Your IP : 216.73.217.77


Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/
Upload File :
Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Show-254ed591.js

import{r as w,T,O as V,o as i,c,a as e,w as j,v as L,u as b,b as y,t as o,F as M,d as Z,n as S,h as B,j as O,f as $,e as C,k as N,l as F,g as D,y as X}from"./app-43851608.js";import K from"./App-2fea9171.js";import{d as q}from"./debounce-729b203d.js";import{u as A}from"./useAlertModal-27d09708.js";import{_ as E}from"./FormTextArea-a182534a.js";import{_ as R}from"./Modal-22a49fae.js";import"./App-ad5f7ecb.js";import"./Sidebar-7bb6d772.js";import"./Menu-4221d61f.js";import"./ProfileModal-628e5b7c.js";import"./FormInput-4a309017.js";import"./LangToggle-8d05b0dc.js";import"./MobileSidebar-b73cd192.js";import"./index-99011d5f.js";/* empty css              */import"./Sidebar-7b5bc85b.js";import"./_baseGetTag-2e10a2d1.js";const I={class:"md:bg-white flex items-center border border-primary md:border-none md:shadow-sm h-12 md:h-10 w-full md:w-80 rounded-[0.5rem] mb-6 text-xl md:text-sm"},z=e("span",{class:"pl-3"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 15l6 6m-11-4a7 7 0 1 1 0-14a7 7 0 0 1 0 14Z"})])],-1),H=["placeholder"],U=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10s10-4.5 10-10S17.5 2 12 2zm3.7 12.3c.4.4.4 1 0 1.4c-.4.4-1 .4-1.4 0L12 13.4l-2.3 2.3c-.4.4-1 .4-1.4 0c-.4-.4-.4-1 0-1.4l2.3-2.3l-2.3-2.3c-.4-.4-.4-1 0-1.4c.4-.4 1-.4 1.4 0l2.3 2.3l2.3-2.3c.4-.4 1-.4 1.4 0c.4.4.4 1 0 1.4L13.4 12l2.3 2.3z"})],-1),P=[U],G={key:1,class:"pr-2"},J=O('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="0 12 12;90 12 12;180 12 12;270 12 12"></animateTransform><animate attributeName="opacity" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" begin="0.2s" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="30 12 12;120 12 12;210 12 12;300 12 12"></animateTransform><animate attributeName="opacity" begin="0.2s" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" begin="0.4s" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="60 12 12;150 12 12;240 12 12;330 12 12"></animateTransform><animate attributeName="opacity" begin="0.4s" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle></svg>',1),Q=[J],W={class:"grid grid-cols-2 bg-gray-50 px-2 md:border-b-0 border-[#d1d5db] text-sm rounded-tr-[8px] rounded-tl-[8px]"},Y={class:"px-2 py-3 max-w-[25em] truncate"},ee={class:"px-2 py-3 truncate"},te={class:"grid grid-cols-2 bg-white px-2 hover:bg-slate-50 md:border-b-0 md:border-t border-[#d1d5db] text-sm border-b cursor-pointer"},se={class:"p-2 flex items-center"},oe={class:"max-w-[24em] truncate"},ne={class:"p-2 truncate flex items-center w-full"},le=["onClick"],ae=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},[e("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[e("path",{d:"M14.25 8.75c-.5 2.5-2.385 4.854-5.03 5.38A6.25 6.25 0 0 1 3.373 3.798C5.187 1.8 8.25 1.25 10.75 2.25"}),e("path",{d:"m5.75 7.75l2.5 2.5l6-6.5"})])],-1),ie=[ae],re=["onClick"],de=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[e("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[e("path",{d:"M9.533 11.15A1.823 1.823 0 0 0 9 12.438V15h2.578c.483 0 .947-.192 1.289-.534l7.6-7.604a1.822 1.822 0 0 0 0-2.577l-.751-.751a1.822 1.822 0 0 0-2.578 0z"}),e("path",{d:"M21 12c0 4.243 0 6.364-1.318 7.682C18.364 21 16.242 21 12 21c-4.243 0-6.364 0-7.682-1.318C3 18.364 3 16.242 3 12c0-4.243 0-6.364 1.318-7.682C5.636 3 7.758 3 12 3"})])],-1),ce=[de],ue={__name:"LangTranslationsTable",props:{rows:{type:Array,required:!0},filters:{type:Object},language:{type:Object}},emits:["edit","delete"],setup(k,{emit:h}){const u=k;A();const p=w(null);T({test:null});const v=w({search:u.filters.search}),x=w(!1),t=()=>{v.value.search=null,s()},l=q(()=>{x.value=!0,s()},1e3),s=()=>{const m=window.location.pathname;V.visit(m,{method:"get",data:v.value})};w(null);const d=T({translation:null}),f=(m,n)=>{p.value=m,d.translation=n},r=async()=>{d.post("/admin/translations/"+u.language.code+"/"+p.value,{preserveScroll:!0,onFinish:()=>{p.value=null}})};return(m,n)=>(i(),c(M,null,[e("div",I,[z,j(e("input",{onInput:n[0]||(n[0]=(...a)=>b(l)&&b(l)(...a)),"onUpdate:modelValue":n[1]||(n[1]=a=>v.value.search=a),type:"text",class:"outline-none px-4 w-full",placeholder:m.$t("Search translation string")},null,40,H),[[L,v.value.search]]),x.value===!1&&v.value.search?(i(),c("button",{key:0,onClick:t,type:"button",class:"pr-2"},P)):y("",!0),x.value?(i(),c("span",G,Q)):y("",!0)]),e("div",W,[e("div",Y,o(m.$t("Key")),1),e("div",ee,o(m.$t("Translation")),1)]),(i(!0),c(M,null,Z(u.rows,(a,_)=>(i(),c("div",{key:_},[e("div",te,[e("div",se,[e("div",oe,o(a.Key),1)]),e("div",ne,[e("div",{class:S(["float-left truncate",p.value!=a.Key?"max-w-[25em]":"w-full"])},[p.value===a.Key?(i(),B(E,{key:0,modelValue:b(d).translation,"onUpdate:modelValue":n[2]||(n[2]=g=>b(d).translation=g),name:"",showLabel:!1,class:S("w-full")},null,8,["modelValue"])):(i(),c("span",{key:1,onClick:g=>f(a.Key,a.Translation)},o(a.Translation),9,le))],2),p.value===a.Key?(i(),c("div",{key:0,class:"ml-auto hover:bg-gray-200 p-2 rounded-full",onClick:n[3]||(n[3]=g=>r())},ie)):(i(),c("div",{key:1,class:"ml-auto hover:bg-gray-200 p-2 rounded-full",onClick:g=>f(a.Key,a.Translation)},ce,8,re))])])]))),128))],64))}},me={class:"flex justify-between"},pe={class:"text-xl mb-1"},he={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},fe=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},[e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 11v5m0 5a9 9 0 1 1 0-18a9 9 0 0 1 0 18Zm.05-13v.1h-.1V8h.1Z"})],-1),ge={class:"ml-1 mt-1"},ve={class:"flex items-center space-x-2"},we={class:"list-decimal ml-4 mt-2 space-y-0 text-sm"},xe={class:"mb-0"},_e={class:"text-sm text-slate-600"},be=e("br",null,null,-1),ye={class:"text-sm text-slate-600 underline"},ke=["href"],$e={class:"text-sm text-slate-600 mt-4 mb-0"},Ce={class:"text-sm text-slate-600 mt-4 mb-0"},Te={class:"max-w-md w-full space-y-8"},Me={class:"mt-8 space-y-6"},Se={class:"text-center"},Ze=e("svg",{class:"mx-auto h-12 w-12 text-gray-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("g",{fill:"none"},[e("path",{fill:"currentColor",d:"m15.393 4.054l-.502.557l.502-.557Zm3.959 3.563l-.502.557l.502-.557Zm2.302 2.537l-.685.305l.685-.305ZM3.172 20.828l.53-.53l-.53.53Zm17.656 0l-.53-.53l.53.53ZM14 21.25h-4v1.5h4v-1.5ZM2.75 14v-4h-1.5v4h2.5Zm18.5-.437V14h2.5v-.437h-1.5ZM14.891 4.61l3.959 3.563l1.003-1.115l-3.958-3.563l-1.004 1.115Zm7.859 8.952c0-1.689.015-2.758-.41-3.714l-1.371.61c.266.598.281 1.283.281 3.104h2.5Zm-3.9-5.389c1.353 1.218 1.853 1.688 2.119 2.285l1.37-.61c-.426-.957-1.23-1.66-2.486-2.79L18.85 8.174ZM10.03 2.75c1.582 0 2.179.012 2.71.216l.538-1.4c-.852-.328-1.78-.316-3.248-.316v1.5Zm5.865.746c-1.086-.977-1.765-1.604-2.617-1.93l-.537 1.4c.532.204.98.592 2.15 1.645l1.004-1.115ZM10 21.25c-1.907 0-3.261-.002-4.29-.14c-1.005-.135-1.585-.389-2.008-.812l-1.06 1.06c.748.75 1.697 1.081 2.869 1.239c1.15.155 2.625.153 4.489.153v-1.5ZM1.25 14c0 1.864-.002 3.338.153 4.489c.158 1.172.49 2.121 1.238 2.87l1.06-1.06c-.422-.424-.676-1.004-.811-2.01c-.138-1.027-.14-2.382-.14-4.289h-1.5ZM14 22.75c1.864 0 3.338.002 4.489-.153c1.172-.158 2.121-.49 2.87-1.238l-1.06-1.06c-.424.422-1.004.676-2.01.811c-1.027.138-2.382.14-4.289.14v1.5ZM21.25 14c0 1.907-.002 3.262-.14 4.29c-.135 1.005-.389 1.585-.812 2.008l1.06 1.06c.75-.748 1.081-1.697 1.239-2.869c.155-1.15.153-2.625.153-4.489h-1.5Zm-18.5-4c0-1.907.002-3.261.14-4.29c.135-1.005.389-1.585.812-2.008l-1.06-1.06c-.75.748-1.081 1.697-1.239 2.869C1.248 6.661 1.25 8.136 1.25 10h2.5Zm7.28-8.75c-1.875 0-3.356-.002-4.511.153c-1.177.158-2.129.49-2.878 1.238l1.06 1.06c.424-.422 1.005-.676 2.017-.811c1.033-.138 2.395-.14 4.312-.14v-1.5Z"}),e("path",{stroke:"currentColor","stroke-width":"1.5",d:"M13 2.5V5c0 2.357 0 3.536.732 4.268C14.464 10 15.643 10 18 10h4"})])],-1),Be={class:"flex text-sm text-gray-600"},Ve={for:"file-upload",class:"relative cursor-pointer bg-white rounded-md font-medium text-indigo-600 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500"},je={class:"pl-1"},Le={class:"text-xs text-gray-500"},Oe={key:0,class:"mt-4"},Ne={class:"mt-2 rounded-md bg-[#F5F7FB] px-6"},Fe={class:"flex-1 min-w-0"},De={class:"text-sm font-medium text-indigo-600 truncate"},Xe={class:"mt-1 flex items-center text-sm text-gray-500"},Ke={key:0},qe={key:1},Ae={class:"ml-4 flex-shrink-0"},Ee={key:0,class:"relative w-48"},Re={class:"overflow-hidden h-2 text-xs flex rounded bg-indigo-200"},Ie={class:"mt-5 grid grid-cols-1 gap-x-6 gap-y-4"},ze={class:"mt-2 w-full"},dt={__name:"Show",props:{language:Object,rows:Object,filters:String},setup(k){const h=k,u=w([]),p=w(!1);T({_method:"put"});const v=t=>{const l=t.target.files;for(let s=0;s<l.length;s++){const d=l[s];if(!["text/csv","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(d.type)){alert(trans("please select a CSV or XLSX file"));return}const f=new FormData;f.append("file",d);const r=new XMLHttpRequest,m=document.querySelector('meta[name="csrf-token"]').getAttribute("content");r.upload.addEventListener("progress",n=>{if(n.lengthComputable){const a=Math.round(n.loaded/n.total*100),_=u.value.findIndex(g=>g.name===d.name);u.value[_].progress=a}}),r.open("POST","/admin/languages/"+h.language.code+"/import"),r.setRequestHeader("X-CSRF-TOKEN",m),r.onload=()=>{r.status},r.send(f),u.value.push({name:d.name,progress:0})}},x=t=>{t.preventDefault();const l=t.dataTransfer.files;for(let s=0;s<l.length;s++){const d=l[s];if(!["text/csv","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(d.type)){alert(trans("please select a CSV or XLSX file"));return}const f=new FormData;f.append("file",d);const r=new XMLHttpRequest,m=document.querySelector('meta[name="csrf-token"]').getAttribute("content");r.upload.addEventListener("progress",n=>{if(n.lengthComputable){const a=Math.round(n.loaded/n.total*100),_=u.value.findIndex(g=>g.name===d.name);u.value[_].progress=a}}),r.open("POST","/admin/languages/"+h.language.code+"/import"),r.setRequestHeader("X-CSRF-TOKEN",m),r.onload=()=>{r.status},r.send(f),u.value.push({name:d.name,progress:0})}};return(t,l)=>(i(),B(K,null,{default:$(()=>[e("div",me,[e("div",null,[e("h2",pe,o(t.$t("Language translations:"))+" "+o(h.language.name),1),e("p",he,[fe,e("span",ge,o(t.$t("Translate your language")),1)])]),e("div",ve,[e("button",{onClick:l[0]||(l[0]=s=>p.value=!0),class:"rounded-md bg-indigo-600 px-3 py-2 text-sm text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},o(t.$t("Bulk edit translations")),1),C(b(F),{href:"/admin/languages",class:"rounded-md bg-black px-3 py-2 text-sm text-white shadow-sm hover:bg-black focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},{default:$(()=>[N(o(t.$t("Back")),1)]),_:1})])]),C(ue,{rows:h.rows,filters:h.filters,language:h.language},null,8,["rows","filters","language"]),C(R,{label:t.$t("Bulk Edit"),isOpen:p.value},{default:$(()=>[e("ol",we,[e("li",xe,[e("span",_e,o(t.$t("Download .xlsx file with all translation strings.")),1),be,e("span",ye,[e("a",{href:"/admin/languages/"+h.language.code+"/export"},o(t.$t("Click here to download")),9,ke)])]),e("li",null,[e("div",$e,o(t.$t("Edit the xlsx file with your own translations")),1)]),e("li",null,[e("div",Ce,o(t.$t("Reupload the edited xlsx file below")),1)])]),e("div",Te,[e("div",Me,[e("div",{onDragover:l[2]||(l[2]=D(()=>{},["prevent"])),onDrop:x,class:"flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md"},[e("input",{type:"file",class:"sr-only",accept:".xslx",ref:"fileInput",id:"file-upload",onChange:l[1]||(l[1]=s=>v(s))},null,544),e("div",Se,[e("div",null,[Ze,e("div",Be,[e("label",Ve,[e("span",null,o(t.$t("Click to upload a file")),1)]),e("p",je,o(t.$t("Or drag and drop")),1)]),e("p",Le,o(t.$t("XLSX files only")),1)])])],32),u.value.length?(i(),c("div",Oe,[e("ul",Ne,[(i(!0),c(M,null,Z(u.value,s=>(i(),c("li",{key:s.name,class:"py-2 flex justify-between items-center"},[e("div",Fe,[e("p",De,o(s.name),1),e("div",Xe,[s.progress!==100?(i(),c("span",Ke,o(s.progress)+"% - ",1)):(i(),c("span",qe,o(t.$t("Complete")),1))])]),e("div",Ae,[s.progress!==100?(i(),c("div",Ee,[e("div",Re,[e("div",{style:X({width:`${s.progress}%`}),class:"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-indigo-500"},null,4)])])):y("",!0)])]))),128))])])):y("",!0)])]),e("div",Ie,[e("div",ze,[e("button",{type:"button",onClick:l[3]||(l[3]=s=>p.value=!1),class:"inline-flex float-right justify-center rounded-md border border-transparent bg-slate-50 px-4 py-2 text-sm text-slate-500 hover:bg-slate-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2"},o(t.$t("Close")),1)])])]),_:1},8,["label","isOpen"])]),_:1}))}};export{dt as default};