import{Et as e,Lt as t,Ut as n,an as r,bt as i,dn as a,st as o,vt as s}from"./design-system-components-Y2tugS6v.mjs";import{hn as c,pi as l,yi as u}from"./composables-DDr4AJUl.mjs";import"./src-C-XpxEWy.mjs";var d={id:`app.search.provider`,extensionType:`search`,multiple:!0},f=()=>s(()=>[d]),p=()=>{let e=c();return s(()=>e.requestExtensions(d).map(({searchProvider:e})=>e))},m=e({setup(){let e=p(),t=u(`provider`),n=s(()=>{let{listSearch:n}=a(e).find(e=>e.id===l(a(t)));return n}),i=r(!0),o=r({values:[],totalResults:null});return{listSearch:n,loading:i,searchResult:o,search:async e=>{i.value=!0;try{o.value=await a(n).search(e||``)}catch(e){if(e===`cancel`)return;o.value={values:[],totalResults:null},console.error(e)}i.value=!1}}}});function h(e,r,a,o,s,c){return t(),i(n(e.listSearch.component),{"search-result":e.searchResult,loading:e.loading,onSearch:e.search},null,40,[`search-result`,`loading`,`onSearch`])}var g=o(m,[[`render`,h]]);export{p as n,f as r,g as t};