import{b as A}from"./app-core.c8323d51.js";import{u as k}from"./PostTypes.9ab2ae40.js";import{B}from"./HighlightToggle.967fb38f.js";import{C as D}from"./Index.b9859662.js";import{C as N}from"./Tooltip.569a23d9.js";import{G as R,a as S}from"./Row.2ef96b1a.js";import{_ as I}from"./_plugin-vue_export-helper.eefbdd86.js";import{_ as p}from"./vendor-other.39e59221.js";import{aq as m,f as c,i as f,j as r,Q as _,R as a,U as s,ae as g,M as y,O as w,ad as L,a0 as x,P as O}from"./vendor-vue-ui.232c7c36.js";const d="all-in-one-seo-pack",U={setup(){const{getPostIconClass:e}=k();return{getPostIconClass:e,rootStore:A()}},components:{BaseHighlightToggle:B,CoreAlert:D,CoreTooltip:N,GridColumn:S,GridRow:R},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 t=!0;return this.supports.length&&e.supports.length&&(t=this.supports.every(o=>e.supports.includes(o))),t&&!this.excluded.includes(e.name)})}},methods:{emitInput(e){this.$emit("input",e)},updateValue(e,t){if(e){const l=this.options[this.type].included;l.push(t.name),this.options[this.type].included=l;return}const o=this.options[this.type].included.findIndex(l=>l===t.name);o!==-1&&this.options[this.type].included.splice(o,1)},getValue(e){return this.options[this.type].included.includes(e.name)},isActive(e){return this.options[this.type].included.findIndex(o=>o===e.name)!==-1}}},j={class:"aioseo-post-type-options-toggle"},q={class:"post-type-options-settings"},G={class:"aioseo-description"};function z(e,t,o,l,u,i){const h=m("core-alert"),T=m("core-tooltip"),b=m("base-highlight-toggle"),P=m("grid-column"),v=m("grid-row");return c(),f("div",j,[r("div",q,[i.postTypes.length===0&&o.type==="postTypes"?(c(),_(h,{key:0,type:"blue"},{default:a(()=>[r("strong",null,s(u.strings.noPostTypes),1),g(" "+s(u.strings.noPostTypesDescription),1)]),_:1})):y("",!0),i.postTypes.length===0&&o.type==="taxonomies"?(c(),_(h,{key:1,type:"blue"},{default:a(()=>[r("strong",null,s(u.strings.noTaxonomies),1),g(" "+s(u.strings.noTaxonomiesDescription),1)]),_:1})):y("",!0),0<i.postTypes.length?(c(),_(v,{key:2},{default:a(()=>[(c(!0),f(w,null,L(i.postTypes,(n,C)=>(c(),_(P,{md:"6",key:C},{default:a(()=>[x(b,{size:"medium",active:i.isActive(n),name:n.name,type:"checkbox",modelValue:i.getValue(n),"onUpdate:modelValue":V=>i.updateValue(V,n)},{default:a(()=>[x(T,null,{tooltip:a(()=>[r("div",G,[g(s(u.strings.label)+" ",1),r("strong",null,s(n.label),1),t[0]||(t[0]=r("br",null,null,-1)),g(" "+s(u.strings.name)+" ",1),r("strong",null,s(n.name),1)])]),default:a(()=>[r("span",{class:O(["icon dashicons",l.getPostIconClass(n.icon)])},null,2)]),_:2},1024),g(" "+s(n.label),1)]),_:2},1032,["active","name","modelValue","onUpdate:modelValue"])]),_:2},1024))),128))]),_:1})):y("",!0)])])}const Y=I(U,[["render",z]]);export{Y as C};
