import{c as e,u as a}from"./index-DoBLtCBk.js";import{a as s}from"./setting-huTIIu1c.js";import{e as t,s as n,r as c,l as o,$ as l}from"./main-DKqTMGci.js";import{u as i,a as u}from"./index-CpnxPwGt.js";const d=a=>e("/v1/access/get_list",a),m=a=>e("/v1/access/add_access",a),r=a=>e("/v1/access/upd_access",a),v=a=>e("/v1/access/del_access",a),_=t("layout-store",(()=>{const{handleError:t}=a(),n=i("layout-collapsed",!1),d=c([]),m=c([]),r=u("menu-active","home"),v=o((()=>"home"!==r.value?"var(--n-content-padding)":"0")),_=i("locales-active","zhCN"),p=c({ssh:{name:"SSH",access:["host"]},btpanel:{name:l("t_10_1745735765165"),access:["host"]},"1panel":{name:"1Panel",access:["host"]},aliyun:{name:l("t_2_1747019616224"),access:["dns","host"]},tencentcloud:{name:l("t_3_1747019616129"),access:["dns","host"]},huaweicloud:{name:"华为云",access:["dns"]},cloudflare:{name:"Cloudflare",access:["dns"]}}),h=c({"btpanel-site":{name:l("t_11_1745735766456")},"1panel-site":{name:l("t_13_1745735766084")},"aliyun-cdn":{name:l("t_16_1745735766712")},"aliyun-oss":{name:l("t_2_1746697487164")},"tencentcloud-cdn":{name:l("t_14_1745735766121")},"tencentcloud-cos":{name:l("t_15_1745735768976")}}),y=c({mail:{name:l("t_68_1745289354676")},dingtalk:{name:l("t_32_1746773348993")},wecom:{name:l("t_33_1746773350932")},feishu:{name:l("t_34_1746773350153")},webhook:{name:"WebHook"}});return{locales:_,notifyProvider:d,dnsProvider:m,isCollapsed:n,layoutPadding:v,menuActive:r,sourceTypes:p,sourceDerivationTypes:h,pushSourceType:y,resetDataInfo:()=>{r.value="home",sessionStorage.removeItem("menu-active")},updateMenuActive:e=>{"logout"!==e&&(r.value=e)},toggleCollapse:()=>{n.value=!n.value},handleCollapse:()=>{n.value=!0},handleExpand:()=>{n.value=!1},fetchNotifyProvider:async()=>{try{d.value=[];const{data:e}=await s({p:1,search:"",limit:1e3}).fetch();d.value=null==e?void 0:e.map((e=>({label:e.name,value:e.id.toString(),type:e.type})))}catch(e){t(e)}},fetchDnsProvider:async(a="")=>{try{m.value=[];const{data:t}=await(s={type:a},e("/v1/access/get_all",s)).fetch();m.value=(null==t?void 0:t.map((e=>({label:e.name,value:e.id.toString(),type:e.type}))))||[]}catch(n){t(n)}var s}}})),p=()=>{const e=_();return{...e,...n(e)}};export{m as a,p as b,v as d,d as g,r as u};
