import{c as x,_ as b,d as p,o as n,e as h,w as g,i as u,f as m,t as d,g as l,F as v,h as r,X as y,ah as c}from"./index.cf09daef.js";import{Q as V}from"./QSelect.5d9ed733.js";const k={props:{modelValue:{required:!0,type:Object},flat:{type:Boolean,default:!1},creating:{type:Boolean,default:!1},title:{type:String,default:"Search engine listing preview"},description:String,prefix:{type:String,default:x.baseURL("/blogs/")},message:{type:String,default:"Add a title and description to see how this product might appear in a search engine listing"}},emits:["update:model-value"],data(){return{item:this.modelValue,editable:!1}},methods:{onChange(t,e){console.func("components/SeoSection:methods.onChange()",arguments),this.item[e]=t,this.$emit("update:model-value",this.item)}},computed:{meta_title:{get(){return(this.item.meta_title||this.item.title||this.item.name||"").slice(0,70)},set(t){return t}},slug:{get(){return(this.item.slug||this.item.title||this.item.name||"").replace(/ /g,"-").replace(/[^\w-]+/g,"")},set(t){return t}},meta_description:{get(){return this.item.meta_description||(this.item.description||"").replace(/(<([^>]+)>)/g,"").slice(0,320)},set(t){return t}},empty(){return!this.meta_title}},watch:{modelValue:{deep:!0,handler(t){this.item=t}}}},S={key:0,class:"col-xs-12"},C={key:1,class:"col-xs-12 col-sm-12"},w={class:"text-h5 text-indigo"},B={class:"caption text-green"},U={class:"caption text-grey"},Q={class:"col-xs-12"},N={class:"col-xs-12 col-sm-12"},q=l("div",{class:"text-label"},"Page title",-1),F={class:"col-xs-12 col-sm-12"},L=l("div",{class:"text-label"},"URL handle",-1),M={class:"col-xs-12 col-sm-12"},R=l("div",{class:"text-label"},"Meta description",-1),j={key:0,class:"col-xs-12 col-sm-12"},z=l("div",{class:"text-label"},"Meta keywords",-1);function A(t,e,o,D,a,i){const _=p("base-btn"),f=p("base-section");return n(),h(f,{flat:o.flat,title:o.title,description:o.description},{action:g(()=>[a.editable?u("",!0):(n(),h(_,{key:0,link:"",color:"primary",size:"13px",onClick:e[0]||(e[0]=s=>a.editable=!0),label:t.$t("label.editSeo")},null,8,["label"]))]),default:g(()=>[i.empty?(n(),m("div",S,d(o.message),1)):(n(),m("div",C,[l("div",w,d(i.meta_title),1),l("div",B,d(o.prefix)+d(i.slug),1),l("div",U,d(i.meta_description),1)])),a.editable?(n(),m(v,{key:2},[l("div",Q,[r(y)]),l("div",N,[q,r(c,{dense:"",outlined:"",modelValue:i.meta_title,"onUpdate:modelValue":[e[1]||(e[1]=s=>i.meta_title=s),e[2]||(e[2]=s=>i.onChange(s,"meta_title"))],counter:"",maxlength:"70",hint:t.$t("hint.max70CharactersCanBeUsed")},null,8,["modelValue","hint"])]),l("div",F,[L,r(c,{dense:"",outlined:"",modelValue:i.slug,"onUpdate:modelValue":[e[3]||(e[3]=s=>i.slug=s),e[4]||(e[4]=s=>i.onChange(s,"slug"))],":prefix":t.$t("prefix.prefix")},null,8,["modelValue",":prefix"])]),l("div",M,[R,r(c,{dense:"",outlined:"",modelValue:i.meta_description,"onUpdate:modelValue":[e[5]||(e[5]=s=>i.meta_description=s),e[6]||(e[6]=s=>i.onChange(s,"meta_description"))],type:"textarea",counter:"",maxlength:"320",hint:t.$t("hint.max320CharactersCanBeUsed")},null,8,["modelValue","hint"])]),a.item.meta_keywords?(n(),m("div",j,[z,r(V,{dense:"",outlined:"",modelValue:a.item.meta_keywords,"onUpdate:modelValue":e[7]||(e[7]=s=>a.item.meta_keywords=s),"use-input":"","use-chips":"",multiple:"","hide-dropdown-icon":"","input-debounce":"0","new-value-mode":"add-unique"},null,8,["modelValue"])])):u("",!0)],64)):u("",!0)]),_:1},8,["flat","title","description"])}var O=b(k,[["render",A]]);export{O as S};
