import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{G as t,J as n,W as r}from"./lit-runtime-BEtFSUCp.js";import{Ht as i,Lt as a,Rt as o,qt as s}from"./control-ui-core-Br5DB0Zj.js";function c(e){return e.split(/[\\/]/).findLast(e=>e.length>0)??e}function l(e){let t=e.replace(/[\\/]+$/u,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));if(!(n<0))return c(n===0?t.slice(0,1):t.slice(0,n))||void 0}function u(e){return e.startsWith(`/`)||e.startsWith(`\\`)||/^[A-Za-z]:[\\/]/.test(e)}function d(e){if(!u(e))return null;let t=e.trim().replaceAll(`\\`,`/`),n=/^[A-Za-z]:\//u.test(t)||t.startsWith(`//`),r=[],i=/^[A-Za-z]:\//u.test(t)?1:t.startsWith(`//`)?2:0;for(let e of t.split(`/`))if(!(!e||e===`.`)){if(e===`..`){r.length>i&&r.pop();continue}r.push(e)}let a=`${t.startsWith(`//`)?`//`:t.startsWith(`/`)?`/`:``}${r.join(`/`)}`.replace(/\/+$/u,``)||`/`;return n?a.toLowerCase():a}function f(e,t){let n=d(e),r=d(t);return!n||!r?!1:r===n||r.startsWith(n===`/`?n:`${n}/`)}function p(e,t){return e.some(e=>f(e,t))}function m(){return(m=e((()=>{})))()}function h(e){let r=e.listing?.entries??[],i=e.registerProjectPath;return n`
{t.key===`Escape`&&(t.preventDefault(),t.stopImmediatePropagation(),e.onBack())}} >
{e.onPathDraftChange(t.target.value)}} @keydown=${t=>{t.key===`Enter`&&(t.preventDefault(),e.onNavigate(e.pathDraft.trim()||void 0))}} /> ${e.loading?n`${s(`common.loading`)}`:t}
${e.error?n`
${e.error}
`:t}
${e.listing&&r.length===0&&!e.loading?n`
${s(`newSession.browserEmpty`)}
`:t} ${r.map(r=>n` `)}
${i?n` `:t}
`}function g(){return(g=e((()=>{r(),o(),i()})))()}export{u as a,m as i,h as n,p as o,c as r,l as s,g as t}; //# sourceMappingURL=place-browser-DiRCxEEz.js.map