import{e as k}from"./index.4b887428.js";import{u as C}from"./JsonValues.a0694556.js";import{_ as S}from"./Button.9a301412.js";import{B as T}from"./Select.f950b4c6.js";import{S as V}from"./AddPlus.39af5a0f.js";import{S as B}from"./Close.ccd53ef3.js";import{S as L}from"./External.641efa63.js";import"./translations.e71e2202.js";import{a as d}from"./runtime-dom.esm-bundler.dc49ee3e.js";import{_ as N}from"./_plugin-vue_export-helper.eefbdd86.js";import{_ as i}from"./default-i18n.65d58dd6.js";import{a6 as u,o as j,c as P,l as p,a2 as a,a7 as g,$ as o,_ as n}from"./runtime-core.esm-bundler.ce5add0b.js";const l="all-in-one-seo-pack",w={setup(){const{getJsonValues:s,setJsonValues:e}=C();return{getJsonValues:s,optionsStore:k(),setJsonValues:e}},components:{BaseButton:S,BaseSelect:T,SvgAddPlus:V,SvgClose:B,SvgExternal:L},props:{options:{type:Object,required:!0},type:{type:String,required:!0}},data(){return{excludeOptions:[],strings:{typeToSearch:i("Type to search...",l),noOptionsPosts:i("Begin typing a post ID, title or slug to search...",l),noOptionsTerms:i("Begin typing a term ID or name to search...",l),noResult:i("No results found for your search. Try again!",l),clear:i("Clear",l),id:i("ID",l),type:i("Type",l)}}},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 m=new RegExp(`(${e})`,"gi");return s.replace(m,'<span class="search-term">$1</span>')},searchableLabel({value:s,label:e,slug:m}){return`${s} ${e} ${m}`}}},J={class:"aioseo-exclude-posts"},R={class:"option"},A=["innerHTML"],D={class:"option-details"},E=["href"],q={class:"multiselect__tag"},I={class:"multiselect__tag-value"},M=["onClick"];function z(s,e,m,h,c,r){const f=u("svg-add-plus"),y=u("base-button"),x=u("svg-external"),b=u("svg-close"),v=u("base-select");return j(),P("div",J,[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:a(()=>[g(o(r.noOptions),1)]),noResult:a(()=>[g(o(c.strings.noResult),1)]),caret:a(({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:a(()=>[p(f,{style:{width:"14px",height:"14px",color:"black"}})]),_:2},1032,["onClick"])]),option:a(({option:t,search:_})=>[n("div",R,[n("div",{class:"option-title",innerHTML:r.getOptionTitle(t.label,_)},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:d(()=>{},["stop"])},[p(x)],8,E)]),tag:a(({option:t,remove:_})=>[n("div",q,[n("div",I,o(t.label)+" - #"+o(t.value),1),n("div",{class:"multiselect__tag-remove",onClick:d(O=>_(t),["stop"])},[p(b,{onClick:d(O=>_(t),["stop"])},null,8,["onClick"])],8,M)])]),_:1},8,["options","ajax-search","customLabel","modelValue","placeholder"]),p(y,{type:"gray",size:"medium",onClick:e[1]||(e[1]=t=>r.optionName=[])},{default:a(()=>[g(o(c.strings.clear),1)]),_:1})])}const te=N(w,[["render",z]]);export{te as C};
