function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = ["./index-dyx4v2bZ.js","./index-BKNuk68o.css"]
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
import{d as k,an as c,ao as S,Q as w,i as x,a as A,ap as B,q as M,c as s,w as C,o as i,f as j,R as o,b as p,aw as L,_ as R}from"./index-dyx4v2bZ.js";import{u as T}from"./useListResources-DdhCMljT.js";const q={class:"BuilderGraphSelect--text"},E=k({__name:"BuilderApplicationSelect",props:c({enableMultiSelection:{type:Boolean,required:!1}},{modelValue:{type:[String,Array],required:!0},modelModifiers:{}}),emits:c(["selected-data"],["update:modelValue"]),setup(r,{expose:m,emit:v}){const f=S({loader:()=>w(()=>import("./index-dyx4v2bZ.js").then(e=>e.bC),__vite__mapDeps([0,1]),import.meta.url)}),_=x(A.core),g=v,a=B(r,"modelValue"),{load:V,data:l,isLoading:u}=T(_,"applications");M(V);function h(e){switch(e.type){case"chat":return"Chat app";case"framework":return"Framework";case"generation":return"Text generation";case"research":return"Research assistant"}}const y=s(()=>l.value.map(e=>({label:e.name,value:e.id,detail:[h(e),e.status].join(" · ")})).sort((e,t)=>e.label.localeCompare(t.label))),d=s({get(){return a.value===void 0?"":typeof a.value=="string"?a.value:a.value.join(",")},set(e){a.value=e.split(",")}}),b=s(()=>{if(a.value!==void 0&&typeof a.value=="string")return l.value.find(e=>e.id===a.value)});return C(()=>a.value,()=>{if(!l.value.length)return;const e=l.value.find(t=>t.id===a.value);g("selected-data",e)}),m({selectedData:b}),(e,t)=>(i(),j("div",q,[o(l).length>0||o(u)?(i(),p(o(f),{key:0,modelValue:a.value,"onUpdate:modelValue":t[0]||(t[0]=n=>a.value=n),options:y.value,"hide-icons":"","enable-search":"",loading:o(u),"enable-multi-selection":r.enableMultiSelection},null,8,["modelValue","options","loading","enable-multi-selection"])):(i(),p(L,{key:1,modelValue:d.value,"onUpdate:modelValue":t[1]||(t[1]=n=>d.value=n)},null,8,["modelValue"]))]))}}),D=R(E,[["__scopeId","data-v-c49c516a"]]);export{D as default};
