import{I as v}from"./ItemsListing-6VW59A0B.js";import{av as _,bG as x,H as B,r as u,aw as i,x as I,aB as C,ax as l,d as V,ag as S,aC as E,aD as L,ay as P,aI as b,aG as D,bh as d,aL as F,aM as N}from"./index-C-Ivu3jU.js";import{_ as j}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Container-DVyc_Yt_.js";import"./index-kQIztB-E.js";import"./VContainer-CNNJtZg6.js";import"./Toolbar-CLPRlZ-4.js";import"./VToolbar-DTucOBiF.js";import"./Button-FtStaD9_.js";import"./ListItem-BLmrgznL.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-B5IzKSW4.js";import"./VCheckboxBtn-BmKOjEU4.js";import"./VInput-CnrZS6Kh.js";import"./MediaItemThumb-BsXB7IV6.js";import"./PanelviewItemCompact-5_ppRL3T.js";import"./VTextField-Bkx949P5.js";import"./VSnackbar-C_PtJN1U.js";import"./layout-D2NB7OTD.js";import"./VRow-DOG0WeJD.js";import"./VVirtualScroll-C_Lzj3jv.js";import"./VAlert-B3qbTkCR.js";const G={class:"breadcrumb-container"},M=["onClick"],O={key:1,class:"breadcrumb-text"},T=_({__name:"BrowseView",props:{path:{}},setup(n){const o=n,{t:f}=x(),p=B(!1),k=u(()=>""),m=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,h)=>{const y=s+r.slice(0,h+1).join("/");e.push({text:c,path:y,clickable:h<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===N.FOLDER),a},g=e=>{e===null?d.push({name:"browse"}):d.push({name:"browse",query:{path:e}})};return(e,a)=>(l(),i("section",null,[I(v,{itemtype:"browse","show-provider":!1,"show-library":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"show-select-button":!!(n.path&&n.path!="root"&&!p.value),"load-items":w,"sort-keys":["original","name","name_desc"],path:n.path,"allow-key-hooks":!0,icon:"mdi-folder-outline",title:k.value},{title:C(()=>[V("div",G,[(l(!0),i(S,null,E(m.value,(t,s)=>(l(),i("span",{key:s,class:"breadcrumb-segment"},[t.clickable?(l(),i("button",{key:0,class:"breadcrumb-link",onClick:r=>g(t.path)},b(t.text),9,M)):(l(),i("span",O,b(t.text),1)),s<m.value.length-1?(l(),L(D,{key:2,icon:"mdi-chevron-right",size:"small",class:"breadcrumb-separator"})):P("",!0)]))),128))])]),_:1},8,["show-select-button","path","title"])]))}}),it=j(T,[["__scopeId","data-v-c0cbe0e2"]]);export{it as default};
