import{S as M,B as A,_ as P}from"./main-bdeedeb2.js";import{m as R,n as Y,o as $,p as K,q as Q,r as G,s as W,t as ee,v as ae,I as n,x as le,y as te,z as se,A as oe,B as ne}from"./editor-d6580967.js";import{d as ie,b as i,s as ue,x as de,o as u,c as g,a as t,h as r,z as f,u as o,t as d,F as T,i as j,A as w,K as O,j as U,B as ce,n as re,y as ve,q as C}from"./_plugin-vue_export-helper-0830d71a.js";const fe={class:"text-white bg-[#303030] relative w-full h-full flex flex-col"},pe={class:"flex justify-between items-center p-2.5 text-sm border-b border-b-solid border-white border-opacity-9"},_e={class:"flex items-center w-16"},ge={class:"flex items-center"},me={class:"flex-grow min-h-0 flex flex-col gap-2 py-4 text-xs"},he={class:"px-4 flex-grow overflow-y-auto flex flex-col gap-4"},Se={key:0,class:"flex flex-col gap-2"},xe={key:1,class:"flex flex-col gap-2"},be={class:"flex flex-col gap-3.5"},we={class:"px-1 flex justify-between items-center"},Ce={class:"px-1 flex justify-between items-center"},Ve=ie({__name:"Setting",setup(ye){const p=i(void 0),v=i(void 0),Z=l=>{var s,c,_;const e=(s=p.value)==null?void 0:s.find(h=>h.e_id===l);e&&((_=(c=globalThis==null?void 0:globalThis.chrome)==null?void 0:c.runtime)==null||_.sendMessage({origin:"popup",target:"background",payload:{value:"switchCompany",data:e.e_id}}))},y=async l=>{if(l){p.value=JSON.parse(l);let e=await ne();e?(e=JSON.parse(decodeURIComponent(e)),v.value=p.value.find(s=>s.e_id==e.e_id)?e.e_id:void 0):v.value=void 0}else p.value=void 0,v.value=void 0},S=i(R),m=i(void 0),E=l=>{var s;const e=(s=S.value)==null?void 0:s.find(c=>c.value===l);e&&se(e)},k=l=>{var e;l?m.value=JSON.parse(l):m.value=(e=S.value)==null?void 0:e.find(s=>s.value===oe())},D=i(!1),B=l=>{D.value=l===!0},V=i(!1),L=l=>{V.value=l===!0};ue(()=>{Y(y),$(k),K(B),Q(L)}),de(()=>{G(y),W(k),ee(B),ae(L)});const x=i(void 0),b=i(!1),J=async()=>{x.value=ve(()=>P(()=>import("./Domain-c13b4c09.js"),["assets/Domain-c13b4c09.js","assets/main-bdeedeb2.js","assets/_plugin-vue_export-helper-0830d71a.js","assets/editor-d6580967.js","assets/index-63db5a40.css"])),b.value=!0},X=()=>{b.value=!1,setTimeout(()=>{x.value=void 0},500)};return(l,e)=>{var h,F,N,H,I,q,z;const s=C("a-option"),c=C("a-select"),_=C("a-switch");return u(),g("div",fe,[t("div",pe,[t("div",_e,[r(A,{class:"w-5 h-5",onClick:e[0]||(e[0]=a=>l.$emit("back"))},{default:f(()=>[r(o(M),{class:"w-3 h-3"})]),_:1})]),t("span",null,d((h=o(n))==null?void 0:h.sheZhi),1),t("div",ge,[r(A,{class:"px-2",onClick:J},{default:f(()=>{var a;return[t("span",null,d((a=o(n))==null?void 0:a.xiTong),1)]}),_:1})])]),t("div",me,[t("div",he,[v.value!==void 0?(u(),g("div",Se,[t("span",null,d((F=o(n))==null?void 0:F.qieHuanQiYe),1),r(c,{modelValue:v.value,"onUpdate:modelValue":e[1]||(e[1]=a=>v.value=a),placeholder:(N=o(n))==null?void 0:N.qingXuanZe,onChange:Z},{default:f(()=>[(u(!0),g(T,null,j(p.value,a=>(u(),w(s,{key:a.e_id,value:a.e_id},{default:f(()=>[O(d(a.e_id===1?o(n).personalAccount:a.e_name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue","placeholder"])])):U("",!0),m.value!==void 0?(u(),g("div",xe,[t("span",null,d((H=o(n))==null?void 0:H.qieHuanYuyan),1),r(c,{placeholder:(I=o(n))==null?void 0:I.qingXuanZe,defaultValue:m.value.value,onChange:E},{default:f(()=>[(u(!0),g(T,null,j(S.value,a=>(u(),w(s,{key:a.value,value:a.value},{default:f(()=>[O(d(a.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["placeholder","defaultValue"])])):U("",!0),t("div",be,[t("div",we,[t("span",null,d((q=o(n))==null?void 0:q.tuoZhuaiBaoCun),1),r(_,{"checked-color":"#7856FF","model-value":!D.value,size:"small",onChange:e[2]||(e[2]=a=>o(le)(!a))},null,8,["model-value"])]),t("div",Ce,[t("span",null,d((z=o(n))==null?void 0:z.shuBiaoXuanFuBaoCun),1),r(_,{"checked-color":"#7856FF","model-value":!V.value,size:"small",onChange:e[3]||(e[3]=a=>o(te)(!a))},null,8,["model-value"])])])])]),t("div",{class:re(["z-99 absolute inset-y-0 w-full transition-all ease-in-out duration-300",b.value?["left-0"]:["left-full"]])},[(u(),w(ce(x.value),{onBack:X},null,32))],2)])}}});export{Ve as default};
