import{I as u}from"./ItemsListing-Cnfrbqt8.js";import{az as p,J as a,b7 as s,a3 as m,bc as i,bB as c,a4 as b,aF as f,aG as v,aE as _}from"./index-D2rF_80D.js";import{B as y}from"./book-audio-C6G39POC.js";import"./Container-C7yRkeCv.js";import"./index-kQIztB-E.js";import"./Toolbar-C66D0zTJ.js";import"./VToolbar-Db4qfa2C.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 K=p({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,l(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)},l=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 m(()=>{const o=i.subscribe(c.MEDIA_ITEM_ADDED,r=>{r.object_id?.startsWith("library://audiobook")&&(e.value=!0)});b(o)}),(o,r)=>(v(),f(u,{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:_(y),"restore-state":!0,total:t.value,"show-provider-filter":!0},null,8,["update-available","title","icon","total"]))}});export{K as default};
