HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dmstechonline/whatsapp.dmstech.online/public/build/assets/HeaderTextArea-096aae70.js
import{r as c,q as L,m as N,o as h,c as g,a as t,w as V,v as I,t as d,F as T,e as z,b as A,n as U,G as j}from"./app-884e4ce3.js";const q={class:"normal-case"},R={class:U("sm:col-span-6")},Z={class:"mt-2"},F={class:"flex items-center justify-between mt-2 mb-2"},G={class:"text-xs"},O={class:"flex items-center space-x-3"},J={key:0,class:"bg-gray-100 p-2 rounded-md"},K={class:"mb-4"},Q={class:"text-slate-600 mb-2"},W={class:"text-xs"},X={class:"w-[10%] text-sm"},Y={class:"w-[90%]"},ee=["onUpdate:modelValue","placeholder"],te={key:0,class:"p-2 bg-red-100 rounded-md flex items-center gap-x-2 mt-4"},se={class:"text-sm"},be={__name:"BodyTextArea",props:{modelValue:[String,Number],customValues:{type:Array,default:()=>[]}},emits:["update:modelValue","updateExamples"],setup(P,{emit:M}){const _=P,s=c(_.modelValue),m=c(null),i=c([]),u=c(_.customValues),x=c("1098"),f=c("0"),b=c(0),B=()=>{i.value=u.value.map((l,e)=>`{{${e+1}}}`)};L(()=>{B(),w()});const S=()=>{let l=parseInt(x.value);if(parseInt(s.value.length)<l){const o=`{{${i.value.length+1}}}`;s.value.indexOf(o)===-1&&(s.value+=o,i.value.push(o),u.value.push("")),w(),k()}},C=()=>{const l=/\{\{\d+\}\}/g,e=s.value.match(l);if(e){e.reduce((o,v)=>{const p=parseInt(v.match(/\d+/)[0]);return p>o?p:o},0);for(let o=1;o<=e.length;o++){const v=`{{${o}}}`;if(!i.value.includes(v))break}b.value=e.length;const a=[...new Set(e)];i.value=a,i.value.forEach((o,v)=>{const p=parseInt(o.match(/\d+/)[0]),D=v+1,H=`{{${p}}}`,E=`{{${D}}}`;s.value=s.value.replace(H,E),i.value[v]=E})}else i.value=[],u.value=[];y(),w(),k()},y=()=>{const l=i.value.length,e=u.value.length;if(l!==e){const a=l-e;if(a>0)for(let o=0;o<a;o++)u.value.push("");else a<0&&u.value.splice(l)}},w=l=>{if(!s.value){f.value=0;return}let e=parseInt(x.value),a=parseInt(s.value.length);a<=e?f.value=a:(s.value=s.value.slice(0,e),f.value=e)},$=M,k=l=>{$("update:modelValue",s.value),$("updateExamples",u.value)},r=N(()=>u.value.some(l=>!l)),n=l=>{const e=m.value,a=e.selectionStart,o=e.selectionEnd,v=s.value.slice(a,o);let p="";l=="bold"?p=s.value.slice(0,a)+"*"+v+"*"+s.value.slice(o):l=="italic"?p=s.value.slice(0,a)+"_"+v+"_"+s.value.slice(o):l=="strike-through"?p=s.value.slice(0,a)+"~"+v+"~"+s.value.slice(o):l=="monospace"&&(p=s.value.slice(0,a)+"```"+v+"```"+s.value.slice(o)),s.value=p,w(),k(),setTimeout(()=>{l=="monospace"?e.setSelectionRange(a+3,o+3):e.setSelectionRange(a+1,o+1),e.focus()},0)};return(l,e)=>(h(),g("div",q,[t("div",null,[t("div",R,[t("div",Z,[V(t("textarea",{ref_key:"textAreaRef",ref:m,class:"block w-full rounded-md border-0 py-1.5 px-4 text-gray-900 shadow-sm outline-none ring-1 ring-inset placeholder:text-gray-400 sm:text-sm sm:leading-6 ring-gray-300","onUpdate:modelValue":e[0]||(e[0]=a=>s.value=a),onInput:C,rows:"5"},"                    ",544),[[I,s.value]])])]),t("div",F,[t("span",G,d(l.$t("Characters"))+": "+d(f.value+"/"+x.value),1),t("div",O,[t("button",{onClick:e[1]||(e[1]=a=>n("bold")),class:"hover:bg-slate-100 rounded p-1"},e[5]||(e[5]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M5 3h8c1.06 0 2.078.474 2.828 1.318C16.578 5.162 17 6.307 17 7.5c0 1.193-.421 2.338-1.172 3.182C15.078 11.526 14.061 12 13 12H5zm0 9h10.039a4.44 4.44 0 0 1 3.154 1.318A4.52 4.52 0 0 1 19.5 16.5a4.52 4.52 0 0 1-1.307 3.182A4.442 4.442 0 0 1 15.038 21H5z"})],-1)])),t("button",{onClick:e[2]||(e[2]=a=>n("italic")),class:"hover:bg-slate-100 rounded p-1"},e[6]||(e[6]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[t("path",{fill:"currentColor",d:"M10 4.75a.75.75 0 0 1 .75-.75h8.5a.75.75 0 0 1 0 1.5h-3.514l-5.828 13h3.342a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5h3.514l5.828-13H20.75a.75.75 0 0 1-.75-.75Z"})],-1)])),t("button",{onClick:e[3]||(e[3]=a=>n("strike-through")),class:"hover:bg-slate-100 rounded p-1"},e[7]||(e[7]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[t("path",{fill:"currentColor",d:"m16.533 12.5l.054.043c.93.75 1.538 1.77 1.538 3.066a4.13 4.13 0 0 1-1.479 3.177c-1.058.904-2.679 1.464-4.974 1.464c-2.35 0-4.252-.837-5.318-1.865a.75.75 0 1 1 1.042-1.08c.747.722 2.258 1.445 4.276 1.445c2.065 0 3.296-.504 3.999-1.105a2.63 2.63 0 0 0 .954-2.036c0-.764-.337-1.38-.979-1.898c-.649-.523-1.598-.931-2.76-1.211H3.75a.75.75 0 0 1 0-1.5h26.5a.75.75 0 0 1 0 1.5ZM12.36 5C9.37 5 8.105 6.613 8.105 7.848c0 .411.072.744.193 1.02a.75.75 0 0 1-1.373.603a3.988 3.988 0 0 1-.32-1.623c0-2.363 2.271-4.348 5.755-4.348c1.931 0 3.722.794 4.814 1.5a.75.75 0 1 1-.814 1.26c-.94-.607-2.448-1.26-4-1.26Z"})],-1)])),t("button",{onClick:e[4]||(e[4]=a=>n("monospace")),class:"hover:bg-slate-100 rounded p-1"},e[8]||(e[8]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13.5 6L10 18.5m-3.5-10L3 12l3.5 3.5m11-7L21 12l-3.5 3.5"})],-1)])),t("button",{type:"button",onClick:S,class:"hover:bg-slate-100 rounded p-1 text-sm"},d(l.$t("Add variable")),1)])])]),i.value.length>0?(h(),g("div",J,[t("div",K,[t("h2",Q,d(l.$t("Samples for body content")),1),t("p",W,d(l.$t("Please add an example for each variable in your body text. Do not use real customer information. Cloud API hosted by Meta reviews templates and variable parameters to protect the security and integrity of their services.")),1)]),(h(!0),g(T,null,z(i.value,(a,o)=>(h(),g("div",{key:o,class:"flex items-center mb-1"},[t("div",X,d(a),1),t("div",Y,[V(t("input",{type:"text","onUpdate:modelValue":v=>u.value[o]=v,placeholder:"Enter content for "+a,class:"block w-full rounded-md border-0 py-1.5 px-4 text-gray-900 shadow-sm outline-none ring-1 ring-inset placeholder:text-gray-400 sm:text-sm sm:leading-6 ring-gray-300",required:""},null,8,ee),[[I,u.value[o]]])])]))),128)),r.value?(h(),g("div",te,[e[9]||(e[9]=t("svg",{class:"text-red-800",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[t("path",{fill:"currentColor",d:"M13 9a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-1 2.75a.75.75 0 0 1 .75.75v5a.75.75 0 1 1-1.5 0v-5a.75.75 0 0 1 .75-.75"}),t("path",{fill:"currentColor","fill-rule":"evenodd",d:"M14.27 3.993a2.749 2.749 0 0 0-4.54 0l-.432.632a75.95 75.95 0 0 0-6.944 12.563l-.09.208a2.511 2.511 0 0 0 2.024 3.497a69.43 69.43 0 0 0 15.424 0a2.511 2.511 0 0 0 2.024-3.497l-.09-.208a75.951 75.951 0 0 0-6.944-12.563zm-3.302.846a1.25 1.25 0 0 1 2.064 0l.432.632a74.444 74.444 0 0 1 6.806 12.315l.09.208a1.011 1.011 0 0 1-.814 1.408c-5.015.56-10.077.56-15.092 0a1.011 1.011 0 0 1-.815-1.408l.09-.208a74.45 74.45 0 0 1 6.807-12.315z","clip-rule":"evenodd"})],-1)),t("p",se,d(l.$t("Add sample text")),1)])):A("",!0)])):A("",!0)]))}},le={class:"normal-case"},ae={class:U("sm:col-span-6")},oe={class:"mt-2"},ne={class:"flex items-center justify-between mt-2 mb-2"},re={class:"text-xs"},ue={class:"flex items-center space-x-3"},ie=["disabled"],de={key:0,class:"bg-gray-100 p-2 rounded-md"},ce={class:"mb-4"},ve={class:"text-slate-600 mb-2"},me={class:"text-xs"},pe={class:"w-[10%] text-sm"},he={class:"w-[90%]"},ge=["onUpdate:modelValue","placeholder"],fe={key:0,class:"p-2 bg-red-100 rounded-md flex items-center gap-x-2 mt-4"},xe={class:"text-sm"},ye={__name:"HeaderTextArea",props:{modelValue:[String,Number],customValues:{type:Array,default:()=>[]}},emits:["update:modelValue","updateExamples"],setup(P,{emit:M}){const _=P,s=c(_.modelValue),m=c([]),i=c({}),u=c(_.customValues),x=c("60"),f=c("0"),b=c(!1),B=()=>{if(!Array.isArray(u.value)){console.error("customValues is not an array");return}if(u.value.some(r=>r==="")){console.warn("Some custom values are empty.");return}m.value=u.value.map((r,n)=>`{{${n+1}}}`)};L(()=>{B(),y()});const S=()=>{var l;let r=parseInt(x.value);if(parseInt((l=s.value)==null?void 0:l.length)<r&&m.value.length===0){const e="{{1}}";s.value+=e,m.value.push(e),i.value[e]=1,u.value.push(""),b.value=!0,y()}},C=()=>{const r=/\{\{\d+\}\}/g,n=s.value.match(r);n&&n.length>1&&(s.value=n[0]),n?(m.value=[n[0]],i.value={[n[0]]:1},b.value=!0):(m.value=[],i.value={},u.value=[],b.value=!1),y(),$()},y=r=>{if(!s.value){f.value=0;return}let n=parseInt(x.value),l=parseInt(s.value.length);l<=n?f.value=l:(s.value=s.value.slice(0,n),f.value=n),$()},w=M,$=r=>{w("update:modelValue",s.value),w("updateExamples",u.value)};j(s,r=>{const n=parseInt(x.value);r.length>n&&(s.value=r.slice(0,n)),y(),C()});const k=N(()=>u.value.some(r=>!r));return(r,n)=>(h(),g("div",le,[t("div",null,[t("div",ae,[t("div",oe,[V(t("input",{type:"text",class:"block w-full rounded-md border-0 py-1.5 px-4 text-gray-900 shadow-sm outline-none ring-1 ring-inset placeholder:text-gray-400 sm:text-sm sm:leading-6 ring-gray-300","onUpdate:modelValue":n[0]||(n[0]=l=>s.value=l),onInput:C,rows:"5"},null,544),[[I,s.value]])])]),t("div",ne,[t("span",re,d(r.$t("Characters"))+": "+d(f.value+"/"+x.value),1),t("div",ue,[t("button",{type:"button",onClick:S,class:"hover:bg-slate-100 rounded p-1 text-sm cursor-pointer",disabled:b.value},d(r.$t("Add variable"))+" ("+d(r.$t("Max: 1"))+")",9,ie)])])]),m.value.length>0?(h(),g("div",de,[t("div",ce,[t("h2",ve,d(r.$t("Samples for header content")),1),t("p",me,d(r.$t("Please add an example for each variable in your body text. Do not use real customer information. Cloud API hosted by Meta reviews templates and variable parameters to protect the security and integrity of their services.")),1)]),(h(!0),g(T,null,z(m.value,(l,e)=>(h(),g("div",{key:e,class:"flex items-center mb-1"},[t("div",pe,d(l),1),t("div",he,[V(t("input",{type:"text","onUpdate:modelValue":a=>u.value[e]=a,placeholder:"Enter content for "+l,class:"block w-full rounded-md border-0 py-1.5 px-4 text-gray-900 shadow-sm outline-none ring-1 ring-inset placeholder:text-gray-400 sm:text-sm sm:leading-6 ring-gray-300",required:""},null,8,ge),[[I,u.value[e]]])])]))),128)),k.value?(h(),g("div",fe,[n[1]||(n[1]=t("svg",{class:"text-red-800",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[t("path",{fill:"currentColor",d:"M13 9a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-1 2.75a.75.75 0 0 1 .75.75v5a.75.75 0 1 1-1.5 0v-5a.75.75 0 0 1 .75-.75"}),t("path",{fill:"currentColor","fill-rule":"evenodd",d:"M14.27 3.993a2.749 2.749 0 0 0-4.54 0l-.432.632a75.95 75.95 0 0 0-6.944 12.563l-.09.208a2.511 2.511 0 0 0 2.024 3.497a69.43 69.43 0 0 0 15.424 0a2.511 2.511 0 0 0 2.024-3.497l-.09-.208a75.951 75.951 0 0 0-6.944-12.563zm-3.302.846a1.25 1.25 0 0 1 2.064 0l.432.632a74.444 74.444 0 0 1 6.806 12.315l.09.208a1.011 1.011 0 0 1-.814 1.408c-5.015.56-10.077.56-15.092 0a1.011 1.011 0 0 1-.815-1.408l.09-.208a74.45 74.45 0 0 1 6.807-12.315z","clip-rule":"evenodd"})],-1)),t("p",xe,d(r.$t("Add sample text")),1)])):A("",!0)])):A("",!0)]))}};export{ye as _,be as a};