| Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Socials-4ddf296a.js |
import{r as y,T as x,i as h,g as V,o as a,a as e,t as r,f as c,u as n,n as s,c as d,b as w,h as C}from"./app-f1493ab2.js";import $ from"./App-bc062293.js";import{_ as u}from"./FormInput-b3450213.js";import"./App-6e8cb8a8.js";import"./Sidebar-b962a0c1.js";import"./Menu-45912eaa.js";import"./ProfileModal-09ae28bb.js";import"./tabs-80627b62.js";import"./hidden-f79cef22.js";import"./micro-task-89dcd6af.js";import"./transition-f32a8133.js";import"./use-outside-click-92c6377f.js";import"./LangToggle-d2b58a25.js";import"./MobileSidebar-5b51f786.js";import"./index-114bea05.js";/* empty css */import"./Sidebar-10203eb5.js";const A={class:"text-xl mb-1"},j={class:"mb-6 flex items-center text-sm leading-6 text-gray-600"},B={class:"ml-1 mt-1"},S={class:"space-y-6"},M={class:""},L={class:"grid gap-6 grid-cols-2 pb-10 border-b md:w-2/3"},N={class:"relative flex gap-x-3 col-span-2"},Z={class:"flex items-center"},F={class:"relative flex gap-x-3 col-span-2"},U={class:"flex items-center"},G={class:"mt-6 flex items-center justify-end gap-x-6 md:w-2/3"},O={type:"button",class:"text-sm leading-6 text-gray-900"},T=["disabled"],q={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},z={key:1},io={__name:"Socials",props:{config:{type:Object,required:!0}},setup(b){const k=b,m=i=>{const o=k.config.find(t=>t.key===i);return o?o.value:""},g=(i,o)=>{const t=JSON.parse(m(i));return t!==null&&typeof t=="object"&&!Array.isArray(t)?t[o]??null:null},p=y(!1),l=x({allow_facebook_login:m("allow_facebook_login")==="1",allow_google_login:m("allow_google_login")==="1",facebook_login:{client_id:g("facebook_login","client_id")??null,client_secret:g("facebook_login","client_secret")??null},google_login:{client_id:g("google_login","client_id")??null,client_secret:g("google_login","client_secret")??null}}),f=()=>{l.allow_facebook_login=!l.allow_facebook_login},_=()=>{l.allow_google_login=!l.allow_google_login},v=async()=>{l.put("/admin/settings?type=socials",{preserveScroll:!0})};return(i,o)=>(a(),h($,null,{default:V(()=>[e("div",null,[e("h2",A,r(i.$t("Social login settings")),1),e("p",j,[o[9]||(o[9]=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)),e("span",B,r(i.$t("Configure social accounts for user login")),1)])]),e("form",{class:"",onSubmit:o[8]||(o[8]=C(t=>v(),["prevent"]))},[e("div",S,[e("div",M,[e("div",L,[c(u,{modelValue:n(l).google_login.client_id,"onUpdate:modelValue":o[0]||(o[0]=t=>n(l).google_login.client_id=t),name:i.$t("Google client id"),error:n(l).errors["google_login.client_id"],type:"text",class:s("col-span-1")},null,8,["modelValue","name","error"]),c(u,{modelValue:n(l).google_login.client_secret,"onUpdate:modelValue":o[1]||(o[1]=t=>n(l).google_login.client_secret=t),name:i.$t("Google client secret"),error:n(l).errors["google_login.client_secret"],type:"password",class:s("col-span-1")},null,8,["modelValue","name","error"]),c(u,{modelValue:n(l).facebook_login.client_id,"onUpdate:modelValue":o[2]||(o[2]=t=>n(l).facebook_login.client_id=t),name:i.$t("Facebook client id"),error:n(l).errors["facebook_login.client_id"],type:"text",class:s("col-span-1")},null,8,["modelValue","name","error"]),c(u,{modelValue:n(l).facebook_login.client_secret,"onUpdate:modelValue":o[3]||(o[3]=t=>n(l).facebook_login.client_secret=t),name:i.$t("Facebook client secret"),error:n(l).errors["facebook_login.client_secret"],type:"password",class:s("col-span-1")},null,8,["modelValue","name","error"]),e("div",N,[e("div",Z,[e("label",{onClick:o[4]||(o[4]=t=>_()),for:"myCheckbox",class:"cursor-pointer"},[e("div",{class:s(["w-4 h-4 border border-gray-400 rounded-md flex items-center justify-center",n(l).allow_google_login?"bg-[#000]":""])},[n(l).allow_google_login?(a(),d("svg",{key:0,class:s(["w-4 h-4",n(l).allow_google_login?"text-white":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},o[10]||(o[10]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]),2)):w("",!0)],2)]),e("span",{onClick:o[5]||(o[5]=t=>_()),class:"ml-2 text-[14px] cursor-pointer"},r(i.$t("Allow google login")),1)])]),e("div",F,[e("div",U,[e("label",{onClick:o[6]||(o[6]=t=>f()),for:"myCheckbox",class:"cursor-pointer"},[e("div",{class:s(["w-4 h-4 border border-gray-400 rounded-md flex items-center justify-center",n(l).allow_facebook_login?"bg-[#000]":""])},[n(l).allow_facebook_login?(a(),d("svg",{key:0,class:s(["w-4 h-4",n(l).allow_facebook_login?"text-white":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},o[11]||(o[11]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]),2)):w("",!0)],2)]),e("span",{onClick:o[7]||(o[7]=t=>f()),class:"ml-2 text-[14px] cursor-pointer"},r(i.$t("Allow facebook login")),1)])])]),e("div",G,[e("button",O,r(i.$t("Cancel")),1),e("button",{class:s(["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":p.value}]),disabled:p.value},[p.value?(a(),d("svg",q,o[12]||(o[12]=[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),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)]))):(a(),d("span",z,r(i.$t("Save")),1))],10,T)])])])],32)]),_:1}))}};export{io as default};