import{c as k}from"./index.bb0afb15.js";import{u as C}from"./JsonValues.3fcfec97.js";import{_ as S,S as T}from"./Caret.7cc96622.js";import{b as V}from"./index.7fee6f1a.js";import{S as B}from"./AddPlus.8648d7b1.js";import{S as L}from"./External.49bc8f29.js";import"./translations.d159963e.js";import{v as u,o as N,c as j,H as p,l as i,x as d,t as o,a as n,J as g}from"./runtime-dom.esm-bundler.baf35205.js";import{_ as P}from"./_plugin-vue_export-helper.eefbdd86.js";import{_ as l}from"./default-i18n.20001971.js";const a="all-in-one-seo-pack",J={setup(){const{getJsonValues:s,setJsonValues:e}=C();return{getJsonValues:s,optionsStore:k(),setJsonValues:e}},components:{BaseButton:S,BaseSelect:V,SvgAddPlus:B,SvgClose:T,SvgExternal:L},props:{options:{type:Object,required:!0},type:{type:String,required:!0}},data(){return{excludeOptions:[],strings:{typeToSearch:l("Type to search...",a),noOptionsPosts:l("Begin typing a post ID, title or slug to search...",a),noOptionsTerms:l("Begin typing a term ID or name to search...",a),noResult:l("No results found for your search. Try again!",a),clear:l("Clear",a),id:l("ID",a),type:l("Type",a)}}},computed:{optionName:{get(){return this.type==="posts"?this.options.excludePosts:this.options.excludeTerms},set(s){if(this.type==="posts"){this.options.excludePosts=s;return}this.options.excludeTerms=s}},noOptions(){return this.type==="posts"?this.strings.noOptionsPosts:this.strings.noOptionsTerms}},methods:{processGetObjects(s){return this.optionsStore.getObjects({query:s,type:this.type}).then(e=>{this.excludeOptions=e.body.objects})},getOptionTitle(s,e){s=s.replace(/<\/?[^>]+(>|$)/g,""),e=e.replace(/<\/?[^>]+(>|$)/g,"");const _=new RegExp(`(${e})`,"gi");return s.replace(_,'<span class="search-term">$1</span>')},searchableLabel({value:s,label:e,slug:_}){return`${s} ${e} ${_}`}}},w={class:"aioseo-exclude-posts"},R={class:"option"},A=["innerHTML"],D={class:"option-details"},E=["href"],q={class:"multiselect__tag"},H={class:"multiselect__tag-value"},I=["onClick"];function M(s,e,_,h,c,r){const x=u("svg-add-plus"),y=u("base-button"),f=u("svg-external"),b=u("svg-close"),v=u("base-select");return N(),j("div",w,[p(v,{options:c.excludeOptions,"ajax-search":r.processGetObjects,customLabel:r.searchableLabel,size:"medium",multiple:"",modelValue:h.getJsonValues(r.optionName),"onUpdate:modelValue":e[0]||(e[0]=t=>r.optionName=h.setJsonValues(t)),placeholder:c.strings.typeToSearch},{noOptions:i(()=>[d(o(r.noOptions),1)]),noResult:i(()=>[d(o(c.strings.noResult),1)]),caret:i(({toggle:t})=>[p(y,{class:"multiselect-toggle",style:{padding:"10px 13px",width:"40px",position:"absolute",height:"36px",right:"2px",top:"2px","text-align":"center",transition:"transform .2s ease"},type:"gray",onClick:t},{default:i(()=>[p(x,{style:{width:"14px",height:"14px",color:"black"}})]),_:2},1032,["onClick"])]),option:i(({option:t,search:m})=>[n("div",R,[n("div",{class:"option-title",innerHTML:r.getOptionTitle(t.label,m)},null,8,A),n("div",D,[n("span",null,o(c.strings.id)+": #"+o(t.value),1),n("span",null,o(c.strings.type)+": "+o(t.type),1)])]),n("a",{class:"option-permalink",href:t.link,target:"_blank",onClick:g(()=>{},["stop"])},[p(f)],8,E)]),tag:i(({option:t,remove:m})=>[n("div",q,[n("div",H,o(t.label)+" - #"+o(t.value),1),n("div",{class:"multiselect__tag-remove",onClick:g(O=>m(t),["stop"])},[p(b,{onClick:g(O=>m(t),["stop"])},null,8,["onClick"])],8,I)])]),_:1},8,["options","ajax-search","customLabel","modelValue","placeholder"]),p(y,{type:"gray",size:"medium",onClick:e[1]||(e[1]=t=>r.optionName=[])},{default:i(()=>[d(o(c.strings.clear),1)]),_:1})])}const $=P(J,[["render",M]]);export{$ as C};
