import{l}from"./main-few-lands-burn.js";const i="https://generativelanguage.googleapis.com/v1beta/",c=async t=>l({method:"GET",queryParams:{key:{encryption:"hmac_decrypt",value:t}},url:`${i}models`}),r=async t=>{t.setComponent("model-id",e=>{e.loading=!0});const n=await t.getConnection();if(!n)return;const{data:a,status:s}=await c(n.auth_details.value);if(s!=="success"){t.setComponent("model-id",e=>{t.util.isSelectComponent(e)&&(e.loading=!1,e.status=s,e.invalidMessage=a)}),console.error("Failed to fetch list");return}t.setComponent("model-id",e=>{t.util.isSelectComponent(e)&&(e.options=a?.models.filter(o=>o.supportedGenerationMethods?.includes("generateContent")).map(o=>({label:o.name,value:o.name})),e.loading=!1)})};export{r as f};
