import{_ as f}from"./AddManualLink.vue_vue_type_script_setup_true_lang-DlAmWTWI.js";import{I as v}from"./ItemsListing-Cnfrbqt8.js";import{az as y,J as r,b7 as l,a3 as _,bc as s,bB as b,a4 as h,aP as g,aG as w,o as n,aE as d,bd as R,ah as E}from"./index-D2rF_80D.js";import{R as A}from"./radio-C5JwViug.js";import"./Toolbar-C66D0zTJ.js";import"./VToolbar-Db4qfa2C.js";import"./Container-C7yRkeCv.js";import"./index-kQIztB-E.js";import"./Button-CrfR8Gdt.js";import"./ListItem-CU9QYmiw.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-cf4_7ViH.js";import"./MediaItemThumb-A-03axGx.js";import"./VCheckbox-DccbdgFZ.js";import"./VCheckboxBtn-Dik76WyM.js";import"./VSelectionControl-BHjDOTFl.js";import"./PanelviewItemCompact-BWonx8dk.js";import"./userPreferences-DWdlmlmR.js";import"./VInfiniteScroll-CfzetGUD.js";import"./VVirtualScroll-CG155sfU.js";import"./createLucideIcon-Bb8oGlVw.js";const W=y({name:"Radios",__name:"LibraryRadios",setup(D){const a=r(!1),t=r(l.libraryRadiosCount),i=r(!1),u=["name","name_desc","sort_name","sort_name_desc","timestamp_added","timestamp_added_desc","last_played","last_played_desc","play_count","play_count_desc"];_(()=>{const e=s.subscribe(b.MEDIA_ITEM_ADDED,o=>{o.object_id?.startsWith("library://radio")&&(a.value=!0)});h(e)});const p=async function(e){return a.value=!1,m(e),await s.getLibraryRadios(e.favoritesOnly||void 0,e.search,e.limit,e.offset,e.sortBy,e.provider&&e.provider.length>0?e.provider:void 0)},m=async function(e){if(!e.favoritesOnly&&!e.provider){t.value=l.libraryRadiosCount;return}if(e.provider&&e.provider.length>0){t.value=void 0;return}t.value=await s.getLibraryRadiosCount(e.favoritesOnly||!1)};return(e,o)=>(w(),g(E,null,[n(v,{itemtype:"radios",path:"libraryradios","show-duration":!1,"show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":p,"sort-keys":u,"update-available":a.value,title:e.$t("radios"),"show-search-button":!0,"allow-key-hooks":!0,"extra-menu-items":[{label:"add_url_item",labelArgs:[],action:()=>{i.value=!0},icon:"mdi-playlist-plus"}],icon:d(A),"restore-state":!0,total:t.value,"show-provider-filter":!0},null,8,["update-available","title","extra-menu-items","icon","total"]),n(f,{modelValue:i.value,"onUpdate:modelValue":o[0]||(o[0]=c=>i.value=c),type:d(R).RADIO},null,8,["modelValue","type"])],64))}});export{W as default};
