import{I as v}from"./ItemsListing-Bd2thLHu.js";import{aw as _,bL as x,J as B,i as u,ax as n,ay as l,o as E,aD as I,E as V,ag as C,aE as L,aG as S,az as N,aL as b,aJ as P,bk as d,aN as D,aO as F,_ as O}from"./index-BeguICWm.js";import"./Container-L7ytxuXf.js";import"./index-kQIztB-E.js";import"./Toolbar-DMSWIhz4.js";import"./VToolbar-DZP2Ylkv.js";import"./Button-BjWxTVGU.js";import"./ListItem-DzMz1Zx0.js";import"./userPreferences-CVtQlCYs.js";import"./VCheckboxBtn-HpD-UT_z.js";import"./MediaItemThumb-B7Ks6j0U.js";import"./PanelviewItemCompact-YKRtLaLa.js";import"./VInfiniteScroll-aGYTBb1l.js";import"./VVirtualScroll-Vx_hX6dw.js";import"./VAlert-Dkia6PbV.js";const j={class:"breadcrumb-container"},z=["onClick"],J={key:1,class:"breadcrumb-text"},T=_({__name:"BrowseView",props:{path:{}},setup(i){const o=i,{t:f}=x(),p=B(!1),k=u(()=>""),h=u(()=>{const e=[];if(e.push({text:f("browse"),path:null,clickable:o.path&&o.path!=="root"||!1}),o.path&&o.path!=="root")if(o.path.includes("://")){const[a,t]=o.path.split("://"),s=a+"://";if(e.push({text:s,path:s,clickable:t&&t.length>0||!1}),t&&t.length>0){const r=t.split("/").filter(c=>c.length>0);r.forEach((c,m)=>{const y=s+r.slice(0,m+1).join("/");e.push({text:c,path:y,clickable:m<r.length-1})})}}else{const a=o.path.split("/").filter(t=>t.length>0);a.forEach((t,s)=>{const r=a.slice(0,s+1).join("/");e.push({text:t,path:r,clickable:s<a.length-1})})}return e}),w=async function(e){const a=await D.browse(o.path);return p.value=a.every(t=>t.media_type===F.FOLDER),a},g=e=>{e===null?d.push({name:"browse"}):d.push({name:"browse",query:{path:e}})};return(e,a)=>(l(),n("section",null,[E(v,{itemtype:"browse","show-provider":!1,"show-library":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"show-select-button":!!(i.path&&i.path!="root"&&!p.value),"load-items":w,"sort-keys":["original","name","name_desc"],path:i.path,"allow-key-hooks":!0,icon:"mdi-folder-outline",title:k.value},{title:I(()=>[V("div",j,[(l(!0),n(C,null,L(h.value,(t,s)=>(l(),n("span",{key:s,class:"breadcrumb-segment"},[t.clickable?(l(),n("button",{key:0,class:"breadcrumb-link",onClick:r=>g(t.path)},b(t.text),9,z)):(l(),n("span",J,b(t.text),1)),s<h.value.length-1?(l(),S(P,{key:2,icon:"mdi-chevron-right",size:"small",class:"breadcrumb-separator"})):N("",!0)]))),128))])]),_:1},8,["show-select-button","path","title"])]))}}),et=O(T,[["__scopeId","data-v-c0cbe0e2"]]);export{et as default};
