import{_ as I,a as b}from"./B8IDXpRD.js";import{d as B,at as N,r as l,a5 as a,x as u,y as s,z as T,a9 as p,A as v,B as $,T as S,a1 as V,ai as q,K as A,v as f,O as D,Q as L}from"./D3l4Cb4m.js";import{u as z}from"./BGlfPyXw.js";import{l as E}from"./BTYgDOhz.js";import"./BLZQuouS.js";import"./C6entnFp.js";import"./Cy9jV2HZ.js";import"./BbpBKUVh.js";import"./C7eKbJgs.js";import"./BrmPz7i0.js";import"./WIvQOhpN.js";import"./B8v3cc24.js";import"./CxVDiOZo.js";import"./6dRv2cdq.js";import"./C4Om2k4R.js";const F=s("img",{"w-6":"","h-6":"","mb-2":"",src:I},null,-1),K={fixed:"","bottom-4":"","right-4":""},oe=B({__name:"caller",setup(O){const n=N(),{chatToBottom:d}=z(),{companyCode:r,guestSign:_,userId:i,userName:g,token:y,sessionId:h,accountId:x}=q();r.value=n.query.companyCode,_.value=n.query.sign;const c=l(!1),o=l(!1);C();function C(){const t={companyCode:r.value,userName:i.value};return E(t).then(e=>{i.value=e.uuid,g.value=e.nickname,y.value=e.token,h.value=e.sessionId,x.value=e.accountId,c.value=!0}).catch(e=>{}).finally(()=>{})}async function m(t=!0){o.value=t,t&&(await A(),d(0))}return(t,e)=>{const k=b;return a(c)?(f(),u(V,{key:0},[a(o)?p("",!0):(f(),u("div",{key:0,fixed:"","bottom-30":"","right-0":"",flex:"","flex-col":"","items-center":"","rounded-l-4":"","bg-white":"","py-3.5":"","px-2":"",shadow:"[0_0_8px_0_rgba(0,0,0,0.1)]","cv-primary-hover":"",text:"3.5 #333",onClick:e[0]||(e[0]=w=>m())},[F,s("span",null,T(t.$t("联系客服")),1)])),v(S,{"enter-active-class":"transition origin-center","leave-active-class":"transition origin-center","enter-from-class":"opacity-0 scale-75","leave-to-class":"opacity-1 scale-75"},{default:$(()=>[D(s("div",K,[v(k,{onClose:e[1]||(e[1]=w=>m(!1))})],512),[[L,a(o)]])]),_:1})],64)):p("",!0)}}});export{oe as default};
