import{I as l}from"./ItemsListing-C9zw7KHa.js";import{s,f as i,E as p}from"./index-CyXUjyDM.js";import{d as m,r as a,o as c,a0 as f,D as b,u as v,aC as _,e as y}from"./lucide-BsOfcLnq.js";import"./Container-D40_MO5w.js";import"./index-kQIztB-E.js";import"./vuetify-DHCm6MV9.js";import"./Toolbar-CTiACIvy.js";import"./userPreferences-CnLqlkxN.js";import"./vue-router-hLkI791z.js";import"./Button-DbnN1LyR.js";import"./ListItem-_zvhSn9K.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-cya6xPO3.js";import"./MediaItemThumb-BvqlnbT6.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-CsLTxntn.js";import"./vue-i18n-CXdnqGsF.js";import"./PanelviewItemCompact-Dlf-jeIa.js";import"./qrcode-DcFvg0BH.js";import"./marked-i_gIkIP3.js";import"./color-BTziYnFN.js";import"./vueuse-CmMrRm2c.js";/* empty css            */import"./swiper-BIRaDS2w.js";const G=m({name:"Audiobooks",__name:"LibraryAudiobooks",setup(k){const e=a(!1),t=a(s.libraryAudiobooksCount),n=["name","name_desc","sort_name","sort_name_desc","timestamp_added","timestamp_added_desc","timestamp_modified","timestamp_modified_desc","last_played","last_played_desc","play_count","play_count_desc"],d=async function(o){return e.value=!1,u(o),await i.getLibraryAudiobooks(o.favoritesOnly||void 0,o.search,o.limit,o.offset,o.sortBy,o.provider&&o.provider.length>0?o.provider:void 0,o.genreIds)},u=async function(o){if(!o.favoritesOnly&&!o.provider){t.value=s.libraryAudiobooksCount;return}if(o.provider&&o.provider.length>0){t.value=void 0;return}t.value=await i.getLibraryAudiobooksCount(o.favoritesOnly||!1)};return c(()=>{const o=i.subscribe(p.MEDIA_ITEM_ADDED,r=>{r.object_id?.startsWith("library://audiobook")&&(e.value=!0)});f(o)}),(o,r)=>(y(),b(l,{itemtype:"audiobooks",path:"libraryaudiobooks","show-duration":!1,"show-provider":!0,"show-favorites-only-filter":!0,"load-paged-data":d,"show-library":!0,"sort-keys":n,"update-available":e.value,title:o.$t("audiobooks"),"allow-key-hooks":!0,"show-search-button":!0,icon:v(_),"restore-state":!0,total:t.value,"show-provider-filter":!0,"show-genre-filter":!0},null,8,["update-available","title","icon","total"]))}});export{G as default};
