import{e as y,h as l}from"./links.C7Z9vJvv.js";import{G as C,a as L}from"./Row.CzuhYwfs.js";import{x as m,o,l as n,m as i,a as s,t as p,d,c as _,K as f,H as g,F as w,G as M,D as q,C as V}from"./vue.esm-bundler.CWQFYt9y.js";import{_ as B}from"./_plugin-vue_export-helper.BN1snXvA.js";const G={setup(){return{settingsStore:y()}},emits:["update:separator"],components:{GridColumn:C,GridRow:L},props:{optionsSeparator:{type:String,required:!0},showMoreSlug:{type:String,required:!0}},data(){return{strings:{custom:this.$t.__("Custom separator:",this.$td),showMore:this.$t.__("Show More",this.$td),showLess:this.$t.__("Show Less",this.$td)},showMoreSeparators:!1,showMoreInitial:!0,customSeparator:null,separators:["&ndash;","&raquo;","&rsaquo;","&#x2023;","&rarr;","&bull;","&#47;","&#124;"],moreSeparators:["&#45;","&mdash;","&laquo;","&larr;","&gt;","&ge;","&#92;","&#43;","&#9658;"]}},watch:{showMoreSeparators(e){if(this.showMoreInitial){this.showMoreInitial=!1;return}this.settingsStore.toggleRadio({slug:this.showMoreSlug,value:e})},customSeparator(e){e!==null&&(this.$emit("update:separator",l.decode(e)),this.separators.concat(this.moreSeparators).concat(this.decodedSeparators).concat(this.decodedMoreSeparators).includes(e)&&(this.customSeparator=null))}},computed:{hiddenSeparator(){return this.optionsSeparator===this.customSeparator||this.decodedMoreSeparators.includes(this.optionsSeparator)?this.optionsSeparator:null},decodedSeparators(){return this.separators.map(e=>l.decode(e))},decodedMoreSeparators(){return this.moreSeparators.map(e=>l.decode(e))},decodedCustomSeparator(){return l.decode(this.hiddenSeparator)}},methods:{setSeparator(e){this.customSeparator=null,this.$emit("update:separator",e)}},mounted(){this.showMoreSeparators=this.settingsStore.settings.toggledRadio[this.showMoreSlug],this.customSeparator=this.decodedSeparators.concat(this.decodedMoreSeparators).includes(this.optionsSeparator)?null:this.optionsSeparator}},N={class:"active separator"},R=["onClick"],b=["onClick"],A={class:"show-more"},I={class:"custom-separator"},z={class:"show-more"};function D(e,u,S,E,t,a){const c=m("grid-column"),k=m("base-input"),v=m("grid-row");return o(),n(v,{class:"aioseo-separators"},{default:i(()=>[!t.showMoreSeparators&&a.hiddenSeparator?(o(),n(c,{key:0,xs:"2",sm:"1"},{default:i(()=>[s("div",N,p(a.decodedCustomSeparator),1)]),_:1})):d("",!0),(o(!0),_(w,null,f(a.decodedSeparators,(r,h)=>(o(),n(c,{xs:"2",sm:"1",key:h},{default:i(()=>[s("div",{onClick:x=>a.setSeparator(r),class:g(["separator",{active:S.optionsSeparator===r}])},p(r),11,R)]),_:2},1024))),128)),t.showMoreSeparators?(o(!0),_(w,{key:1},f(a.decodedMoreSeparators,(r,h)=>(o(),n(c,{xs:"2",sm:"1",key:`m_${h}`},{default:i(()=>[s("div",{onClick:x=>a.setSeparator(r),class:g(["separator",{active:S.optionsSeparator===r}])},p(r),11,b)]),_:2},1024))),128)):d("",!0),t.showMoreSeparators?d("",!0):(o(),n(c,{key:2,xs:a.hiddenSeparator?"3":"4"},{default:i(()=>[s("div",A,[s("a",{href:"#",onClick:u[0]||(u[0]=M(r=>t.showMoreSeparators=!0,["prevent"]))},p(t.strings.showMore)+"… ",1)])]),_:1},8,["xs"])),t.showMoreSeparators?(o(),n(c,{key:3,class:"custom-separator-col"},{default:i(()=>[s("div",I,[q(p(t.strings.custom)+" ",1),V(k,{spellcheck:!1,size:"medium",modelValue:t.customSeparator,"onUpdate:modelValue":u[1]||(u[1]=r=>t.customSeparator=r)},null,8,["modelValue"])])]),_:1})):d("",!0),t.showMoreSeparators?(o(),n(c,{key:4,xs:"2"},{default:i(()=>[s("div",z,[s("a",{href:"#",onClick:u[2]||(u[2]=M(r=>t.showMoreSeparators=!1,["prevent"]))},p(t.strings.showLess)+"… ",1)])]),_:1})):d("",!0)]),_:1})}const P=B(G,[["render",D]]);export{P as C};
