import{B as e,Bt as t,G as n,Gt as r,H as i,J as a,Mt as o,N as s,Tt as c,Ut as l,bt as u,ht as d,j as f,lt as p,ot as m}from"./vue-3bs2-dMU.js";import{E as h,a as g,k as _,yt as v}from"./stores-DmetsdTd.js";import{M as y}from"./vuetify-gGrfRH2I.js";var b=function(e){return e.ALL=`all`,e.ONLY_FILES=`files`,e.ONLY_DIRECTORIES=`dirs`,e}({});n(),l(),c();var x=e({__name:`ServerPathField`,props:a({title:{},historyKey:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e,{expose:n}){let a=e,c=d(e,`modelValue`),l=o([]),x=h(),S=g(),C=o(),w=f(()=>S.getHistory(a.historyKey)),T=f(()=>{let e=w.value,t=l.value,n=[...e];return t.forEach(e=>{n.includes(e)||n.push(e)}),n}),E=v(async e=>{if(!e||!x.usesQbit5){l.value=[];return}try{let t=await _.getDirectoryContent(e,b.ALL);t&&(l.value=t)}catch(e){console.warn(`Failed to fetch directory content:`,e),l.value=[]}},500);function D(){S.pushValueToHistory(a.historyKey,c.value??``)}return n({saveValueToHistory:D,focus:()=>C.value?.focus()}),(n,a)=>(m(),s(y,{ref_key:`comboboxRef`,ref:C,modelValue:c.value,"onUpdate:modelValue":a[0]||=e=>c.value=e,items:T.value,label:e.title,"onUpdate:search":t(E)},{prepend:u(e=>[p(n.$slots,`prepend`,r(i(e)))]),append:u(e=>[p(n.$slots,`append`,r(i(e)))]),"append-inner":u(e=>[p(n.$slots,`append-inner`,r(i(e)))]),"prepend-inner":u(e=>[p(n.$slots,`prepend-inner`,r(i(e)))]),_:3},8,[`modelValue`,`items`,`label`,`onUpdate:search`]))}});export{x as t};