import{u as k}from"./index.a13799ab.js";import{u as A}from"./PostTypes.dafa8837.js";import{B as N}from"./HighlightToggle.f01975c9.js";import{C as B}from"./Caret.7cc96622.js";import{C as D}from"./Tooltip.78b61f71.js";import{G as S,a as I}from"./Row.c7b7fb90.js";import"./translations.d159963e.js";import{_ as R}from"./_plugin-vue_export-helper.eefbdd86.js";import{_ as p}from"./default-i18n.20001971.js";import{v as m,o as c,c as f,a as n,k as _,l as a,t as o,x as g,b as h,G as w,N as G,H as x,K as L}from"./runtime-dom.esm-bundler.baf35205.js";const d="all-in-one-seo-pack",O={setup(){const{getPostIconClass:e}=A();return{getPostIconClass:e,rootStore:k()}},components:{BaseHighlightToggle:N,CoreAlert:B,CoreTooltip:D,GridColumn:S,GridRow:I},props:{type:{type:String,required:!0},options:{type:Object,required:!0},registeredPostTypes:Object,excluded:{type:Array,default(){return[]}},supports:{type:Array,default(){return[]}}},data(){return{strings:{label:p("Label:",d),name:p("Slug:",d),noPostTypes:p("No post types available.",d),noTaxonomies:p("No taxonomies available.",d),noPostTypesDescription:p("All post types are set to noindex or your site does not have any post types registered that are supported by this feature.",d),noTaxonomiesDescription:p("All taxonomies are set to noindex or your site does not have any taxonomies registered that are supported by this feature.",d)}}},computed:{getRegisteredPostTypes(){return this.registeredPostTypes||this.rootStore.aioseo.postData},postTypes(){return this.getRegisteredPostTypes[this.type].filter(e=>{let r=!0;return this.supports.length&&e.supports.length&&(r=this.supports.every(t=>e.supports.includes(t))),r&&!this.excluded.includes(e.name)})}},methods:{emitInput(e){this.$emit("input",e)},updateValue(e,r){if(e){const l=this.options[this.type].included;l.push(r.name),this.options[this.type].included=l;return}const t=this.options[this.type].included.findIndex(l=>l===r.name);t!==-1&&this.options[this.type].included.splice(t,1)},getValue(e){return this.options[this.type].included.includes(e.name)},isActive(e){return this.options[this.type].included.findIndex(t=>t===e.name)!==-1}}},U={class:"aioseo-post-type-options-toggle"},j={class:"post-type-options-settings"},q={class:"aioseo-description"},z=n("br",null,null,-1);function H(e,r,t,l,u,i){const y=m("core-alert"),T=m("core-tooltip"),b=m("base-highlight-toggle"),v=m("grid-column"),C=m("grid-row");return c(),f("div",U,[n("div",j,[i.postTypes.length===0&&t.type==="postTypes"?(c(),_(y,{key:0,type:"blue"},{default:a(()=>[n("strong",null,o(u.strings.noPostTypes),1),g(" "+o(u.strings.noPostTypesDescription),1)]),_:1})):h("",!0),i.postTypes.length===0&&t.type==="taxonomies"?(c(),_(y,{key:1,type:"blue"},{default:a(()=>[n("strong",null,o(u.strings.noTaxonomies),1),g(" "+o(u.strings.noTaxonomiesDescription),1)]),_:1})):h("",!0),0<i.postTypes.length?(c(),_(C,{key:2},{default:a(()=>[(c(!0),f(w,null,G(i.postTypes,(s,P)=>(c(),_(v,{md:"6",key:P},{default:a(()=>[x(b,{size:"medium",active:i.isActive(s),name:s.name,type:"checkbox",modelValue:i.getValue(s),"onUpdate:modelValue":V=>i.updateValue(V,s)},{default:a(()=>[x(T,null,{tooltip:a(()=>[n("div",q,[g(o(u.strings.label)+" ",1),n("strong",null,o(s.label),1),z,g(" "+o(u.strings.name)+" ",1),n("strong",null,o(s.name),1)])]),default:a(()=>[n("span",{class:L(["icon dashicons",l.getPostIconClass(s.icon)])},null,2)]),_:2},1024),g(" "+o(s.label),1)]),_:2},1032,["active","name","modelValue","onUpdate:modelValue"])]),_:2},1024))),128))]),_:1})):h("",!0)])])}const $=R(O,[["render",H]]);export{$ as C};
