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/General-e8f88ea1.js

import{r as b,o as u,c as g,a as e,t as r,b as y,n as c,j as w,T as V,h as k,f as x,e as m,u as l,g as $}from"./app-43851608.js";import S from"./App-2fea9171.js";import{_ as h}from"./FormInput-4a309017.js";import"./index-17cd980e.js";import{_ as U}from"./FormTextArea-a182534a.js";import{_ as z}from"./FormToggleSwitch-1780efa4.js";import"./App-ad5f7ecb.js";import"./Sidebar-7bb6d772.js";import"./Menu-4221d61f.js";import"./ProfileModal-628e5b7c.js";import"./LangToggle-8d05b0dc.js";import"./MobileSidebar-b73cd192.js";import"./index-99011d5f.js";/* empty css              */import"./Sidebar-7b5bc85b.js";const C={for:"name",class:"block text-sm leading-6 text-gray-900 mb-2"},L={class:"flex items-center gap-x-3"},j={key:0,class:"h-16 w-16 rounded-lg border-2 border-dashed overflow-hidden"},A=["src"],F={key:1,class:"border-2 border-dashed h-16 w-16 flex rounded-lg items-center justify-center"},B=w('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6Z"></path><circle cx="8.5" cy="8.5" r="2.5"></circle><path d="M14.526 12.621L6 22h12.133A3.867 3.867 0 0 0 22 18.133V18c0-.466-.175-.645-.49-.99l-4.03-4.395a2 2 0 0 0-2.954.006Z"></path></g></svg>',1),M=[B],Z=["accept","disabled"],N={key:0,class:"form-error text-[#b91c1c] text-xs"},I={__name:"FormImageFavicon",props:{modelValue:File,name:String,label:String,className:String,error:String,disabled:Boolean,imageUrl:String},emits:["update:modelValue"],setup(d,{emit:_}){const p=b(d.imageUrl),n=_,f=t=>{const s=t.target.files[0];if(s&&s.size>5242880)alert("File size exceeds the limit. Max allowed size: 5242880 bytes"),t.target.value=null;else{const o=new FileReader;o.onload=a=>{p.value=a.target.result},n("update:modelValue",s),o.readAsDataURL(s)}};return(t,v)=>(u(),g("div",{class:c(d.className)},[e("label",C,r(d.name),1),e("div",L,[p.value?(u(),g("div",j,[e("img",{src:p.value,alt:"",class:"object-contain w-full h-full"},null,8,A)])):(u(),g("div",F,M)),e("input",{type:"file",class:"",accept:".png, .jpg",id:"file-upload",onChange:f,disabled:d.disabled},null,40,Z)]),d.error?(u(),g("div",N,r(d.error),1)):y("",!0)],2))}},R={for:"name",class:"block text-sm leading-6 text-gray-900 mb-2"},T={class:"flex items-center gap-x-3"},D={key:0,class:"h-20 w-48 rounded-lg border-2 border-dashed overflow-hidden"},E=["src"],G={key:1,class:"border-2 border-dashed h-20 w-48 flex rounded-lg items-center justify-center"},H=w('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6Z"></path><circle cx="8.5" cy="8.5" r="2.5"></circle><path d="M14.526 12.621L6 22h12.133A3.867 3.867 0 0 0 22 18.133V18c0-.466-.175-.645-.49-.99l-4.03-4.395a2 2 0 0 0-2.954.006Z"></path></g></svg>',1),O=[H],q=["accept","disabled"],J={key:0,class:"form-error text-[#b91c1c] text-xs"},K={__name:"FormImageLogo",props:{modelValue:File,name:String,label:String,className:String,error:String,disabled:Boolean,imageUrl:String},emits:["update:modelValue"],setup(d,{emit:_}){const p=b(d.imageUrl),n=_,f=t=>{const s=t.target.files[0];if(s&&s.size>5242880)alert("File size exceeds the limit. Max allowed size: 5242880 bytes"),t.target.value=null;else{const o=new FileReader;o.onload=a=>{p.value=a.target.result},n("update:modelValue",s),o.readAsDataURL(s)}};return(t,v)=>(u(),g("div",{class:c(d.className)},[e("label",R,r(d.name),1),e("div",T,[p.value?(u(),g("div",D,[e("img",{src:p.value,alt:"",class:"object-contain w-full h-full"},null,8,E)])):(u(),g("div",G,O)),e("input",{type:"file",class:"",accept:".png, .jpg",id:"file-upload",onChange:f,disabled:d.disabled},null,40,q)]),d.error?(u(),g("div",J,r(d.error),1)):y("",!0)],2))}},P={class:"text-xl mb-1"},Q={class:"mb-6 flex items-center text-sm leading-6"},W=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),X={class:"ml-1 mt-1"},Y={class:"space-y-12"},ee={class:"pb-12"},te={class:"grid gap-6 grid-cols-2 pb-10 border-b md:w-2/3"},oe={class:"pt-5"},se={class:"text-base text-gray-900"},ae={class:"text-sm leading-6 mb-5"},le={class:"grid gap-6 grid-cols-2 pb-10 border-b md:w-2/3"},ne={class:"pt-5"},ie={class:"text-base text-gray-900"},re={class:"text-sm leading-6 mb-5"},de={class:"flex gap-x-10 md:w-2/3 pb-10 border-b"},ce={class:"w-[80%]"},me={class:"text-xs text-slate-700 flex items-center"},ue=e("svg",{class:"mr-1",xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",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),pe={class:"w-[20%]"},ge={class:"pt-5"},he={class:"text-base text-gray-900"},fe={class:"text-sm leading-6 mb-5"},_e={class:"grid gap-6 grid-cols-2 pb-10 border-b md:w-2/3"},ve={class:"mt-6 flex items-center justify-end gap-x-6 md:w-2/3"},be={type:"button",class:"text-sm leading-6 text-gray-900"},ye=["disabled"],we={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},Ve=e("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"},null,-1),ke=e("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[e("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})],-1),xe=[Ve,ke],$e={key:1},De={__name:"General",props:{config:{type:Array,required:!0}},setup(d){const _=d,i=s=>{const o=_.config.find(a=>a.key===s);return o?o.value:""},p=s=>{const o=i(s);return o!=""&&o!=null?"/media/"+o:null},n=JSON.parse(i("socials")),f=b(!1),t=V({_method:"put",company_name:i("company_name"),phone:i("phone"),email:i("email"),address:i("address"),recaptcha_active:i("recaptcha_active")==="1",recaptcha_site_key:i("recaptcha_site_key"),recaptcha_secret_key:i("recaptcha_secret_key"),google_analytics_tracking_id:i("google_analytics_tracking_id"),google_maps_api_key:i("google_maps_api_key"),app_environment:i("app_environment"),display_frontend:i("display_frontend")==1||i("display_frontend")=="",logo:null,favicon:null,socials:{facebook:n==null?void 0:n.facebook,twitter:n==null?void 0:n.twitter,instagram:n==null?void 0:n.instagram,slack:n==null?void 0:n.slack,linkedin:n==null?void 0:n.linkedin}}),v=async()=>{t.post("/admin/settings?type=general",{preserveScroll:!0})};return(s,o)=>(u(),k(S,null,{default:x(()=>[e("div",null,[e("h2",P,r(s.$t("General settings")),1),e("p",Q,[W,e("span",X,r(s.$t("Configure general account information")),1)])]),e("form",{onSubmit:o[12]||(o[12]=$(a=>v(),["prevent"])),enctype:"multipart/form-data"},[e("div",Y,[e("div",ee,[e("div",te,[m(h,{modelValue:l(t).company_name,"onUpdate:modelValue":o[0]||(o[0]=a=>l(t).company_name=a),name:s.$t("Organization/company name"),error:l(t).errors.company_name,type:"text",class:c("col-span-2")},null,8,["modelValue","name","error"]),m(h,{modelValue:l(t).phone,"onUpdate:modelValue":o[1]||(o[1]=a=>l(t).phone=a),name:s.$t("Phone"),error:l(t).errors.phone,type:"text",class:c("col-span-1")},null,8,["modelValue","name","error"]),m(h,{modelValue:l(t).email,"onUpdate:modelValue":o[2]||(o[2]=a=>l(t).email=a),name:s.$t("Email"),error:l(t).errors.email,type:"text",class:c("col-span-1")},null,8,["modelValue","name","error"]),m(U,{modelValue:l(t).address,"onUpdate:modelValue":o[3]||(o[3]=a=>l(t).address=a),name:s.$t("Address"),showLabel:!0,error:l(t).errors.address,class:c("col-span-2")},null,8,["modelValue","name","error"])]),e("div",oe,[e("h2",se,r(s.$t("Social media accounts")),1),e("p",ae,r(s.$t("Add your social media account links")),1),e("div",le,[m(h,{modelValue:l(t).socials.facebook,"onUpdate:modelValue":o[4]||(o[4]=a=>l(t).socials.facebook=a),name:"Facebook",type:"text",class:c("col-span-1")},null,8,["modelValue"]),m(h,{modelValue:l(t).socials.twitter,"onUpdate:modelValue":o[5]||(o[5]=a=>l(t).socials.twitter=a),name:"Twitter",type:"text",class:c("col-span-1")},null,8,["modelValue"]),m(h,{modelValue:l(t).socials.instagram,"onUpdate:modelValue":o[6]||(o[6]=a=>l(t).socials.instagram=a),name:"Instagram",type:"text",class:c("col-span-1")},null,8,["modelValue"]),m(h,{modelValue:l(t).socials.slack,"onUpdate:modelValue":o[7]||(o[7]=a=>l(t).socials.slack=a),name:"Slack",type:"text",class:c("col-span-1")},null,8,["modelValue"]),m(h,{modelValue:l(t).socials.linkedin,"onUpdate:modelValue":o[8]||(o[8]=a=>l(t).socials.linkedin=a),name:"LinkedIn",type:"text",class:c("col-span-1")},null,8,["modelValue"])])]),e("div",ne,[e("h2",ie,r(s.$t("Frontend Settings")),1),e("p",re,r(s.$t("Show/hide the main frontend page")),1),e("div",de,[e("div",ce,[e("span",null,r(s.$t("Use the current default frontend")),1),e("div",me,[ue,e("span",null,r(s.$t("Toggle on/off to show/hide the main frontend page")),1)])]),e("div",pe,[m(z,{modelValue:l(t).display_frontend,"onUpdate:modelValue":o[9]||(o[9]=a=>l(t).display_frontend=a),class:"float-right"},null,8,["modelValue"])])])]),e("div",ge,[e("h2",he,r(s.$t("Site logo and favicon")),1),e("p",fe,r(s.$t("Add your logo and favicon")),1),e("div",_e,[m(K,{modelValue:l(t).logo,"onUpdate:modelValue":o[10]||(o[10]=a=>l(t).logo=a),name:s.$t("Site logo"),error:l(t).errors.logo,label:s.$t("Upload logo"),imageUrl:p("logo"),class:c("col-span-2")},null,8,["modelValue","name","error","label","imageUrl"]),m(I,{modelValue:l(t).favicon,"onUpdate:modelValue":o[11]||(o[11]=a=>l(t).favicon=a),name:s.$t("Favicon"),error:l(t).errors.favicon,label:s.$t("Upload logo"),imageUrl:p("favicon"),class:c("col-span-2")},null,8,["modelValue","name","error","label","imageUrl"])])]),e("div",ve,[e("button",be,r(s.$t("Cancel")),1),e("button",{class:c(["inline-flex justify-center rounded-md border border-transparent bg-primary px-4 py-2 text-sm text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",{"opacity-50":f.value}]),disabled:f.value},[f.value?(u(),g("svg",we,xe)):(u(),g("span",$e,r(s.$t("Save")),1))],10,ye)])])])],32)]),_:1}))}};export{De as default};