import{B as r}from"./HighlightToggle.62b97732.js";import{C as a}from"./index.3c70e00e.js";import{C as p}from"./Tooltip.68a8a92b.js";import{G as l,a as u}from"./Row.830f6397.js";import{n as c}from"./_plugin-vue2_normalizer.61652a7c.js";const d={components:{BaseHighlightToggle:r,CoreAlert:a,CoreTooltip:p,GridColumn:l,GridRow:u},props:{type:{type:String,required:!0},options:{type:Object,required:!0},excluded:{type:Array,default(){return[]}}},data(){return{strings:{label:this.$t.__("Label:",this.$td),name:this.$t.__("Slug:",this.$td),noPostTypes:this.$t.__("No post types available.",this.$td),noTaxonomies:this.$t.__("No taxonomies available.",this.$td),noPostTypesDescription:this.$t.__("All post types are set to noindex or your site does not have any post types registered that are supported by this feature.",this.$td),noTaxonomiesDescription:this.$t.__("All taxonomies are set to noindex or your site does not have any taxonomies registered that are supported by this feature.",this.$td)}}},computed:{postTypes(){return this.$aioseo.postData[this.type].filter(n=>!this.excluded.includes(n.name))}},methods:{emitInput(n){this.$emit("input",n)},updateValue(n,t){if(n){const s=this.options[this.type].included;s.push(t.name),this.$set(this.options[this.type],"included",s);return}const e=this.options[this.type].included.findIndex(s=>s===t.name);e!==-1&&this.$delete(this.options[this.type].included,e)},getValue(n){return this.options[this.type].included.includes(n.name)},isActive(n){return this.options[this.type].included.findIndex(e=>e===n.name)!==-1}}};var _=function(){var t=this,e=t._self._c;return e("div",{staticClass:"aioseo-post-type-options-toggle"},[e("div",{staticClass:"post-type-options-settings"},[t.postTypes.length===0&&t.type==="postTypes"?e("core-alert",{attrs:{type:"blue"}},[e("strong",[t._v(t._s(t.strings.noPostTypes))]),t._v(" "+t._s(t.strings.noPostTypesDescription)+" ")]):t._e(),t.postTypes.length===0&&t.type==="taxonomies"?e("core-alert",{attrs:{type:"blue"}},[e("strong",[t._v(t._s(t.strings.noTaxonomies))]),t._v(" "+t._s(t.strings.noTaxonomiesDescription)+" ")]):t._e(),0<t.postTypes.length?e("grid-row",t._l(t.postTypes,function(s,o){return e("grid-column",{key:o,attrs:{md:"6"}},[e("base-highlight-toggle",{attrs:{size:"medium",active:t.isActive(s),name:s.name,type:"checkbox",value:t.getValue(s)},on:{input:i=>t.updateValue(i,s)}},[e("core-tooltip",{scopedSlots:t._u([{key:"tooltip",fn:function(){return[e("div",{staticClass:"aioseo-description"},[t._v(" "+t._s(t.strings.label)+" "),e("strong",[t._v(t._s(s.label))]),e("br"),t._v(" "+t._s(t.strings.name)+" "),e("strong",[t._v(t._s(s.name))])])]},proxy:!0}],null,!0)},[e("span",{staticClass:"icon dashicons",class:`${s.icon||"dashicons-admin-post"}`})]),t._v(" "+t._s(s.label)+" ")],1)],1)}),1):t._e()],1)])},h=[],m=c(d,_,h,!1,null,null,null,null);const T=m.exports;export{T as C};
