import{I as y}from"./ItemsListing-DTH9nBqi.js";import{d as _,bA as x,r as B,O as u,c as l,b as I,w as V,o as i,a as C,F as S,g as E,h as F,e as P,t as b,j,be as d,v as L,M as N}from"./index-CoB_2BUd.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Container-BzMt4Ci6.js";import"./index-kQIztB-E.js";import"./VContainer-DlTgmJKi.js";/* empty css              */import"./Toolbar-B0keKpNj.js";import"./VToolbar-CJXC56GW.js";import"./VBtn-hyLqVrgl.js";import"./Button-BDPKHRLH.js";import"./ListItem-DQin6AeB.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-rRluqShO.js";import"./VInput-BoZgh6ys.js";import"./MediaItemThumb-BKmjY3cv.js";import"./PanelviewItemCompact-B9m_eVXB.js";import"./VSpacer-C76jgahG.js";import"./VTextField-DbD7hU_y.js";import"./VInfiniteScroll--D1O9T4-.js";import"./layout-CPyFIpzx.js";import"./VRow-CLgWC1Pi.js";import"./VVirtualScroll-CSh2i2e_.js";import"./VAlert-C67nJg0B.js";const D={class:"breadcrumb-container"},M=["onClick"],T={key:1,class:"breadcrumb-text"},q=_({__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[s,t]=o.path.split("://"),a=s+"://";if(e.push({text:a,path:a,clickable:t&&t.length>0||!1}),t&&t.length>0){const r=t.split("/").filter(c=>c.length>0);r.forEach((c,h)=>{const v=a+r.slice(0,h+1).join("/");e.push({text:c,path:v,clickable:h<r.length-1})})}}else{const s=o.path.split("/").filter(t=>t.length>0);s.forEach((t,a)=>{const r=s.slice(0,a+1).join("/");e.push({text:t,path:r,clickable:a<s.length-1})})}return e}),w=async function(e){const s=await L.browse(o.path);return p.value=s.every(t=>t.media_type===N.FOLDER),s},g=e=>{e===null?d.push({name:"browse"}):d.push({name:"browse",query:{path:e}})};return(e,s)=>(i(),l("section",null,[I(y,{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:V(()=>[C("div",D,[(i(!0),l(S,null,E(m.value,(t,a)=>(i(),l("span",{key:a,class:"breadcrumb-segment"},[t.clickable?(i(),l("button",{key:0,class:"breadcrumb-link",onClick:r=>g(t.path)},b(t.text),9,M)):(i(),l("span",T,b(t.text),1)),a<m.value.length-1?(i(),F(j,{key:2,icon:"mdi-chevron-right",size:"small",class:"breadcrumb-separator"})):P("",!0)]))),128))])]),_:1},8,["show-select-button","path","title"])]))}}),ct=O(q,[["__scopeId","data-v-c0cbe0e2"]]);export{ct as default};
