import{aq as m,f,i as w,a0 as c,j as p,T as g,M as T,an as S}from"./js/vendor-vue-ui.f00a1236.js";import{l as x}from"./js/index.18357c0f.js";import{l as E}from"./js/index.60474bd4.js";import{l as k}from"./js/index.0d80c2c2.js";import{c as $,u as v,i as P,H as B,I as b,l as _,af as A,k as C}from"./js/app-core.b862f9c8.js";import{g as L,t as M,a as H}from"./js/helpers.d19da47a.js";import{S as N}from"./js/Information.bbfb3caf.js";import{S as I}from"./js/Close.de45e465.js";import{_ as h}from"./js/_plugin-vue_export-helper.eefbdd86.js";import{a as d,_ as l}from"./js/vendor-other.7b559694.js";import"./js/Button.6c09d515.js";import"./js/Input.af82b72e.js";import"./js/Index.3967c277.js";import"./js/Pencil.1ca5815a.js";import"./js/Trash.c3e8db0b.js";import"./js/Select.952b21a0.js";import"./js/Caret.e6c9f7cc.js";import"./js/Toggle.b43ed20a.js";import"./js/vendor-lodash.d3ad8b99.js";const u="all-in-one-seo-pack",U={setup(){return{postEditorStore:v()}},components:{SvgCircleInformation:N,SvgClose:I},props:{taxonomy:String},data(){return{selectedTerms:[],strings:{didYouKnow:d(l("Did you know that %1$s Pro allows you to choose a %2$sprimary category%3$s for your posts? This feature works hand in hand with our powerful Breadcrumbs template to give you full navigational control to help improve your search rankings!",u),"AIOSEO","",""),learnMoreLink:d('%2$s →',$.getDocUrl("primaryTerm"),l("Learn more",u))}}},computed:{canShowUpsell(){const{options:o}=this.postEditorStore.currentPost;return!o.primaryTerm.productEducationDismissed&&1s=>{const{slug:a}=s;return M(a)?o(t,{},o(i,s),o("div",{id:`aioseo-primary-term-${a}`},o("div",{className:"aioseo-primary-term-app",taxonomy:a}))):o(i,s)},"withInspectorControls")),n(()=>{window.aioseoBus.$emit("updateSelectedTerms")})}(B()||b())&&(_(),H().forEach(o=>{const t=document.getElementById(`${o.name}div`)?.querySelector(".inside");if(!t)return;const e=document.createElement("div");e.setAttribute("id",`aioseo-primary-term-${o.name}`),e.setAttribute("class","aioseo-primary-term-app"),e.setAttribute("taxonomy",o.name),t.append(e),(function(r){r(`#${o.name}checklist`).on("change",'input[type="checkbox"]',()=>{window.aioseoBus.$emit("updateSelectedTerms")}),r(`#${o.name}checklist`).on("wpListAddEnd",()=>{window.aioseoBus.$emit("updateSelectedTerms")})})(window.jQuery)}));const y=o=>{if(!o)return;const t=o.getAttribute("taxonomy");let e=S({...Q,name:"Standalone/PrimaryTerm"},{taxonomy:t});e=x(e),e=E(e),e=k(e),_(e),e.mount(o)};if(A()&&window.aioseo&&window.aioseo.currentPost&&window.aioseo.currentPost.context==="post"){const o=document.getElementsByClassName("aioseo-primary-term-app");Array.prototype.forEach.call(o,t=>y(t)),C(".aioseo-primary-term-app","aioseoPrimaryTerm"),document.addEventListener("animationstart",function(t){t.animationName==="aioseoPrimaryTerm"&&y(t.target)},{passive:!0})}