import{$ as e,Ct as t,Kt as n,L as r,M as i,Nt as a,Pt as o,R as s,X as c,pt as l,st as u}from"../chunks/xY0c-UfG.js";import"../chunks/xihTtKlq.js";import{i as d,t as f}from"../chunks/Ca8AGdcM.js";import{t as p}from"../chunks/ByTixK1i.js";import{a as m}from"../chunks/gfak5NLW.js";import{t as h}from"../chunks/DayPzYFE2.js";var g=n({load:()=>_});function _({params:e}){let t=(e.path??``).replace(/^\/+|\/+$/g,``);return{folderName:e.name,subPath:t}}function v(n,g){o(g,!0);let _=t(()=>g.data.folderName),v=t(()=>g.data.subPath),y=t(()=>()=>{let e=d.repos.find(e=>e.name===c(_)),t=e?.displayName??c(_),n=c(v).split(`/`).filter(Boolean).join(`/`);if(!n)return t;let r=f(e?.subfolders??[],n);return r[r.length-1]??t});u(()=>{p.showView(-1)}),u(()=>{let t=c(_),n=c(v);e(()=>p.selectRepo(t,n))}),u(()=>{let e=c(_);return m.enter(e,`_folder`,`_chat`),()=>m.leave()});var b=s();i(l(b),()=>`${c(_)}/${c(v)}`,e=>{{let n=t(()=>c(y)()),r=t(()=>`folder-${c(_)}`);h(e,{get name(){return c(n)},get storageId(){return c(r)},get lockedFolder(){return c(_)},get lockedFolderPath(){return c(v)},defaultSortKey:`name`,defaultSortAsc:!0})}}),r(n,b),a()}export{v as component,g as universal};