From 0b86cc18c7b2a4419ecc677c09944ae6d41d61cf Mon Sep 17 00:00:00 2001 From: Alain Nussbaumer Date: Sat, 1 Mar 2025 22:41:24 +0100 Subject: [PATCH] [web] Fix issue preventing items to be played --- htdocs/assets/index.js | 2 +- web-src/src/components/ModalDialogArtist.vue | 1 + web-src/src/components/ModalDialogArtistSpotify.vue | 1 + web-src/src/components/ModalDialogPlayable.vue | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/assets/index.js b/htdocs/assets/index.js index cb9e26be..df1d86e7 100644 --- a/htdocs/assets/index.js +++ b/htdocs/assets/index.js @@ -76,7 +76,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins font-size="${t.size/3}" fill="${SM(e)>.5?"#000000":"#FFFFFF"}"> ${t.caption} - `;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(n)}`},wM={name:"ControlImage",props:{album:{default:"",type:String},artist:{default:"",type:String},url:{default:"",type:String}},emits:["click"],data(){return{font:{family:"sans-serif",weight:"bold"},lifecycle:{error:t=>{t.src=this.dataURI()}},size:600}},methods:{dataURI(){return EM({alternate:`${this.artist} - ${this.album}`,caption:(this.album||this.artist||"").substring(0,2),font:this.font,size:this.size})}}},CM={class:"figure has-shadow"};function kM(t,e,n,s,i,r){const o=Vh("lazy");return O(),M("figure",CM,[An(g("img",{onClick:e[0]||(e[0]=a=>t.$emit("click"))},null,512),[[o,{src:n.url,lifecycle:i.lifecycle}]])])}const Qi=it(wM,[["render",kM],["__scopeId","data-v-92383b31"]]),{t:Dl,locale:TM}=Ru.global,cS="NO_INDEX",xM=(t,e)=>t-e,AM=(t,e)=>t.localeCompare(e,TM.value),OM=(t,e)=>new Date(t)-new Date(e)||(t?e?0:1:-1),IM=t=>t.map(({field:e,type:n,order:s=1})=>{switch(n){case String:return(i,r)=>AM(i[e],r[e])*s;case Number:return(i,r)=>xM(i[e],r[e])*s;case Date:return(i,r)=>OM(i[e],r[e])*s;default:return()=>0}}),NM=(t="")=>{const e=t.charAt(0);return e.match(new RegExp("\\p{Letter}","gu"))?e.toUpperCase():e.match(new RegExp("\\p{Number}","gu"))?"#":"⌘"},PM=t=>{},$M=[{difference:NaN,text:()=>Dl("grouped-list.undefined")},{difference:864e5,text:()=>Dl("grouped-list.today")},{difference:6048e5,text:()=>Dl("grouped-list.last-week")},{difference:2592e6,text:()=>Dl("grouped-list.last-month")},{difference:1/0,text:t=>t.getFullYear()}],RM=t=>{var s;const e=new Date(t),n=new Date-e;return(s=$M.find(i=>isNaN(n)||n{switch(e){case String:return n=>NM(n[t]);case Number:return n=>n[t];case Date:return n=>RM(n[t]);case"Digits":return n=>PM(n[t]);default:return()=>cS}};class Tt{constructor({items:e=[],total:n=0,offset:s=0,limit:i=-1}={},r={}){this.items=e,this.total=n,this.offset=s,this.limit=i,this.count=e.length,this.indices=[],this.group(r)}group({criteria:e=[],filters:n=[],index:s}={}){const i=this.items.filter(l=>n.every(c=>c(l)));this.count=i.length;const r=IM(e),o=i.sort((l,c)=>r.reduce((u,d)=>u||d(l,c),0)),a=LM(s);return this.itemsGrouped=o.reduce((l,c)=>{const u=a(c);return l.set(u,[...l.get(u)||[],c]),l},new Map),this.indices=Array.from(this.itemsGrouped.keys()),this}*generate(){for(const[e,n]of this.itemsGrouped.entries()){e!==cS&&(yield{index:e,isItem:!1,item:{},itemId:e});for(const s of n)yield{index:e,isItem:!0,item:s,itemId:s.id}}}[Symbol.iterator](){return this.generate()}}const DM={name:"ListProperties",components:{ControlImage:Qi},props:{item:{required:!0,type:Object}}},MM={class:"title is-4"},FM=["textContent"],VM=["textContent"],HM=["textContent"],UM={class:"title is-6"},jM=["onClick","textContent"],BM=["textContent"];function WM(t,e,n,s,i,r){var a;const o=x("control-image");return O(),M(pt,null,[g("div",MM,[n.item.handler?(O(),M("a",{key:0,onClick:e[0]||(e[0]=(...l)=>n.item.handler&&n.item.handler(...l)),textContent:$(n.item.name)},null,8,FM)):(O(),M("span",{key:1,textContent:$(n.item.name)},null,8,VM))]),n.item.image?(O(),_t(o,{key:0,url:n.item.image,artist:n.item.artist,album:n.item.name,class:"is-normal mb-5"},null,8,["url","artist","album"])):vt("",!0),t.$slots.buttons?ge(t.$slots,"buttons",{key:1}):vt("",!0),(O(!0),M(pt,null,fe((a=n.item.properties)==null?void 0:a.filter(l=>l.value),l=>(O(),M("div",{key:l.label,class:"mb-3"},[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t(l.label))},null,8,HM),g("div",UM,[l.handler?(O(),M("a",{key:0,onClick:l.handler,textContent:$(l.value)},null,8,jM)):(O(),M("span",{key:1,class:"title is-6",textContent:$(l.value)},null,8,BM))])]))),128))],64)}const uS=it(DM,[["render",WM]]),qM={name:"ModalDialogPlayable",components:{ControlButton:Je,ListProperties:uS,ModalDialog:mi},props:{buttons:{default:()=>[],type:Array},item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{actions(){return[{label:this.$t("dialog.playable.add"),handler:this.queue_add,icon:"playlist-plus"},{label:this.$t("dialog.playable.add-next"),handler:this.queue_add_next,icon:"playlist-play"},{label:this.$t("dialog.playable.play"),handler:this.play,icon:"play"}]}},methods:{play(){this.$emit("close"),this.item.expression?tt.player_play_expression(this.item.expression,!1):tt.player_play_uri(this.item.uris||this.item.item.uri,!1)},queue_add(){this.$emit("close"),this.item.expression?tt.queue_expression_add(this.item.expression):tt.queue_add(this.item.uris||this.item.uri)},queue_add_next(){this.$emit("close"),this.item.expression?tt.queue_expression_add_next(this.item.expression):tt.queue_add_next(this.item.uris||this.item.uri)}}},zM={class:"buttons"};function GM(t,e,n,s,i,r){const o=x("control-button"),a=x("list-properties"),l=x("modal-dialog");return O(),_t(l,{actions:r.actions,show:n.show,onClose:e[0]||(e[0]=c=>t.$emit("close"))},{content:D(()=>[C(a,{item:n.item},Ya({_:2},[n.buttons.length?{name:"buttons",fn:D(()=>[g("div",zM,[(O(!0),M(pt,null,fe(n.buttons,c=>(O(),_t(o,{key:c.label,handler:c.handler,label:"button.label"},null,8,["handler"]))),128))])]),key:"0"}:void 0]),1032,["item"])]),_:1},8,["actions","show"])}const Os=it(qM,[["render",GM]]),KM={name:"ModalDialogTrack",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close","play-count-changed"],computed:{buttons(){return this.item.media_kind!=="podcast"?[]:this.item.play_count>0?[{label:"dialog.track.mark-as-new",handler:this.mark_new}]:[{label:"dialog.track.mark-as-played",handler:this.mark_played}]},playable(){return{name:this.item.title,uri:this.item.uri,properties:[{label:"property.album",value:this.item.album,handler:this.open_album},{label:"property.album-artist",value:this.item.album_artist,handler:this.open_artist},{label:"property.composer",value:this.item.composer},{label:"property.release-date",value:this.$filters.toDate(this.item.date_released)},{label:"property.year",value:this.item.year},{label:"property.genre",value:this.item.genre},{label:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{label:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)},{label:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{label:"property.quality",value:this.item.data_kind!=="spotify"&&this.$t("dialog.track.quality-value",{format:this.item.type,bitrate:this.item.bitrate,channels:this.$t("count.channels",this.item.channels),samplerate:this.item.samplerate})},{label:"property.added-on",value:this.$filters.toDateTime(this.item.time_added)},{label:"property.rating",value:this.$t("dialog.track.rating-value",{rating:Math.floor(this.item.rating/10)})},{label:"property.comment",value:this.item.comment},{label:"property.path",value:this.item.path}]}}},methods:{mark_new(){tt.library_track_update(this.item.id,{play_count:"reset"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},mark_played(){tt.library_track_update(this.item.id,{play_count:"increment"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},open_album(){this.$emit("close"),this.item.media_kind==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.album_id}}):this.item.media_kind==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:this.item.album_id}}):this.item.media_kind==="music"&&this.$router.push({name:"music-album",params:{id:this.item.album_id}})},open_artist(){this.$emit("close"),this.item.media_kind==="music"||this.item.media_kind==="podcast"?this.$router.push({name:"music-artist",params:{id:this.item.album_artist_id}}):this.item.media_kind==="audiobook"&&this.$router.push({name:"audiobooks-artist",params:{id:this.item.album_artist_id}})},open_genre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{media_kind:this.item.media_kind}})}}};function XM(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["buttons","item","show"])}const YM=it(KM,[["render",XM]]),ZM={name:"ListTracks",components:{ModalDialogTrack:YM},props:{expression:{default:"",type:String},items:{required:!0,type:Object},show_icon:Boolean,show_progress:Boolean,uris:{default:"",type:String}},emits:["play-count-changed"],data(){return{selected_item:{},show_details_modal:!1}},methods:{open_dialog(t){this.selected_item=t,this.show_details_modal=!0},play(t){this.uris?tt.player_play_uri(this.uris,!1,this.items.items.indexOf(t)):this.expression?tt.player_play_expression(this.expression,!1,this.items.items.indexOf(t)):tt.player_play_uri(t.uri,!1)}}},JM={key:0,class:"py-5"},QM=["id","textContent"],t8=["onClick"],e8={class:"media-content"},n8=["textContent"],s8=["textContent"],i8=["textContent"],r8=["max","value"],o8={class:"media-right"},a8=["onClick"];function l8(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-track");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M(pt,{key:l.itemId},[l.isItem?(O(),M("div",{key:1,class:Vt(["media is-align-items-center is-clickable mb-0",{"with-progress":n.show_progress}]),onClick:c=>r.play(l.item)},[n.show_icon?(O(),_t(o,{key:0,class:"media-left icon",name:"file-music-outline"})):vt("",!0),g("div",e8,[g("div",{class:Vt(["is-size-6 has-text-weight-bold",{"has-text-grey":l.item.media_kind==="podcast"&&l.item.play_count>0}]),textContent:$(l.item.title)},null,10,n8),g("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:$(l.item.artist)},null,8,s8),g("div",{class:"is-size-7 has-text-grey",textContent:$(l.item.album)},null,8,i8),n.show_progress&&l.item.seek_ms>0?(O(),M("progress",{key:0,class:"progress is-dark",max:l.item.length_ms,value:l.item.seek_ms},null,8,r8)):vt("",!0)]),g("div",o8,[g("a",{onClick:Oe(c=>r.open_dialog(l.item),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,a8)])],10,t8)):(O(),M("div",JM,[g("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:$(l.index)},null,8,QM)]))],64))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1),onPlayCountChanged:e[1]||(e[1]=l=>t.$emit("play-count-changed"))},null,8,["item","show"])]))],64)}const Vn=it(ZM,[["render",l8],["__scopeId","data-v-44ebdd0b"]]),c8={name:"ModalDialogAlbum",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},media_kind:{default:"",type:String},show:Boolean},emits:["close","remove-podcast","play-count-changed"],computed:{buttons(){return this.media_kind_resolved==="podcast"?this.item.data_kind==="url"?[{label:"dialog.album.mark-as-played",handler:this.mark_played},{label:"dialog.album.remove-podcast",handler:this.remove_podcast}]:[{label:"dialog.album.mark-as-played",handler:this.mark_played}]:[]},media_kind_resolved(){return this.media_kind||this.item.media_kind},playable(){return{name:this.item.name,handler:this.open,image:this.item.artwork_url,uri:this.item.uri,properties:[{label:"property.artist",value:this.item.artist,handler:this.open_artist},{label:"property.release-date",value:this.$filters.toDate(this.item.date_released)},{label:"property.year",value:this.item.year},{label:"property.tracks",value:this.item.track_count},{label:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)},{label:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{label:"property.added-on",value:this.$filters.toDateTime(this.item.time_added)}]}}},methods:{mark_played(){tt.library_album_track_update(this.item.id,{play_count:"played"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},open(){this.$emit("close"),this.media_kind_resolved==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.id}}):this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:this.item.id}}):this.$router.push({name:"music-album",params:{id:this.item.id}})},open_artist(){this.$emit("close"),this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-artist",params:{id:this.item.artist_id}}):this.$router.push({name:"music-artist",params:{id:this.item.artist_id}})},remove_podcast(){this.$emit("remove-podcast")}}};function u8(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["buttons","item","show"])}const ud=it(c8,[["render",u8]]),Qb={load(t){return Promise.all([tt.library_album(t.params.id),tt.library_album_tracks(t.params.id)])},set(t,e){t.album=e[0].data,t.tracks=new Tt(e[1].data,{criteria:[{field:"disc_number",type:Number}],index:{field:"disc_number",type:Number}}),t.tracks.indices.length<2&&t.tracks.group()}},d8={name:"PageAlbum",components:{ContentWithHero:cd,ControlButton:Je,ControlImage:Qi,ListTracks:Vn,ModalDialogAlbum:ud},beforeRouteEnter(t,e,n){Qb.load(t).then(s=>{n(i=>Qb.set(i,s))})},data(){return{album:{},show_details_modal:!1,tracks:new Tt}},methods:{open_artist(){this.show_details_modal=!1,this.$router.push({name:"music-artist",params:{id:this.album.artist_id}})},play(){tt.player_play_uri(this.album.uri,!0)},showDetails(){this.show_details_modal=!0}}},f8=["textContent"],h8={class:"subtitle is-6"},p8=["textContent"],m8=["textContent"],g8={class:"buttons is-centered-mobile mt-5"};function b8(t,e,n,s,i,r){const o=x("control-button"),a=x("control-image"),l=x("list-tracks"),c=x("modal-dialog-album"),u=x("content-with-hero");return O(),M("div",null,[C(u,null,{"heading-left":D(()=>[g("div",{class:"title is-5",textContent:$(i.album.name)},null,8,f8),g("div",h8,[g("a",{onClick:e[0]||(e[0]=(...d)=>r.open_artist&&r.open_artist(...d)),textContent:$(i.album.artist)},null,8,p8)]),g("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:$(t.$t("count.tracks",{count:i.album.track_count}))},null,8,m8),g("div",g8,[C(o,{handler:r.play,icon:"shuffle",label:"page.album.shuffle"},null,8,["handler"]),C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"])])]),"heading-right":D(()=>[C(a,{url:i.album.artwork_url,artist:i.album.artist,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]),content:D(()=>[C(l,{items:i.tracks,uris:i.album.uri},null,8,["items","uris"]),C(c,{item:i.album,show:i.show_details_modal,onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const y8=it(d8,[["render",b8]]),_8={name:"ModalDialogTrackSpotify",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t;return this.item.artists?{name:this.item.name,uri:this.item.uri,properties:[{label:"property.album",value:this.item.album.name,handler:this.open_album},{label:"property.album-artist",value:(t=this.item.artists[0])==null?void 0:t.name,handler:this.open_artist},{label:"property.release-date",value:this.$filters.toDate(this.item.album.release_date)},{label:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{label:"property.duration",value:this.$filters.toTimecode(this.item.duration_ms)},{label:"property.path",value:this.item.uri}]}:{}}},methods:{open_album(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.album.id}})},open_artist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function v8(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const S8=it(_8,[["render",v8]]),E8={name:"ListTracksSpotify",components:{ModalDialogTrackSpotify:S8},props:{context_uri:{default:"",type:String},items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open_dialog(t){this.selected_item=t,this.show_details_modal=!0},play(t){t.is_playable&&tt.player_play_uri(this.context_uri||t.uri,!1,t.position||0)}}},w8=["onClick"],C8=["textContent"],k8=["textContent"],T8=["textContent"],x8={key:0,class:"is-size-7 has-text-grey"},A8=["textContent"],O8=["textContent"],I8={class:"media-right"},N8=["onClick"];function P8(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-track-spotify");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>{var c;return O(),M("div",{key:l.id,class:"media is-align-items-center mb-0"},[g("div",{class:Vt(["media-content",{"is-clickable":l.is_playable,"is-not-allowed":!l.is_playable}]),onClick:u=>r.play(l)},[g("div",{class:Vt(["is-size-6 has-text-weight-bold",{"has-text-grey-light":!l.is_playable}]),textContent:$(l.name)},null,10,C8),g("div",{class:Vt(["is-size-7 has-text-weight-bold",{"has-text-grey":l.is_playable,"has-text-grey-light":!l.is_playable}]),textContent:$(l.artists[0].name)},null,10,k8),g("div",{class:"is-size-7 has-text-grey",textContent:$(l.album.name)},null,8,T8),l.is_playable?vt("",!0):(O(),M("div",x8,[e[1]||(e[1]=ws(" (")),g("span",{textContent:$(t.$t("list.spotify.not-playable-track"))},null,8,A8),(c=l.restrictions)!=null&&c.reason?(O(),M("span",{key:0,textContent:$(t.$t("list.spotify.restriction-reason",{reason:l.restrictions.reason}))},null,8,O8)):vt("",!0),e[2]||(e[2]=ws(") "))]))],10,w8),g("div",I8,[g("a",{onClick:Oe(u=>r.open_dialog(l),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,N8)])])}),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Gc=it(E8,[["render",P8],["__scopeId","data-v-f2f903a5"]]),$8={name:"ModalDialogAlbumSpotify",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e,n,s,i,r;return{name:this.item.name||"",image:((n=(e=(t=this.item)==null?void 0:t.images)==null?void 0:e[0])==null?void 0:n.url)||"",handler:this.open,uri:this.item.uri,properties:[{label:"property.artist",value:(r=(i=(s=this.item)==null?void 0:s.artists)==null?void 0:i[0])==null?void 0:r.name,handler:this.open_artist},{label:"property.release-date",value:this.$filters.toDate(this.item.release_date)},{label:"property.type",value:this.item.album_type}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.id}})},open_artist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function R8(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const dS=it($8,[["render",R8]]);var Zd={exports:{}},ty;function L8(){return ty||(ty=1,function(t){var e=function(){var n="https://api.spotify.com/v1",s=null,i=null,r=function(f,h){return f.abort=h,f},o=function(f,h){var p;if(i!==null){var m=i.defer();f(function(_){m.resolve(_)},function(_){m.reject(_)}),p=m.promise}else window.Promise&&(p=new window.Promise(f));return p?new r(p,h):null},a=function(){var f=Array.prototype.slice.call(arguments),h=f[0],p=f.slice(1);return h=h||{},p.forEach(function(m){for(var _ in m)m.hasOwnProperty(_)&&(h[_]=m[_])}),h},l=function(f,h){var p="";for(var m in h)if(h.hasOwnProperty(m)){var _=h[m];p+=encodeURIComponent(m)+"="+encodeURIComponent(_)+"&"}return p.length>0&&(p=p.substring(0,p.length-1),f=f+"?"+p),f},c=function(f,h){var p=new XMLHttpRequest,m=function(_,y){function S(w){_&&_(w),h&&h(null,w)}function b(){y&&y(p),h&&h(p,null)}var v=f.type||"GET";if(p.open(v,l(f.url,f.params)),s&&p.setRequestHeader("Authorization","Bearer "+s),p.onreadystatechange=function(){if(p.readyState===4){var w=null;try{w=p.responseText?JSON.parse(p.responseText):""}catch(N){console.error(N)}p.status>=200&&p.status<300?S(w):b()}},v==="GET")p.send(null);else{var E=null;f.postData&&(f.contentType==="image/jpeg"?(E=f.postData,p.setRequestHeader("Content-Type",f.contentType)):(E=JSON.stringify(f.postData),p.setRequestHeader("Content-Type","application/json"))),p.send(E)}};return h?(m(),null):o(m,function(){p.abort()})},u=function(f,h,p,m){var _={},y=null;typeof h=="object"?(_=h,y=p):typeof h=="function"&&(y=h);var S=f.type||"GET";return S!=="GET"&&f.postData&&!m?f.postData=a(f.postData,_):f.params=a(f.params,_),c(f,y)},d=function(){};return d.prototype={constructor:e},d.prototype.getGeneric=function(f,h){var p={url:f};return u(p,h)},d.prototype.getMe=function(f,h){var p={url:n+"/me"};return u(p,f,h)},d.prototype.getMySavedTracks=function(f,h){var p={url:n+"/me/tracks"};return u(p,f,h)},d.prototype.addToMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedAlbums=function(f,h){var p={url:n+"/me/albums"};return u(p,f,h)},d.prototype.addToMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMyTopArtists=function(f,h){var p={url:n+"/me/top/artists"};return u(p,f,h)},d.prototype.getMyTopTracks=function(f,h){var p={url:n+"/me/top/tracks"};return u(p,f,h)},d.prototype.getMyRecentlyPlayedTracks=function(f,h){var p={url:n+"/me/player/recently-played"};return u(p,f,h)},d.prototype.followUsers=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.followArtists=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.followPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers",type:"PUT",postData:{}};return u(m,h,p)},d.prototype.unfollowUsers=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.unfollowArtists=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.unfollowPlaylist=function(f,h){var p={url:n+"/playlists/"+f+"/followers",type:"DELETE"};return u(p,h)},d.prototype.isFollowingUsers=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.isFollowingArtists=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.areFollowingPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers/contains",type:"GET",params:{ids:h.join(",")}};return u(m,p)},d.prototype.getFollowedArtists=function(f,h){var p={url:n+"/me/following",type:"GET",params:{type:"artist"}};return u(p,f,h)},d.prototype.getUser=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)};return u(m,h,p)},d.prototype.getUserPlaylists=function(f,h,p){var m;return typeof f=="string"?m={url:n+"/users/"+encodeURIComponent(f)+"/playlists"}:(m={url:n+"/me/playlists"},p=h,h=f),u(m,h,p)},d.prototype.getPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f};return u(m,h,p)},d.prototype.getPlaylistTracks=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks"};return u(m,h,p)},d.prototype.getPlaylistCoverImage=function(f,h){var p={url:n+"/playlists/"+f+"/images"};return u(p,h)},d.prototype.createPlaylist=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)+"/playlists",type:"POST",postData:h};return u(m,h,p)},d.prototype.changePlaylistDetails=function(f,h,p){var m={url:n+"/playlists/"+f,type:"PUT",postData:h};return u(m,h,p)},d.prototype.addTracksToPlaylist=function(f,h,p,m){var _={url:n+"/playlists/"+f+"/tracks",type:"POST",postData:{uris:h}};return u(_,p,m,!0)},d.prototype.replaceTracksInPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{uris:h}};return u(m,{},p)},d.prototype.reorderTracksInPlaylist=function(f,h,p,m,_){var y={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{range_start:h,insert_before:p}};return u(y,m,_)},d.prototype.removeTracksFromPlaylist=function(f,h,p){var m=h.map(function(y){return typeof y=="string"?{uri:y}:y}),_={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:m}};return u(_,{},p)},d.prototype.removeTracksFromPlaylistWithSnapshotId=function(f,h,p,m){var _=h.map(function(S){return typeof S=="string"?{uri:S}:S}),y={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:_,snapshot_id:p}};return u(y,{},m)},d.prototype.removeTracksFromPlaylistInPositions=function(f,h,p,m){var _={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{positions:h,snapshot_id:p}};return u(_,{},m)},d.prototype.uploadCustomPlaylistCoverImage=function(f,h,p){var m={url:n+"/playlists/"+f+"/images",type:"PUT",postData:h.replace(/^data:image\/jpeg;base64,/,""),contentType:"image/jpeg"};return u(m,{},p)},d.prototype.getAlbum=function(f,h,p){var m={url:n+"/albums/"+f};return u(m,h,p)},d.prototype.getAlbumTracks=function(f,h,p){var m={url:n+"/albums/"+f+"/tracks"};return u(m,h,p)},d.prototype.getAlbums=function(f,h,p){var m={url:n+"/albums/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getTrack=function(f,h,p){var m={};return m.url=n+"/tracks/"+f,u(m,h,p)},d.prototype.getTracks=function(f,h,p){var m={url:n+"/tracks/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtist=function(f,h,p){var m={url:n+"/artists/"+f};return u(m,h,p)},d.prototype.getArtists=function(f,h,p){var m={url:n+"/artists/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtistAlbums=function(f,h,p){var m={url:n+"/artists/"+f+"/albums"};return u(m,h,p)},d.prototype.getArtistTopTracks=function(f,h,p,m){var _={url:n+"/artists/"+f+"/top-tracks",params:{country:h}};return u(_,p,m)},d.prototype.getArtistRelatedArtists=function(f,h,p){var m={url:n+"/artists/"+f+"/related-artists"};return u(m,h,p)},d.prototype.getFeaturedPlaylists=function(f,h){var p={url:n+"/browse/featured-playlists"};return u(p,f,h)},d.prototype.getNewReleases=function(f,h){var p={url:n+"/browse/new-releases"};return u(p,f,h)},d.prototype.getCategories=function(f,h){var p={url:n+"/browse/categories"};return u(p,f,h)},d.prototype.getCategory=function(f,h,p){var m={url:n+"/browse/categories/"+f};return u(m,h,p)},d.prototype.getCategoryPlaylists=function(f,h,p){var m={url:n+"/browse/categories/"+f+"/playlists"};return u(m,h,p)},d.prototype.search=function(f,h,p,m){var _={url:n+"/search/",params:{q:f,type:h.join(",")}};return u(_,p,m)},d.prototype.searchAlbums=function(f,h,p){return this.search(f,["album"],h,p)},d.prototype.searchArtists=function(f,h,p){return this.search(f,["artist"],h,p)},d.prototype.searchTracks=function(f,h,p){return this.search(f,["track"],h,p)},d.prototype.searchPlaylists=function(f,h,p){return this.search(f,["playlist"],h,p)},d.prototype.searchShows=function(f,h,p){return this.search(f,["show"],h,p)},d.prototype.searchEpisodes=function(f,h,p){return this.search(f,["episode"],h,p)},d.prototype.getAudioFeaturesForTrack=function(f,h){var p={};return p.url=n+"/audio-features/"+f,u(p,{},h)},d.prototype.getAudioFeaturesForTracks=function(f,h){var p={url:n+"/audio-features",params:{ids:f}};return u(p,{},h)},d.prototype.getAudioAnalysisForTrack=function(f,h){var p={};return p.url=n+"/audio-analysis/"+f,u(p,{},h)},d.prototype.getRecommendations=function(f,h){var p={url:n+"/recommendations"};return u(p,f,h)},d.prototype.getAvailableGenreSeeds=function(f){var h={url:n+"/recommendations/available-genre-seeds"};return u(h,{},f)},d.prototype.getMyDevices=function(f){var h={url:n+"/me/player/devices"};return u(h,{},f)},d.prototype.getMyCurrentPlaybackState=function(f,h){var p={url:n+"/me/player"};return u(p,f,h)},d.prototype.getMyCurrentPlayingTrack=function(f,h){var p={url:n+"/me/player/currently-playing"};return u(p,f,h)},d.prototype.transferMyPlayback=function(f,h,p){var m=h||{};m.device_ids=f;var _={type:"PUT",url:n+"/me/player",postData:m};return u(_,h,p)},d.prototype.play=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={};["context_uri","uris","offset","position_ms"].forEach(function(S){S in f&&(m[S]=f[S])});var _={type:"PUT",url:n+"/me/player/play",params:p,postData:m},y=typeof f=="function"?f:{};return u(_,y,h)},d.prototype.queue=function(f,h,p){h=h||{};var m="device_id"in h?{uri:f,device_id:h.device_id}:{uri:f},_={type:"POST",url:n+"/me/player/queue",params:m};return u(_,h,p)},d.prototype.pause=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"PUT",url:n+"/me/player/pause",params:p};return u(m,f,h)},d.prototype.skipToNext=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/next",params:p};return u(m,f,h)},d.prototype.skipToPrevious=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/previous",params:p};return u(m,f,h)},d.prototype.seek=function(f,h,p){h=h||{};var m={position_ms:f};"device_id"in h&&(m.device_id=h.device_id);var _={type:"PUT",url:n+"/me/player/seek",params:m};return u(_,h,p)},d.prototype.setRepeat=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var _={type:"PUT",url:n+"/me/player/repeat",params:m};return u(_,h,p)},d.prototype.setVolume=function(f,h,p){h=h||{};var m={volume_percent:f};"device_id"in h&&(m.device_id=h.device_id);var _={type:"PUT",url:n+"/me/player/volume",params:m};return u(_,h,p)},d.prototype.setShuffle=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var _={type:"PUT",url:n+"/me/player/shuffle",params:m};return u(_,h,p)},d.prototype.getShow=function(f,h,p){var m={};return m.url=n+"/shows/"+f,u(m,h,p)},d.prototype.getShows=function(f,h,p){var m={url:n+"/shows/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedShows=function(f,h){var p={url:n+"/me/shows"};return u(p,f,h)},d.prototype.addToMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedShows=function(f,h,p){var m={url:n+"/me/shows/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getShowEpisodes=function(f,h,p){var m={url:n+"/shows/"+f+"/episodes"};return u(m,h,p)},d.prototype.getEpisode=function(f,h,p){var m={};return m.url=n+"/episodes/"+f,u(m,h,p)},d.prototype.getEpisodes=function(f,h,p){var m={url:n+"/episodes/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getAccessToken=function(){return s},d.prototype.setAccessToken=function(f){s=f},d.prototype.setPromiseImplementation=function(f){var h=!1;try{var p=new f(function(m){m()});typeof p.then=="function"&&typeof p.catch=="function"&&(h=!0)}catch(m){console.error(m)}if(h)i=f;else throw new Error("Unsupported implementation of Promises/A+")},d}();t.exports=e}(Zd)),Zd.exports}var D8=L8();const Bs=Fu(D8),ey={load(t){const e=new Bs;return e.setAccessToken(Ue().spotify.webapi_token),e.getAlbum(t.params.id,{market:Ue().spotify.webapi_country})},set(t,e){t.album=e}},M8={name:"PageAlbumSpotify",components:{ContentWithHero:cd,ControlButton:Je,ControlImage:Qi,ListTracksSpotify:Gc,ModalDialogAlbumSpotify:dS},beforeRouteEnter(t,e,n){ey.load(t).then(s=>{n(i=>ey.set(i,s))})},setup(){return{servicesStore:Ue()}},data(){return{album:{artists:[{}],tracks:{}},show_details_modal:!1}},computed:{tracks(){const{album:t}=this;return t.tracks.total?t.tracks.items.map(e=>({...e,album:t})):{}}},methods:{open_artist(){this.$router.push({name:"music-spotify-artist",params:{id:this.album.artists[0].id}})},play(){this.show_details_modal=!1,tt.player_play_uri(this.album.uri,!0)},showDetails(){this.show_details_modal=!0}}},F8=["textContent"],V8={class:"subtitle is-6"},H8=["textContent"],U8=["textContent"],j8={class:"buttons is-centered-mobile mt-5"};function B8(t,e,n,s,i,r){const o=x("control-button"),a=x("control-image"),l=x("list-tracks-spotify"),c=x("modal-dialog-album-spotify"),u=x("content-with-hero");return O(),M("div",null,[C(u,null,{"heading-left":D(()=>[g("div",{class:"title is-5",textContent:$(i.album.name)},null,8,F8),g("div",V8,[g("a",{onClick:e[0]||(e[0]=(...d)=>r.open_artist&&r.open_artist(...d)),textContent:$(i.album.artists[0].name)},null,8,H8)]),g("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:$(t.$t("count.tracks",{count:i.album.tracks.total}))},null,8,U8),g("div",j8,[C(o,{handler:r.play,icon:"shuffle",label:"page.spotify.album.shuffle"},null,8,["handler"]),C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"])])]),"heading-right":D(()=>{var d,f;return[C(a,{url:((f=(d=i.album.images)==null?void 0:d[0])==null?void 0:f.url)??"",artist:i.album.artists[0].name,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]}),content:D(()=>[C(l,{items:r.tracks,context_uri:i.album.uri},null,8,["items","context_uri"]),C(c,{item:i.album,show:i.show_details_modal,onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const W8=it(M8,[["render",B8]]),q8={name:"ContentWithHeading",data(){return{hidden:!0}},computed:{icon(){return this.hidden?"chevron-down":"chevron-up"}}},z8={class:"container"},G8={class:"columns is-centered"},K8={class:"column is-four-fifths"},X8={key:0,class:"my-2"},Y8={class:"buttons is-centered"},Z8={class:"level is-clipped"},J8={class:"level-left is-flex-shrink-1"},Q8={class:"level-item is-flex-shrink-1 has-text-centered-mobile"},t5={class:"level-right has-text-centered-mobile"},e5={class:"mt-4"};function n5(t,e,n,s,i,r){const o=x("mdicon");return O(),M("section",{class:Vt(["section",{"pt-0":t.$slots.options}])},[g("div",z8,[g("div",G8,[g("div",K8,[t.$slots.options?(O(),M("div",X8,[g("div",{class:Vt([{"is-hidden":i.hidden},"mt-4"])},[ge(t.$slots,"options")],2),g("div",Y8,[g("button",{class:"button is-small",onClick:e[0]||(e[0]=a=>i.hidden=!i.hidden)},[C(o,{class:"icon",name:r.icon,size:"16"},null,8,["name"])])])])):vt("",!0),g("div",null,[g("nav",Z8,[g("div",J8,[g("div",Q8,[g("div",null,[ge(t.$slots,"heading-left")])])]),g("div",t5,[ge(t.$slots,"heading-right")])]),ge(t.$slots,"content"),g("div",e5,[ge(t.$slots,"footer")])])])])])],2)}const ie=it(q8,[["render",n5]]),s5={name:"ControlDropdown",props:{options:{required:!0,type:Array},value:{required:!0,type:[String,Number]}},emits:["update:value"],data(){return{active:!1}},computed:{option:{get(){return this.options.find(t=>t.id===this.value)}}},methods:{deactivate(){this.active=!1},select(t){this.active=!1,this.$emit("update:value",t.id)}}},i5={class:"dropdown-trigger"},r5=["textContent"],o5={id:"dropdown",class:"dropdown-menu",role:"menu"},a5={class:"dropdown-content"},l5=["onClick","textContent"];function c5(t,e,n,s,i,r){const o=x("mdicon"),a=Vh("click-away");return An((O(),M("div",{class:Vt(["dropdown",{"is-active":i.active}])},[g("div",i5,[g("button",{class:"button","aria-haspopup":"true","aria-controls":"dropdown",onClick:e[0]||(e[0]=l=>i.active=!i.active)},[g("span",{textContent:$(r.option.name)},null,8,r5),C(o,{class:"icon",name:"chevron-down",size:"16"})])]),g("div",o5,[g("div",a5,[(O(!0),M(pt,null,fe(n.options,l=>(O(),M("a",{key:l.id,class:Vt(["dropdown-item",{"is-active":n.value===l.id}]),onClick:c=>r.select(l),textContent:$(l.name)},null,10,l5))),128))])])],2)),[[a,r.deactivate]])}const Rr=it(s5,[["render",c5]]),u5={name:"IndexButtonList",props:{indices:{required:!0,type:Array}}},d5={class:"buttons is-centered mb-4"};function f5(t,e,n,s,i,r){const o=x("router-link");return O(),M("section",null,[g("nav",d5,[(O(!0),M(pt,null,fe(n.indices,a=>(O(),_t(o,{key:a,class:"button px-2 is-small is-square",to:{hash:`#index_${a}`,query:t.$route.query}},{default:D(()=>[ws($(a),1)]),_:2},1032,["to"]))),128))])])}const Is=it(u5,[["render",f5],["__scopeId","data-v-f15ebd8e"]]),h5={name:"ListAlbums",components:{ControlImage:Qi,ModalDialog:mi,ModalDialogAlbum:ud},props:{items:{required:!0,type:Object},media_kind:{default:"",type:String}},emits:["play-count-changed","podcast-deleted"],setup(){return{settingsStore:gi()}},data(){return{rss_playlist_to_remove:{},selected_item:{},show_details_modal:!1,show_remove_podcast_modal:!1}},computed:{actions(){return[{label:this.$t("page.podcast.cancel"),handler:"cancel",icon:"cancel"},{label:this.$t("page.podcast.remove"),handler:"remove",icon:"delete"}]},media_kind_resolved(){return this.media_kind||this.selected_item.media_kind}},methods:{open(t){this.selected_item=t,this.media_kind_resolved==="podcast"?this.$router.push({name:"podcast",params:{id:t.id}}):this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:t.id}}):this.$router.push({name:"music-album",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0},open_remove_podcast_dialog(){tt.library_album_tracks(this.selected_item.id,{limit:1}).then(({data:t})=>{tt.library_track_playlists(t.items[0].id).then(({data:e})=>{[this.rss_playlist_to_remove]=e.items.filter(n=>n.type==="rss"),this.show_remove_podcast_modal=!0,this.show_details_modal=!1})})},play_count_changed(){this.$emit("play-count-changed")},remove_podcast(){this.show_remove_podcast_modal=!1,tt.library_playlist_delete(this.rss_playlist_to_remove.id).then(()=>{this.$emit("podcast-deleted")})}}},p5={key:0,class:"py-5"},m5=["id","textContent"],g5=["onClick"],b5={class:"media-content"},y5=["textContent"],_5=["textContent"],v5=["textContent"],S5={class:"media-right"},E5=["onClick"],w5=["textContent"];function C5(t,e,n,s,i,r){const o=x("control-image"),a=x("mdicon"),l=x("modal-dialog-album"),c=x("i18n-t"),u=x("modal-dialog");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,d=>(O(),M(pt,{key:d.itemId},[d.isItem?(O(),M("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:f=>r.open(d.item)},[s.settingsStore.show_cover_artwork_in_album_lists?(O(),_t(o,{key:0,url:d.item.artwork_url,artist:d.item.artist,album:d.item.name,class:"media-left is-small"},null,8,["url","artist","album"])):vt("",!0),g("div",b5,[g("div",{class:"is-size-6 has-text-weight-bold",textContent:$(d.item.name)},null,8,y5),g("div",{class:"is-size-7 has-text-grey has-text-weight-bold",textContent:$(d.item.artist)},null,8,_5),d.item.date_released&&d.item.media_kind==="music"?(O(),M("div",{key:0,class:"is-size-7 has-text-grey",textContent:$(t.$filters.toDate(d.item.date_released))},null,8,v5)):vt("",!0)]),g("div",S5,[g("a",{onClick:Oe(f=>r.open_dialog(d.item),["prevent","stop"])},[C(a,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,E5)])],8,g5)):(O(),M("div",p5,[g("span",{id:`index_${d.index}`,class:"tag is-small has-text-weight-bold",textContent:$(d.index)},null,8,m5)]))],64))),128)),(O(),_t(ds,{to:"#app"},[C(l,{item:i.selected_item,media_kind:n.media_kind,show:i.show_details_modal,onClose:e[0]||(e[0]=d=>i.show_details_modal=!1),onRemovePodcast:e[1]||(e[1]=d=>r.open_remove_podcast_dialog()),onPlayCountChanged:e[2]||(e[2]=d=>r.play_count_changed())},null,8,["item","media_kind","show"]),C(u,{actions:r.actions,show:i.show_remove_podcast_modal,title:t.$t("page.podcast.remove-podcast"),onCancel:e[3]||(e[3]=d=>i.show_remove_podcast_modal=!1),onRemove:r.remove_podcast},{content:D(()=>[C(c,{keypath:"list.albums.info",tag:"p",scope:"global"},{separator:D(()=>e[4]||(e[4]=[g("br",null,null,-1)])),name:D(()=>[g("b",{textContent:$(i.rss_playlist_to_remove.name)},null,8,w5)]),_:1})]),_:1},8,["actions","show","title","onRemove"])]))],64)}const qn=it(h5,[["render",C5]]),k5={name:"ControlTabList",props:{links:{required:!0,type:Array}}},T5={class:"section py-0 tabs-section"},x5={class:"container"},A5={class:"columns is-centered my-0"},O5={class:"column is-four-fifths py-0"},I5={class:"tabs is-centered is-small"},N5=["onClick","onKeypress"],P5=["textContent"];function $5(t,e,n,s,i,r){const o=x("mdicon"),a=x("router-link");return O(),M("section",T5,[g("div",x5,[g("div",A5,[g("div",O5,[g("div",I5,[g("ul",null,[(O(!0),M(pt,null,fe(n.links,l=>(O(),_t(a,{key:l.to.name,to:{name:l.to.name},custom:""},{default:D(({navigate:c,isActive:u})=>[g("li",{class:Vt({"is-active":u})},[g("a",{onClick:c,onKeypress:Wv(c,["enter"])},[l.icon?(O(),_t(o,{key:0,class:"icon is-small",name:l.icon},null,8,["name"])):vt("",!0),g("span",{class:Vt({"is-hidden-mobile":l.icon}),textContent:$(t.$t(l.label))},null,10,P5)],40,N5)],2)]),_:2},1032,["to"]))),128))])])])])])])}const Xp=it(k5,[["render",$5],["__scopeId","data-v-95d58276"]]),R5={name:"TabsMusic",components:{ControlTabList:Xp},setup(){return{servicesStore:Ue()}},computed:{links(){const t=[{to:{name:"music-history"},icon:"history",label:"page.music.tabs.history"},{to:{name:"music-artists"},icon:"account-music",label:"page.music.tabs.artists"},{to:{name:"music-albums"},icon:"album",label:"page.music.tabs.albums"},{to:{name:"music-genres"},icon:"speaker",label:"page.music.tabs.genres"},{to:{name:"music-composers"},icon:"book-open-page-variant",label:"page.music.tabs.composers"}];return this.servicesStore.spotify.webapi_token_valid&&t.push({to:{name:"music-spotify"},icon:"spotify",label:"page.music.tabs.spotify"}),t}}};function L5(t,e,n,s,i,r){const o=x("control-tab-list");return O(),_t(o,{links:r.links},null,8,["links"])}const Ws=it(R5,[["render",L5]]),ny={load(t){return tt.library_albums("music")},set(t,e){t.albums_list=new Tt(e.data)}},D5={name:"PageAlbums",components:{ContentWithHeading:ie,ControlDropdown:Rr,ControlSwitch:Pr,IndexButtonList:Is,ListAlbums:qn,TabsMusic:Ws},beforeRouteEnter(t,e,n){ny.load(t).then(s=>{n(i=>ny.set(i,s))})},setup(){return{uiStore:Hn(),servicesStore:Ue()}},data(){return{albums_list:new Tt,groupings:[{id:1,name:this.$t("page.albums.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("page.albums.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}},{id:3,name:this.$t("page.albums.sort.recently-released"),options:{criteria:[{field:"date_released",order:-1,type:Date}],index:{field:"date_released",type:Date}}},{id:4,name:this.$t("page.albums.sort.artist-name"),options:{criteria:[{field:"artist",type:String},{field:"name_sort",type:String}],index:{field:"artist",type:String}}},{id:5,name:this.$t("page.albums.sort.artist-date"),options:{criteria:[{field:"artist",type:String},{field:"date_released",type:Date}],index:{field:"artist",type:String}}}]}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.albums_sort);return t.filters=[e=>!this.uiStore.hide_singles||e.track_count>2,e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.albums_list.group(t)},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid}}},M5={class:"columns"},F5={class:"column"},V5=["textContent"],H5=["textContent"],U5=["textContent"],j5=["textContent"],B5=["textContent"],W5={class:"column"},q5=["textContent"],z5=["textContent"],G5=["textContent"];function K5(t,e,n,s,i,r){const o=x("tabs-music"),a=x("index-button-list"),l=x("control-switch"),c=x("control-dropdown"),u=x("list-albums"),d=x("content-with-heading");return O(),M("div",null,[C(o),C(d,null,{options:D(()=>[C(a,{indices:r.albums.indices},null,8,["indices"]),g("div",M5,[g("div",F5,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.albums.filter"))},null,8,V5),C(l,{modelValue:s.uiStore.hide_singles,"onUpdate:modelValue":e[0]||(e[0]=f=>s.uiStore.hide_singles=f)},{label:D(()=>[g("span",{textContent:$(t.$t("page.albums.hide-singles"))},null,8,H5)]),help:D(()=>[g("span",{textContent:$(t.$t("page.albums.hide-singles-help"))},null,8,U5)]),_:1},8,["modelValue"]),r.spotify_enabled?(O(),_t(l,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[1]||(e[1]=f=>s.uiStore.hide_spotify=f)},{label:D(()=>[g("span",{textContent:$(t.$t("page.albums.hide-spotify"))},null,8,j5)]),help:D(()=>[g("span",{textContent:$(t.$t("page.albums.hide-spotify-help"))},null,8,B5)]),_:1},8,["modelValue"])):vt("",!0)]),g("div",W5,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.albums.sort.title"))},null,8,q5),C(c,{value:s.uiStore.albums_sort,"onUpdate:value":e[2]||(e[2]=f=>s.uiStore.albums_sort=f),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.albums.title"))},null,8,z5),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.albums",{count:r.albums.count}))},null,8,G5)]),content:D(()=>[C(u,{items:r.albums},null,8,["items"])]),_:1})])}const X5=it(D5,[["render",K5]]),Y5={name:"ModalDialogArtist",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,properties:[{label:"property.albums",value:this.item.album_count},{label:"property.tracks",value:this.item.track_count},{label:"property.type",value:this.$t(`data.kind.${this.item.data_kind}`)},{label:"property.added-on",value:this.$filters.toDateTime(this.item.time_added)}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-artist",params:{id:this.item.id}})}}};function Z5(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const dd=it(Y5,[["render",Z5]]),sy={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_albums(t.params.id)])},set(t,e){t.artist=e[0].data,t.albums_list=new Tt(e[1].data)}},J5={name:"PageArtist",components:{ContentWithHeading:ie,ControlButton:Je,ControlDropdown:Rr,ControlSwitch:Pr,ListAlbums:qn,ModalDialogArtist:dd},beforeRouteEnter(t,e,n){sy.load(t).then(s=>{n(i=>sy.set(i,s))})},setup(){return{servicesStore:Ue(),uiStore:Hn()}},data(){return{albums_list:new Tt,artist:{},groupings:[{id:1,name:this.$t("page.artist.sort.name"),options:{criteria:[{field:"name_sort",type:String}]}},{id:2,name:this.$t("page.artist.sort.release-date"),options:{criteria:[{field:"date_released",type:Date}]}}],show_details_modal:!1}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artist_albums_sort);return t.filters=[e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.albums_list.group(t)},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid},track_count(){return[...this.albums].reduce((t,e)=>t+(e.isItem?e.item.track_count:0),0)}},methods:{open_tracks(){this.$router.push({name:"music-artist-tracks",params:{id:this.artist.id}})},play(){tt.player_play_uri(this.albums.items.map(t=>t.uri).join(),!0)},showDetails(){this.show_details_modal=!0}}},Q5={class:"columns"},t6={class:"column"},e6=["textContent"],n6=["textContent"],s6=["textContent"],i6={class:"column"},r6=["textContent"],o6=["textContent"],a6={class:"is-size-7 is-uppercase"},l6=["textContent"],c6=["textContent"],u6={class:"buttons is-centered"};function d6(t,e,n,s,i,r){const o=x("control-switch"),a=x("control-dropdown"),l=x("control-button"),c=x("list-albums"),u=x("modal-dialog-artist"),d=x("content-with-heading");return O(),M("div",null,[C(d,null,{options:D(()=>[g("div",Q5,[g("div",t6,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artist.filter"))},null,8,e6),r.spotify_enabled?(O(),_t(o,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[0]||(e[0]=f=>s.uiStore.hide_spotify=f)},{label:D(()=>[g("span",{textContent:$(t.$t("page.artist.hide-spotify"))},null,8,n6)]),help:D(()=>[g("span",{textContent:$(t.$t("page.artist.hide-spotify-help"))},null,8,s6)]),_:1},8,["modelValue"])):vt("",!0)]),g("div",i6,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artist.sort.title"))},null,8,r6),C(a,{value:s.uiStore.artist_albums_sort,"onUpdate:value":e[1]||(e[1]=f=>s.uiStore.artist_albums_sort=f),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.artist.name)},null,8,o6),g("div",a6,[g("span",{textContent:$(t.$t("count.albums",{count:r.albums.count}))},null,8,l6),e[4]||(e[4]=g("span",null," | ",-1)),g("a",{onClick:e[2]||(e[2]=(...f)=>r.open_tracks&&r.open_tracks(...f)),textContent:$(t.$t("count.tracks",{count:r.track_count}))},null,8,c6)])]),"heading-right":D(()=>[g("div",u6,[C(l,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(l,{handler:r.play,icon:"shuffle",label:"page.artist.shuffle"},null,8,["handler"])])]),content:D(()=>[C(c,{items:r.albums},null,8,["items"]),C(u,{item:i.artist,show:i.show_details_modal,onClose:e[3]||(e[3]=f=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const f6=it(J5,[["render",d6]]),h6={name:"ListAlbumsSpotify",components:{ControlImage:Qi,ModalDialogAlbumSpotify:dS},props:{items:{required:!0,type:Object}},setup(){return{settingsStore:gi()}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"music-spotify-album",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},p6=["onClick"],m6={class:"media-content"},g6=["textContent"],b6=["textContent"],y6=["textContent"],_6={class:"media-right"},v6=["onClick"];function S6(t,e,n,s,i,r){const o=x("control-image"),a=x("mdicon"),l=x("modal-dialog-album-spotify");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,c=>{var u,d,f;return O(),M("div",{key:c.id,class:"media is-align-items-center is-clickable mb-0",onClick:h=>r.open(c)},[s.settingsStore.show_cover_artwork_in_album_lists?(O(),_t(o,{key:0,url:((d=(u=c.images)==null?void 0:u[0])==null?void 0:d.url)??"",artist:c.artist,album:c.name,class:"media-left is-small"},null,8,["url","artist","album"])):vt("",!0),g("div",m6,[g("div",{class:"is-size-6 has-text-weight-bold",textContent:$(c.name)},null,8,g6),g("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:$((f=c.artists[0])==null?void 0:f.name)},null,8,b6),g("div",{class:"is-size-7 has-text-grey",textContent:$(t.$filters.toDate(c.release_date))},null,8,y6)]),g("div",_6,[g("a",{onClick:Oe(h=>r.open_dialog(c),["prevent","stop"])},[C(a,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,v6)])],8,p6)}),128)),(O(),_t(ds,{to:"#app"},[C(l,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=c=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Wa=it(h6,[["render",S6]]),E6={name:"ModalDialogArtistSpotify",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,handler:this.open,properties:[{label:"property.popularity",value:[this.item.popularity,(t=this.item.followers)==null?void 0:t.total].join(" / ")},{label:"property.genres",value:(e=this.item.genres)==null?void 0:e.join(", ")}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.id}})}}};function w6(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const fS=it(E6,[["render",w6]]);function C6(t){return t.scrollHeight}function k6(t){return t.scrollWidth}function T6(t,e){t.scrollTop=t.scrollHeight-e+t.scrollTop}function x6(t,e){t.scrollLeft=t.scrollWidth-e+t.scrollLeft}const A6=g("div",{class:"loading"},"Loading...",-1),O6=g("div",{class:"no-more"},"No more.",-1),I6=g("div",{class:"no-results"},"No results.",-1),N6=g("div",{class:"error"},"Error.",-1),Yp=hi({__name:"VueEternalLoading",props:{load:{required:!0,type:Function},isInitial:{required:!1,type:Boolean,default:!0},position:{required:!1,type:String,default:"default"},container:{required:!1,type:Object,default:null},margin:{required:!1,type:String,default:void 0}},emits:["update:isInitial"],setup(t,{emit:e}){const n=t,s=is();let i=is("loading"),r=is(n.isInitial),o=0;function a(){Nr(()=>{var b,v;n.position==="top"?T6((b=n.container)!=null?b:document.documentElement,o):n.position==="left"&&x6((v=n.container)!=null?v:document.documentElement,o)})}function l(b,v){return b===0?r.value?(u(),"no-results"):(c(),"no-more"):b!==void 0&&v!==void 0&&b{var v,E;b.isIntersecting&&(n.position==="top"?o=C6((v=n.container)!=null?v:document.documentElement):n.position==="left"&&(o=k6((E=n.container)!=null?E:document.documentElement)),m(),n.load({loaded:l,noMore:c,noResults:u,error:d},{isFirstLoad:r.value}))},{root:n.container,threshold:0,rootMargin:n.margin})}let S;return typeof IntersectionObserver<"u"&&dv(()=>{S&&m(),S=y(),_()},{flush:"post"}),Gn(()=>n.isInitial,b=>{b&&f()}),Gn(r,b=>{b||e("update:isInitial",!1)}),(b,v)=>(O(),M("div",{class:"vue-eternal-loading",ref_key:"rootRef",ref:s},[Dn(i)==="loading"?ge(b.$slots,"loading",to(no({key:0},{isFirstLoad:Dn(r)})),()=>[A6]):Dn(i)==="no-more"?ge(b.$slots,"no-more",to(no({key:1},{retry:h})),()=>[O6]):Dn(i)==="no-results"?ge(b.$slots,"no-results",to(no({key:2},{retry:h})),()=>[I6]):Dn(i)==="error"?ge(b.$slots,"error",to(no({key:3},{retry:h})),()=>[N6]):vt("",!0)],512))}}),fh=50,iy={load(t){const e=new Bs;return e.setAccessToken(Ue().spotify.webapi_token),Promise.all([e.getArtist(t.params.id),e.getArtistAlbums(t.params.id,{include_groups:"album,single",limit:fh,market:Ue().spotify.webapi_country,offset:0})])},set(t,e){t.artist=e.shift(),t.albums=[],t.total=0,t.offset=0,t.append_albums(e.shift())}},P6={name:"PageArtistSpotify",components:{ContentWithHeading:ie,ControlButton:Je,ListAlbumsSpotify:Wa,ModalDialogArtistSpotify:fS,VueEternalLoading:Yp},beforeRouteEnter(t,e,n){iy.load(t).then(s=>{n(i=>iy.set(i,s))})},setup(){return{servicesStore:Ue()}},data(){return{albums:[],artist:{},offset:0,show_details_modal:!1,total:0}},methods:{append_albums(t){this.albums=this.albums.concat(t.items),this.total=t.total,this.offset+=t.limit},load_next({loaded:t}){const e=new Bs;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getArtistAlbums(this.artist.id,{include_groups:"album,single",limit:fh,offset:this.offset}).then(n=>{this.append_albums(n),t(n.items.length,fh)})},play(){this.show_album_details_modal=!1,tt.player_play_uri(this.artist.uri,!0)},showDetails(){this.show_details_modal=!0}}},$6=["textContent"],R6=["textContent"],L6={class:"buttons is-centered"},D6={class:"columns is-centered"},M6={class:"column has-text-centered"};function F6(t,e,n,s,i,r){const o=x("control-button"),a=x("list-albums-spotify"),l=x("mdicon"),c=x("vue-eternal-loading"),u=x("modal-dialog-artist-spotify"),d=x("content-with-heading");return O(),M("div",null,[C(d,null,{"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.artist.name)},null,8,$6),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.albums",{count:i.total}))},null,8,R6)]),"heading-right":D(()=>[g("div",L6,[C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(o,{handler:r.play,icon:"shuffle",label:"page.spotify.artist.shuffle"},null,8,["handler"])])]),content:D(()=>[C(a,{items:i.albums},null,8,["items"]),i.offset[g("div",D6,[g("div",M6,[C(l,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":D(()=>e[1]||(e[1]=[g("br",null,null,-1)])),"no-results":D(()=>e[2]||(e[2]=[g("br",null,null,-1)])),_:1},8,["load"])):vt("",!0),C(u,{item:i.artist,show:i.show_details_modal,onClose:e[0]||(e[0]=f=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const V6=it(P6,[["render",F6]]),ry={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_tracks(t.params.id)])},set(t,e){t.artist=e[0].data,t.tracks_list=new Tt(e[1].data.tracks)}},H6={name:"PageArtistTracks",components:{ContentWithHeading:ie,ControlButton:Je,ControlDropdown:Rr,ControlSwitch:Pr,IndexButtonList:Is,ListTracks:Vn,ModalDialogArtist:dd},beforeRouteEnter(t,e,n){ry.load(t).then(s=>{n(i=>ry.set(i,s))})},setup(){return{servicesStore:Ue(),uiStore:Hn()}},data(){return{artist:{},groupings:[{id:1,name:this.$t("page.artist.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.artist.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],show_details_modal:!1,tracks_list:new Tt}},computed:{album_count(){return new Set([...this.tracks].filter(t=>t.isItem).map(t=>t.item.album_id)).size},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid},track_uris(){return this.tracks_list.items.map(t=>t.uri).join()},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artist_tracks_sort);return t.filters=[e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.tracks_list.group(t)}},methods:{open_artist(){this.show_details_modal=!1,this.$router.push({name:"music-artist",params:{id:this.artist.id}})},play(){tt.player_play_uri(this.tracks_list.items.map(t=>t.uri).join(),!0)},showDetails(){this.show_details_modal=!0}}},U6={class:"columns"},j6={class:"column"},B6=["textContent"],W6=["textContent"],q6=["textContent"],z6={class:"column"},G6=["textContent"],K6=["textContent"],X6={class:"is-size-7 is-uppercase"},Y6=["textContent"],Z6=["textContent"],J6={class:"buttons is-centered"};function Q6(t,e,n,s,i,r){const o=x("index-button-list"),a=x("control-switch"),l=x("control-dropdown"),c=x("control-button"),u=x("list-tracks"),d=x("modal-dialog-artist"),f=x("content-with-heading");return O(),M("div",null,[C(f,null,{options:D(()=>[C(o,{indices:r.tracks.indices},null,8,["indices"]),g("div",U6,[g("div",j6,[g("p",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artist.filter"))},null,8,B6),r.spotify_enabled?(O(),_t(a,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[0]||(e[0]=h=>s.uiStore.hide_spotify=h)},{label:D(()=>[g("span",{textContent:$(t.$t("page.artist.hide-spotify"))},null,8,W6)]),help:D(()=>[g("span",{textContent:$(t.$t("page.artist.hide-spotify-help"))},null,8,q6)]),_:1},8,["modelValue"])):vt("",!0)]),g("div",z6,[g("p",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artist.sort.title"))},null,8,G6),C(l,{value:s.uiStore.artist_tracks_sort,"onUpdate:value":e[1]||(e[1]=h=>s.uiStore.artist_tracks_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(i.artist.name)},null,8,K6),g("div",X6,[g("a",{onClick:e[2]||(e[2]=(...h)=>r.open_artist&&r.open_artist(...h)),textContent:$(t.$t("count.albums",{count:r.album_count}))},null,8,Y6),e[4]||(e[4]=g("span",null," | ",-1)),g("span",{textContent:$(t.$t("count.tracks",{count:r.tracks.count}))},null,8,Z6)])]),"heading-right":D(()=>[g("div",J6,[C(c,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(c,{handler:r.play,icon:"shuffle",label:"page.artist.shuffle"},null,8,["handler"])])]),content:D(()=>[C(u,{items:r.tracks,uris:r.track_uris},null,8,["items","uris"]),C(d,{item:i.artist,show:i.show_details_modal,onClose:e[3]||(e[3]=h=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const tF=it(H6,[["render",Q6]]),eF={name:"ListArtists",components:{ModalDialogArtist:dd},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.selected_item=t;const e=t.media_kind==="audiobook"?"audiobooks-artist":"music-artist";this.$router.push({name:e,params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},nF={key:0,class:"py-5"},sF=["id","textContent"],iF=["onClick"],rF={class:"media-content"},oF=["textContent"],aF={class:"media-right"},lF=["onClick"];function cF(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-artist");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M(pt,{key:l.itemId},[l.isItem?(O(),M("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[g("div",rF,[g("p",{class:"title is-6",textContent:$(l.item.name)},null,8,oF)]),g("div",aF,[g("a",{onClick:Oe(c=>r.open_dialog(l.item),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,lF)])],8,iF)):(O(),M("div",nF,[g("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:$(l.index)},null,8,sF)]))],64))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Kc=it(eF,[["render",cF]]),oy={load(t){return tt.library_artists("music")},set(t,e){t.artists_list=new Tt(e.data)}},uF={name:"PageArtists",components:{ContentWithHeading:ie,ControlDropdown:Rr,ControlSwitch:Pr,IndexButtonList:Is,ListArtists:Kc,TabsMusic:Ws},beforeRouteEnter(t,e,n){oy.load(t).then(s=>{n(i=>oy.set(i,s))})},setup(){return{servicesStore:Ue(),uiStore:Hn()}},data(){return{artists_list:new Tt,groupings:[{id:1,name:this.$t("page.artists.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("page.artists.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}}]}},computed:{artists(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artists_sort);return t.filters=[e=>!this.uiStore.hide_singles||e.track_count>e.album_count*2,e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.artists_list.group(t)},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid}}},dF={class:"columns"},fF={class:"column"},hF=["textContent"],pF=["textContent"],mF=["textContent"],gF={key:0,class:"field"},bF=["textContent"],yF=["textContent"],_F={class:"column"},vF=["textContent"],SF=["textContent"],EF=["textContent"];function wF(t,e,n,s,i,r){const o=x("tabs-music"),a=x("index-button-list"),l=x("control-switch"),c=x("control-dropdown"),u=x("list-artists"),d=x("content-with-heading");return O(),M("div",null,[C(o),C(d,null,{options:D(()=>[C(a,{indices:r.artists.indices},null,8,["indices"]),g("div",dF,[g("div",fF,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artists.filter"))},null,8,hF),C(l,{modelValue:s.uiStore.hide_singles,"onUpdate:modelValue":e[0]||(e[0]=f=>s.uiStore.hide_singles=f)},{label:D(()=>[g("span",{textContent:$(t.$t("page.artists.hide-singles"))},null,8,pF)]),help:D(()=>[g("span",{textContent:$(t.$t("page.artists.hide-singles-help"))},null,8,mF)]),_:1},8,["modelValue"]),r.spotify_enabled?(O(),M("div",gF,[C(l,{modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[1]||(e[1]=f=>s.uiStore.hide_spotify=f)},{label:D(()=>[g("span",{textContent:$(t.$t("page.artists.hide-spotify"))},null,8,bF)]),help:D(()=>[g("span",{textContent:$(t.$t("page.artists.hide-spotify-help"))},null,8,yF)]),_:1},8,["modelValue"])])):vt("",!0)]),g("div",_F,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artists.sort.title"))},null,8,vF),C(c,{value:s.uiStore.artists_sort,"onUpdate:value":e[2]||(e[2]=f=>s.uiStore.artists_sort=f),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.artists.title"))},null,8,SF),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.artists",{count:r.artists.count}))},null,8,EF)]),content:D(()=>[C(u,{items:r.artists},null,8,["items"])]),_:1})])}const CF=it(uF,[["render",wF]]),ay={load(t){return Promise.all([tt.library_album(t.params.id),tt.library_album_tracks(t.params.id)])},set(t,e){t.album=e[0].data,t.tracks=new Tt(e[1].data)}},kF={name:"PageAudiobooksAlbum",components:{ContentWithHero:cd,ControlButton:Je,ControlImage:Qi,ListTracks:Vn,ModalDialogAlbum:ud},beforeRouteEnter(t,e,n){ay.load(t).then(s=>{n(i=>ay.set(i,s))})},data(){return{album:{},show_details_modal:!1,tracks:new Tt}},methods:{open_artist(){this.show_details_modal=!1,this.$router.push({name:"audiobooks-artist",params:{id:this.album.artist_id}})},play(){tt.player_play_uri(this.album.uri,!1)},showDetails(){this.show_details_modal=!0}}},TF=["textContent"],xF={class:"subtitle is-6"},AF=["textContent"],OF=["textContent"],IF={class:"buttons is-centered-mobile mt-5"};function NF(t,e,n,s,i,r){const o=x("control-button"),a=x("control-image"),l=x("list-tracks"),c=x("modal-dialog-album"),u=x("content-with-hero");return O(),M("div",null,[C(u,null,{"heading-left":D(()=>[g("div",{class:"title is-5",textContent:$(i.album.name)},null,8,TF),g("div",xF,[g("a",{onClick:e[0]||(e[0]=(...d)=>r.open_artist&&r.open_artist(...d)),textContent:$(i.album.artist)},null,8,AF)]),g("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:$(t.$t("count.tracks",{count:i.album.track_count}))},null,8,OF),g("div",IF,[C(o,{handler:r.play,icon:"play",label:"page.audiobooks.album.play"},null,8,["handler"]),C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"])])]),"heading-right":D(()=>[C(a,{url:i.album.artwork_url,artist:i.album.artist,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]),content:D(()=>[C(l,{items:i.tracks,show_progress:!0,uris:i.album.uri},null,8,["items","uris"]),C(c,{item:i.album,show:i.show_details_modal,media_kind:"audiobook",onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const PF=it(kF,[["render",NF]]),$F={name:"TabsAudiobooks",components:{ControlTabList:Xp},computed:{links(){return[{to:{name:"audiobooks-artists"},icon:"account-music",label:"page.audiobooks.tabs.authors"},{to:{name:"audiobooks-albums"},icon:"album",label:"page.audiobooks.tabs.audiobooks"},{to:{name:"audiobooks-genres"},icon:"speaker",label:"page.audiobooks.tabs.genres"}]}}};function RF(t,e,n,s,i,r){const o=x("control-tab-list");return O(),_t(o,{links:r.links},null,8,["links"])}const Zp=it($F,[["render",RF]]),ly={load(t){return tt.library_albums("audiobook")},set(t,e){t.albums=new Tt(e.data,{index:{field:"name_sort",type:String}})}},LF={name:"PageAudiobooksAlbums",components:{ContentWithHeading:ie,IndexButtonList:Is,ListAlbums:qn,TabsAudiobooks:Zp},beforeRouteEnter(t,e,n){ly.load(t).then(s=>{n(i=>ly.set(i,s))})},data(){return{albums:new Tt}}},DF=["textContent"],MF=["textContent"];function FF(t,e,n,s,i,r){const o=x("tabs-audiobooks"),a=x("index-button-list"),l=x("list-albums"),c=x("content-with-heading");return O(),M("div",null,[C(o),C(c,null,{options:D(()=>[C(a,{indices:i.albums.indices},null,8,["indices"])]),"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.audiobooks.albums.title"))},null,8,DF),g("p",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.audiobooks",{count:i.albums.count}))},null,8,MF)]),content:D(()=>[C(l,{items:i.albums},null,8,["items"])]),_:1})])}const VF=it(LF,[["render",FF]]),cy={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_albums(t.params.id)])},set(t,e){t.artist=e[0].data,t.albums=new Tt(e[1].data)}},HF={name:"PageAudiobooksArtist",components:{ContentWithHeading:ie,ControlButton:Je,ListAlbums:qn,ModalDialogArtist:dd},beforeRouteEnter(t,e,n){cy.load(t).then(s=>{n(i=>cy.set(i,s))})},data(){return{albums:new Tt,artist:{},show_details_modal:!1}},methods:{play(){tt.player_play_uri(this.albums.items.map(t=>t.uri).join(),!1)},showDetails(){this.show_details_modal=!0}}},UF=["textContent"],jF=["textContent"],BF={class:"buttons is-centered"};function WF(t,e,n,s,i,r){const o=x("control-button"),a=x("list-albums"),l=x("modal-dialog-artist"),c=x("content-with-heading");return O(),M("div",null,[C(c,null,{"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.artist.name)},null,8,UF),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.audiobooks",{count:i.artist.album_count}))},null,8,jF)]),"heading-right":D(()=>[g("div",BF,[C(o,{handle:r.showDetails,icon:"dots-horizontal"},null,8,["handle"]),C(o,{handle:r.play,icon:"play",label:"page.audiobooks.artist.play"},null,8,["handle"]),e[1]||(e[1]=ws(" /> "))])]),content:D(()=>[C(a,{items:i.albums},null,8,["items"]),C(l,{item:i.artist,show:i.show_details_modal,onClose:e[0]||(e[0]=u=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const qF=it(HF,[["render",WF]]),uy={load(t){return tt.library_artists("audiobook")},set(t,e){t.artists=new Tt(e.data,{index:{field:"name_sort",type:String}})}},zF={name:"PageAudiobooksArtists",components:{ContentWithHeading:ie,IndexButtonList:Is,ListArtists:Kc,TabsAudiobooks:Zp},beforeRouteEnter(t,e,n){uy.load(t).then(s=>{n(i=>uy.set(i,s))})},data(){return{artists:new Tt}}},GF=["textContent"],KF=["textContent"];function XF(t,e,n,s,i,r){const o=x("tabs-audiobooks"),a=x("index-button-list"),l=x("list-artists"),c=x("content-with-heading");return O(),M("div",null,[C(o),C(c,null,{options:D(()=>[C(a,{indices:i.artists.indices},null,8,["indices"])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.audiobooks.artists.title"))},null,8,GF),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.authors",{count:i.artists.count}))},null,8,KF)]),content:D(()=>[C(l,{items:i.artists},null,8,["items"])]),_:1})])}const YF=it(zF,[["render",XF]]),ZF={name:"ModalDialogGenre",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},media_kind:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,expression:`genre is "${this.item.name}" and media_kind is ${this.media_kind}`,properties:[{label:"property.albums",value:this.item.album_count},{label:"property.tracks",value:this.item.track_count},{label:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.name},query:{media_kind:this.media_kind}})}}};function JF(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const Jp=it(ZF,[["render",JF]]),QF={name:"ListGenres",components:{ModalDialogGenre:Jp},props:{items:{required:!0,type:Object},media_kind:{required:!0,type:String}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"genre-albums",params:{name:t.name},query:{media_kind:this.media_kind}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},tV={key:0,class:"py-5"},eV={class:"media-content"},nV=["id","textContent"],sV=["onClick"],iV={class:"media-content"},rV=["textContent"],oV={class:"media-right"},aV=["onClick"];function lV(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-genre");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M(pt,{key:l.itemId},[l.isItem?(O(),M("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[g("div",iV,[g("p",{class:"title is-6",textContent:$(l.item.name)},null,8,rV)]),g("div",oV,[g("a",{onClick:Oe(c=>r.open_dialog(l.item),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,aV)])],8,sV)):(O(),M("div",tV,[g("div",eV,[g("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:$(l.index)},null,8,nV)])]))],64))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,media_kind:n.media_kind,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]))],64)}const hS=it(QF,[["render",lV]]),dy={load(t){return tt.library_genres("audiobook")},set(t,e){t.genres=new Tt(e.data.genres,{index:{field:"name_sort",type:String}})}},cV={name:"PageAudiobooksGenres",components:{ContentWithHeading:ie,IndexButtonList:Is,ListGenres:hS,TabsAudiobooks:Zp},beforeRouteEnter(t,e,n){dy.load(t).then(s=>{n(i=>dy.set(i,s))})},data(){return{genres:new Tt}}},uV=["textContent"],dV=["textContent"];function fV(t,e,n,s,i,r){const o=x("tabs-audiobooks"),a=x("index-button-list"),l=x("list-genres"),c=x("content-with-heading");return O(),M("div",null,[C(o),C(c,null,{options:D(()=>[C(a,{indices:i.genres.indices},null,8,["indices"])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.genres.title"))},null,8,uV),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.genres",{count:i.genres.total}))},null,8,dV)]),content:D(()=>[C(l,{items:i.genres,media_kind:"audiobook"},null,8,["items"])]),_:1})])}const hV=it(cV,[["render",fV]]),pV={name:"ModalDialogComposer",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open_albums,expression:`composer is "${this.item.name}" and media_kind is music`,properties:[{label:"property.albums",value:this.item.album_count,handler:this.open_albums},{label:"property.tracks",value:this.item.track_count,handler:this.open_tracks},{label:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)}]}}},methods:{open_albums(){this.$emit("close"),this.$router.push({name:"music-composer-albums",params:{name:this.item.name}})},open_tracks(){this.$emit("close"),this.$router.push({name:"music-composer-tracks",params:{name:this.item.name}})}}};function mV(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const Qp=it(pV,[["render",mV]]),fy={load(t){return Promise.all([tt.library_composer(t.params.name),tt.library_composer_albums(t.params.name)])},set(t,e){t.composer=e[0].data,t.albums=new Tt(e[1].data.albums)}},gV={name:"PageComposerAlbums",components:{ContentWithHeading:ie,ControlButton:Je,ListAlbums:qn,ModalDialogComposer:Qp},beforeRouteEnter(t,e,n){fy.load(t).then(s=>{n(i=>fy.set(i,s))})},data(){return{albums:new Tt,composer:{},show_details_modal:!1}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`}},methods:{open_tracks(){this.$router.push({name:"music-composer-tracks",params:{name:this.composer.name}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}},bV=["textContent"],yV={class:"is-size-7 is-uppercase"},_V=["textContent"],vV=["textContent"],SV={class:"buttons is-centered"};function EV(t,e,n,s,i,r){const o=x("control-button"),a=x("list-albums"),l=x("modal-dialog-composer"),c=x("content-with-heading");return O(),M("div",null,[C(c,null,{"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.composer.name)},null,8,bV),g("div",yV,[g("span",{textContent:$(t.$t("count.albums",{count:i.composer.album_count}))},null,8,_V),e[2]||(e[2]=g("span",null," | ",-1)),g("a",{onClick:e[0]||(e[0]=(...u)=>r.open_tracks&&r.open_tracks(...u)),textContent:$(t.$t("count.tracks",{count:i.composer.track_count}))},null,8,vV)])]),"heading-right":D(()=>[g("div",SV,[C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(o,{handler:r.play,icon:"shuffle",label:"page.composer.shuffle"},null,8,["handler"])])]),content:D(()=>[C(a,{items:i.albums},null,8,["items"]),C(l,{item:i.composer,show:i.show_details_modal,onClose:e[1]||(e[1]=u=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const wV=it(gV,[["render",EV]]),hy={load(t){return Promise.all([tt.library_composer(t.params.name),tt.library_composer_tracks(t.params.name)])},set(t,e){t.composer=e[0].data,t.tracks_list=new Tt(e[1].data.tracks)}},CV={name:"PageComposerTracks",components:{ContentWithHeading:ie,ControlButton:Je,ControlDropdown:Rr,IndexButtonList:Is,ListTracks:Vn,ModalDialogComposer:Qp},beforeRouteEnter(t,e,n){hy.load(t).then(s=>{n(i=>hy.set(i,s))})},setup(){return{uiStore:Hn()}},data(){return{composer:{},groupings:[{id:1,name:this.$t("page.composer.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.composer.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],show_details_modal:!1,tracks_list:new Tt}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.composer_tracks_sort);return this.tracks_list.group(t)}},methods:{open_albums(){this.$router.push({name:"music-composer-albums",params:{name:this.composer.name}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}},kV={class:"columns"},TV={class:"column"},xV=["textContent"],AV=["textContent"],OV={class:"is-size-7 is-uppercase"},IV=["textContent"],NV=["textContent"],PV={class:"buttons is-centered"};function $V(t,e,n,s,i,r){const o=x("index-button-list"),a=x("control-dropdown"),l=x("control-button"),c=x("list-tracks"),u=x("modal-dialog-composer"),d=x("content-with-heading");return O(),M("div",null,[C(d,null,{options:D(()=>[C(o,{indices:r.tracks.indices},null,8,["indices"]),g("div",kV,[g("div",TV,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artist.sort.title"))},null,8,xV),C(a,{value:s.uiStore.composer_tracks_sort,"onUpdate:value":e[0]||(e[0]=f=>s.uiStore.composer_tracks_sort=f),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.composer.name)},null,8,AV),g("div",OV,[g("a",{onClick:e[1]||(e[1]=(...f)=>r.open_albums&&r.open_albums(...f)),textContent:$(t.$t("count.albums",{count:i.composer.album_count}))},null,8,IV),e[3]||(e[3]=g("span",null," | ",-1)),g("span",{textContent:$(t.$t("count.tracks",{count:i.composer.track_count}))},null,8,NV)])]),"heading-right":D(()=>[g("div",PV,[C(l,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(l,{handler:r.play,icon:"shuffle",label:"page.composer.shuffle"},null,8,["handler"])])]),content:D(()=>[C(c,{items:r.tracks,expression:r.expression},null,8,["items","expression"]),C(u,{item:i.composer,show:i.show_details_modal,onClose:e[2]||(e[2]=f=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const RV=it(CV,[["render",$V]]),LV={name:"ListComposers",components:{ModalDialogComposer:Qp},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.selected_item=t,this.$router.push({name:"music-composer-albums",params:{name:t.name}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},DV={key:0,class:"py-5"},MV={class:"media-content"},FV=["id","textContent"],VV=["onClick"],HV={class:"media-content"},UV=["textContent"],jV={class:"media-right"},BV=["onClick"];function WV(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-composer");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M(pt,{key:l.itemId},[l.isItem?(O(),M("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[g("div",HV,[g("p",{class:"title is-6",textContent:$(l.item.name)},null,8,UV)]),g("div",jV,[g("a",{onClick:Oe(c=>r.open_dialog(l.item),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,BV)])],8,VV)):(O(),M("div",DV,[g("div",MV,[g("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:$(l.index)},null,8,FV)])]))],64))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const hh=it(LV,[["render",WV]]),py={load(t){return tt.library_composers("music")},set(t,e){t.composers=new Tt(e.data,{index:{field:"name_sort",type:String}})}},qV={name:"PageComposers",components:{ContentWithHeading:ie,IndexButtonList:Is,ListComposers:hh,TabsMusic:Ws},beforeRouteEnter(t,e,n){py.load(t).then(s=>{n(i=>py.set(i,s))})},data(){return{composers:new Tt}}},zV=["textContent"],GV=["textContent"];function KV(t,e,n,s,i,r){const o=x("tabs-music"),a=x("index-button-list"),l=x("list-composers"),c=x("content-with-heading");return O(),M("div",null,[C(o),C(c,null,{options:D(()=>[C(a,{indices:i.composers.indices},null,8,["indices"])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.composers.title"))},null,8,zV),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.composers",{count:i.composers.total}))},null,8,GV)]),content:D(()=>[C(l,{items:i.composers},null,8,["items"])]),_:1})])}const XV=it(qV,[["render",KV]]),YV={name:"ModalDialogDirectory",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item,expression:`path starts with "${this.item}" order by path asc`}}}};function ZV(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const pS=it(YV,[["render",ZV]]),JV={name:"ListDirectories",components:{ModalDialogDirectory:pS},props:{items:{required:!0,type:Array}},data(){return{selected_item:"",show_details_modal:!1}},computed:{directories(){var n;const t=[];let e="";return(n=this.$route.query)==null||n.directory.split("/").slice(1,-1).forEach((s,i)=>{e=`${e}/${s}`,t.push({index:i,name:s,path:e})}),t}},methods:{open(t){const e={name:"files"};t.index!==0&&(e.query={directory:t.path}),this.$router.push(e)},open_dialog(t){this.selected_item=t.path,this.show_details_modal=!0},open_parent(){this.open(this.directories.slice(-1).pop())}}},QV={key:0,class:"media is-align-items-center mb-0"},t7={class:"media-content"},e7={class:"breadcrumb"},n7=["onClick"],s7=["textContent"],i7={class:"media-right"},r7=["onClick"],o7={class:"media-content"},a7=["textContent"],l7={class:"media-right"},c7=["onClick"];function u7(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-directory");return O(),M(pt,null,[t.$route.query.directory?(O(),M("div",QV,[C(o,{class:"icon media-left is-clickable",name:"chevron-left",onClick:r.open_parent},null,8,["onClick"]),g("div",t7,[g("nav",e7,[g("ul",null,[(O(!0),M(pt,null,fe(r.directories,l=>(O(),M("li",{key:l.index},[g("a",{onClick:c=>r.open(l)},[g("span",{textContent:$(l.name)},null,8,s7)],8,n7)]))),128))])])]),g("div",i7,[ge(t.$slots,"actions")])])):vt("",!0),(O(!0),M(pt,null,fe(n.items,l=>(O(),M("div",{key:l.path,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l)},[C(o,{class:"media-left icon",name:"folder"}),g("div",o7,[g("p",{class:"title is-6",textContent:$(l.name)},null,8,a7)]),g("div",l7,[g("a",{onClick:Oe(c=>r.open_dialog(l),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,c7)])],8,r7))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const d7=it(JV,[["render",u7]]),f7={name:"ModalDialogPlaylist",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean,uris:{default:"",type:String}},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,uri:this.item.uri,uris:this.uris,properties:[{label:"property.tracks",value:this.item.item_count},{label:"property.type",value:this.$t(`playlist.type.${this.item.type}`)},{label:"property.path",value:this.item.path}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"playlist",params:{id:this.item.id}})}}};function h7(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const mS=it(f7,[["render",h7]]),p7={name:"ListPlaylists",components:{ModalDialogPlaylist:mS},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{icon(t){return t.type==="folder"?"folder":t.type==="rss"?"rss":"music-box-multiple"},open(t){t.type==="folder"?this.$router.push({name:"playlist-folder",params:{id:t.id}}):this.$router.push({name:"playlist",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},m7=["onClick"],g7={class:"media-content"},b7=["textContent"],y7={class:"media-right"},_7=["onClick"];function v7(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-playlist");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M("div",{key:l.itemId,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[C(o,{class:"media-left icon",name:r.icon(l.item)},null,8,["name"]),g("div",g7,[g("p",{class:"title is-6",textContent:$(l.item.name)},null,8,b7)]),g("div",y7,[g("a",{onClick:Oe(c=>r.open_dialog(l.item),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,_7)])],8,m7))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Xc=it(p7,[["render",v7]]),Ml={load(t){return t.query.directory?tt.library_files(t.query.directory):Promise.resolve()},set(t,e){e?t.directories=e.data.directories.map(n=>t.transform(n.path)):Cr().directories?t.directories=Cr().directories.map(n=>t.transform(n)):tt.config().then(n=>{t.directories=n.data.directories.map(s=>t.transform(s))}),t.playlists=new Tt(e==null?void 0:e.data.playlists),t.tracks=new Tt(e==null?void 0:e.data.tracks)}},S7={name:"PageFiles",components:{ContentWithHeading:ie,ControlButton:Je,ListDirectories:d7,ListPlaylists:Xc,ListTracks:Vn,ModalDialogDirectory:pS},beforeRouteEnter(t,e,n){Ml.load(t).then(s=>{n(i=>Ml.set(i,s))})},beforeRouteUpdate(t,e,n){Ml.load(t).then(s=>{Ml.set(this,s),n()})},setup(){return{configurationStore:Cr()}},data(){return{directories:[],playlists:new Tt,show_details_modal:!1,tracks:new Tt}},computed:{current(){var t;return((t=this.$route.query)==null?void 0:t.directory)||"/"},name(){var t;return this.current!=="/"?(t=this.current)==null?void 0:t.slice(this.current.lastIndexOf("/")+1):this.$t("page.files.title")},expression(){return`path starts with "${this.current}" order by path asc`}},methods:{play(){tt.player_play_expression(this.expression,!1)},showDetails(){this.show_details_modal=!0},transform(t){return{name:t.slice(t.lastIndexOf("/")+1),path:t}}}},E7=["textContent"],w7={class:"buttons is-centered"};function C7(t,e,n,s,i,r){const o=x("control-button"),a=x("list-directories"),l=x("list-playlists"),c=x("list-tracks"),u=x("modal-dialog-directory"),d=x("content-with-heading");return O(),M("div",null,[C(d,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(r.name)},null,8,E7)]),"heading-right":D(()=>[g("div",w7,[C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(o,{handler:r.play,icon:"play",label:"page.files.play"},null,8,["handler"])])]),content:D(()=>[C(a,{items:i.directories},null,8,["items"]),C(l,{items:i.playlists},null,8,["items"]),C(c,{expression:r.expression,items:i.tracks,show_icon:!0},null,8,["expression","items"]),C(u,{item:r.current,show:i.show_details_modal,onClose:e[0]||(e[0]=f=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const k7=it(S7,[["render",C7]]),my={load(t){return Promise.all([tt.library_genre(t.params.name,t.query.media_kind),tt.library_genre_albums(t.params.name,t.query.media_kind)])},set(t,e){t.genre=e[0].data.genres.items.shift(),t.albums=new Tt(e[1].data.albums,{index:{field:"name_sort",type:String}})}},T7={name:"PageGenreAlbums",components:{ContentWithHeading:ie,ControlButton:Je,IndexButtonList:Is,ListAlbums:qn,ModalDialogGenre:Jp},beforeRouteEnter(t,e,n){my.load(t).then(s=>{n(i=>my.set(i,s))})},data(){return{albums:new Tt,genre:{},media_kind:this.$route.query.media_kind,show_details_modal:!1}},methods:{open_tracks(){this.show_details_modal=!1,this.$router.push({name:"genre-tracks",params:{name:this.genre.name},query:{media_kind:this.media_kind}})},play(){tt.player_play_expression(`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`,!0)},showDetails(){this.show_details_modal=!0}}},x7=["textContent"],A7={class:"is-size-7 is-uppercase"},O7=["textContent"],I7=["textContent"],N7={class:"buttons is-centered"};function P7(t,e,n,s,i,r){const o=x("index-button-list"),a=x("control-button"),l=x("list-albums"),c=x("modal-dialog-genre"),u=x("content-with-heading");return O(),M("div",null,[C(u,null,{options:D(()=>[C(o,{indices:i.albums.indices},null,8,["indices"])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.genre.name)},null,8,x7),g("div",A7,[g("span",{textContent:$(t.$t("count.albums",{count:i.genre.album_count}))},null,8,O7),e[2]||(e[2]=g("span",null," | ",-1)),g("a",{onClick:e[0]||(e[0]=(...d)=>r.open_tracks&&r.open_tracks(...d)),textContent:$(t.$t("count.tracks",{count:i.genre.track_count}))},null,8,I7)])]),"heading-right":D(()=>[g("div",N7,[C(a,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(a,{handler:r.play,icon:"shuffle",label:"page.genre.shuffle"},null,8,["handler"])])]),content:D(()=>[C(l,{items:i.albums},null,8,["items"]),C(c,{item:i.genre,media_kind:i.media_kind,show:i.show_details_modal,onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]),_:1})])}const $7=it(T7,[["render",P7]]),gy={load(t){return Promise.all([tt.library_genre(t.params.name,t.query.media_kind),tt.library_genre_tracks(t.params.name,t.query.media_kind)])},set(t,e){t.genre=e[0].data.genres.items.shift(),t.tracks_list=new Tt(e[1].data.tracks)}},R7={name:"PageGenreTracks",components:{ContentWithHeading:ie,ControlButton:Je,ControlDropdown:Rr,IndexButtonList:Is,ListTracks:Vn,ModalDialogGenre:Jp},beforeRouteEnter(t,e,n){gy.load(t).then(s=>{n(i=>gy.set(i,s))})},setup(){return{uiStore:Hn()}},data(){return{genre:{},groupings:[{id:1,name:this.$t("page.genre.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.genre.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],media_kind:this.$route.query.media_kind,show_details_modal:!1,tracks_list:new Tt}},computed:{expression(){return`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.genre_tracks_sort);return this.tracks_list.group(t)}},methods:{open_genre(){this.show_details_modal=!1,this.$router.push({name:"genre-albums",params:{name:this.genre.name},query:{media_kind:this.media_kind}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}},L7={class:"columns"},D7={class:"column"},M7=["textContent"],F7=["textContent"],V7={class:"is-size-7 is-uppercase"},H7=["textContent"],U7=["textContent"],j7={class:"buttons is-centered"};function B7(t,e,n,s,i,r){const o=x("index-button-list"),a=x("control-dropdown"),l=x("control-button"),c=x("list-tracks"),u=x("modal-dialog-genre"),d=x("content-with-heading");return O(),M("div",null,[C(d,null,{options:D(()=>[C(o,{indices:r.tracks.indices},null,8,["indices"]),g("div",L7,[g("div",D7,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.genre.sort.title"))},null,8,M7),C(a,{value:s.uiStore.genre_tracks_sort,"onUpdate:value":e[0]||(e[0]=f=>s.uiStore.genre_tracks_sort=f),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.genre.name)},null,8,F7),g("div",V7,[g("a",{onClick:e[1]||(e[1]=(...f)=>r.open_genre&&r.open_genre(...f)),textContent:$(t.$t("count.albums",{count:i.genre.album_count}))},null,8,H7),e[3]||(e[3]=g("span",null," | ",-1)),g("span",{textContent:$(t.$t("count.tracks",{count:i.genre.track_count}))},null,8,U7)])]),"heading-right":D(()=>[g("div",j7,[C(l,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(l,{handler:r.play,icon:"shuffle",label:"page.genre.shuffle"},null,8,["handler"])])]),content:D(()=>[C(c,{items:r.tracks,expression:r.expression},null,8,["items","expression"]),C(u,{item:i.genre,media_kind:i.media_kind,show:i.show_details_modal,onClose:e[2]||(e[2]=f=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]),_:1})])}const W7=it(R7,[["render",B7]]),by={load(t){return tt.library_genres("music")},set(t,e){t.genres=new Tt(e.data.genres,{index:{field:"name_sort",type:String}})}},q7={name:"PageGenres",components:{ContentWithHeading:ie,IndexButtonList:Is,ListGenres:hS,TabsMusic:Ws},beforeRouteEnter(t,e,n){by.load(t).then(s=>{n(i=>by.set(i,s))})},data(){return{genres:new Tt}}},z7=["textContent"],G7=["textContent"];function K7(t,e,n,s,i,r){const o=x("tabs-music"),a=x("index-button-list"),l=x("list-genres"),c=x("content-with-heading");return O(),M("div",null,[C(o),C(c,null,{options:D(()=>[C(a,{indices:i.genres.indices},null,8,["indices"])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.genres.title"))},null,8,z7),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.genres",{count:i.genres.total}))},null,8,G7)]),content:D(()=>[C(l,{items:i.genres,media_kind:"music"},null,8,["items"])]),_:1})])}const X7=it(q7,[["render",K7]]),yy={load(t){return Promise.all([tt.search({expression:"time_added after 8 weeks ago and media_kind is music having track_count > 3 order by time_added desc",limit:3,type:"album"}),tt.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:3,type:"track"})])},set(t,e){t.albums=new Tt(e[0].data.albums),t.tracks=new Tt(e[1].data.tracks)}},Y7={name:"PageMusic",components:{ContentWithHeading:ie,ListAlbums:qn,ListTracks:Vn,TabsMusic:Ws},beforeRouteEnter(t,e,n){yy.load(t).then(s=>{n(i=>yy.set(i,s))})},data(){return{albums:[],tracks:{items:[]},selected_track:{}}}},Z7=["textContent"],J7={class:"level"},Q7={class:"level-item"},t9=["textContent"],e9={class:"level"},n9={class:"level-item"};function s9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-albums"),l=x("router-link"),c=x("content-with-heading"),u=x("list-tracks");return O(),M("div",null,[C(o),C(c,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.music.recently-added.title"))},null,8,Z7)]),content:D(()=>[C(a,{items:i.albums},null,8,["items"])]),footer:D(()=>[g("nav",J7,[g("p",Q7,[C(l,{class:"button is-small is-rounded",to:{name:"music-recently-added"}},{default:D(()=>[ws($(t.$t("page.music.show-more")),1)]),_:1})])])]),_:1}),C(c,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.music.recently-played.title"))},null,8,t9)]),content:D(()=>[C(u,{items:i.tracks},null,8,["items"])]),footer:D(()=>[g("nav",e9,[g("p",n9,[C(l,{class:"button is-small is-rounded",to:{name:"music-recently-played"}},{default:D(()=>[ws($(t.$t("page.music.show-more")),1)]),_:1})])])]),_:1})])}const i9=it(Y7,[["render",s9]]),_y={load(t){const e=gi().recently_added_limit;return tt.search({expression:"media_kind is music having track_count > 3 order by time_added desc",limit:e,type:"album"})},set(t,e){t.albums=new Tt(e.data.albums,{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}})}},r9={name:"PageMusicRecentlyAdded",components:{ContentWithHeading:ie,ListAlbums:qn,TabsMusic:Ws},beforeRouteEnter(t,e,n){_y.load(t).then(s=>{n(i=>_y.set(i,s))})},setup(){return{settingsStore:gi()}},data(){return{albums:new Tt}}},o9=["textContent"];function a9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-albums"),l=x("content-with-heading");return O(),M("div",null,[C(o),C(l,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.music.recently-added.title"))},null,8,o9)]),content:D(()=>[C(a,{items:i.albums},null,8,["items"])]),_:1})])}const l9=it(r9,[["render",a9]]),vy={load(t){return tt.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:50,type:"track"})},set(t,e){t.tracks=new Tt(e.data.tracks)}},c9={name:"PageMusicRecentlyPlayed",components:{ContentWithHeading:ie,ListTracks:Vn,TabsMusic:Ws},beforeRouteEnter(t,e,n){vy.load(t).then(s=>{n(i=>vy.set(i,s))})},data(){return{tracks:{}}}},u9=["textContent"];function d9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-tracks"),l=x("content-with-heading");return O(),M("div",null,[C(o),C(l,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.music.recently-played.title"))},null,8,u9)]),content:D(()=>[C(a,{items:i.tracks},null,8,["items"])]),_:1})])}const f9=it(c9,[["render",d9]]),h9={name:"ModalDialogPlaylistSpotify",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,handler:this.open,uri:this.item.uri,properties:[{label:"property.owner",value:(t=this.item.owner)==null?void 0:t.display_name},{label:"property.tracks",value:(e=this.item.tracks)==null?void 0:e.total},{label:"property.path",value:this.item.uri}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"playlist-spotify",params:{id:this.item.id}})}}};function p9(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const gS=it(h9,[["render",p9]]),m9={name:"ListPlaylistsSpotify",components:{ModalDialogPlaylistSpotify:gS},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"playlist-spotify",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},g9=["onClick"],b9={class:"media-content"},y9=["textContent"],_9=["textContent"],v9={class:"media-right"},S9=["onClick"];function E9(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-playlist-spotify");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M("div",{key:l.id,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l)},[g("div",b9,[g("div",{class:"is-size-6 has-text-weight-bold",textContent:$(l.name)},null,8,y9),g("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:$(l.owner.display_name)},null,8,_9)]),g("div",v9,[g("a",{onClick:Oe(c=>r.open_dialog(l),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,S9)])],8,g9))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Yc=it(m9,[["render",E9]]),Sy={load(t){return tt.spotify().then(({data:e})=>{const n=new Bs;return n.setAccessToken(e.webapi_token),Promise.all([n.getNewReleases({country:e.webapi_country,limit:3}),n.getFeaturedPlaylists({country:e.webapi_country,limit:3})])})},set(t,e){t.albums=e[0].albums.items,t.playlists=e[1].playlists.items}},w9={name:"PageMusicSpotify",components:{ContentWithHeading:ie,ListAlbumsSpotify:Wa,ListPlaylistsSpotify:Yc,TabsMusic:Ws},beforeRouteEnter(t,e,n){Sy.load(t).then(s=>{n(i=>Sy.set(i,s))})},data(){return{playlists:[],albums:[]}}},C9=["textContent"],k9={class:"level"},T9={class:"level-item"},x9=["textContent"],A9={class:"level"},O9={class:"level-item"};function I9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-albums-spotify"),l=x("router-link"),c=x("content-with-heading"),u=x("list-playlists-spotify");return O(),M("div",null,[C(o),C(c,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.spotify.music.new-releases"))},null,8,C9)]),content:D(()=>[C(a,{items:i.albums},null,8,["items"])]),footer:D(()=>[g("nav",k9,[g("p",T9,[C(l,{to:{name:"music-spotify-new-releases"},class:"button is-small is-rounded"},{default:D(()=>[ws($(t.$t("page.spotify.music.show-more")),1)]),_:1})])])]),_:1}),C(c,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.spotify.music.featured-playlists"))},null,8,x9)]),content:D(()=>[C(u,{items:i.playlists},null,8,["items"])]),footer:D(()=>[g("nav",A9,[g("p",O9,[C(l,{to:{name:"music-spotify-featured-playlists"},class:"button is-small is-rounded"},{default:D(()=>[ws($(t.$t("page.spotify.music.show-more")),1)]),_:1})])])]),_:1})])}const N9=it(w9,[["render",I9]]),Ey={load(t){return tt.spotify().then(({data:e})=>{const n=new Bs;return n.setAccessToken(e.webapi_token),n.getFeaturedPlaylists({country:e.webapi_country,limit:50})})},set(t,e){t.playlists=e.playlists.items}},P9={name:"PageMusicSpotifyFeaturedPlaylists",components:{ContentWithHeading:ie,ListPlaylistsSpotify:Yc,TabsMusic:Ws},beforeRouteEnter(t,e,n){Ey.load(t).then(s=>{n(i=>Ey.set(i,s))})},data(){return{playlists:[]}}},$9=["textContent"];function R9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-playlists-spotify"),l=x("content-with-heading");return O(),M("div",null,[C(o),C(l,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.spotify.music.featured-playlists"))},null,8,$9)]),content:D(()=>[C(a,{items:i.playlists},null,8,["items"])]),_:1})])}const L9=it(P9,[["render",R9]]),wy={load(t){return tt.spotify().then(({data:e})=>{const n=new Bs;return n.setAccessToken(e.webapi_token),n.getNewReleases({country:e.webapi_country,limit:50})})},set(t,e){t.albums=e.albums.items}},D9={name:"PageMusicSpotifyNewReleases",components:{ContentWithHeading:ie,ListAlbumsSpotify:Wa,TabsMusic:Ws},beforeRouteEnter(t,e,n){wy.load(t).then(s=>{n(i=>wy.set(i,s))})},data(){return{albums:[]}}},M9=["textContent"];function F9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-albums-spotify"),l=x("content-with-heading");return O(),M("div",null,[C(o),C(l,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.spotify.music.new-releases"))},null,8,M9)]),content:D(()=>[C(a,{items:i.albums},null,8,["items"])]),_:1})])}const V9=it(D9,[["render",F9]]),H9={name:"LyricsPane",setup(){return{lyricsStore:Mu(),playerStore:Zn()}},data(){return this.lastIndex=-1,this.scrollingTimer=null,this.lastItemId=-1,{autoScrolling:!0}},computed:{is_playing(){return this.playerStore.state==="play"},lyrics(){const t=this.lyricsStore.content,e=[];if(t.length>0){const n=/\[(?\d+):(?\d+)(?:\.(?\d+))?\] ?(?.*)/u;t.split(` + `;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(n)}`},wM={name:"ControlImage",props:{album:{default:"",type:String},artist:{default:"",type:String},url:{default:"",type:String}},emits:["click"],data(){return{font:{family:"sans-serif",weight:"bold"},lifecycle:{error:t=>{t.src=this.dataURI()}},size:600}},methods:{dataURI(){return EM({alternate:`${this.artist} - ${this.album}`,caption:(this.album||this.artist||"").substring(0,2),font:this.font,size:this.size})}}},CM={class:"figure has-shadow"};function kM(t,e,n,s,i,r){const o=Vh("lazy");return O(),M("figure",CM,[An(g("img",{onClick:e[0]||(e[0]=a=>t.$emit("click"))},null,512),[[o,{src:n.url,lifecycle:i.lifecycle}]])])}const Qi=it(wM,[["render",kM],["__scopeId","data-v-92383b31"]]),{t:Dl,locale:TM}=Ru.global,cS="NO_INDEX",xM=(t,e)=>t-e,AM=(t,e)=>t.localeCompare(e,TM.value),OM=(t,e)=>new Date(t)-new Date(e)||(t?e?0:1:-1),IM=t=>t.map(({field:e,type:n,order:s=1})=>{switch(n){case String:return(i,r)=>AM(i[e],r[e])*s;case Number:return(i,r)=>xM(i[e],r[e])*s;case Date:return(i,r)=>OM(i[e],r[e])*s;default:return()=>0}}),NM=(t="")=>{const e=t.charAt(0);return e.match(new RegExp("\\p{Letter}","gu"))?e.toUpperCase():e.match(new RegExp("\\p{Number}","gu"))?"#":"⌘"},PM=t=>{},$M=[{difference:NaN,text:()=>Dl("grouped-list.undefined")},{difference:864e5,text:()=>Dl("grouped-list.today")},{difference:6048e5,text:()=>Dl("grouped-list.last-week")},{difference:2592e6,text:()=>Dl("grouped-list.last-month")},{difference:1/0,text:t=>t.getFullYear()}],RM=t=>{var s;const e=new Date(t),n=new Date-e;return(s=$M.find(i=>isNaN(n)||n{switch(e){case String:return n=>NM(n[t]);case Number:return n=>n[t];case Date:return n=>RM(n[t]);case"Digits":return n=>PM(n[t]);default:return()=>cS}};class Tt{constructor({items:e=[],total:n=0,offset:s=0,limit:i=-1}={},r={}){this.items=e,this.total=n,this.offset=s,this.limit=i,this.count=e.length,this.indices=[],this.group(r)}group({criteria:e=[],filters:n=[],index:s}={}){const i=this.items.filter(l=>n.every(c=>c(l)));this.count=i.length;const r=IM(e),o=i.sort((l,c)=>r.reduce((u,d)=>u||d(l,c),0)),a=LM(s);return this.itemsGrouped=o.reduce((l,c)=>{const u=a(c);return l.set(u,[...l.get(u)||[],c]),l},new Map),this.indices=Array.from(this.itemsGrouped.keys()),this}*generate(){for(const[e,n]of this.itemsGrouped.entries()){e!==cS&&(yield{index:e,isItem:!1,item:{},itemId:e});for(const s of n)yield{index:e,isItem:!0,item:s,itemId:s.id}}}[Symbol.iterator](){return this.generate()}}const DM={name:"ListProperties",components:{ControlImage:Qi},props:{item:{required:!0,type:Object}}},MM={class:"title is-4"},FM=["textContent"],VM=["textContent"],HM=["textContent"],UM={class:"title is-6"},jM=["onClick","textContent"],BM=["textContent"];function WM(t,e,n,s,i,r){var a;const o=x("control-image");return O(),M(pt,null,[g("div",MM,[n.item.handler?(O(),M("a",{key:0,onClick:e[0]||(e[0]=(...l)=>n.item.handler&&n.item.handler(...l)),textContent:$(n.item.name)},null,8,FM)):(O(),M("span",{key:1,textContent:$(n.item.name)},null,8,VM))]),n.item.image?(O(),_t(o,{key:0,url:n.item.image,artist:n.item.artist,album:n.item.name,class:"is-normal mb-5"},null,8,["url","artist","album"])):vt("",!0),t.$slots.buttons?ge(t.$slots,"buttons",{key:1}):vt("",!0),(O(!0),M(pt,null,fe((a=n.item.properties)==null?void 0:a.filter(l=>l.value),l=>(O(),M("div",{key:l.label,class:"mb-3"},[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t(l.label))},null,8,HM),g("div",UM,[l.handler?(O(),M("a",{key:0,onClick:l.handler,textContent:$(l.value)},null,8,jM)):(O(),M("span",{key:1,class:"title is-6",textContent:$(l.value)},null,8,BM))])]))),128))],64)}const uS=it(DM,[["render",WM]]),qM={name:"ModalDialogPlayable",components:{ControlButton:Je,ListProperties:uS,ModalDialog:mi},props:{buttons:{default:()=>[],type:Array},item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{actions(){return[{label:this.$t("dialog.playable.add"),handler:this.queue_add,icon:"playlist-plus"},{label:this.$t("dialog.playable.add-next"),handler:this.queue_add_next,icon:"playlist-play"},{label:this.$t("dialog.playable.play"),handler:this.play,icon:"play"}]}},methods:{play(){this.$emit("close"),this.item.expression?tt.player_play_expression(this.item.expression,!1):tt.player_play_uri(this.item.uris||this.item.uri,!1)},queue_add(){this.$emit("close"),this.item.expression?tt.queue_expression_add(this.item.expression):tt.queue_add(this.item.uris||this.item.uri)},queue_add_next(){this.$emit("close"),this.item.expression?tt.queue_expression_add_next(this.item.expression):tt.queue_add_next(this.item.uris||this.item.uri)}}},zM={class:"buttons"};function GM(t,e,n,s,i,r){const o=x("control-button"),a=x("list-properties"),l=x("modal-dialog");return O(),_t(l,{actions:r.actions,show:n.show,onClose:e[0]||(e[0]=c=>t.$emit("close"))},{content:D(()=>[C(a,{item:n.item},Ya({_:2},[n.buttons.length?{name:"buttons",fn:D(()=>[g("div",zM,[(O(!0),M(pt,null,fe(n.buttons,c=>(O(),_t(o,{key:c.label,handler:c.handler,label:"button.label"},null,8,["handler"]))),128))])]),key:"0"}:void 0]),1032,["item"])]),_:1},8,["actions","show"])}const Os=it(qM,[["render",GM]]),KM={name:"ModalDialogTrack",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close","play-count-changed"],computed:{buttons(){return this.item.media_kind!=="podcast"?[]:this.item.play_count>0?[{label:"dialog.track.mark-as-new",handler:this.mark_new}]:[{label:"dialog.track.mark-as-played",handler:this.mark_played}]},playable(){return{name:this.item.title,uri:this.item.uri,properties:[{label:"property.album",value:this.item.album,handler:this.open_album},{label:"property.album-artist",value:this.item.album_artist,handler:this.open_artist},{label:"property.composer",value:this.item.composer},{label:"property.release-date",value:this.$filters.toDate(this.item.date_released)},{label:"property.year",value:this.item.year},{label:"property.genre",value:this.item.genre},{label:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{label:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)},{label:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{label:"property.quality",value:this.item.data_kind!=="spotify"&&this.$t("dialog.track.quality-value",{format:this.item.type,bitrate:this.item.bitrate,channels:this.$t("count.channels",this.item.channels),samplerate:this.item.samplerate})},{label:"property.added-on",value:this.$filters.toDateTime(this.item.time_added)},{label:"property.rating",value:this.$t("dialog.track.rating-value",{rating:Math.floor(this.item.rating/10)})},{label:"property.comment",value:this.item.comment},{label:"property.path",value:this.item.path}]}}},methods:{mark_new(){tt.library_track_update(this.item.id,{play_count:"reset"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},mark_played(){tt.library_track_update(this.item.id,{play_count:"increment"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},open_album(){this.$emit("close"),this.item.media_kind==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.album_id}}):this.item.media_kind==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:this.item.album_id}}):this.item.media_kind==="music"&&this.$router.push({name:"music-album",params:{id:this.item.album_id}})},open_artist(){this.$emit("close"),this.item.media_kind==="music"||this.item.media_kind==="podcast"?this.$router.push({name:"music-artist",params:{id:this.item.album_artist_id}}):this.item.media_kind==="audiobook"&&this.$router.push({name:"audiobooks-artist",params:{id:this.item.album_artist_id}})},open_genre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{media_kind:this.item.media_kind}})}}};function XM(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["buttons","item","show"])}const YM=it(KM,[["render",XM]]),ZM={name:"ListTracks",components:{ModalDialogTrack:YM},props:{expression:{default:"",type:String},items:{required:!0,type:Object},show_icon:Boolean,show_progress:Boolean,uris:{default:"",type:String}},emits:["play-count-changed"],data(){return{selected_item:{},show_details_modal:!1}},methods:{open_dialog(t){this.selected_item=t,this.show_details_modal=!0},play(t){this.uris?tt.player_play_uri(this.uris,!1,this.items.items.indexOf(t)):this.expression?tt.player_play_expression(this.expression,!1,this.items.items.indexOf(t)):tt.player_play_uri(t.uri,!1)}}},JM={key:0,class:"py-5"},QM=["id","textContent"],t8=["onClick"],e8={class:"media-content"},n8=["textContent"],s8=["textContent"],i8=["textContent"],r8=["max","value"],o8={class:"media-right"},a8=["onClick"];function l8(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-track");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M(pt,{key:l.itemId},[l.isItem?(O(),M("div",{key:1,class:Vt(["media is-align-items-center is-clickable mb-0",{"with-progress":n.show_progress}]),onClick:c=>r.play(l.item)},[n.show_icon?(O(),_t(o,{key:0,class:"media-left icon",name:"file-music-outline"})):vt("",!0),g("div",e8,[g("div",{class:Vt(["is-size-6 has-text-weight-bold",{"has-text-grey":l.item.media_kind==="podcast"&&l.item.play_count>0}]),textContent:$(l.item.title)},null,10,n8),g("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:$(l.item.artist)},null,8,s8),g("div",{class:"is-size-7 has-text-grey",textContent:$(l.item.album)},null,8,i8),n.show_progress&&l.item.seek_ms>0?(O(),M("progress",{key:0,class:"progress is-dark",max:l.item.length_ms,value:l.item.seek_ms},null,8,r8)):vt("",!0)]),g("div",o8,[g("a",{onClick:Oe(c=>r.open_dialog(l.item),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,a8)])],10,t8)):(O(),M("div",JM,[g("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:$(l.index)},null,8,QM)]))],64))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1),onPlayCountChanged:e[1]||(e[1]=l=>t.$emit("play-count-changed"))},null,8,["item","show"])]))],64)}const Vn=it(ZM,[["render",l8],["__scopeId","data-v-44ebdd0b"]]),c8={name:"ModalDialogAlbum",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},media_kind:{default:"",type:String},show:Boolean},emits:["close","remove-podcast","play-count-changed"],computed:{buttons(){return this.media_kind_resolved==="podcast"?this.item.data_kind==="url"?[{label:"dialog.album.mark-as-played",handler:this.mark_played},{label:"dialog.album.remove-podcast",handler:this.remove_podcast}]:[{label:"dialog.album.mark-as-played",handler:this.mark_played}]:[]},media_kind_resolved(){return this.media_kind||this.item.media_kind},playable(){return{name:this.item.name,handler:this.open,image:this.item.artwork_url,uri:this.item.uri,properties:[{label:"property.artist",value:this.item.artist,handler:this.open_artist},{label:"property.release-date",value:this.$filters.toDate(this.item.date_released)},{label:"property.year",value:this.item.year},{label:"property.tracks",value:this.item.track_count},{label:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)},{label:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{label:"property.added-on",value:this.$filters.toDateTime(this.item.time_added)}]}}},methods:{mark_played(){tt.library_album_track_update(this.item.id,{play_count:"played"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},open(){this.$emit("close"),this.media_kind_resolved==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.id}}):this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:this.item.id}}):this.$router.push({name:"music-album",params:{id:this.item.id}})},open_artist(){this.$emit("close"),this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-artist",params:{id:this.item.artist_id}}):this.$router.push({name:"music-artist",params:{id:this.item.artist_id}})},remove_podcast(){this.$emit("remove-podcast")}}};function u8(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["buttons","item","show"])}const ud=it(c8,[["render",u8]]),Qb={load(t){return Promise.all([tt.library_album(t.params.id),tt.library_album_tracks(t.params.id)])},set(t,e){t.album=e[0].data,t.tracks=new Tt(e[1].data,{criteria:[{field:"disc_number",type:Number}],index:{field:"disc_number",type:Number}}),t.tracks.indices.length<2&&t.tracks.group()}},d8={name:"PageAlbum",components:{ContentWithHero:cd,ControlButton:Je,ControlImage:Qi,ListTracks:Vn,ModalDialogAlbum:ud},beforeRouteEnter(t,e,n){Qb.load(t).then(s=>{n(i=>Qb.set(i,s))})},data(){return{album:{},show_details_modal:!1,tracks:new Tt}},methods:{open_artist(){this.show_details_modal=!1,this.$router.push({name:"music-artist",params:{id:this.album.artist_id}})},play(){tt.player_play_uri(this.album.uri,!0)},showDetails(){this.show_details_modal=!0}}},f8=["textContent"],h8={class:"subtitle is-6"},p8=["textContent"],m8=["textContent"],g8={class:"buttons is-centered-mobile mt-5"};function b8(t,e,n,s,i,r){const o=x("control-button"),a=x("control-image"),l=x("list-tracks"),c=x("modal-dialog-album"),u=x("content-with-hero");return O(),M("div",null,[C(u,null,{"heading-left":D(()=>[g("div",{class:"title is-5",textContent:$(i.album.name)},null,8,f8),g("div",h8,[g("a",{onClick:e[0]||(e[0]=(...d)=>r.open_artist&&r.open_artist(...d)),textContent:$(i.album.artist)},null,8,p8)]),g("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:$(t.$t("count.tracks",{count:i.album.track_count}))},null,8,m8),g("div",g8,[C(o,{handler:r.play,icon:"shuffle",label:"page.album.shuffle"},null,8,["handler"]),C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"])])]),"heading-right":D(()=>[C(a,{url:i.album.artwork_url,artist:i.album.artist,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]),content:D(()=>[C(l,{items:i.tracks,uris:i.album.uri},null,8,["items","uris"]),C(c,{item:i.album,show:i.show_details_modal,onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const y8=it(d8,[["render",b8]]),_8={name:"ModalDialogTrackSpotify",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t;return this.item.artists?{name:this.item.name,uri:this.item.uri,properties:[{label:"property.album",value:this.item.album.name,handler:this.open_album},{label:"property.album-artist",value:(t=this.item.artists[0])==null?void 0:t.name,handler:this.open_artist},{label:"property.release-date",value:this.$filters.toDate(this.item.album.release_date)},{label:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{label:"property.duration",value:this.$filters.toTimecode(this.item.duration_ms)},{label:"property.path",value:this.item.uri}]}:{}}},methods:{open_album(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.album.id}})},open_artist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function v8(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const S8=it(_8,[["render",v8]]),E8={name:"ListTracksSpotify",components:{ModalDialogTrackSpotify:S8},props:{context_uri:{default:"",type:String},items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open_dialog(t){this.selected_item=t,this.show_details_modal=!0},play(t){t.is_playable&&tt.player_play_uri(this.context_uri||t.uri,!1,t.position||0)}}},w8=["onClick"],C8=["textContent"],k8=["textContent"],T8=["textContent"],x8={key:0,class:"is-size-7 has-text-grey"},A8=["textContent"],O8=["textContent"],I8={class:"media-right"},N8=["onClick"];function P8(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-track-spotify");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>{var c;return O(),M("div",{key:l.id,class:"media is-align-items-center mb-0"},[g("div",{class:Vt(["media-content",{"is-clickable":l.is_playable,"is-not-allowed":!l.is_playable}]),onClick:u=>r.play(l)},[g("div",{class:Vt(["is-size-6 has-text-weight-bold",{"has-text-grey-light":!l.is_playable}]),textContent:$(l.name)},null,10,C8),g("div",{class:Vt(["is-size-7 has-text-weight-bold",{"has-text-grey":l.is_playable,"has-text-grey-light":!l.is_playable}]),textContent:$(l.artists[0].name)},null,10,k8),g("div",{class:"is-size-7 has-text-grey",textContent:$(l.album.name)},null,8,T8),l.is_playable?vt("",!0):(O(),M("div",x8,[e[1]||(e[1]=ws(" (")),g("span",{textContent:$(t.$t("list.spotify.not-playable-track"))},null,8,A8),(c=l.restrictions)!=null&&c.reason?(O(),M("span",{key:0,textContent:$(t.$t("list.spotify.restriction-reason",{reason:l.restrictions.reason}))},null,8,O8)):vt("",!0),e[2]||(e[2]=ws(") "))]))],10,w8),g("div",I8,[g("a",{onClick:Oe(u=>r.open_dialog(l),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,N8)])])}),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Gc=it(E8,[["render",P8],["__scopeId","data-v-f2f903a5"]]),$8={name:"ModalDialogAlbumSpotify",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e,n,s,i,r;return{name:this.item.name||"",image:((n=(e=(t=this.item)==null?void 0:t.images)==null?void 0:e[0])==null?void 0:n.url)||"",handler:this.open,uri:this.item.uri,properties:[{label:"property.artist",value:(r=(i=(s=this.item)==null?void 0:s.artists)==null?void 0:i[0])==null?void 0:r.name,handler:this.open_artist},{label:"property.release-date",value:this.$filters.toDate(this.item.release_date)},{label:"property.type",value:this.item.album_type}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.id}})},open_artist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function R8(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const dS=it($8,[["render",R8]]);var Zd={exports:{}},ty;function L8(){return ty||(ty=1,function(t){var e=function(){var n="https://api.spotify.com/v1",s=null,i=null,r=function(f,h){return f.abort=h,f},o=function(f,h){var p;if(i!==null){var m=i.defer();f(function(_){m.resolve(_)},function(_){m.reject(_)}),p=m.promise}else window.Promise&&(p=new window.Promise(f));return p?new r(p,h):null},a=function(){var f=Array.prototype.slice.call(arguments),h=f[0],p=f.slice(1);return h=h||{},p.forEach(function(m){for(var _ in m)m.hasOwnProperty(_)&&(h[_]=m[_])}),h},l=function(f,h){var p="";for(var m in h)if(h.hasOwnProperty(m)){var _=h[m];p+=encodeURIComponent(m)+"="+encodeURIComponent(_)+"&"}return p.length>0&&(p=p.substring(0,p.length-1),f=f+"?"+p),f},c=function(f,h){var p=new XMLHttpRequest,m=function(_,y){function S(w){_&&_(w),h&&h(null,w)}function b(){y&&y(p),h&&h(p,null)}var v=f.type||"GET";if(p.open(v,l(f.url,f.params)),s&&p.setRequestHeader("Authorization","Bearer "+s),p.onreadystatechange=function(){if(p.readyState===4){var w=null;try{w=p.responseText?JSON.parse(p.responseText):""}catch(N){console.error(N)}p.status>=200&&p.status<300?S(w):b()}},v==="GET")p.send(null);else{var E=null;f.postData&&(f.contentType==="image/jpeg"?(E=f.postData,p.setRequestHeader("Content-Type",f.contentType)):(E=JSON.stringify(f.postData),p.setRequestHeader("Content-Type","application/json"))),p.send(E)}};return h?(m(),null):o(m,function(){p.abort()})},u=function(f,h,p,m){var _={},y=null;typeof h=="object"?(_=h,y=p):typeof h=="function"&&(y=h);var S=f.type||"GET";return S!=="GET"&&f.postData&&!m?f.postData=a(f.postData,_):f.params=a(f.params,_),c(f,y)},d=function(){};return d.prototype={constructor:e},d.prototype.getGeneric=function(f,h){var p={url:f};return u(p,h)},d.prototype.getMe=function(f,h){var p={url:n+"/me"};return u(p,f,h)},d.prototype.getMySavedTracks=function(f,h){var p={url:n+"/me/tracks"};return u(p,f,h)},d.prototype.addToMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedAlbums=function(f,h){var p={url:n+"/me/albums"};return u(p,f,h)},d.prototype.addToMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMyTopArtists=function(f,h){var p={url:n+"/me/top/artists"};return u(p,f,h)},d.prototype.getMyTopTracks=function(f,h){var p={url:n+"/me/top/tracks"};return u(p,f,h)},d.prototype.getMyRecentlyPlayedTracks=function(f,h){var p={url:n+"/me/player/recently-played"};return u(p,f,h)},d.prototype.followUsers=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.followArtists=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.followPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers",type:"PUT",postData:{}};return u(m,h,p)},d.prototype.unfollowUsers=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.unfollowArtists=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.unfollowPlaylist=function(f,h){var p={url:n+"/playlists/"+f+"/followers",type:"DELETE"};return u(p,h)},d.prototype.isFollowingUsers=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.isFollowingArtists=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.areFollowingPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers/contains",type:"GET",params:{ids:h.join(",")}};return u(m,p)},d.prototype.getFollowedArtists=function(f,h){var p={url:n+"/me/following",type:"GET",params:{type:"artist"}};return u(p,f,h)},d.prototype.getUser=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)};return u(m,h,p)},d.prototype.getUserPlaylists=function(f,h,p){var m;return typeof f=="string"?m={url:n+"/users/"+encodeURIComponent(f)+"/playlists"}:(m={url:n+"/me/playlists"},p=h,h=f),u(m,h,p)},d.prototype.getPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f};return u(m,h,p)},d.prototype.getPlaylistTracks=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks"};return u(m,h,p)},d.prototype.getPlaylistCoverImage=function(f,h){var p={url:n+"/playlists/"+f+"/images"};return u(p,h)},d.prototype.createPlaylist=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)+"/playlists",type:"POST",postData:h};return u(m,h,p)},d.prototype.changePlaylistDetails=function(f,h,p){var m={url:n+"/playlists/"+f,type:"PUT",postData:h};return u(m,h,p)},d.prototype.addTracksToPlaylist=function(f,h,p,m){var _={url:n+"/playlists/"+f+"/tracks",type:"POST",postData:{uris:h}};return u(_,p,m,!0)},d.prototype.replaceTracksInPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{uris:h}};return u(m,{},p)},d.prototype.reorderTracksInPlaylist=function(f,h,p,m,_){var y={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{range_start:h,insert_before:p}};return u(y,m,_)},d.prototype.removeTracksFromPlaylist=function(f,h,p){var m=h.map(function(y){return typeof y=="string"?{uri:y}:y}),_={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:m}};return u(_,{},p)},d.prototype.removeTracksFromPlaylistWithSnapshotId=function(f,h,p,m){var _=h.map(function(S){return typeof S=="string"?{uri:S}:S}),y={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:_,snapshot_id:p}};return u(y,{},m)},d.prototype.removeTracksFromPlaylistInPositions=function(f,h,p,m){var _={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{positions:h,snapshot_id:p}};return u(_,{},m)},d.prototype.uploadCustomPlaylistCoverImage=function(f,h,p){var m={url:n+"/playlists/"+f+"/images",type:"PUT",postData:h.replace(/^data:image\/jpeg;base64,/,""),contentType:"image/jpeg"};return u(m,{},p)},d.prototype.getAlbum=function(f,h,p){var m={url:n+"/albums/"+f};return u(m,h,p)},d.prototype.getAlbumTracks=function(f,h,p){var m={url:n+"/albums/"+f+"/tracks"};return u(m,h,p)},d.prototype.getAlbums=function(f,h,p){var m={url:n+"/albums/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getTrack=function(f,h,p){var m={};return m.url=n+"/tracks/"+f,u(m,h,p)},d.prototype.getTracks=function(f,h,p){var m={url:n+"/tracks/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtist=function(f,h,p){var m={url:n+"/artists/"+f};return u(m,h,p)},d.prototype.getArtists=function(f,h,p){var m={url:n+"/artists/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtistAlbums=function(f,h,p){var m={url:n+"/artists/"+f+"/albums"};return u(m,h,p)},d.prototype.getArtistTopTracks=function(f,h,p,m){var _={url:n+"/artists/"+f+"/top-tracks",params:{country:h}};return u(_,p,m)},d.prototype.getArtistRelatedArtists=function(f,h,p){var m={url:n+"/artists/"+f+"/related-artists"};return u(m,h,p)},d.prototype.getFeaturedPlaylists=function(f,h){var p={url:n+"/browse/featured-playlists"};return u(p,f,h)},d.prototype.getNewReleases=function(f,h){var p={url:n+"/browse/new-releases"};return u(p,f,h)},d.prototype.getCategories=function(f,h){var p={url:n+"/browse/categories"};return u(p,f,h)},d.prototype.getCategory=function(f,h,p){var m={url:n+"/browse/categories/"+f};return u(m,h,p)},d.prototype.getCategoryPlaylists=function(f,h,p){var m={url:n+"/browse/categories/"+f+"/playlists"};return u(m,h,p)},d.prototype.search=function(f,h,p,m){var _={url:n+"/search/",params:{q:f,type:h.join(",")}};return u(_,p,m)},d.prototype.searchAlbums=function(f,h,p){return this.search(f,["album"],h,p)},d.prototype.searchArtists=function(f,h,p){return this.search(f,["artist"],h,p)},d.prototype.searchTracks=function(f,h,p){return this.search(f,["track"],h,p)},d.prototype.searchPlaylists=function(f,h,p){return this.search(f,["playlist"],h,p)},d.prototype.searchShows=function(f,h,p){return this.search(f,["show"],h,p)},d.prototype.searchEpisodes=function(f,h,p){return this.search(f,["episode"],h,p)},d.prototype.getAudioFeaturesForTrack=function(f,h){var p={};return p.url=n+"/audio-features/"+f,u(p,{},h)},d.prototype.getAudioFeaturesForTracks=function(f,h){var p={url:n+"/audio-features",params:{ids:f}};return u(p,{},h)},d.prototype.getAudioAnalysisForTrack=function(f,h){var p={};return p.url=n+"/audio-analysis/"+f,u(p,{},h)},d.prototype.getRecommendations=function(f,h){var p={url:n+"/recommendations"};return u(p,f,h)},d.prototype.getAvailableGenreSeeds=function(f){var h={url:n+"/recommendations/available-genre-seeds"};return u(h,{},f)},d.prototype.getMyDevices=function(f){var h={url:n+"/me/player/devices"};return u(h,{},f)},d.prototype.getMyCurrentPlaybackState=function(f,h){var p={url:n+"/me/player"};return u(p,f,h)},d.prototype.getMyCurrentPlayingTrack=function(f,h){var p={url:n+"/me/player/currently-playing"};return u(p,f,h)},d.prototype.transferMyPlayback=function(f,h,p){var m=h||{};m.device_ids=f;var _={type:"PUT",url:n+"/me/player",postData:m};return u(_,h,p)},d.prototype.play=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={};["context_uri","uris","offset","position_ms"].forEach(function(S){S in f&&(m[S]=f[S])});var _={type:"PUT",url:n+"/me/player/play",params:p,postData:m},y=typeof f=="function"?f:{};return u(_,y,h)},d.prototype.queue=function(f,h,p){h=h||{};var m="device_id"in h?{uri:f,device_id:h.device_id}:{uri:f},_={type:"POST",url:n+"/me/player/queue",params:m};return u(_,h,p)},d.prototype.pause=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"PUT",url:n+"/me/player/pause",params:p};return u(m,f,h)},d.prototype.skipToNext=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/next",params:p};return u(m,f,h)},d.prototype.skipToPrevious=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/previous",params:p};return u(m,f,h)},d.prototype.seek=function(f,h,p){h=h||{};var m={position_ms:f};"device_id"in h&&(m.device_id=h.device_id);var _={type:"PUT",url:n+"/me/player/seek",params:m};return u(_,h,p)},d.prototype.setRepeat=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var _={type:"PUT",url:n+"/me/player/repeat",params:m};return u(_,h,p)},d.prototype.setVolume=function(f,h,p){h=h||{};var m={volume_percent:f};"device_id"in h&&(m.device_id=h.device_id);var _={type:"PUT",url:n+"/me/player/volume",params:m};return u(_,h,p)},d.prototype.setShuffle=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var _={type:"PUT",url:n+"/me/player/shuffle",params:m};return u(_,h,p)},d.prototype.getShow=function(f,h,p){var m={};return m.url=n+"/shows/"+f,u(m,h,p)},d.prototype.getShows=function(f,h,p){var m={url:n+"/shows/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedShows=function(f,h){var p={url:n+"/me/shows"};return u(p,f,h)},d.prototype.addToMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedShows=function(f,h,p){var m={url:n+"/me/shows/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getShowEpisodes=function(f,h,p){var m={url:n+"/shows/"+f+"/episodes"};return u(m,h,p)},d.prototype.getEpisode=function(f,h,p){var m={};return m.url=n+"/episodes/"+f,u(m,h,p)},d.prototype.getEpisodes=function(f,h,p){var m={url:n+"/episodes/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getAccessToken=function(){return s},d.prototype.setAccessToken=function(f){s=f},d.prototype.setPromiseImplementation=function(f){var h=!1;try{var p=new f(function(m){m()});typeof p.then=="function"&&typeof p.catch=="function"&&(h=!0)}catch(m){console.error(m)}if(h)i=f;else throw new Error("Unsupported implementation of Promises/A+")},d}();t.exports=e}(Zd)),Zd.exports}var D8=L8();const Bs=Fu(D8),ey={load(t){const e=new Bs;return e.setAccessToken(Ue().spotify.webapi_token),e.getAlbum(t.params.id,{market:Ue().spotify.webapi_country})},set(t,e){t.album=e}},M8={name:"PageAlbumSpotify",components:{ContentWithHero:cd,ControlButton:Je,ControlImage:Qi,ListTracksSpotify:Gc,ModalDialogAlbumSpotify:dS},beforeRouteEnter(t,e,n){ey.load(t).then(s=>{n(i=>ey.set(i,s))})},setup(){return{servicesStore:Ue()}},data(){return{album:{artists:[{}],tracks:{}},show_details_modal:!1}},computed:{tracks(){const{album:t}=this;return t.tracks.total?t.tracks.items.map(e=>({...e,album:t})):{}}},methods:{open_artist(){this.$router.push({name:"music-spotify-artist",params:{id:this.album.artists[0].id}})},play(){this.show_details_modal=!1,tt.player_play_uri(this.album.uri,!0)},showDetails(){this.show_details_modal=!0}}},F8=["textContent"],V8={class:"subtitle is-6"},H8=["textContent"],U8=["textContent"],j8={class:"buttons is-centered-mobile mt-5"};function B8(t,e,n,s,i,r){const o=x("control-button"),a=x("control-image"),l=x("list-tracks-spotify"),c=x("modal-dialog-album-spotify"),u=x("content-with-hero");return O(),M("div",null,[C(u,null,{"heading-left":D(()=>[g("div",{class:"title is-5",textContent:$(i.album.name)},null,8,F8),g("div",V8,[g("a",{onClick:e[0]||(e[0]=(...d)=>r.open_artist&&r.open_artist(...d)),textContent:$(i.album.artists[0].name)},null,8,H8)]),g("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:$(t.$t("count.tracks",{count:i.album.tracks.total}))},null,8,U8),g("div",j8,[C(o,{handler:r.play,icon:"shuffle",label:"page.spotify.album.shuffle"},null,8,["handler"]),C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"])])]),"heading-right":D(()=>{var d,f;return[C(a,{url:((f=(d=i.album.images)==null?void 0:d[0])==null?void 0:f.url)??"",artist:i.album.artists[0].name,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]}),content:D(()=>[C(l,{items:r.tracks,context_uri:i.album.uri},null,8,["items","context_uri"]),C(c,{item:i.album,show:i.show_details_modal,onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const W8=it(M8,[["render",B8]]),q8={name:"ContentWithHeading",data(){return{hidden:!0}},computed:{icon(){return this.hidden?"chevron-down":"chevron-up"}}},z8={class:"container"},G8={class:"columns is-centered"},K8={class:"column is-four-fifths"},X8={key:0,class:"my-2"},Y8={class:"buttons is-centered"},Z8={class:"level is-clipped"},J8={class:"level-left is-flex-shrink-1"},Q8={class:"level-item is-flex-shrink-1 has-text-centered-mobile"},t5={class:"level-right has-text-centered-mobile"},e5={class:"mt-4"};function n5(t,e,n,s,i,r){const o=x("mdicon");return O(),M("section",{class:Vt(["section",{"pt-0":t.$slots.options}])},[g("div",z8,[g("div",G8,[g("div",K8,[t.$slots.options?(O(),M("div",X8,[g("div",{class:Vt([{"is-hidden":i.hidden},"mt-4"])},[ge(t.$slots,"options")],2),g("div",Y8,[g("button",{class:"button is-small",onClick:e[0]||(e[0]=a=>i.hidden=!i.hidden)},[C(o,{class:"icon",name:r.icon,size:"16"},null,8,["name"])])])])):vt("",!0),g("div",null,[g("nav",Z8,[g("div",J8,[g("div",Q8,[g("div",null,[ge(t.$slots,"heading-left")])])]),g("div",t5,[ge(t.$slots,"heading-right")])]),ge(t.$slots,"content"),g("div",e5,[ge(t.$slots,"footer")])])])])])],2)}const ie=it(q8,[["render",n5]]),s5={name:"ControlDropdown",props:{options:{required:!0,type:Array},value:{required:!0,type:[String,Number]}},emits:["update:value"],data(){return{active:!1}},computed:{option:{get(){return this.options.find(t=>t.id===this.value)}}},methods:{deactivate(){this.active=!1},select(t){this.active=!1,this.$emit("update:value",t.id)}}},i5={class:"dropdown-trigger"},r5=["textContent"],o5={id:"dropdown",class:"dropdown-menu",role:"menu"},a5={class:"dropdown-content"},l5=["onClick","textContent"];function c5(t,e,n,s,i,r){const o=x("mdicon"),a=Vh("click-away");return An((O(),M("div",{class:Vt(["dropdown",{"is-active":i.active}])},[g("div",i5,[g("button",{class:"button","aria-haspopup":"true","aria-controls":"dropdown",onClick:e[0]||(e[0]=l=>i.active=!i.active)},[g("span",{textContent:$(r.option.name)},null,8,r5),C(o,{class:"icon",name:"chevron-down",size:"16"})])]),g("div",o5,[g("div",a5,[(O(!0),M(pt,null,fe(n.options,l=>(O(),M("a",{key:l.id,class:Vt(["dropdown-item",{"is-active":n.value===l.id}]),onClick:c=>r.select(l),textContent:$(l.name)},null,10,l5))),128))])])],2)),[[a,r.deactivate]])}const Rr=it(s5,[["render",c5]]),u5={name:"IndexButtonList",props:{indices:{required:!0,type:Array}}},d5={class:"buttons is-centered mb-4"};function f5(t,e,n,s,i,r){const o=x("router-link");return O(),M("section",null,[g("nav",d5,[(O(!0),M(pt,null,fe(n.indices,a=>(O(),_t(o,{key:a,class:"button px-2 is-small is-square",to:{hash:`#index_${a}`,query:t.$route.query}},{default:D(()=>[ws($(a),1)]),_:2},1032,["to"]))),128))])])}const Is=it(u5,[["render",f5],["__scopeId","data-v-f15ebd8e"]]),h5={name:"ListAlbums",components:{ControlImage:Qi,ModalDialog:mi,ModalDialogAlbum:ud},props:{items:{required:!0,type:Object},media_kind:{default:"",type:String}},emits:["play-count-changed","podcast-deleted"],setup(){return{settingsStore:gi()}},data(){return{rss_playlist_to_remove:{},selected_item:{},show_details_modal:!1,show_remove_podcast_modal:!1}},computed:{actions(){return[{label:this.$t("page.podcast.cancel"),handler:"cancel",icon:"cancel"},{label:this.$t("page.podcast.remove"),handler:"remove",icon:"delete"}]},media_kind_resolved(){return this.media_kind||this.selected_item.media_kind}},methods:{open(t){this.selected_item=t,this.media_kind_resolved==="podcast"?this.$router.push({name:"podcast",params:{id:t.id}}):this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:t.id}}):this.$router.push({name:"music-album",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0},open_remove_podcast_dialog(){tt.library_album_tracks(this.selected_item.id,{limit:1}).then(({data:t})=>{tt.library_track_playlists(t.items[0].id).then(({data:e})=>{[this.rss_playlist_to_remove]=e.items.filter(n=>n.type==="rss"),this.show_remove_podcast_modal=!0,this.show_details_modal=!1})})},play_count_changed(){this.$emit("play-count-changed")},remove_podcast(){this.show_remove_podcast_modal=!1,tt.library_playlist_delete(this.rss_playlist_to_remove.id).then(()=>{this.$emit("podcast-deleted")})}}},p5={key:0,class:"py-5"},m5=["id","textContent"],g5=["onClick"],b5={class:"media-content"},y5=["textContent"],_5=["textContent"],v5=["textContent"],S5={class:"media-right"},E5=["onClick"],w5=["textContent"];function C5(t,e,n,s,i,r){const o=x("control-image"),a=x("mdicon"),l=x("modal-dialog-album"),c=x("i18n-t"),u=x("modal-dialog");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,d=>(O(),M(pt,{key:d.itemId},[d.isItem?(O(),M("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:f=>r.open(d.item)},[s.settingsStore.show_cover_artwork_in_album_lists?(O(),_t(o,{key:0,url:d.item.artwork_url,artist:d.item.artist,album:d.item.name,class:"media-left is-small"},null,8,["url","artist","album"])):vt("",!0),g("div",b5,[g("div",{class:"is-size-6 has-text-weight-bold",textContent:$(d.item.name)},null,8,y5),g("div",{class:"is-size-7 has-text-grey has-text-weight-bold",textContent:$(d.item.artist)},null,8,_5),d.item.date_released&&d.item.media_kind==="music"?(O(),M("div",{key:0,class:"is-size-7 has-text-grey",textContent:$(t.$filters.toDate(d.item.date_released))},null,8,v5)):vt("",!0)]),g("div",S5,[g("a",{onClick:Oe(f=>r.open_dialog(d.item),["prevent","stop"])},[C(a,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,E5)])],8,g5)):(O(),M("div",p5,[g("span",{id:`index_${d.index}`,class:"tag is-small has-text-weight-bold",textContent:$(d.index)},null,8,m5)]))],64))),128)),(O(),_t(ds,{to:"#app"},[C(l,{item:i.selected_item,media_kind:n.media_kind,show:i.show_details_modal,onClose:e[0]||(e[0]=d=>i.show_details_modal=!1),onRemovePodcast:e[1]||(e[1]=d=>r.open_remove_podcast_dialog()),onPlayCountChanged:e[2]||(e[2]=d=>r.play_count_changed())},null,8,["item","media_kind","show"]),C(u,{actions:r.actions,show:i.show_remove_podcast_modal,title:t.$t("page.podcast.remove-podcast"),onCancel:e[3]||(e[3]=d=>i.show_remove_podcast_modal=!1),onRemove:r.remove_podcast},{content:D(()=>[C(c,{keypath:"list.albums.info",tag:"p",scope:"global"},{separator:D(()=>e[4]||(e[4]=[g("br",null,null,-1)])),name:D(()=>[g("b",{textContent:$(i.rss_playlist_to_remove.name)},null,8,w5)]),_:1})]),_:1},8,["actions","show","title","onRemove"])]))],64)}const qn=it(h5,[["render",C5]]),k5={name:"ControlTabList",props:{links:{required:!0,type:Array}}},T5={class:"section py-0 tabs-section"},x5={class:"container"},A5={class:"columns is-centered my-0"},O5={class:"column is-four-fifths py-0"},I5={class:"tabs is-centered is-small"},N5=["onClick","onKeypress"],P5=["textContent"];function $5(t,e,n,s,i,r){const o=x("mdicon"),a=x("router-link");return O(),M("section",T5,[g("div",x5,[g("div",A5,[g("div",O5,[g("div",I5,[g("ul",null,[(O(!0),M(pt,null,fe(n.links,l=>(O(),_t(a,{key:l.to.name,to:{name:l.to.name},custom:""},{default:D(({navigate:c,isActive:u})=>[g("li",{class:Vt({"is-active":u})},[g("a",{onClick:c,onKeypress:Wv(c,["enter"])},[l.icon?(O(),_t(o,{key:0,class:"icon is-small",name:l.icon},null,8,["name"])):vt("",!0),g("span",{class:Vt({"is-hidden-mobile":l.icon}),textContent:$(t.$t(l.label))},null,10,P5)],40,N5)],2)]),_:2},1032,["to"]))),128))])])])])])])}const Xp=it(k5,[["render",$5],["__scopeId","data-v-95d58276"]]),R5={name:"TabsMusic",components:{ControlTabList:Xp},setup(){return{servicesStore:Ue()}},computed:{links(){const t=[{to:{name:"music-history"},icon:"history",label:"page.music.tabs.history"},{to:{name:"music-artists"},icon:"account-music",label:"page.music.tabs.artists"},{to:{name:"music-albums"},icon:"album",label:"page.music.tabs.albums"},{to:{name:"music-genres"},icon:"speaker",label:"page.music.tabs.genres"},{to:{name:"music-composers"},icon:"book-open-page-variant",label:"page.music.tabs.composers"}];return this.servicesStore.spotify.webapi_token_valid&&t.push({to:{name:"music-spotify"},icon:"spotify",label:"page.music.tabs.spotify"}),t}}};function L5(t,e,n,s,i,r){const o=x("control-tab-list");return O(),_t(o,{links:r.links},null,8,["links"])}const Ws=it(R5,[["render",L5]]),ny={load(t){return tt.library_albums("music")},set(t,e){t.albums_list=new Tt(e.data)}},D5={name:"PageAlbums",components:{ContentWithHeading:ie,ControlDropdown:Rr,ControlSwitch:Pr,IndexButtonList:Is,ListAlbums:qn,TabsMusic:Ws},beforeRouteEnter(t,e,n){ny.load(t).then(s=>{n(i=>ny.set(i,s))})},setup(){return{uiStore:Hn(),servicesStore:Ue()}},data(){return{albums_list:new Tt,groupings:[{id:1,name:this.$t("page.albums.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("page.albums.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}},{id:3,name:this.$t("page.albums.sort.recently-released"),options:{criteria:[{field:"date_released",order:-1,type:Date}],index:{field:"date_released",type:Date}}},{id:4,name:this.$t("page.albums.sort.artist-name"),options:{criteria:[{field:"artist",type:String},{field:"name_sort",type:String}],index:{field:"artist",type:String}}},{id:5,name:this.$t("page.albums.sort.artist-date"),options:{criteria:[{field:"artist",type:String},{field:"date_released",type:Date}],index:{field:"artist",type:String}}}]}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.albums_sort);return t.filters=[e=>!this.uiStore.hide_singles||e.track_count>2,e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.albums_list.group(t)},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid}}},M5={class:"columns"},F5={class:"column"},V5=["textContent"],H5=["textContent"],U5=["textContent"],j5=["textContent"],B5=["textContent"],W5={class:"column"},q5=["textContent"],z5=["textContent"],G5=["textContent"];function K5(t,e,n,s,i,r){const o=x("tabs-music"),a=x("index-button-list"),l=x("control-switch"),c=x("control-dropdown"),u=x("list-albums"),d=x("content-with-heading");return O(),M("div",null,[C(o),C(d,null,{options:D(()=>[C(a,{indices:r.albums.indices},null,8,["indices"]),g("div",M5,[g("div",F5,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.albums.filter"))},null,8,V5),C(l,{modelValue:s.uiStore.hide_singles,"onUpdate:modelValue":e[0]||(e[0]=f=>s.uiStore.hide_singles=f)},{label:D(()=>[g("span",{textContent:$(t.$t("page.albums.hide-singles"))},null,8,H5)]),help:D(()=>[g("span",{textContent:$(t.$t("page.albums.hide-singles-help"))},null,8,U5)]),_:1},8,["modelValue"]),r.spotify_enabled?(O(),_t(l,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[1]||(e[1]=f=>s.uiStore.hide_spotify=f)},{label:D(()=>[g("span",{textContent:$(t.$t("page.albums.hide-spotify"))},null,8,j5)]),help:D(()=>[g("span",{textContent:$(t.$t("page.albums.hide-spotify-help"))},null,8,B5)]),_:1},8,["modelValue"])):vt("",!0)]),g("div",W5,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.albums.sort.title"))},null,8,q5),C(c,{value:s.uiStore.albums_sort,"onUpdate:value":e[2]||(e[2]=f=>s.uiStore.albums_sort=f),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.albums.title"))},null,8,z5),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.albums",{count:r.albums.count}))},null,8,G5)]),content:D(()=>[C(u,{items:r.albums},null,8,["items"])]),_:1})])}const X5=it(D5,[["render",K5]]),Y5={name:"ModalDialogArtist",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,uri:this.item.uri,properties:[{label:"property.albums",value:this.item.album_count},{label:"property.tracks",value:this.item.track_count},{label:"property.type",value:this.$t(`data.kind.${this.item.data_kind}`)},{label:"property.added-on",value:this.$filters.toDateTime(this.item.time_added)}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-artist",params:{id:this.item.id}})}}};function Z5(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const dd=it(Y5,[["render",Z5]]),sy={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_albums(t.params.id)])},set(t,e){t.artist=e[0].data,t.albums_list=new Tt(e[1].data)}},J5={name:"PageArtist",components:{ContentWithHeading:ie,ControlButton:Je,ControlDropdown:Rr,ControlSwitch:Pr,ListAlbums:qn,ModalDialogArtist:dd},beforeRouteEnter(t,e,n){sy.load(t).then(s=>{n(i=>sy.set(i,s))})},setup(){return{servicesStore:Ue(),uiStore:Hn()}},data(){return{albums_list:new Tt,artist:{},groupings:[{id:1,name:this.$t("page.artist.sort.name"),options:{criteria:[{field:"name_sort",type:String}]}},{id:2,name:this.$t("page.artist.sort.release-date"),options:{criteria:[{field:"date_released",type:Date}]}}],show_details_modal:!1}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artist_albums_sort);return t.filters=[e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.albums_list.group(t)},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid},track_count(){return[...this.albums].reduce((t,e)=>t+(e.isItem?e.item.track_count:0),0)}},methods:{open_tracks(){this.$router.push({name:"music-artist-tracks",params:{id:this.artist.id}})},play(){tt.player_play_uri(this.albums.items.map(t=>t.uri).join(),!0)},showDetails(){this.show_details_modal=!0}}},Q5={class:"columns"},t6={class:"column"},e6=["textContent"],n6=["textContent"],s6=["textContent"],i6={class:"column"},r6=["textContent"],o6=["textContent"],a6={class:"is-size-7 is-uppercase"},l6=["textContent"],c6=["textContent"],u6={class:"buttons is-centered"};function d6(t,e,n,s,i,r){const o=x("control-switch"),a=x("control-dropdown"),l=x("control-button"),c=x("list-albums"),u=x("modal-dialog-artist"),d=x("content-with-heading");return O(),M("div",null,[C(d,null,{options:D(()=>[g("div",Q5,[g("div",t6,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artist.filter"))},null,8,e6),r.spotify_enabled?(O(),_t(o,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[0]||(e[0]=f=>s.uiStore.hide_spotify=f)},{label:D(()=>[g("span",{textContent:$(t.$t("page.artist.hide-spotify"))},null,8,n6)]),help:D(()=>[g("span",{textContent:$(t.$t("page.artist.hide-spotify-help"))},null,8,s6)]),_:1},8,["modelValue"])):vt("",!0)]),g("div",i6,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artist.sort.title"))},null,8,r6),C(a,{value:s.uiStore.artist_albums_sort,"onUpdate:value":e[1]||(e[1]=f=>s.uiStore.artist_albums_sort=f),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.artist.name)},null,8,o6),g("div",a6,[g("span",{textContent:$(t.$t("count.albums",{count:r.albums.count}))},null,8,l6),e[4]||(e[4]=g("span",null," | ",-1)),g("a",{onClick:e[2]||(e[2]=(...f)=>r.open_tracks&&r.open_tracks(...f)),textContent:$(t.$t("count.tracks",{count:r.track_count}))},null,8,c6)])]),"heading-right":D(()=>[g("div",u6,[C(l,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(l,{handler:r.play,icon:"shuffle",label:"page.artist.shuffle"},null,8,["handler"])])]),content:D(()=>[C(c,{items:r.albums},null,8,["items"]),C(u,{item:i.artist,show:i.show_details_modal,onClose:e[3]||(e[3]=f=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const f6=it(J5,[["render",d6]]),h6={name:"ListAlbumsSpotify",components:{ControlImage:Qi,ModalDialogAlbumSpotify:dS},props:{items:{required:!0,type:Object}},setup(){return{settingsStore:gi()}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"music-spotify-album",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},p6=["onClick"],m6={class:"media-content"},g6=["textContent"],b6=["textContent"],y6=["textContent"],_6={class:"media-right"},v6=["onClick"];function S6(t,e,n,s,i,r){const o=x("control-image"),a=x("mdicon"),l=x("modal-dialog-album-spotify");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,c=>{var u,d,f;return O(),M("div",{key:c.id,class:"media is-align-items-center is-clickable mb-0",onClick:h=>r.open(c)},[s.settingsStore.show_cover_artwork_in_album_lists?(O(),_t(o,{key:0,url:((d=(u=c.images)==null?void 0:u[0])==null?void 0:d.url)??"",artist:c.artist,album:c.name,class:"media-left is-small"},null,8,["url","artist","album"])):vt("",!0),g("div",m6,[g("div",{class:"is-size-6 has-text-weight-bold",textContent:$(c.name)},null,8,g6),g("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:$((f=c.artists[0])==null?void 0:f.name)},null,8,b6),g("div",{class:"is-size-7 has-text-grey",textContent:$(t.$filters.toDate(c.release_date))},null,8,y6)]),g("div",_6,[g("a",{onClick:Oe(h=>r.open_dialog(c),["prevent","stop"])},[C(a,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,v6)])],8,p6)}),128)),(O(),_t(ds,{to:"#app"},[C(l,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=c=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Wa=it(h6,[["render",S6]]),E6={name:"ModalDialogArtistSpotify",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,handler:this.open,uri:this.item.uri,properties:[{label:"property.popularity",value:[this.item.popularity,(t=this.item.followers)==null?void 0:t.total].join(" / ")},{label:"property.genres",value:(e=this.item.genres)==null?void 0:e.join(", ")}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.id}})}}};function w6(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const fS=it(E6,[["render",w6]]);function C6(t){return t.scrollHeight}function k6(t){return t.scrollWidth}function T6(t,e){t.scrollTop=t.scrollHeight-e+t.scrollTop}function x6(t,e){t.scrollLeft=t.scrollWidth-e+t.scrollLeft}const A6=g("div",{class:"loading"},"Loading...",-1),O6=g("div",{class:"no-more"},"No more.",-1),I6=g("div",{class:"no-results"},"No results.",-1),N6=g("div",{class:"error"},"Error.",-1),Yp=hi({__name:"VueEternalLoading",props:{load:{required:!0,type:Function},isInitial:{required:!1,type:Boolean,default:!0},position:{required:!1,type:String,default:"default"},container:{required:!1,type:Object,default:null},margin:{required:!1,type:String,default:void 0}},emits:["update:isInitial"],setup(t,{emit:e}){const n=t,s=is();let i=is("loading"),r=is(n.isInitial),o=0;function a(){Nr(()=>{var b,v;n.position==="top"?T6((b=n.container)!=null?b:document.documentElement,o):n.position==="left"&&x6((v=n.container)!=null?v:document.documentElement,o)})}function l(b,v){return b===0?r.value?(u(),"no-results"):(c(),"no-more"):b!==void 0&&v!==void 0&&b{var v,E;b.isIntersecting&&(n.position==="top"?o=C6((v=n.container)!=null?v:document.documentElement):n.position==="left"&&(o=k6((E=n.container)!=null?E:document.documentElement)),m(),n.load({loaded:l,noMore:c,noResults:u,error:d},{isFirstLoad:r.value}))},{root:n.container,threshold:0,rootMargin:n.margin})}let S;return typeof IntersectionObserver<"u"&&dv(()=>{S&&m(),S=y(),_()},{flush:"post"}),Gn(()=>n.isInitial,b=>{b&&f()}),Gn(r,b=>{b||e("update:isInitial",!1)}),(b,v)=>(O(),M("div",{class:"vue-eternal-loading",ref_key:"rootRef",ref:s},[Dn(i)==="loading"?ge(b.$slots,"loading",to(no({key:0},{isFirstLoad:Dn(r)})),()=>[A6]):Dn(i)==="no-more"?ge(b.$slots,"no-more",to(no({key:1},{retry:h})),()=>[O6]):Dn(i)==="no-results"?ge(b.$slots,"no-results",to(no({key:2},{retry:h})),()=>[I6]):Dn(i)==="error"?ge(b.$slots,"error",to(no({key:3},{retry:h})),()=>[N6]):vt("",!0)],512))}}),fh=50,iy={load(t){const e=new Bs;return e.setAccessToken(Ue().spotify.webapi_token),Promise.all([e.getArtist(t.params.id),e.getArtistAlbums(t.params.id,{include_groups:"album,single",limit:fh,market:Ue().spotify.webapi_country,offset:0})])},set(t,e){t.artist=e.shift(),t.albums=[],t.total=0,t.offset=0,t.append_albums(e.shift())}},P6={name:"PageArtistSpotify",components:{ContentWithHeading:ie,ControlButton:Je,ListAlbumsSpotify:Wa,ModalDialogArtistSpotify:fS,VueEternalLoading:Yp},beforeRouteEnter(t,e,n){iy.load(t).then(s=>{n(i=>iy.set(i,s))})},setup(){return{servicesStore:Ue()}},data(){return{albums:[],artist:{},offset:0,show_details_modal:!1,total:0}},methods:{append_albums(t){this.albums=this.albums.concat(t.items),this.total=t.total,this.offset+=t.limit},load_next({loaded:t}){const e=new Bs;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getArtistAlbums(this.artist.id,{include_groups:"album,single",limit:fh,offset:this.offset}).then(n=>{this.append_albums(n),t(n.items.length,fh)})},play(){this.show_album_details_modal=!1,tt.player_play_uri(this.artist.uri,!0)},showDetails(){this.show_details_modal=!0}}},$6=["textContent"],R6=["textContent"],L6={class:"buttons is-centered"},D6={class:"columns is-centered"},M6={class:"column has-text-centered"};function F6(t,e,n,s,i,r){const o=x("control-button"),a=x("list-albums-spotify"),l=x("mdicon"),c=x("vue-eternal-loading"),u=x("modal-dialog-artist-spotify"),d=x("content-with-heading");return O(),M("div",null,[C(d,null,{"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.artist.name)},null,8,$6),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.albums",{count:i.total}))},null,8,R6)]),"heading-right":D(()=>[g("div",L6,[C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(o,{handler:r.play,icon:"shuffle",label:"page.spotify.artist.shuffle"},null,8,["handler"])])]),content:D(()=>[C(a,{items:i.albums},null,8,["items"]),i.offset[g("div",D6,[g("div",M6,[C(l,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":D(()=>e[1]||(e[1]=[g("br",null,null,-1)])),"no-results":D(()=>e[2]||(e[2]=[g("br",null,null,-1)])),_:1},8,["load"])):vt("",!0),C(u,{item:i.artist,show:i.show_details_modal,onClose:e[0]||(e[0]=f=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const V6=it(P6,[["render",F6]]),ry={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_tracks(t.params.id)])},set(t,e){t.artist=e[0].data,t.tracks_list=new Tt(e[1].data.tracks)}},H6={name:"PageArtistTracks",components:{ContentWithHeading:ie,ControlButton:Je,ControlDropdown:Rr,ControlSwitch:Pr,IndexButtonList:Is,ListTracks:Vn,ModalDialogArtist:dd},beforeRouteEnter(t,e,n){ry.load(t).then(s=>{n(i=>ry.set(i,s))})},setup(){return{servicesStore:Ue(),uiStore:Hn()}},data(){return{artist:{},groupings:[{id:1,name:this.$t("page.artist.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.artist.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],show_details_modal:!1,tracks_list:new Tt}},computed:{album_count(){return new Set([...this.tracks].filter(t=>t.isItem).map(t=>t.item.album_id)).size},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid},track_uris(){return this.tracks_list.items.map(t=>t.uri).join()},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artist_tracks_sort);return t.filters=[e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.tracks_list.group(t)}},methods:{open_artist(){this.show_details_modal=!1,this.$router.push({name:"music-artist",params:{id:this.artist.id}})},play(){tt.player_play_uri(this.tracks_list.items.map(t=>t.uri).join(),!0)},showDetails(){this.show_details_modal=!0}}},U6={class:"columns"},j6={class:"column"},B6=["textContent"],W6=["textContent"],q6=["textContent"],z6={class:"column"},G6=["textContent"],K6=["textContent"],X6={class:"is-size-7 is-uppercase"},Y6=["textContent"],Z6=["textContent"],J6={class:"buttons is-centered"};function Q6(t,e,n,s,i,r){const o=x("index-button-list"),a=x("control-switch"),l=x("control-dropdown"),c=x("control-button"),u=x("list-tracks"),d=x("modal-dialog-artist"),f=x("content-with-heading");return O(),M("div",null,[C(f,null,{options:D(()=>[C(o,{indices:r.tracks.indices},null,8,["indices"]),g("div",U6,[g("div",j6,[g("p",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artist.filter"))},null,8,B6),r.spotify_enabled?(O(),_t(a,{key:0,modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[0]||(e[0]=h=>s.uiStore.hide_spotify=h)},{label:D(()=>[g("span",{textContent:$(t.$t("page.artist.hide-spotify"))},null,8,W6)]),help:D(()=>[g("span",{textContent:$(t.$t("page.artist.hide-spotify-help"))},null,8,q6)]),_:1},8,["modelValue"])):vt("",!0)]),g("div",z6,[g("p",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artist.sort.title"))},null,8,G6),C(l,{value:s.uiStore.artist_tracks_sort,"onUpdate:value":e[1]||(e[1]=h=>s.uiStore.artist_tracks_sort=h),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(i.artist.name)},null,8,K6),g("div",X6,[g("a",{onClick:e[2]||(e[2]=(...h)=>r.open_artist&&r.open_artist(...h)),textContent:$(t.$t("count.albums",{count:r.album_count}))},null,8,Y6),e[4]||(e[4]=g("span",null," | ",-1)),g("span",{textContent:$(t.$t("count.tracks",{count:r.tracks.count}))},null,8,Z6)])]),"heading-right":D(()=>[g("div",J6,[C(c,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(c,{handler:r.play,icon:"shuffle",label:"page.artist.shuffle"},null,8,["handler"])])]),content:D(()=>[C(u,{items:r.tracks,uris:r.track_uris},null,8,["items","uris"]),C(d,{item:i.artist,show:i.show_details_modal,onClose:e[3]||(e[3]=h=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const tF=it(H6,[["render",Q6]]),eF={name:"ListArtists",components:{ModalDialogArtist:dd},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.selected_item=t;const e=t.media_kind==="audiobook"?"audiobooks-artist":"music-artist";this.$router.push({name:e,params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},nF={key:0,class:"py-5"},sF=["id","textContent"],iF=["onClick"],rF={class:"media-content"},oF=["textContent"],aF={class:"media-right"},lF=["onClick"];function cF(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-artist");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M(pt,{key:l.itemId},[l.isItem?(O(),M("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[g("div",rF,[g("p",{class:"title is-6",textContent:$(l.item.name)},null,8,oF)]),g("div",aF,[g("a",{onClick:Oe(c=>r.open_dialog(l.item),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,lF)])],8,iF)):(O(),M("div",nF,[g("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:$(l.index)},null,8,sF)]))],64))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Kc=it(eF,[["render",cF]]),oy={load(t){return tt.library_artists("music")},set(t,e){t.artists_list=new Tt(e.data)}},uF={name:"PageArtists",components:{ContentWithHeading:ie,ControlDropdown:Rr,ControlSwitch:Pr,IndexButtonList:Is,ListArtists:Kc,TabsMusic:Ws},beforeRouteEnter(t,e,n){oy.load(t).then(s=>{n(i=>oy.set(i,s))})},setup(){return{servicesStore:Ue(),uiStore:Hn()}},data(){return{artists_list:new Tt,groupings:[{id:1,name:this.$t("page.artists.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("page.artists.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}}]}},computed:{artists(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artists_sort);return t.filters=[e=>!this.uiStore.hide_singles||e.track_count>e.album_count*2,e=>!this.uiStore.hide_spotify||e.data_kind!=="spotify"],this.artists_list.group(t)},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid}}},dF={class:"columns"},fF={class:"column"},hF=["textContent"],pF=["textContent"],mF=["textContent"],gF={key:0,class:"field"},bF=["textContent"],yF=["textContent"],_F={class:"column"},vF=["textContent"],SF=["textContent"],EF=["textContent"];function wF(t,e,n,s,i,r){const o=x("tabs-music"),a=x("index-button-list"),l=x("control-switch"),c=x("control-dropdown"),u=x("list-artists"),d=x("content-with-heading");return O(),M("div",null,[C(o),C(d,null,{options:D(()=>[C(a,{indices:r.artists.indices},null,8,["indices"]),g("div",dF,[g("div",fF,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artists.filter"))},null,8,hF),C(l,{modelValue:s.uiStore.hide_singles,"onUpdate:modelValue":e[0]||(e[0]=f=>s.uiStore.hide_singles=f)},{label:D(()=>[g("span",{textContent:$(t.$t("page.artists.hide-singles"))},null,8,pF)]),help:D(()=>[g("span",{textContent:$(t.$t("page.artists.hide-singles-help"))},null,8,mF)]),_:1},8,["modelValue"]),r.spotify_enabled?(O(),M("div",gF,[C(l,{modelValue:s.uiStore.hide_spotify,"onUpdate:modelValue":e[1]||(e[1]=f=>s.uiStore.hide_spotify=f)},{label:D(()=>[g("span",{textContent:$(t.$t("page.artists.hide-spotify"))},null,8,bF)]),help:D(()=>[g("span",{textContent:$(t.$t("page.artists.hide-spotify-help"))},null,8,yF)]),_:1},8,["modelValue"])])):vt("",!0)]),g("div",_F,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artists.sort.title"))},null,8,vF),C(c,{value:s.uiStore.artists_sort,"onUpdate:value":e[2]||(e[2]=f=>s.uiStore.artists_sort=f),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.artists.title"))},null,8,SF),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.artists",{count:r.artists.count}))},null,8,EF)]),content:D(()=>[C(u,{items:r.artists},null,8,["items"])]),_:1})])}const CF=it(uF,[["render",wF]]),ay={load(t){return Promise.all([tt.library_album(t.params.id),tt.library_album_tracks(t.params.id)])},set(t,e){t.album=e[0].data,t.tracks=new Tt(e[1].data)}},kF={name:"PageAudiobooksAlbum",components:{ContentWithHero:cd,ControlButton:Je,ControlImage:Qi,ListTracks:Vn,ModalDialogAlbum:ud},beforeRouteEnter(t,e,n){ay.load(t).then(s=>{n(i=>ay.set(i,s))})},data(){return{album:{},show_details_modal:!1,tracks:new Tt}},methods:{open_artist(){this.show_details_modal=!1,this.$router.push({name:"audiobooks-artist",params:{id:this.album.artist_id}})},play(){tt.player_play_uri(this.album.uri,!1)},showDetails(){this.show_details_modal=!0}}},TF=["textContent"],xF={class:"subtitle is-6"},AF=["textContent"],OF=["textContent"],IF={class:"buttons is-centered-mobile mt-5"};function NF(t,e,n,s,i,r){const o=x("control-button"),a=x("control-image"),l=x("list-tracks"),c=x("modal-dialog-album"),u=x("content-with-hero");return O(),M("div",null,[C(u,null,{"heading-left":D(()=>[g("div",{class:"title is-5",textContent:$(i.album.name)},null,8,TF),g("div",xF,[g("a",{onClick:e[0]||(e[0]=(...d)=>r.open_artist&&r.open_artist(...d)),textContent:$(i.album.artist)},null,8,AF)]),g("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:$(t.$t("count.tracks",{count:i.album.track_count}))},null,8,OF),g("div",IF,[C(o,{handler:r.play,icon:"play",label:"page.audiobooks.album.play"},null,8,["handler"]),C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"])])]),"heading-right":D(()=>[C(a,{url:i.album.artwork_url,artist:i.album.artist,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]),content:D(()=>[C(l,{items:i.tracks,show_progress:!0,uris:i.album.uri},null,8,["items","uris"]),C(c,{item:i.album,show:i.show_details_modal,media_kind:"audiobook",onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const PF=it(kF,[["render",NF]]),$F={name:"TabsAudiobooks",components:{ControlTabList:Xp},computed:{links(){return[{to:{name:"audiobooks-artists"},icon:"account-music",label:"page.audiobooks.tabs.authors"},{to:{name:"audiobooks-albums"},icon:"album",label:"page.audiobooks.tabs.audiobooks"},{to:{name:"audiobooks-genres"},icon:"speaker",label:"page.audiobooks.tabs.genres"}]}}};function RF(t,e,n,s,i,r){const o=x("control-tab-list");return O(),_t(o,{links:r.links},null,8,["links"])}const Zp=it($F,[["render",RF]]),ly={load(t){return tt.library_albums("audiobook")},set(t,e){t.albums=new Tt(e.data,{index:{field:"name_sort",type:String}})}},LF={name:"PageAudiobooksAlbums",components:{ContentWithHeading:ie,IndexButtonList:Is,ListAlbums:qn,TabsAudiobooks:Zp},beforeRouteEnter(t,e,n){ly.load(t).then(s=>{n(i=>ly.set(i,s))})},data(){return{albums:new Tt}}},DF=["textContent"],MF=["textContent"];function FF(t,e,n,s,i,r){const o=x("tabs-audiobooks"),a=x("index-button-list"),l=x("list-albums"),c=x("content-with-heading");return O(),M("div",null,[C(o),C(c,null,{options:D(()=>[C(a,{indices:i.albums.indices},null,8,["indices"])]),"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.audiobooks.albums.title"))},null,8,DF),g("p",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.audiobooks",{count:i.albums.count}))},null,8,MF)]),content:D(()=>[C(l,{items:i.albums},null,8,["items"])]),_:1})])}const VF=it(LF,[["render",FF]]),cy={load(t){return Promise.all([tt.library_artist(t.params.id),tt.library_artist_albums(t.params.id)])},set(t,e){t.artist=e[0].data,t.albums=new Tt(e[1].data)}},HF={name:"PageAudiobooksArtist",components:{ContentWithHeading:ie,ControlButton:Je,ListAlbums:qn,ModalDialogArtist:dd},beforeRouteEnter(t,e,n){cy.load(t).then(s=>{n(i=>cy.set(i,s))})},data(){return{albums:new Tt,artist:{},show_details_modal:!1}},methods:{play(){tt.player_play_uri(this.albums.items.map(t=>t.uri).join(),!1)},showDetails(){this.show_details_modal=!0}}},UF=["textContent"],jF=["textContent"],BF={class:"buttons is-centered"};function WF(t,e,n,s,i,r){const o=x("control-button"),a=x("list-albums"),l=x("modal-dialog-artist"),c=x("content-with-heading");return O(),M("div",null,[C(c,null,{"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.artist.name)},null,8,UF),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.audiobooks",{count:i.artist.album_count}))},null,8,jF)]),"heading-right":D(()=>[g("div",BF,[C(o,{handle:r.showDetails,icon:"dots-horizontal"},null,8,["handle"]),C(o,{handle:r.play,icon:"play",label:"page.audiobooks.artist.play"},null,8,["handle"]),e[1]||(e[1]=ws(" /> "))])]),content:D(()=>[C(a,{items:i.albums},null,8,["items"]),C(l,{item:i.artist,show:i.show_details_modal,onClose:e[0]||(e[0]=u=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const qF=it(HF,[["render",WF]]),uy={load(t){return tt.library_artists("audiobook")},set(t,e){t.artists=new Tt(e.data,{index:{field:"name_sort",type:String}})}},zF={name:"PageAudiobooksArtists",components:{ContentWithHeading:ie,IndexButtonList:Is,ListArtists:Kc,TabsAudiobooks:Zp},beforeRouteEnter(t,e,n){uy.load(t).then(s=>{n(i=>uy.set(i,s))})},data(){return{artists:new Tt}}},GF=["textContent"],KF=["textContent"];function XF(t,e,n,s,i,r){const o=x("tabs-audiobooks"),a=x("index-button-list"),l=x("list-artists"),c=x("content-with-heading");return O(),M("div",null,[C(o),C(c,null,{options:D(()=>[C(a,{indices:i.artists.indices},null,8,["indices"])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.audiobooks.artists.title"))},null,8,GF),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.authors",{count:i.artists.count}))},null,8,KF)]),content:D(()=>[C(l,{items:i.artists},null,8,["items"])]),_:1})])}const YF=it(zF,[["render",XF]]),ZF={name:"ModalDialogGenre",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},media_kind:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,expression:`genre is "${this.item.name}" and media_kind is ${this.media_kind}`,properties:[{label:"property.albums",value:this.item.album_count},{label:"property.tracks",value:this.item.track_count},{label:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.name},query:{media_kind:this.media_kind}})}}};function JF(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const Jp=it(ZF,[["render",JF]]),QF={name:"ListGenres",components:{ModalDialogGenre:Jp},props:{items:{required:!0,type:Object},media_kind:{required:!0,type:String}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"genre-albums",params:{name:t.name},query:{media_kind:this.media_kind}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},tV={key:0,class:"py-5"},eV={class:"media-content"},nV=["id","textContent"],sV=["onClick"],iV={class:"media-content"},rV=["textContent"],oV={class:"media-right"},aV=["onClick"];function lV(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-genre");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M(pt,{key:l.itemId},[l.isItem?(O(),M("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[g("div",iV,[g("p",{class:"title is-6",textContent:$(l.item.name)},null,8,rV)]),g("div",oV,[g("a",{onClick:Oe(c=>r.open_dialog(l.item),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,aV)])],8,sV)):(O(),M("div",tV,[g("div",eV,[g("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:$(l.index)},null,8,nV)])]))],64))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,media_kind:n.media_kind,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]))],64)}const hS=it(QF,[["render",lV]]),dy={load(t){return tt.library_genres("audiobook")},set(t,e){t.genres=new Tt(e.data.genres,{index:{field:"name_sort",type:String}})}},cV={name:"PageAudiobooksGenres",components:{ContentWithHeading:ie,IndexButtonList:Is,ListGenres:hS,TabsAudiobooks:Zp},beforeRouteEnter(t,e,n){dy.load(t).then(s=>{n(i=>dy.set(i,s))})},data(){return{genres:new Tt}}},uV=["textContent"],dV=["textContent"];function fV(t,e,n,s,i,r){const o=x("tabs-audiobooks"),a=x("index-button-list"),l=x("list-genres"),c=x("content-with-heading");return O(),M("div",null,[C(o),C(c,null,{options:D(()=>[C(a,{indices:i.genres.indices},null,8,["indices"])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.genres.title"))},null,8,uV),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.genres",{count:i.genres.total}))},null,8,dV)]),content:D(()=>[C(l,{items:i.genres,media_kind:"audiobook"},null,8,["items"])]),_:1})])}const hV=it(cV,[["render",fV]]),pV={name:"ModalDialogComposer",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open_albums,expression:`composer is "${this.item.name}" and media_kind is music`,properties:[{label:"property.albums",value:this.item.album_count,handler:this.open_albums},{label:"property.tracks",value:this.item.track_count,handler:this.open_tracks},{label:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)}]}}},methods:{open_albums(){this.$emit("close"),this.$router.push({name:"music-composer-albums",params:{name:this.item.name}})},open_tracks(){this.$emit("close"),this.$router.push({name:"music-composer-tracks",params:{name:this.item.name}})}}};function mV(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const Qp=it(pV,[["render",mV]]),fy={load(t){return Promise.all([tt.library_composer(t.params.name),tt.library_composer_albums(t.params.name)])},set(t,e){t.composer=e[0].data,t.albums=new Tt(e[1].data.albums)}},gV={name:"PageComposerAlbums",components:{ContentWithHeading:ie,ControlButton:Je,ListAlbums:qn,ModalDialogComposer:Qp},beforeRouteEnter(t,e,n){fy.load(t).then(s=>{n(i=>fy.set(i,s))})},data(){return{albums:new Tt,composer:{},show_details_modal:!1}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`}},methods:{open_tracks(){this.$router.push({name:"music-composer-tracks",params:{name:this.composer.name}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}},bV=["textContent"],yV={class:"is-size-7 is-uppercase"},_V=["textContent"],vV=["textContent"],SV={class:"buttons is-centered"};function EV(t,e,n,s,i,r){const o=x("control-button"),a=x("list-albums"),l=x("modal-dialog-composer"),c=x("content-with-heading");return O(),M("div",null,[C(c,null,{"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.composer.name)},null,8,bV),g("div",yV,[g("span",{textContent:$(t.$t("count.albums",{count:i.composer.album_count}))},null,8,_V),e[2]||(e[2]=g("span",null," | ",-1)),g("a",{onClick:e[0]||(e[0]=(...u)=>r.open_tracks&&r.open_tracks(...u)),textContent:$(t.$t("count.tracks",{count:i.composer.track_count}))},null,8,vV)])]),"heading-right":D(()=>[g("div",SV,[C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(o,{handler:r.play,icon:"shuffle",label:"page.composer.shuffle"},null,8,["handler"])])]),content:D(()=>[C(a,{items:i.albums},null,8,["items"]),C(l,{item:i.composer,show:i.show_details_modal,onClose:e[1]||(e[1]=u=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const wV=it(gV,[["render",EV]]),hy={load(t){return Promise.all([tt.library_composer(t.params.name),tt.library_composer_tracks(t.params.name)])},set(t,e){t.composer=e[0].data,t.tracks_list=new Tt(e[1].data.tracks)}},CV={name:"PageComposerTracks",components:{ContentWithHeading:ie,ControlButton:Je,ControlDropdown:Rr,IndexButtonList:Is,ListTracks:Vn,ModalDialogComposer:Qp},beforeRouteEnter(t,e,n){hy.load(t).then(s=>{n(i=>hy.set(i,s))})},setup(){return{uiStore:Hn()}},data(){return{composer:{},groupings:[{id:1,name:this.$t("page.composer.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.composer.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],show_details_modal:!1,tracks_list:new Tt}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.composer_tracks_sort);return this.tracks_list.group(t)}},methods:{open_albums(){this.$router.push({name:"music-composer-albums",params:{name:this.composer.name}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}},kV={class:"columns"},TV={class:"column"},xV=["textContent"],AV=["textContent"],OV={class:"is-size-7 is-uppercase"},IV=["textContent"],NV=["textContent"],PV={class:"buttons is-centered"};function $V(t,e,n,s,i,r){const o=x("index-button-list"),a=x("control-dropdown"),l=x("control-button"),c=x("list-tracks"),u=x("modal-dialog-composer"),d=x("content-with-heading");return O(),M("div",null,[C(d,null,{options:D(()=>[C(o,{indices:r.tracks.indices},null,8,["indices"]),g("div",kV,[g("div",TV,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.artist.sort.title"))},null,8,xV),C(a,{value:s.uiStore.composer_tracks_sort,"onUpdate:value":e[0]||(e[0]=f=>s.uiStore.composer_tracks_sort=f),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.composer.name)},null,8,AV),g("div",OV,[g("a",{onClick:e[1]||(e[1]=(...f)=>r.open_albums&&r.open_albums(...f)),textContent:$(t.$t("count.albums",{count:i.composer.album_count}))},null,8,IV),e[3]||(e[3]=g("span",null," | ",-1)),g("span",{textContent:$(t.$t("count.tracks",{count:i.composer.track_count}))},null,8,NV)])]),"heading-right":D(()=>[g("div",PV,[C(l,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(l,{handler:r.play,icon:"shuffle",label:"page.composer.shuffle"},null,8,["handler"])])]),content:D(()=>[C(c,{items:r.tracks,expression:r.expression},null,8,["items","expression"]),C(u,{item:i.composer,show:i.show_details_modal,onClose:e[2]||(e[2]=f=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const RV=it(CV,[["render",$V]]),LV={name:"ListComposers",components:{ModalDialogComposer:Qp},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.selected_item=t,this.$router.push({name:"music-composer-albums",params:{name:t.name}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},DV={key:0,class:"py-5"},MV={class:"media-content"},FV=["id","textContent"],VV=["onClick"],HV={class:"media-content"},UV=["textContent"],jV={class:"media-right"},BV=["onClick"];function WV(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-composer");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M(pt,{key:l.itemId},[l.isItem?(O(),M("div",{key:1,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[g("div",HV,[g("p",{class:"title is-6",textContent:$(l.item.name)},null,8,UV)]),g("div",jV,[g("a",{onClick:Oe(c=>r.open_dialog(l.item),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,BV)])],8,VV)):(O(),M("div",DV,[g("div",MV,[g("span",{id:`index_${l.index}`,class:"tag is-small has-text-weight-bold",textContent:$(l.index)},null,8,FV)])]))],64))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const hh=it(LV,[["render",WV]]),py={load(t){return tt.library_composers("music")},set(t,e){t.composers=new Tt(e.data,{index:{field:"name_sort",type:String}})}},qV={name:"PageComposers",components:{ContentWithHeading:ie,IndexButtonList:Is,ListComposers:hh,TabsMusic:Ws},beforeRouteEnter(t,e,n){py.load(t).then(s=>{n(i=>py.set(i,s))})},data(){return{composers:new Tt}}},zV=["textContent"],GV=["textContent"];function KV(t,e,n,s,i,r){const o=x("tabs-music"),a=x("index-button-list"),l=x("list-composers"),c=x("content-with-heading");return O(),M("div",null,[C(o),C(c,null,{options:D(()=>[C(a,{indices:i.composers.indices},null,8,["indices"])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.composers.title"))},null,8,zV),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.composers",{count:i.composers.total}))},null,8,GV)]),content:D(()=>[C(l,{items:i.composers},null,8,["items"])]),_:1})])}const XV=it(qV,[["render",KV]]),YV={name:"ModalDialogDirectory",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item,expression:`path starts with "${this.item}" order by path asc`}}}};function ZV(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const pS=it(YV,[["render",ZV]]),JV={name:"ListDirectories",components:{ModalDialogDirectory:pS},props:{items:{required:!0,type:Array}},data(){return{selected_item:"",show_details_modal:!1}},computed:{directories(){var n;const t=[];let e="";return(n=this.$route.query)==null||n.directory.split("/").slice(1,-1).forEach((s,i)=>{e=`${e}/${s}`,t.push({index:i,name:s,path:e})}),t}},methods:{open(t){const e={name:"files"};t.index!==0&&(e.query={directory:t.path}),this.$router.push(e)},open_dialog(t){this.selected_item=t.path,this.show_details_modal=!0},open_parent(){this.open(this.directories.slice(-1).pop())}}},QV={key:0,class:"media is-align-items-center mb-0"},t7={class:"media-content"},e7={class:"breadcrumb"},n7=["onClick"],s7=["textContent"],i7={class:"media-right"},r7=["onClick"],o7={class:"media-content"},a7=["textContent"],l7={class:"media-right"},c7=["onClick"];function u7(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-directory");return O(),M(pt,null,[t.$route.query.directory?(O(),M("div",QV,[C(o,{class:"icon media-left is-clickable",name:"chevron-left",onClick:r.open_parent},null,8,["onClick"]),g("div",t7,[g("nav",e7,[g("ul",null,[(O(!0),M(pt,null,fe(r.directories,l=>(O(),M("li",{key:l.index},[g("a",{onClick:c=>r.open(l)},[g("span",{textContent:$(l.name)},null,8,s7)],8,n7)]))),128))])])]),g("div",i7,[ge(t.$slots,"actions")])])):vt("",!0),(O(!0),M(pt,null,fe(n.items,l=>(O(),M("div",{key:l.path,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l)},[C(o,{class:"media-left icon",name:"folder"}),g("div",o7,[g("p",{class:"title is-6",textContent:$(l.name)},null,8,a7)]),g("div",l7,[g("a",{onClick:Oe(c=>r.open_dialog(l),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,c7)])],8,r7))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const d7=it(JV,[["render",u7]]),f7={name:"ModalDialogPlaylist",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean,uris:{default:"",type:String}},emits:["close"],computed:{playable(){return{name:this.item.name,handler:this.open,uri:this.item.uri,uris:this.uris,properties:[{label:"property.tracks",value:this.item.item_count},{label:"property.type",value:this.$t(`playlist.type.${this.item.type}`)},{label:"property.path",value:this.item.path}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"playlist",params:{id:this.item.id}})}}};function h7(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const mS=it(f7,[["render",h7]]),p7={name:"ListPlaylists",components:{ModalDialogPlaylist:mS},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{icon(t){return t.type==="folder"?"folder":t.type==="rss"?"rss":"music-box-multiple"},open(t){t.type==="folder"?this.$router.push({name:"playlist-folder",params:{id:t.id}}):this.$router.push({name:"playlist",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},m7=["onClick"],g7={class:"media-content"},b7=["textContent"],y7={class:"media-right"},_7=["onClick"];function v7(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-playlist");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M("div",{key:l.itemId,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l.item)},[C(o,{class:"media-left icon",name:r.icon(l.item)},null,8,["name"]),g("div",g7,[g("p",{class:"title is-6",textContent:$(l.item.name)},null,8,b7)]),g("div",y7,[g("a",{onClick:Oe(c=>r.open_dialog(l.item),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,_7)])],8,m7))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Xc=it(p7,[["render",v7]]),Ml={load(t){return t.query.directory?tt.library_files(t.query.directory):Promise.resolve()},set(t,e){e?t.directories=e.data.directories.map(n=>t.transform(n.path)):Cr().directories?t.directories=Cr().directories.map(n=>t.transform(n)):tt.config().then(n=>{t.directories=n.data.directories.map(s=>t.transform(s))}),t.playlists=new Tt(e==null?void 0:e.data.playlists),t.tracks=new Tt(e==null?void 0:e.data.tracks)}},S7={name:"PageFiles",components:{ContentWithHeading:ie,ControlButton:Je,ListDirectories:d7,ListPlaylists:Xc,ListTracks:Vn,ModalDialogDirectory:pS},beforeRouteEnter(t,e,n){Ml.load(t).then(s=>{n(i=>Ml.set(i,s))})},beforeRouteUpdate(t,e,n){Ml.load(t).then(s=>{Ml.set(this,s),n()})},setup(){return{configurationStore:Cr()}},data(){return{directories:[],playlists:new Tt,show_details_modal:!1,tracks:new Tt}},computed:{current(){var t;return((t=this.$route.query)==null?void 0:t.directory)||"/"},name(){var t;return this.current!=="/"?(t=this.current)==null?void 0:t.slice(this.current.lastIndexOf("/")+1):this.$t("page.files.title")},expression(){return`path starts with "${this.current}" order by path asc`}},methods:{play(){tt.player_play_expression(this.expression,!1)},showDetails(){this.show_details_modal=!0},transform(t){return{name:t.slice(t.lastIndexOf("/")+1),path:t}}}},E7=["textContent"],w7={class:"buttons is-centered"};function C7(t,e,n,s,i,r){const o=x("control-button"),a=x("list-directories"),l=x("list-playlists"),c=x("list-tracks"),u=x("modal-dialog-directory"),d=x("content-with-heading");return O(),M("div",null,[C(d,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(r.name)},null,8,E7)]),"heading-right":D(()=>[g("div",w7,[C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(o,{handler:r.play,icon:"play",label:"page.files.play"},null,8,["handler"])])]),content:D(()=>[C(a,{items:i.directories},null,8,["items"]),C(l,{items:i.playlists},null,8,["items"]),C(c,{expression:r.expression,items:i.tracks,show_icon:!0},null,8,["expression","items"]),C(u,{item:r.current,show:i.show_details_modal,onClose:e[0]||(e[0]=f=>i.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const k7=it(S7,[["render",C7]]),my={load(t){return Promise.all([tt.library_genre(t.params.name,t.query.media_kind),tt.library_genre_albums(t.params.name,t.query.media_kind)])},set(t,e){t.genre=e[0].data.genres.items.shift(),t.albums=new Tt(e[1].data.albums,{index:{field:"name_sort",type:String}})}},T7={name:"PageGenreAlbums",components:{ContentWithHeading:ie,ControlButton:Je,IndexButtonList:Is,ListAlbums:qn,ModalDialogGenre:Jp},beforeRouteEnter(t,e,n){my.load(t).then(s=>{n(i=>my.set(i,s))})},data(){return{albums:new Tt,genre:{},media_kind:this.$route.query.media_kind,show_details_modal:!1}},methods:{open_tracks(){this.show_details_modal=!1,this.$router.push({name:"genre-tracks",params:{name:this.genre.name},query:{media_kind:this.media_kind}})},play(){tt.player_play_expression(`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`,!0)},showDetails(){this.show_details_modal=!0}}},x7=["textContent"],A7={class:"is-size-7 is-uppercase"},O7=["textContent"],I7=["textContent"],N7={class:"buttons is-centered"};function P7(t,e,n,s,i,r){const o=x("index-button-list"),a=x("control-button"),l=x("list-albums"),c=x("modal-dialog-genre"),u=x("content-with-heading");return O(),M("div",null,[C(u,null,{options:D(()=>[C(o,{indices:i.albums.indices},null,8,["indices"])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.genre.name)},null,8,x7),g("div",A7,[g("span",{textContent:$(t.$t("count.albums",{count:i.genre.album_count}))},null,8,O7),e[2]||(e[2]=g("span",null," | ",-1)),g("a",{onClick:e[0]||(e[0]=(...d)=>r.open_tracks&&r.open_tracks(...d)),textContent:$(t.$t("count.tracks",{count:i.genre.track_count}))},null,8,I7)])]),"heading-right":D(()=>[g("div",N7,[C(a,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(a,{handler:r.play,icon:"shuffle",label:"page.genre.shuffle"},null,8,["handler"])])]),content:D(()=>[C(l,{items:i.albums},null,8,["items"]),C(c,{item:i.genre,media_kind:i.media_kind,show:i.show_details_modal,onClose:e[1]||(e[1]=d=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]),_:1})])}const $7=it(T7,[["render",P7]]),gy={load(t){return Promise.all([tt.library_genre(t.params.name,t.query.media_kind),tt.library_genre_tracks(t.params.name,t.query.media_kind)])},set(t,e){t.genre=e[0].data.genres.items.shift(),t.tracks_list=new Tt(e[1].data.tracks)}},R7={name:"PageGenreTracks",components:{ContentWithHeading:ie,ControlButton:Je,ControlDropdown:Rr,IndexButtonList:Is,ListTracks:Vn,ModalDialogGenre:Jp},beforeRouteEnter(t,e,n){gy.load(t).then(s=>{n(i=>gy.set(i,s))})},setup(){return{uiStore:Hn()}},data(){return{genre:{},groupings:[{id:1,name:this.$t("page.genre.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("page.genre.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}],media_kind:this.$route.query.media_kind,show_details_modal:!1,tracks_list:new Tt}},computed:{expression(){return`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.genre_tracks_sort);return this.tracks_list.group(t)}},methods:{open_genre(){this.show_details_modal=!1,this.$router.push({name:"genre-albums",params:{name:this.genre.name},query:{media_kind:this.media_kind}})},play(){tt.player_play_expression(this.expression,!0)},showDetails(){this.show_details_modal=!0}}},L7={class:"columns"},D7={class:"column"},M7=["textContent"],F7=["textContent"],V7={class:"is-size-7 is-uppercase"},H7=["textContent"],U7=["textContent"],j7={class:"buttons is-centered"};function B7(t,e,n,s,i,r){const o=x("index-button-list"),a=x("control-dropdown"),l=x("control-button"),c=x("list-tracks"),u=x("modal-dialog-genre"),d=x("content-with-heading");return O(),M("div",null,[C(d,null,{options:D(()=>[C(o,{indices:r.tracks.indices},null,8,["indices"]),g("div",L7,[g("div",D7,[g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("page.genre.sort.title"))},null,8,M7),C(a,{value:s.uiStore.genre_tracks_sort,"onUpdate:value":e[0]||(e[0]=f=>s.uiStore.genre_tracks_sort=f),options:i.groupings},null,8,["value","options"])])])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.genre.name)},null,8,F7),g("div",V7,[g("a",{onClick:e[1]||(e[1]=(...f)=>r.open_genre&&r.open_genre(...f)),textContent:$(t.$t("count.albums",{count:i.genre.album_count}))},null,8,H7),e[3]||(e[3]=g("span",null," | ",-1)),g("span",{textContent:$(t.$t("count.tracks",{count:i.genre.track_count}))},null,8,U7)])]),"heading-right":D(()=>[g("div",j7,[C(l,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(l,{handler:r.play,icon:"shuffle",label:"page.genre.shuffle"},null,8,["handler"])])]),content:D(()=>[C(c,{items:r.tracks,expression:r.expression},null,8,["items","expression"]),C(u,{item:i.genre,media_kind:i.media_kind,show:i.show_details_modal,onClose:e[2]||(e[2]=f=>i.show_details_modal=!1)},null,8,["item","media_kind","show"])]),_:1})])}const W7=it(R7,[["render",B7]]),by={load(t){return tt.library_genres("music")},set(t,e){t.genres=new Tt(e.data.genres,{index:{field:"name_sort",type:String}})}},q7={name:"PageGenres",components:{ContentWithHeading:ie,IndexButtonList:Is,ListGenres:hS,TabsMusic:Ws},beforeRouteEnter(t,e,n){by.load(t).then(s=>{n(i=>by.set(i,s))})},data(){return{genres:new Tt}}},z7=["textContent"],G7=["textContent"];function K7(t,e,n,s,i,r){const o=x("tabs-music"),a=x("index-button-list"),l=x("list-genres"),c=x("content-with-heading");return O(),M("div",null,[C(o),C(c,null,{options:D(()=>[C(a,{indices:i.genres.indices},null,8,["indices"])]),"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.genres.title"))},null,8,z7),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.genres",{count:i.genres.total}))},null,8,G7)]),content:D(()=>[C(l,{items:i.genres,media_kind:"music"},null,8,["items"])]),_:1})])}const X7=it(q7,[["render",K7]]),yy={load(t){return Promise.all([tt.search({expression:"time_added after 8 weeks ago and media_kind is music having track_count > 3 order by time_added desc",limit:3,type:"album"}),tt.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:3,type:"track"})])},set(t,e){t.albums=new Tt(e[0].data.albums),t.tracks=new Tt(e[1].data.tracks)}},Y7={name:"PageMusic",components:{ContentWithHeading:ie,ListAlbums:qn,ListTracks:Vn,TabsMusic:Ws},beforeRouteEnter(t,e,n){yy.load(t).then(s=>{n(i=>yy.set(i,s))})},data(){return{albums:[],tracks:{items:[]},selected_track:{}}}},Z7=["textContent"],J7={class:"level"},Q7={class:"level-item"},t9=["textContent"],e9={class:"level"},n9={class:"level-item"};function s9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-albums"),l=x("router-link"),c=x("content-with-heading"),u=x("list-tracks");return O(),M("div",null,[C(o),C(c,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.music.recently-added.title"))},null,8,Z7)]),content:D(()=>[C(a,{items:i.albums},null,8,["items"])]),footer:D(()=>[g("nav",J7,[g("p",Q7,[C(l,{class:"button is-small is-rounded",to:{name:"music-recently-added"}},{default:D(()=>[ws($(t.$t("page.music.show-more")),1)]),_:1})])])]),_:1}),C(c,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.music.recently-played.title"))},null,8,t9)]),content:D(()=>[C(u,{items:i.tracks},null,8,["items"])]),footer:D(()=>[g("nav",e9,[g("p",n9,[C(l,{class:"button is-small is-rounded",to:{name:"music-recently-played"}},{default:D(()=>[ws($(t.$t("page.music.show-more")),1)]),_:1})])])]),_:1})])}const i9=it(Y7,[["render",s9]]),_y={load(t){const e=gi().recently_added_limit;return tt.search({expression:"media_kind is music having track_count > 3 order by time_added desc",limit:e,type:"album"})},set(t,e){t.albums=new Tt(e.data.albums,{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}})}},r9={name:"PageMusicRecentlyAdded",components:{ContentWithHeading:ie,ListAlbums:qn,TabsMusic:Ws},beforeRouteEnter(t,e,n){_y.load(t).then(s=>{n(i=>_y.set(i,s))})},setup(){return{settingsStore:gi()}},data(){return{albums:new Tt}}},o9=["textContent"];function a9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-albums"),l=x("content-with-heading");return O(),M("div",null,[C(o),C(l,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.music.recently-added.title"))},null,8,o9)]),content:D(()=>[C(a,{items:i.albums},null,8,["items"])]),_:1})])}const l9=it(r9,[["render",a9]]),vy={load(t){return tt.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:50,type:"track"})},set(t,e){t.tracks=new Tt(e.data.tracks)}},c9={name:"PageMusicRecentlyPlayed",components:{ContentWithHeading:ie,ListTracks:Vn,TabsMusic:Ws},beforeRouteEnter(t,e,n){vy.load(t).then(s=>{n(i=>vy.set(i,s))})},data(){return{tracks:{}}}},u9=["textContent"];function d9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-tracks"),l=x("content-with-heading");return O(),M("div",null,[C(o),C(l,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.music.recently-played.title"))},null,8,u9)]),content:D(()=>[C(a,{items:i.tracks},null,8,["items"])]),_:1})])}const f9=it(c9,[["render",d9]]),h9={name:"ModalDialogPlaylistSpotify",components:{ModalDialogPlayable:Os},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,handler:this.open,uri:this.item.uri,properties:[{label:"property.owner",value:(t=this.item.owner)==null?void 0:t.display_name},{label:"property.tracks",value:(e=this.item.tracks)==null?void 0:e.total},{label:"property.path",value:this.item.uri}]}}},methods:{open(){this.$emit("close"),this.$router.push({name:"playlist-spotify",params:{id:this.item.id}})}}};function p9(t,e,n,s,i,r){const o=x("modal-dialog-playable");return O(),_t(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const gS=it(h9,[["render",p9]]),m9={name:"ListPlaylistsSpotify",components:{ModalDialogPlaylistSpotify:gS},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(t){this.$router.push({name:"playlist-spotify",params:{id:t.id}})},open_dialog(t){this.selected_item=t,this.show_details_modal=!0}}},g9=["onClick"],b9={class:"media-content"},y9=["textContent"],_9=["textContent"],v9={class:"media-right"},S9=["onClick"];function E9(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog-playlist-spotify");return O(),M(pt,null,[(O(!0),M(pt,null,fe(n.items,l=>(O(),M("div",{key:l.id,class:"media is-align-items-center is-clickable mb-0",onClick:c=>r.open(l)},[g("div",b9,[g("div",{class:"is-size-6 has-text-weight-bold",textContent:$(l.name)},null,8,y9),g("div",{class:"is-size-7 has-text-weight-bold has-text-grey",textContent:$(l.owner.display_name)},null,8,_9)]),g("div",v9,[g("a",{onClick:Oe(c=>r.open_dialog(l),["prevent","stop"])},[C(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})],8,S9)])],8,g9))),128)),(O(),_t(ds,{to:"#app"},[C(a,{item:i.selected_item,show:i.show_details_modal,onClose:e[0]||(e[0]=l=>i.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Yc=it(m9,[["render",E9]]),Sy={load(t){return tt.spotify().then(({data:e})=>{const n=new Bs;return n.setAccessToken(e.webapi_token),Promise.all([n.getNewReleases({country:e.webapi_country,limit:3}),n.getFeaturedPlaylists({country:e.webapi_country,limit:3})])})},set(t,e){t.albums=e[0].albums.items,t.playlists=e[1].playlists.items}},w9={name:"PageMusicSpotify",components:{ContentWithHeading:ie,ListAlbumsSpotify:Wa,ListPlaylistsSpotify:Yc,TabsMusic:Ws},beforeRouteEnter(t,e,n){Sy.load(t).then(s=>{n(i=>Sy.set(i,s))})},data(){return{playlists:[],albums:[]}}},C9=["textContent"],k9={class:"level"},T9={class:"level-item"},x9=["textContent"],A9={class:"level"},O9={class:"level-item"};function I9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-albums-spotify"),l=x("router-link"),c=x("content-with-heading"),u=x("list-playlists-spotify");return O(),M("div",null,[C(o),C(c,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.spotify.music.new-releases"))},null,8,C9)]),content:D(()=>[C(a,{items:i.albums},null,8,["items"])]),footer:D(()=>[g("nav",k9,[g("p",T9,[C(l,{to:{name:"music-spotify-new-releases"},class:"button is-small is-rounded"},{default:D(()=>[ws($(t.$t("page.spotify.music.show-more")),1)]),_:1})])])]),_:1}),C(c,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.spotify.music.featured-playlists"))},null,8,x9)]),content:D(()=>[C(u,{items:i.playlists},null,8,["items"])]),footer:D(()=>[g("nav",A9,[g("p",O9,[C(l,{to:{name:"music-spotify-featured-playlists"},class:"button is-small is-rounded"},{default:D(()=>[ws($(t.$t("page.spotify.music.show-more")),1)]),_:1})])])]),_:1})])}const N9=it(w9,[["render",I9]]),Ey={load(t){return tt.spotify().then(({data:e})=>{const n=new Bs;return n.setAccessToken(e.webapi_token),n.getFeaturedPlaylists({country:e.webapi_country,limit:50})})},set(t,e){t.playlists=e.playlists.items}},P9={name:"PageMusicSpotifyFeaturedPlaylists",components:{ContentWithHeading:ie,ListPlaylistsSpotify:Yc,TabsMusic:Ws},beforeRouteEnter(t,e,n){Ey.load(t).then(s=>{n(i=>Ey.set(i,s))})},data(){return{playlists:[]}}},$9=["textContent"];function R9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-playlists-spotify"),l=x("content-with-heading");return O(),M("div",null,[C(o),C(l,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.spotify.music.featured-playlists"))},null,8,$9)]),content:D(()=>[C(a,{items:i.playlists},null,8,["items"])]),_:1})])}const L9=it(P9,[["render",R9]]),wy={load(t){return tt.spotify().then(({data:e})=>{const n=new Bs;return n.setAccessToken(e.webapi_token),n.getNewReleases({country:e.webapi_country,limit:50})})},set(t,e){t.albums=e.albums.items}},D9={name:"PageMusicSpotifyNewReleases",components:{ContentWithHeading:ie,ListAlbumsSpotify:Wa,TabsMusic:Ws},beforeRouteEnter(t,e,n){wy.load(t).then(s=>{n(i=>wy.set(i,s))})},data(){return{albums:[]}}},M9=["textContent"];function F9(t,e,n,s,i,r){const o=x("tabs-music"),a=x("list-albums-spotify"),l=x("content-with-heading");return O(),M("div",null,[C(o),C(l,null,{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.spotify.music.new-releases"))},null,8,M9)]),content:D(()=>[C(a,{items:i.albums},null,8,["items"])]),_:1})])}const V9=it(D9,[["render",F9]]),H9={name:"LyricsPane",setup(){return{lyricsStore:Mu(),playerStore:Zn()}},data(){return this.lastIndex=-1,this.scrollingTimer=null,this.lastItemId=-1,{autoScrolling:!0}},computed:{is_playing(){return this.playerStore.state==="play"},lyrics(){const t=this.lyricsStore.content,e=[];if(t.length>0){const n=/\[(?\d+):(?\d+)(?:\.(?\d+))?\] ?(?.*)/u;t.split(` `).forEach(s=>{const{text:i,minutes:r,seconds:o,hundredths:a}=n.exec(s).groups;if(i){const l={text:i,time:r*60+Number(o)+ +`.${a||0}`};e.push(l)}}),e.forEach((s,i,r)=>{const o=(r[i+1].time-s.time||3)/s.text.length;let a=0;s.words=s.text.match(/\S+\s*/gu).map(l=>{const c=l.length*o;return a+=c,{duration:c,delay:a,text:l}})})}return e},verse_index(){var t;if(this.lyrics.length&&this.lyrics[0].time){const e=this.playerStore.item_progress_ms/1e3,n=this.lyrics,s=this.playerStore.item_id!==this.lastItemId,i=this.lastIndex>=0&&this.lastIndexe;if((s||i)&&this.reset_scrolling(),this.lastIndexe||this.lastIndex===n.length-1)return this.lastIndex;if(this.lastIndexe)return this.lastIndex+1;let r=n.length-1,o=-1,a=0;for(;a<=r;){o=a+r>>1;const l=n[o].time,c=(t=n[o+1])==null?void 0:t.time;if(l<=e&&(c>e||!c))break;l>1)+(e.offsetHeight>>1)-t.scrollTop})},start_scrolling(t){(t.screenX??t.screenY)&&(this.autoScrolling=!1,clearTimeout(this.scrollingTimer),this.scrollingTimer=setTimeout(this.autoScrolling=!0,2e3))}}},U9=["textContent"],j9={key:1};function B9(t,e,n,s,i,r){return O(),M("div",{ref:"lyrics",class:"lyrics",onTouchstart:e[0]||(e[0]=o=>i.autoScrolling=!1),onTouchend:e[1]||(e[1]=o=>i.autoScrolling=!0),onScrollPassive:e[2]||(e[2]=(...o)=>r.start_scrolling&&r.start_scrolling(...o)),onWheelPassive:e[3]||(e[3]=(...o)=>r.start_scrolling&&r.start_scrolling(...o))},[(O(!0),M(pt,null,fe(r.lyrics,(o,a)=>(O(),M(pt,{key:a},[a===r.verse_index?(O(),M("div",{key:0,class:Vt({"is-highlighted":r.is_playing})},[(O(!0),M(pt,null,fe(o.words,l=>(O(),M("span",{key:l,class:"has-text-weight-bold is-size-5"},[g("span",{style:fi({"animation-duration":`${l.delay}s`}),textContent:$(l.text)},null,12,U9)]))),128))],2)):(O(),M("div",j9,$(o.text),1))],64))),128))],544)}const W9=it(H9,[["render",B9],["__scopeId","data-v-e04e7f3f"]]),q9={name:"ModalDialogQueueItem",components:{ListProperties:uS,ModalDialog:mi},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],setup(){return{servicesStore:Ue()}},data(){return{spotify_track:{}}},computed:{actions(){return[{label:this.$t("dialog.queue-item.remove"),handler:this.remove,icon:"delete"},{label:this.$t("dialog.queue-item.play"),handler:this.play,icon:"play"}]},playable(){return{name:this.item.title,uri:this.item.uri,properties:[{label:"property.album",value:this.item.album,handler:this.open_album},{label:"property.album-artist",value:this.item.album_artist,handler:this.open_album_artist},{label:"property.composer",value:this.item.composer},{label:"property.year",value:this.item.year},{label:"property.genre",value:this.item.genre,handler:this.open_genre},{label:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{label:"property.duration",value:this.$filters.toTimecode(this.item.length_ms)},{label:"property.path",value:this.item.path},{label:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{label:"property.quality",value:this.$t("dialog.track.quality-value",{format:this.item.type,bitrate:this.item.bitrate,channels:this.$t("count.channels",this.item.channels),samplerate:this.item.samplerate})}]}}},watch:{item(){var t;if(((t=this.item)==null?void 0:t.data_kind)==="spotify"){const e=new Bs;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getTrack(this.item.path.slice(this.item.path.lastIndexOf(":")+1)).then(n=>{this.spotify_track=n})}else this.spotify_track={}}},methods:{open_album(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-album",params:{id:this.spotify_track.album.id}}):this.item.media_kind==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.album_id}}):this.item.media_kind==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:this.item.album_id}}):this.item.media_kind==="music"&&this.$router.push({name:"music-album",params:{id:this.item.album_id}})},open_album_artist(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-artist",params:{id:this.spotify_track.artists[0].id}}):this.item.media_kind==="music"||this.item.media_kind==="podcast"?this.$router.push({name:"music-artist",params:{id:this.item.album_artist_id}}):this.item.media_kind==="audiobook"&&this.$router.push({name:"audiobooks-artist",params:{id:this.item.album_artist_id}})},open_genre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{media_kind:this.item.media_kind}})},play(){this.$emit("close"),tt.player_play({item_id:this.item.id})},remove(){this.$emit("close"),tt.queue_remove(this.item.id)}}};function z9(t,e,n,s,i,r){const o=x("list-properties"),a=x("modal-dialog");return O(),_t(a,{actions:r.actions,show:n.show,onClose:e[0]||(e[0]=l=>t.$emit("close"))},{content:D(()=>[C(o,{item:r.playable},null,8,["item"])]),_:1},8,["actions","show"])}const bS=it(q9,[["render",z9]]),Ci=1e3,G9={name:"PageNowPlaying",components:{ControlSlider:Du,ControlImage:Qi,LyricsPane:W9,ModalDialogQueueItem:bS},setup(){return{lyricsStore:Mu(),playerStore:Zn(),queueStore:ks(),settingsStore:gi()}},data(){return{INTERVAL:Ci,interval_id:0,is_dragged:!1,selected_item:{},show_details_modal:!1}},computed:{composer(){if(this.settingsStore.show_composer_now_playing){const t=this.settingsStore.show_composer_for_genre;if(!t||this.track.genre&&t.toLowerCase().split(",").findIndex(e=>this.track.genre.toLowerCase().indexOf(e.trim())>=0)>=0)return this.track.composer}return null},is_live(){return this.track.length_ms===0},track(){return this.queueStore.current},track_elapsed_time(){return this.$filters.toTimecode(this.track_progress*Ci)},track_progress:{get(){return Math.floor(this.playerStore.item_progress_ms/Ci)},set(t){this.playerStore.item_progress_ms=t*Ci}},track_progress_max(){return this.is_live?1:Math.floor(this.track.length_ms/Ci)},track_total_time(){return this.is_live?this.$t("page.now-playing.live"):this.$filters.toTimecode(this.track.length_ms)}},watch:{"playerStore.state"(t){this.interval_id>0&&(window.clearTimeout(this.interval_id),this.interval_id=0),t==="play"&&(this.interval_id=window.setInterval(this.tick,Ci))}},created(){tt.player_status().then(({data:t})=>{this.playerStore.$state=t,this.playerStore.state==="play"&&(this.interval_id=window.setInterval(this.tick,Ci))})},unmounted(){this.interval_id>0&&(window.clearTimeout(this.interval_id),this.interval_id=0)},methods:{end_dragging(){this.is_dragged=!1},open_dialog(t){this.selected_item=t,this.show_details_modal=!0},seek(){this.is_live||tt.player_seek_to_pos(this.track_progress*Ci)},start_dragging(){this.is_dragged=!0},tick(){this.is_dragged||(this.track_progress+=1)}}},K9={class:"is-flex is-align-items-center has-text-centered px-5 is-full-height"},X9={key:0,class:"mx-auto",style:{"max-width":"32rem"}},Y9={class:"is-flex is-justify-content-space-between"},Z9=["textContent"],J9=["textContent"],Q9=["textContent"],tH=["textContent"],eH=["textContent"],nH=["textContent"],sH=["textContent"],iH={key:1,class:"mx-auto"},rH=["textContent"],oH=["textContent"];function aH(t,e,n,s,i,r){const o=x("control-image"),a=x("lyrics-pane"),l=x("control-slider"),c=x("modal-dialog-queue-item");return O(),M(pt,null,[g("div",K9,[r.track.id?(O(),M("div",X9,[C(o,{url:r.track.artwork_url,artist:r.track.artist,album:r.track.album,class:Vt(["is-clickable is-big",{"is-masked":s.lyricsStore.pane}]),onClick:e[0]||(e[0]=u=>r.open_dialog(r.track))},null,8,["url","artist","album","class"]),s.lyricsStore.pane?(O(),_t(a,{key:0})):vt("",!0),C(l,{value:r.track_progress,"onUpdate:value":e[1]||(e[1]=u=>r.track_progress=u),class:"mt-5",disabled:r.is_live,max:r.track_progress_max,onChange:r.seek,onMousedown:r.start_dragging,onMouseup:r.end_dragging},null,8,["value","disabled","max","onChange","onMousedown","onMouseup"]),g("div",Y9,[g("p",{class:"subtitle is-7",textContent:$(r.track_elapsed_time)},null,8,Z9),g("p",{class:"subtitle is-7",textContent:$(r.track_total_time)},null,8,J9)]),g("p",{class:"title is-5",textContent:$(r.track.title)},null,8,Q9),g("p",{class:"title is-6",textContent:$(r.track.artist)},null,8,tH),r.composer?(O(),M("p",{key:1,class:"subtitle is-6 has-text-grey has-text-weight-bold",textContent:$(r.composer)},null,8,eH)):vt("",!0),r.track.album?(O(),M("p",{key:2,class:"subtitle is-6",textContent:$(r.track.album)},null,8,nH)):vt("",!0),s.settingsStore.show_filepath_now_playing?(O(),M("p",{key:3,class:"subtitle is-6 has-text-grey",textContent:$(r.track.path)},null,8,sH)):vt("",!0)])):(O(),M("div",iH,[g("p",{class:"title is-5",textContent:$(t.$t("page.now-playing.title"))},null,8,rH),g("p",{class:"subtitle",textContent:$(t.$t("page.now-playing.info"))},null,8,oH)]))]),C(c,{show:i.show_details_modal,item:i.selected_item,onClose:e[2]||(e[2]=u=>i.show_details_modal=!1)},null,8,["show","item"])],64)}const lH=it(G9,[["render",aH],["__scopeId","data-v-1b33df78"]]),Fl={load(t){return Promise.all([tt.library_playlist(t.params.id),tt.library_playlist_folder(t.params.id)])},set(t,e){t.playlist=e[0].data,t.playlists_list=new Tt(e[1].data)}},cH={name:"PagePlaylistFolder",components:{ContentWithHeading:ie,ListPlaylists:Xc},beforeRouteEnter(t,e,n){Fl.load(t).then(s=>{n(i=>Fl.set(i,s))})},beforeRouteUpdate(t,e,n){Fl.load(t).then(s=>{Fl.set(this,s),n()})},setup(){return{configurationStore:Cr()}},data(){return{playlist:{},playlists_list:new Tt}},computed:{playlists(){return this.playlists_list.group({filters:[t=>t.folder||this.radio_playlists||t.stream_count===0||t.item_count>t.stream_count]})},radio_playlists(){return this.configurationStore.radio_playlists}}},uH=["textContent"],dH=["textContent"];function fH(t,e,n,s,i,r){const o=x("list-playlists"),a=x("content-with-heading");return O(),M("div",null,[C(a,null,{"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.playlist.id===0?t.$t("page.playlists.title"):i.playlist.name)},null,8,uH),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.playlists",{count:r.playlists.count}))},null,8,dH)]),content:D(()=>[C(o,{items:r.playlists},null,8,["items"])]),_:1})])}const hH=it(cH,[["render",fH]]),Cy={load(t){return Promise.all([tt.library_playlist(t.params.id),tt.library_playlist_tracks(t.params.id)])},set(t,e){t.playlist=e[0].data,t.tracks=new Tt(e[1].data)}},pH={name:"PagePlaylistTracks",components:{ContentWithHeading:ie,ControlButton:Je,ListTracks:Vn,ModalDialogPlaylist:mS},beforeRouteEnter(t,e,n){Cy.load(t).then(s=>{n(i=>Cy.set(i,s))})},data(){return{playlist:{},show_details_modal:!1,tracks:new Tt}},computed:{uris(){return this.playlist.random?this.tracks.map(t=>t.uri).join():this.playlist.uri}},methods:{play(){tt.player_play_uri(this.uris,!0)},showDetails(){this.show_details_modal=!0}}},mH=["textContent"],gH=["textContent"],bH={class:"buttons is-centered"};function yH(t,e,n,s,i,r){const o=x("control-button"),a=x("list-tracks"),l=x("modal-dialog-playlist"),c=x("content-with-heading");return O(),M("div",null,[C(c,null,{"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.playlist.name)},null,8,mH),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.tracks",{count:i.tracks.count}))},null,8,gH)]),"heading-right":D(()=>[g("div",bH,[C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(o,{disabled:i.tracks.count===0,handler:r.play,icon:"shuffle",label:"page.playlist.shuffle"},null,8,["disabled","handler"])])]),content:D(()=>[C(a,{items:i.tracks,uris:r.uris},null,8,["items","uris"]),C(l,{item:i.playlist,show:i.show_details_modal,uris:r.uris,onClose:e[0]||(e[0]=u=>i.show_details_modal=!1)},null,8,["item","show","uris"])]),_:1})])}const _H=it(pH,[["render",yH]]),ph=50,ky={load(t){const e=new Bs;return e.setAccessToken(Ue().spotify.webapi_token),Promise.all([e.getPlaylist(t.params.id),e.getPlaylistTracks(t.params.id,{limit:ph,market:Ue().$state.spotify.webapi_country,offset:0})])},set(t,e){t.playlist=e.shift(),t.tracks=[],t.total=0,t.offset=0,t.append_tracks(e.shift())}},vH={name:"PagePlaylistTracksSpotify",components:{ContentWithHeading:ie,ControlButton:Je,ListTracksSpotify:Gc,ModalDialogPlaylistSpotify:gS,VueEternalLoading:Yp},beforeRouteEnter(t,e,n){ky.load(t).then(s=>{n(i=>ky.set(i,s))})},setup(){return{servicesStore:Ue()}},data(){return{offset:0,playlist:{tracks:{}},show_playlist_details_modal:!1,total:0,tracks:[]}},methods:{append_tracks(t){let e=Math.max(-1,...this.tracks.map(n=>n.position).filter(n=>n));t.items.forEach(n=>{const{track:s}=n;s&&(s.is_playable&&(s.position=++e),this.tracks.push(s))}),this.total=t.total,this.offset+=t.limit},load_next({loaded:t}){const e=new Bs;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getPlaylistTracks(this.playlist.id,{limit:ph,market:this.servicesStore.spotify.webapi_country,offset:this.offset}).then(n=>{this.append_tracks(n),t(n.items.length,ph)})},play(){this.show_details_modal=!1,tt.player_play_uri(this.playlist.uri,!0)},showDetails(){this.show_playlist_details_modal=!0}}},SH=["textContent"],EH=["textContent"],wH={class:"buttons is-centered"},CH={class:"columns is-centered"},kH={class:"column has-text-centered"};function TH(t,e,n,s,i,r){const o=x("control-button"),a=x("list-tracks-spotify"),l=x("mdicon"),c=x("vue-eternal-loading"),u=x("modal-dialog-playlist-spotify"),d=x("content-with-heading");return O(),M("div",null,[C(d,null,{"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(i.playlist.name)},null,8,SH),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.playlists",{count:i.playlist.tracks.total}))},null,8,EH)]),"heading-right":D(()=>[g("div",wH,[C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"]),C(o,{disabled:i.playlist.tracks.total===0,handler:r.play,icon:"shuffle",label:"page.spotify.playlist.shuffle"},null,8,["disabled","handler"])])]),content:D(()=>[C(a,{items:i.tracks,context_uri:i.playlist.uri},null,8,["items","context_uri"]),i.offset[g("div",CH,[g("div",kH,[C(l,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":D(()=>e[1]||(e[1]=[g("br",null,null,-1)])),_:1},8,["load"])):vt("",!0),C(u,{item:i.playlist,show:i.show_playlist_details_modal,onClose:e[0]||(e[0]=f=>i.show_playlist_details_modal=!1)},null,8,["item","show"])]),_:1})])}const xH=it(vH,[["render",TH]]),Ty={load(t){return Promise.all([tt.library_album(t.params.id),tt.library_podcast_episodes(t.params.id)])},set(t,e){t.album=e[0].data,t.tracks=new Tt(e[1].data.tracks)}},AH={name:"PagePodcast",components:{ContentWithHero:cd,ControlButton:Je,ControlImage:Qi,ListTracks:Vn,ModalDialog:mi,ModalDialogAlbum:ud},beforeRouteEnter(t,e,n){Ty.load(t).then(s=>{n(i=>Ty.set(i,s))})},data(){return{album:{},rss_playlist_to_remove:{},show_details_modal:!1,show_remove_podcast_modal:!1,tracks:new Tt}},computed:{actions(){return[{label:this.$t("page.podcast.cancel"),handler:"cancel",icon:"cancel"},{label:this.$t("page.podcast.remove"),handler:"remove",icon:"delete"}]}},methods:{open_remove_podcast_dialog(){tt.library_track_playlists(this.tracks.items[0].id).then(({data:t})=>{[this.rss_playlist_to_remove]=t.items.filter(e=>e.type==="rss"),this.show_remove_podcast_modal=!0,this.show_details_modal=!1})},play(){tt.player_play_uri(this.album.uri,!1)},reload_tracks(){tt.library_podcast_episodes(this.album.id).then(({data:t})=>{this.tracks=new Tt(t.tracks)})},remove_podcast(){this.show_remove_podcast_modal=!1,tt.library_playlist_delete(this.rss_playlist_to_remove.id).then(()=>{this.$router.replace({name:"podcasts"})})},showDetails(){this.show_details_modal=!0}}},OH=["textContent"],IH=["textContent"],NH={class:"buttons is-centered-mobile mt-5"},PH=["textContent"];function $H(t,e,n,s,i,r){const o=x("control-button"),a=x("control-image"),l=x("list-tracks"),c=x("modal-dialog-album"),u=x("i18n-t"),d=x("modal-dialog"),f=x("content-with-hero");return O(),M("div",null,[C(f,null,{"heading-left":D(()=>[g("div",{class:"title is-5",textContent:$(i.album.name)},null,8,OH),e[2]||(e[2]=g("div",{class:"subtitle is-6"},[g("br")],-1)),g("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:$(t.$t("count.tracks",{count:i.album.track_count}))},null,8,IH),g("div",NH,[C(o,{handler:r.play,icon:"play",label:"page.podcast.play"},null,8,["handler"]),C(o,{handler:r.showDetails,icon:"dots-horizontal"},null,8,["handler"])])]),"heading-right":D(()=>[C(a,{url:i.album.artwork_url,artist:i.album.artist,album:i.album.name,class:"is-clickable is-medium",onClick:r.showDetails},null,8,["url","artist","album","onClick"])]),content:D(()=>[C(l,{items:i.tracks,show_progress:!0,onPlayCountChanged:r.reload_tracks},null,8,["items","onPlayCountChanged"]),C(c,{item:i.album,show:i.show_details_modal,media_kind:"podcast",onClose:e[0]||(e[0]=h=>i.show_details_modal=!1),onPlayCountChanged:r.reload_tracks,onRemovePodcast:r.open_remove_podcast_dialog},null,8,["item","show","onPlayCountChanged","onRemovePodcast"]),C(d,{actions:r.actions,show:i.show_remove_podcast_modal,title:t.$t("page.podcast.remove-podcast"),onCancel:e[1]||(e[1]=h=>i.show_remove_podcast_modal=!1),onRemove:r.remove_podcast},{content:D(()=>[C(u,{keypath:"page.podcast.remove-info",tag:"p",scope:"global"},{separator:D(()=>e[3]||(e[3]=[g("br",null,null,-1)])),name:D(()=>[g("b",{textContent:$(i.rss_playlist_to_remove.name)},null,8,PH)]),_:1})]),_:1},8,["actions","show","title","onRemove"])]),_:1})])}const RH=it(AH,[["render",$H]]),LH={name:"ControlUrlField",props:{placeholder:{type:String,required:!0},icon:{type:String,required:!0},help:{type:String,default:""},loading:{type:Boolean,default:!1}},emits:["url-changed"],data(){return{url:"",disabled:!0}},mounted(){setTimeout(()=>{this.$refs.input.focus()},10)},methods:{validate(t){const{validity:e}=t.target;this.disabled=e.patternMismatch||e.valueMissing,this.$emit("url-changed",this.url,this.disabled)}}},DH={class:"field"},MH={class:"control has-icons-left"},FH=["placeholder","disabled"],VH=["textContent"];function HH(t,e,n,s,i,r){const o=x("mdicon");return O(),M("div",DH,[g("p",MH,[An(g("input",{ref:"input","onUpdate:modelValue":e[0]||(e[0]=a=>i.url=a),class:"input",type:"url",pattern:"http[s]?://.+",required:"",placeholder:n.placeholder,disabled:n.loading,onInput:e[1]||(e[1]=(...a)=>r.validate&&r.validate(...a))},null,40,FH),[[Yn,i.url]]),C(o,{class:"icon is-left",name:n.icon,size:"16"},null,8,["name"])]),n.help?(O(),M("p",{key:0,class:"help",textContent:$(n.help)},null,8,VH)):vt("",!0)])}const yS=it(LH,[["render",HH]]),UH={name:"ModalDialogAddRss",components:{ControlUrlField:yS,ModalDialog:mi},props:{show:Boolean},emits:["close","podcast-added"],data(){return{loading:!1,disabled:!0,url:""}},computed:{actions(){return this.loading?[{label:this.$t("dialog.add.rss.processing"),icon:"web"}]:[{label:this.$t("dialog.add.rss.cancel"),handler:this.cancel,icon:"cancel"},{label:this.$t("dialog.add.rss.add"),disabled:this.disabled,handler:this.add,icon:"playlist-plus"}]}},methods:{onUrlChanged(t,e){this.url=t,this.disabled=e},add(){this.loading=!0,tt.library_add(this.url).then(()=>{this.$emit("close"),this.$emit("podcast-added"),this.url=""}).catch(()=>{this.loading=!1})},cancel(){this.$emit("close")}}};function jH(t,e,n,s,i,r){const o=x("control-url-field"),a=x("modal-dialog");return O(),_t(a,{actions:r.actions,show:n.show,title:t.$t("dialog.add.rss.title"),onClose:e[0]||(e[0]=l=>t.$emit("close"))},{content:D(()=>[C(o,{icon:"rss",help:t.$t("dialog.add.rss.help"),loading:i.loading,placeholder:t.$t("dialog.add.rss.placeholder"),onUrlChanged:r.onUrlChanged},null,8,["help","loading","placeholder","onUrlChanged"])]),_:1},8,["actions","show","title"])}const BH=it(UH,[["render",jH]]),xy={load(t){return Promise.all([tt.library_albums("podcast"),tt.library_podcasts_new_episodes()])},set(t,e){t.albums=new Tt(e[0].data),t.tracks=new Tt(e[1].data.tracks)}},WH={name:"PagePodcasts",components:{ContentWithHeading:ie,ControlButton:Je,ListAlbums:qn,ListTracks:Vn,ModalDialogAddRss:BH},beforeRouteEnter(t,e,n){xy.load(t).then(s=>{n(i=>xy.set(i,s))})},setup(){return{libraryStore:Lu(),uiStore:Hn()}},data(){return{albums:[],tracks:{items:[]},show_url_modal:!1}},computed:{rss(){return this.libraryStore.rss}},methods:{mark_all_played(){this.tracks.items.forEach(t=>{tt.library_track_update(t.id,{play_count:"increment"})}),this.tracks.items={}},open_add_podcast_dialog(){this.show_url_modal=!0},reload_new_episodes(){tt.library_podcasts_new_episodes().then(({data:t})=>{this.tracks=new Tt(t.tracks)})},reload_podcasts(){tt.library_albums("podcast").then(({data:t})=>{this.albums=new Tt(t),this.reload_new_episodes()})},update_rss(){this.libraryStore.update_dialog_scan_kind="rss",this.uiStore.show_update_dialog=!0}}},qH=["textContent"],zH={class:"buttons is-centered"},GH=["textContent"],KH=["textContent"],XH={class:"buttons is-centered"};function YH(t,e,n,s,i,r){const o=x("control-button"),a=x("list-tracks"),l=x("content-with-heading"),c=x("list-albums"),u=x("modal-dialog-add-rss");return O(),M("div",null,[i.tracks.items.length>0?(O(),_t(l,{key:0},{"heading-left":D(()=>[g("p",{class:"title is-4",textContent:$(t.$t("page.podcasts.new-episodes"))},null,8,qH)]),"heading-right":D(()=>[g("div",zH,[C(o,{handler:r.mark_all_played,icon:"pencil",label:"page.podcasts.mark-all-played"},null,8,["handler"])])]),content:D(()=>[C(a,{items:i.tracks,show_progress:!0,onPlayCountChanged:r.reload_new_episodes},null,8,["items","onPlayCountChanged"])]),_:1})):vt("",!0),C(l,null,{"heading-left":D(()=>[g("div",{class:"title is-4",textContent:$(t.$t("page.podcasts.title"))},null,8,GH),g("div",{class:"is-size-7 is-uppercase",textContent:$(t.$t("count.podcasts",{count:i.albums.total}))},null,8,KH)]),"heading-right":D(()=>[g("div",XH,[r.rss.tracks>0?(O(),_t(o,{key:0,handler:r.update_rss,icon:"refresh",label:"page.podcasts.update"},null,8,["handler"])):vt("",!0),C(o,{handler:r.open_add_podcast_dialog,icon:"rss",label:"page.podcasts.add"},null,8,["handler"])])]),content:D(()=>[C(c,{items:i.albums,onPlayCountChanged:e[0]||(e[0]=d=>r.reload_new_episodes()),onPodcastDeleted:e[1]||(e[1]=d=>r.reload_podcasts())},null,8,["items"]),C(u,{show:i.show_url_modal,onClose:e[2]||(e[2]=d=>i.show_url_modal=!1),onPodcastAdded:e[3]||(e[3]=d=>r.reload_podcasts())},null,8,["show"])]),_:1})])}const ZH=it(WH,[["render",YH]]),JH={name:"ListItemQueueItem",props:{current_position:{required:!0,type:Number},edit_mode:Boolean,item:{required:!0,type:Object},position:{required:!0,type:Number},show_only_next_items:Boolean},setup(){return{playerStore:Zn()}},computed:{is_next(){return this.current_position<0||this.position>=this.current_position},player(){return this.playerStore}},methods:{play(){tt.player_play({item_id:this.item.id})}}},QH={key:0,class:"media-left"},tU={class:"media-content"},eU=["textContent"],nU=["textContent"],sU=["textContent"],iU={class:"media-right"};function rU(t,e,n,s,i,r){const o=x("mdicon");return r.is_next||!n.show_only_next_items?(O(),M("div",{key:0,class:"media is-align-items-center is-clickable mb-0",onClick:e[0]||(e[0]=(...a)=>r.play&&r.play(...a))},[n.edit_mode?(O(),M("div",QH,[C(o,{class:"icon has-text-grey is-movable",name:"drag-horizontal",size:"18"})])):vt("",!0),g("div",tU,[g("div",{class:Vt(["is-size-6 has-text-weight-bold",{"has-text-primary":n.item.id===r.player.item_id,"has-text-grey-light":!r.is_next}]),textContent:$(n.item.title)},null,10,eU),g("div",{class:Vt(["is-size-7 has-text-weight-bold",{"has-text-primary":n.item.id===r.player.item_id,"has-text-grey-light":!r.is_next,"has-text-grey":r.is_next&&n.item.id!==r.player.item_id}]),textContent:$(n.item.artist)},null,10,nU),g("div",{class:Vt(["is-size-7",{"has-text-primary":n.item.id===r.player.item_id,"has-text-grey-light":!r.is_next,"has-text-grey":r.is_next&&n.item.id!==r.player.item_id}]),textContent:$(n.item.album)},null,10,sU)]),g("div",iU,[ge(t.$slots,"actions",{},void 0,!0)])])):vt("",!0)}const oU=it(JH,[["render",rU],["__scopeId","data-v-af14c00f"]]),aU={name:"ModalDialogAddStream",components:{ControlUrlField:yS,ModalDialog:mi},props:{show:Boolean},emits:["close"],data(){return{loading:!1,disabled:!0,url:""}},computed:{actions(){return this.loading?[{label:this.$t("dialog.add.stream.processing"),icon:"web"}]:[{label:this.$t("dialog.add.stream.cancel"),handler:this.cancel,icon:"cancel"},{label:this.$t("dialog.add.stream.add"),disabled:this.disabled,handler:this.add,icon:"playlist-plus"},{label:this.$t("dialog.add.stream.play"),disabled:this.disabled,handler:this.play,icon:"play"}]}},methods:{onUrlChanged(t,e){this.url=t,this.disabled=e},add(){this.loading=!0,tt.queue_add(this.url).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})},cancel(){this.$emit("close")},play(){this.loading=!0,tt.player_play_uri(this.url,!1).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})}}};function lU(t,e,n,s,i,r){const o=x("control-url-field"),a=x("modal-dialog");return O(),_t(a,{actions:r.actions,show:n.show,title:t.$t("dialog.add.stream.title"),onClose:e[1]||(e[1]=l=>t.$emit("close"))},{content:D(()=>[g("form",{onSubmit:e[0]||(e[0]=Oe((...l)=>r.play&&r.play(...l),["prevent"]))},[C(o,{icon:"web",loading:i.loading,placeholder:t.$t("dialog.add.stream.placeholder"),onUrlChanged:r.onUrlChanged},null,8,["loading","placeholder","onUrlChanged"])],32)]),_:1},8,["actions","show","title"])}const cU=it(aU,[["render",lU]]),uU={name:"ModalDialogPlaylistSave",components:{ModalDialog:mi},props:{show:Boolean},emits:["close"],data(){return{disabled:!0,loading:!1,playlist_name:""}},computed:{actions(){return this.loading?[{label:this.$t("dialog.playlist.save.saving"),icon:"web"}]:[{label:this.$t("dialog.playlist.save.cancel"),handler:this.cancel,icon:"cancel"},{label:this.$t("dialog.playlist.save.save"),disabled:this.disabled,handler:this.save,icon:"download"}]}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.playlist_name_field.focus()},10))}},methods:{cancel(){this.$emit("close")},check_name(t){const{validity:e}=t.target;this.disabled=e.patternMismatch||e.valueMissing},save(){this.loading=!0,tt.queue_save_playlist(this.playlist_name).then(()=>{this.$emit("close"),this.playlist_name=""}).catch(()=>{this.loading=!1})}}},dU={class:"field"},fU={class:"control has-icons-left"},hU=["placeholder","disabled"];function pU(t,e,n,s,i,r){const o=x("mdicon"),a=x("modal-dialog");return O(),_t(a,{actions:r.actions,show:n.show,title:t.$t("dialog.playlist.save.title"),onClose:e[3]||(e[3]=l=>t.$emit("close"))},{content:D(()=>[g("form",{onSubmit:e[2]||(e[2]=Oe((...l)=>r.save&&r.save(...l),["prevent"]))},[g("div",dU,[g("p",fU,[An(g("input",{ref:"playlist_name_field","onUpdate:modelValue":e[0]||(e[0]=l=>i.playlist_name=l),class:"input",type:"text",pattern:".+",required:"",placeholder:t.$t("dialog.playlist.save.playlist-name"),disabled:i.loading,onInput:e[1]||(e[1]=(...l)=>r.check_name&&r.check_name(...l))},null,40,hU),[[Yn,i.playlist_name]]),C(o,{class:"icon is-left",name:"playlist-music",size:"16"})])])],32)]),_:1},8,["actions","show","title"])}const mU=it(uU,[["render",pU]]);var uc={exports:{}};/**! * Sortable 1.14.0 * @author RubaXa diff --git a/web-src/src/components/ModalDialogArtist.vue b/web-src/src/components/ModalDialogArtist.vue index 25192a23..3e21cbb8 100644 --- a/web-src/src/components/ModalDialogArtist.vue +++ b/web-src/src/components/ModalDialogArtist.vue @@ -19,6 +19,7 @@ export default { return { name: this.item.name, handler: this.open, + uri: this.item.uri, properties: [ { label: 'property.albums', value: this.item.album_count }, { label: 'property.tracks', value: this.item.track_count }, diff --git a/web-src/src/components/ModalDialogArtistSpotify.vue b/web-src/src/components/ModalDialogArtistSpotify.vue index e5c42c1f..399dc70c 100644 --- a/web-src/src/components/ModalDialogArtistSpotify.vue +++ b/web-src/src/components/ModalDialogArtistSpotify.vue @@ -19,6 +19,7 @@ export default { return { name: this.item.name, handler: this.open, + uri: this.item.uri, properties: [ { label: 'property.popularity', diff --git a/web-src/src/components/ModalDialogPlayable.vue b/web-src/src/components/ModalDialogPlayable.vue index 5f4d12c9..48fcd577 100644 --- a/web-src/src/components/ModalDialogPlayable.vue +++ b/web-src/src/components/ModalDialogPlayable.vue @@ -59,7 +59,7 @@ export default { if (this.item.expression) { webapi.player_play_expression(this.item.expression, false) } else { - webapi.player_play_uri(this.item.uris || this.item.item.uri, false) + webapi.player_play_uri(this.item.uris || this.item.uri, false) } }, queue_add() {