관리-도구
편집 파일: WritingAssistant.83cd460b.js
import{G as I}from"./constants.2019bcb3.js";import{b as V,H as x,l as D}from"./index.5a710757.js";import{C as W}from"./Card.5b602127.js";import{C}from"./SettingsRow.1934f141.js";import"./translations.12335a6a.js";import{B as P}from"./Checkbox.e983780b.js";import{S as U,_ as S}from"./Caret.662da1f3.js";import{b as h}from"./index.ee8124c6.js";import{C as z}from"./PostTypeOptions.b8e00ea2.js";import{u as M,_ as N}from"./Seoboost.5c950c16.js";import{v as R,o as p,k as f,l,a as c,E as H,C as u,u as t,t as r,x as _,g as k,c as v,b as y}from"./runtime-dom.esm-bundler.6789c400.js";import{C as Y}from"./Index.c4d148bc.js";import{_ as n,s as G}from"./default-i18n.54b5d8cd.js";import"./helpers.f95d5840.js";import"./Tooltip.b6b45c85.js";import"./_plugin-vue_export-helper.249dac1d.js";import"./Slide.d0517fb0.js";import"./Row.f01f32cd.js";import"./Checkmark.32f79576.js";import"./PostTypes.d6c1987b.js";import"./HighlightToggle.6ee9eb70.js";import"./Radio.e92f8160.js";import"./escapeRegex.e4a2b75d.js";import"./helpers.b97d7047.js";import"./metabox.1128ddb8.js";import"./cleanForSlug.f9ffe7db.js";import"./toString.1401d490.js";import"./_baseTrim.940c51cf.js";import"./_stringToArray.08127ca9.js";import"./_baseSet.32e7a763.js";import"./regex.f8017116.js";const F={class:"aioseo-modal-body"},j={class:"reset-description"},q={__name:"DisconnectModal",props:{showModal:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["continue","cancel"],setup(b){const o="all-in-one-seo-pack",m={areYouSureReset:n("Are you sure you want to disconnect from SEOBoost?",o),actionCannotBeUndone:G(n("This action will disconnect %1$s from SEOBoost. By disconnecting from SEOBoost, you will no longer be able to get actionable insights for your target keywords to help your content rank better in SERPs.",o),"AIOSEO"),yesContinue:n("Yes, I want to disconnect",o),noCancel:n("No, I changed my mind",o)},w=b;return(e,i)=>{const g=R("base-button");return p(),f(t(Y),{show:w.showModal,"no-header":"",onClose:i[4]||(i[4]=s=>e.$emit("cancel")),classes:["aioseo-writing-assistant-settings__disconnect-modal"]},{body:l(()=>[c("div",F,[c("button",{class:"close",onClick:i[1]||(i[1]=H(s=>e.$emit("cancel"),["stop"]))},[u(t(U),{onClick:i[0]||(i[0]=s=>e.$emit("cancel"))})]),c("h3",null,r(m.areYouSureReset),1),c("div",j,r(m.actionCannotBeUndone),1),u(g,{type:"blue",size:"medium",onClick:i[2]||(i[2]=s=>e.$emit("continue")),loading:w.loading},{default:l(()=>[_(r(m.yesContinue),1)]),_:1},8,["loading"]),u(g,{type:"gray",size:"medium",onClick:i[3]||(i[3]=s=>e.$emit("cancel"))},{default:l(()=>[_(r(m.noCancel),1)]),_:1})])]),_:1},8,["show"])}}},J={class:"aioseo-writing-assistant-settings"},K={class:"aioseo-settings-row aioseo-section-description"},Q=["innerHTML"],X={key:0},Z={class:"aioseo-writing-assistant-settings__connect-buttons"},tt={key:1},ot={class:"aioseo-description"},et={key:1,class:"aioseo-writing-assistant-settings__connect-logout"},nt={class:"aioseo-description"},Wt={__name:"WritingAssistant",setup(b){const o="all-in-one-seo-pack",m=V(),w=M(),e=x();e.hookSaveUserOptions();const i=k(!1),g=k(!1),s={tooltip:n("Integrate seamlessly with SEOBoost via AIOSEO to supercharge your WordPress content.",o),description:n("Integrate seamlessly with SEOBoost via AIOSEO to supercharge your WordPress content.",o),writingAssistant:n("Writing Assistant",o),seoBoost:n("SEOBoost CTA",o),postType:n("Post Types",o),includeAllPostTypes:n("Include all post types",o),selectPostTypes:n("Select the post types you want the Writing Assistant to be available.",o),connect:n("Connect to SEOBoost",o),connectExisting:n("Connect to an Existing Account",o),connectDescription:n("Connect to SEOBoost to get access to the Writing Assistant.",o),loggedIn:n("You're connected to SEOBoost!",o),logoutButton:n("Disconnect",o),reportDefaults:n("Report Defaults",o),defaultCountry:n("Default Region",o),defaultLanguage:n("Default Language",o),or:n("OR",o),createAccount:n("Create a Free Account",o),connectNow:n("Now Connect to Your SEOBoost Account",o)},O=()=>{i.value=!1,e.disconnect()},E=()=>{const A=w.seoBoost.createAccountUrl||e.seoBoost.createAccountUrl,a=650,d=800,$=window.innerWidth/2-a/2,L=window.innerHeight/2-d/2,T=`width=${a},height=${d},resizable=no,scrollbars=no,status=no,location=no,toolbar=no,menubar=no`;window.open(A,"_blank",T).moveBy($,L),window.addEventListener("message",B=>{B.origin===window.location.origin&&B.data==="seoboost-ms-logged-in"&&(g.value=!0)})};return(A,a)=>(p(),v("div",J,[u(t(W),{slug:"writingAssistantSettings","header-text":s.writingAssistant},{tooltip:l(()=>[c("div",null,r(s.tooltip),1)]),default:l(()=>[c("div",K,[_(r(s.description)+" ",1),c("span",{innerHTML:t(D).getDocLink(t(I).learnMore,"writingAssistantHowToUse",!0)},null,8,Q)]),u(t(C),{name:s.connect,class:"aioseo-writing-assistant-settings__connect"},{content:l(()=>[t(e).seoBoost.isLoggedIn?y("",!0):(p(),v("div",X,[c("div",Z,[g.value?y("",!0):(p(),f(t(S),{key:0,type:"green",size:"medium",onClick:E},{default:l(()=>[_(r(s.createAccount),1)]),_:1})),g.value?y("",!0):(p(),v("div",tt,r(s.or),1)),u(t(N),{"button-only":!0,"button-text":g.value?s.connectNow:s.connectExisting,"button-type":g.value?"green":"gray","button-icons":!1,"button-size":"medium"},null,8,["button-text","button-type"])]),c("div",ot,r(s.connectDescription),1)])),t(e).seoBoost.isLoggedIn?(p(),v("div",et,[c("div",null,[u(t(S),{type:"blue",size:"medium",onClick:a[0]||(a[0]=d=>i.value=!0)},{default:l(()=>[_(r(s.logoutButton),1)]),_:1})]),c("div",null,r(s.loggedIn),1)])):y("",!0)]),_:1},8,["name"]),t(e).seoBoost.isLoggedIn?(p(),f(t(C),{key:0,name:s.defaultCountry},{content:l(()=>[u(t(h),{class:"select-auto",size:"medium",options:t(e).getCountriesOptions,modelValue:t(e).userCountryOption,"onUpdate:modelValue":a[1]||(a[1]=d=>t(e).seoBoost.userOptions.country=d.value),disabled:t(e).loading},null,8,["options","modelValue","disabled"])]),_:1},8,["name"])):y("",!0),t(e).seoBoost.isLoggedIn?(p(),f(t(C),{key:1,name:s.defaultLanguage},{content:l(()=>[u(t(h),{class:"select-auto",size:"medium",options:t(e).getLanguagesOptions,modelValue:t(e).userLanguageOption,"onUpdate:modelValue":a[2]||(a[2]=d=>t(e).seoBoost.userOptions.language=d.value),disabled:t(e).loading},null,8,["options","modelValue","disabled"])]),_:1},8,["name"])):y("",!0),u(t(C),{name:s.postType},{content:l(()=>[u(t(P),{size:"medium",modelValue:t(m).options.writingAssistant.postTypes.all,"onUpdate:modelValue":a[3]||(a[3]=d=>t(m).options.writingAssistant.postTypes.all=d)},{default:l(()=>[_(r(s.includeAllPostTypes),1)]),_:1},8,["modelValue"]),t(m).options.writingAssistant.postTypes.all?y("",!0):(p(),f(t(z),{key:0,options:t(m).options.writingAssistant,type:"postTypes",supports:["editor"]},null,8,["options"])),c("div",nt,r(s.selectPostTypes),1)]),_:1},8,["name"])]),_:1},8,["header-text"]),t(e).seoBoost.isLoggedIn?(p(),f(t(q),{key:0,"show-modal":i.value,onContinue:O,onCancel:a[4]||(a[4]=d=>i.value=!1)},null,8,["show-modal"])):y("",!0)]))}};export{Wt as default};