import{da as n}from"./main-tangy-colts-beg.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,o){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,o),o)}};const l="https://api.deepseek.com/",h=async e=>n({headers:{Authorization:["Bearer ",{encryption:"hmac_decrypt",value:e}]},method:"GET",url:`${l}models`});globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,o){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,o),o)}};const d=async e=>{e.setComponent("model-id",t=>{t.loading=!0});const o=await e.getConnection();if(!o)return;const{data:a,status:s}=await h(o.auth_details.value);if(s!=="success"){e.setComponent("model-id",t=>{e.util.isSelectComponent(t)&&(t.loading=!1,t.status=s,t.invalidMessage=a)}),console.error("Failed to fetch list");return}e.setComponent("model-id",t=>{var i;e.util.isSelectComponent(t)&&(t.options=(i=a==null?void 0:a.data)==null?void 0:i.map(c=>({label:c.id,value:c.id})),t.loading=!1)})};export{d as f};
