import{I as v}from"./ItemsListing-D_KqSTZS.js";import{ay as _,bN as x,J as B,i as u,az as n,aA as l,o as I,aG as V,E as C,ah as E,aH as N,aI as P,aB as S,aN as b,aL as L,bm as d,aP as F,aQ as j,_ as z}from"./index-BRUnowC8.js";import"./Container-ZHtGcXZO.js";import"./index-kQIztB-E.js";import"./Toolbar-BEJzY0mB.js";import"./VToolbar-DS4mUdOC.js";import"./Button-BKv4xLAv.js";import"./ListItem-jfbxOrad.js";import"./userPreferences-DBWZCHKf.js";import"./VCheckboxBtn-D390s4L9.js";import"./VSelectionControl-Co1cRcmS.js";import"./MediaItemThumb-CIE9_Elw.js";import"./PanelviewItemCompact-CsJmi5IT.js";import"./VInfiniteScroll-BORsRMGl.js";import"./VVirtualScroll-htzu2YXu.js";import"./VAlert-DQxypmdN.js";const D={class:"breadcrumb-container"},O=["onClick"],T={key:1,class:"breadcrumb-text"},q=_({__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 g=s+r.slice(0,m+1).join("/");e.push({text:c,path:g,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 F.browse(o.path);return p.value=a.every(t=>t.media_type===j.FOLDER),a},y=e=>{e===null?d.push({name:"browse"}):d.push({name:"browse",query:{path:e}})};return(e,a)=>(l(),n("section",null,[I(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:V(()=>[C("div",D,[(l(!0),n(E,null,N(h.value,(t,s)=>(l(),n("span",{key:s,class:"breadcrumb-segment"},[t.clickable?(l(),n("button",{key:0,class:"breadcrumb-link",onClick:r=>y(t.path)},b(t.text),9,O)):(l(),n("span",T,b(t.text),1)),s<h.value.length-1?(l(),P(L,{key:2,icon:"mdi-chevron-right",size:"small",class:"breadcrumb-separator"})):S("",!0)]))),128))])]),_:1},8,["show-select-button","path","title"])]))}}),at=z(q,[["__scopeId","data-v-c0cbe0e2"]]);export{at as default};
