From 218d77e07008c61f4f00885326b3dea7b0745950 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Dec 2024 09:18:20 +0000 Subject: [PATCH] [web] Rebuild web interface --- htdocs/assets/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/assets/index.js b/htdocs/assets/index.js index a62a13eb..95a63f94 100644 --- a/htdocs/assets/index.js +++ b/htdocs/assets/index.js @@ -59,7 +59,7 @@ ${e.caption} `;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(n)}`},ZP={name:"CoverArtwork",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:e=>{e.src=this.dataURI()}},size:600}},computed:{alt_text(){return`${this.artist} - ${this.album}`},caption(){return(this.album||this.artist||"").substring(0,2)}},methods:{dataURI(){return KP({alternate:this.alt_text,caption:this.caption,font:this.font,size:this.size})}}};function YP(e,t,n,r,o,s){const i=kd("lazy");return x(),I("figure",null,[ht(c("img",{onClick:t[0]||(t[0]=a=>e.$emit("click"))},null,512),[[i,{src:n.url,lifecycle:o.lifecycle}]])])}const Lr=ae(ZP,[["render",YP]]),{t:ya,locale:XP}=ql.global,J1="NO_INDEX",JP=(e,t)=>e-t,QP=(e,t)=>e.localeCompare(t,XP.value),eI=(e,t)=>new Date(e)-new Date(t)||(e?t?0:1:-1),tI=e=>e.map(({field:t,type:n,order:r=1})=>{switch(n){case String:return(o,s)=>QP(o[t],s[t])*r;case Number:return(o,s)=>JP(o[t],s[t])*r;case Date:return(o,s)=>eI(o[t],s[t])*r;default:return()=>0}}),nI=(e="")=>{const t=e.charAt(0);return t.match(new RegExp("\\p{Letter}","gu"))?t.toUpperCase():t.match(new RegExp("\\p{Number}","gu"))?"#":"⌘"},rI=e=>{},oI=[{difference:NaN,text:()=>ya("grouped-list.undefined")},{difference:864e5,text:()=>ya("grouped-list.today")},{difference:6048e5,text:()=>ya("grouped-list.last-week")},{difference:2592e6,text:()=>ya("grouped-list.last-month")},{difference:1/0,text:e=>e.getFullYear()}],sI=e=>{var r;const t=new Date(e),n=new Date-t;return(r=oI.find(o=>isNaN(n)||n{switch(t){case String:return n=>nI(n[e]);case Number:return n=>n[e];case Date:return n=>sI(n[e]);case"Digits":return n=>rI(n[e]);default:return()=>J1}};class Ee{constructor({items:t=[],total:n=0,offset:r=0,limit:o=-1}={},s={}){this.items=t,this.total=n,this.offset=r,this.limit=o,this.count=t.length,this.indices=[],this.group(s)}group({criteria:t=[],filters:n=[],index:r}={}){const o=this.items.filter(l=>n.every(u=>u(l)));this.count=o.length;const s=tI(t),i=o.sort((l,u)=>s.reduce((m,d)=>m||d(l,u),0)),a=iI(r);return this.itemsGrouped=i.reduce((l,u)=>{const m=a(u);return l.set(m,[...l.get(m)||[],u]),l},new Map),this.indices=Array.from(this.itemsGrouped.keys()),this}*generate(){for(const[t,n]of this.itemsGrouped.entries()){t!==J1&&(yield{index:t,isItem:!1,item:{},itemId:t});for(const r of n)yield{index:t,isItem:!0,item:r,itemId:r.id}}}[Symbol.iterator](){return this.generate()}}var Q1={exports:{}};(function(e){var t=function(){var n="https://api.spotify.com/v1",r=null,o=null,s=function(f,p){return f.abort=p,f},i=function(f,p){var h;if(o!==null){var g=o.defer();f(function(z){g.resolve(z)},function(z){g.reject(z)}),h=g.promise}else window.Promise&&(h=new window.Promise(f));return h?new s(h,p):null},a=function(){var f=Array.prototype.slice.call(arguments),p=f[0],h=f.slice(1);return p=p||{},h.forEach(function(g){for(var z in g)g.hasOwnProperty(z)&&(p[z]=g[z])}),p},l=function(f,p){var h="";for(var g in p)if(p.hasOwnProperty(g)){var z=p[g];h+=encodeURIComponent(g)+"="+encodeURIComponent(z)+"&"}return h.length>0&&(h=h.substring(0,h.length-1),f=f+"?"+h),f},u=function(f,p){var h=new XMLHttpRequest,g=function(z,k){function w(C){z&&z(C),p&&p(null,C)}function _(){k&&k(h),p&&p(h,null)}var v=f.type||"GET";if(h.open(v,l(f.url,f.params)),r&&h.setRequestHeader("Authorization","Bearer "+r),h.onreadystatechange=function(){if(h.readyState===4){var C=null;try{C=h.responseText?JSON.parse(h.responseText):""}catch(L){console.error(L)}h.status>=200&&h.status<300?w(C):_()}},v==="GET")h.send(null);else{var S=null;f.postData&&(f.contentType==="image/jpeg"?(S=f.postData,h.setRequestHeader("Content-Type",f.contentType)):(S=JSON.stringify(f.postData),h.setRequestHeader("Content-Type","application/json"))),h.send(S)}};return p?(g(),null):i(g,function(){h.abort()})},m=function(f,p,h,g){var z={},k=null;typeof p=="object"?(z=p,k=h):typeof p=="function"&&(k=p);var w=f.type||"GET";return w!=="GET"&&f.postData&&!g?f.postData=a(f.postData,z):f.params=a(f.params,z),u(f,k)},d=function(){};return d.prototype={constructor:t},d.prototype.getGeneric=function(f,p){var h={url:f};return m(h,p)},d.prototype.getMe=function(f,p){var h={url:n+"/me"};return m(h,f,p)},d.prototype.getMySavedTracks=function(f,p){var h={url:n+"/me/tracks"};return m(h,f,p)},d.prototype.addToMySavedTracks=function(f,p,h){var g={url:n+"/me/tracks",type:"PUT",postData:f};return m(g,p,h)},d.prototype.removeFromMySavedTracks=function(f,p,h){var g={url:n+"/me/tracks",type:"DELETE",postData:f};return m(g,p,h)},d.prototype.containsMySavedTracks=function(f,p,h){var g={url:n+"/me/tracks/contains",params:{ids:f.join(",")}};return m(g,p,h)},d.prototype.getMySavedAlbums=function(f,p){var h={url:n+"/me/albums"};return m(h,f,p)},d.prototype.addToMySavedAlbums=function(f,p,h){var g={url:n+"/me/albums",type:"PUT",postData:f};return m(g,p,h)},d.prototype.removeFromMySavedAlbums=function(f,p,h){var g={url:n+"/me/albums",type:"DELETE",postData:f};return m(g,p,h)},d.prototype.containsMySavedAlbums=function(f,p,h){var g={url:n+"/me/albums/contains",params:{ids:f.join(",")}};return m(g,p,h)},d.prototype.getMyTopArtists=function(f,p){var h={url:n+"/me/top/artists"};return m(h,f,p)},d.prototype.getMyTopTracks=function(f,p){var h={url:n+"/me/top/tracks"};return m(h,f,p)},d.prototype.getMyRecentlyPlayedTracks=function(f,p){var h={url:n+"/me/player/recently-played"};return m(h,f,p)},d.prototype.followUsers=function(f,p){var h={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"user"}};return m(h,p)},d.prototype.followArtists=function(f,p){var h={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"artist"}};return m(h,p)},d.prototype.followPlaylist=function(f,p,h){var g={url:n+"/playlists/"+f+"/followers",type:"PUT",postData:{}};return m(g,p,h)},d.prototype.unfollowUsers=function(f,p){var h={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"user"}};return m(h,p)},d.prototype.unfollowArtists=function(f,p){var h={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"artist"}};return m(h,p)},d.prototype.unfollowPlaylist=function(f,p){var h={url:n+"/playlists/"+f+"/followers",type:"DELETE"};return m(h,p)},d.prototype.isFollowingUsers=function(f,p){var h={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"user"}};return m(h,p)},d.prototype.isFollowingArtists=function(f,p){var h={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"artist"}};return m(h,p)},d.prototype.areFollowingPlaylist=function(f,p,h){var g={url:n+"/playlists/"+f+"/followers/contains",type:"GET",params:{ids:p.join(",")}};return m(g,h)},d.prototype.getFollowedArtists=function(f,p){var h={url:n+"/me/following",type:"GET",params:{type:"artist"}};return m(h,f,p)},d.prototype.getUser=function(f,p,h){var g={url:n+"/users/"+encodeURIComponent(f)};return m(g,p,h)},d.prototype.getUserPlaylists=function(f,p,h){var g;return typeof f=="string"?g={url:n+"/users/"+encodeURIComponent(f)+"/playlists"}:(g={url:n+"/me/playlists"},h=p,p=f),m(g,p,h)},d.prototype.getPlaylist=function(f,p,h){var g={url:n+"/playlists/"+f};return m(g,p,h)},d.prototype.getPlaylistTracks=function(f,p,h){var g={url:n+"/playlists/"+f+"/tracks"};return m(g,p,h)},d.prototype.getPlaylistCoverImage=function(f,p){var h={url:n+"/playlists/"+f+"/images"};return m(h,p)},d.prototype.createPlaylist=function(f,p,h){var g={url:n+"/users/"+encodeURIComponent(f)+"/playlists",type:"POST",postData:p};return m(g,p,h)},d.prototype.changePlaylistDetails=function(f,p,h){var g={url:n+"/playlists/"+f,type:"PUT",postData:p};return m(g,p,h)},d.prototype.addTracksToPlaylist=function(f,p,h,g){var z={url:n+"/playlists/"+f+"/tracks",type:"POST",postData:{uris:p}};return m(z,h,g,!0)},d.prototype.replaceTracksInPlaylist=function(f,p,h){var g={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{uris:p}};return m(g,{},h)},d.prototype.reorderTracksInPlaylist=function(f,p,h,g,z){var k={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{range_start:p,insert_before:h}};return m(k,g,z)},d.prototype.removeTracksFromPlaylist=function(f,p,h){var g=p.map(function(k){return typeof k=="string"?{uri:k}:k}),z={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:g}};return m(z,{},h)},d.prototype.removeTracksFromPlaylistWithSnapshotId=function(f,p,h,g){var z=p.map(function(w){return typeof w=="string"?{uri:w}:w}),k={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:z,snapshot_id:h}};return m(k,{},g)},d.prototype.removeTracksFromPlaylistInPositions=function(f,p,h,g){var z={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{positions:p,snapshot_id:h}};return m(z,{},g)},d.prototype.uploadCustomPlaylistCoverImage=function(f,p,h){var g={url:n+"/playlists/"+f+"/images",type:"PUT",postData:p.replace(/^data:image\/jpeg;base64,/,""),contentType:"image/jpeg"};return m(g,{},h)},d.prototype.getAlbum=function(f,p,h){var g={url:n+"/albums/"+f};return m(g,p,h)},d.prototype.getAlbumTracks=function(f,p,h){var g={url:n+"/albums/"+f+"/tracks"};return m(g,p,h)},d.prototype.getAlbums=function(f,p,h){var g={url:n+"/albums/",params:{ids:f.join(",")}};return m(g,p,h)},d.prototype.getTrack=function(f,p,h){var g={};return g.url=n+"/tracks/"+f,m(g,p,h)},d.prototype.getTracks=function(f,p,h){var g={url:n+"/tracks/",params:{ids:f.join(",")}};return m(g,p,h)},d.prototype.getArtist=function(f,p,h){var g={url:n+"/artists/"+f};return m(g,p,h)},d.prototype.getArtists=function(f,p,h){var g={url:n+"/artists/",params:{ids:f.join(",")}};return m(g,p,h)},d.prototype.getArtistAlbums=function(f,p,h){var g={url:n+"/artists/"+f+"/albums"};return m(g,p,h)},d.prototype.getArtistTopTracks=function(f,p,h,g){var z={url:n+"/artists/"+f+"/top-tracks",params:{country:p}};return m(z,h,g)},d.prototype.getArtistRelatedArtists=function(f,p,h){var g={url:n+"/artists/"+f+"/related-artists"};return m(g,p,h)},d.prototype.getFeaturedPlaylists=function(f,p){var h={url:n+"/browse/featured-playlists"};return m(h,f,p)},d.prototype.getNewReleases=function(f,p){var h={url:n+"/browse/new-releases"};return m(h,f,p)},d.prototype.getCategories=function(f,p){var h={url:n+"/browse/categories"};return m(h,f,p)},d.prototype.getCategory=function(f,p,h){var g={url:n+"/browse/categories/"+f};return m(g,p,h)},d.prototype.getCategoryPlaylists=function(f,p,h){var g={url:n+"/browse/categories/"+f+"/playlists"};return m(g,p,h)},d.prototype.search=function(f,p,h,g){var z={url:n+"/search/",params:{q:f,type:p.join(",")}};return m(z,h,g)},d.prototype.searchAlbums=function(f,p,h){return this.search(f,["album"],p,h)},d.prototype.searchArtists=function(f,p,h){return this.search(f,["artist"],p,h)},d.prototype.searchTracks=function(f,p,h){return this.search(f,["track"],p,h)},d.prototype.searchPlaylists=function(f,p,h){return this.search(f,["playlist"],p,h)},d.prototype.searchShows=function(f,p,h){return this.search(f,["show"],p,h)},d.prototype.searchEpisodes=function(f,p,h){return this.search(f,["episode"],p,h)},d.prototype.getAudioFeaturesForTrack=function(f,p){var h={};return h.url=n+"/audio-features/"+f,m(h,{},p)},d.prototype.getAudioFeaturesForTracks=function(f,p){var h={url:n+"/audio-features",params:{ids:f}};return m(h,{},p)},d.prototype.getAudioAnalysisForTrack=function(f,p){var h={};return h.url=n+"/audio-analysis/"+f,m(h,{},p)},d.prototype.getRecommendations=function(f,p){var h={url:n+"/recommendations"};return m(h,f,p)},d.prototype.getAvailableGenreSeeds=function(f){var p={url:n+"/recommendations/available-genre-seeds"};return m(p,{},f)},d.prototype.getMyDevices=function(f){var p={url:n+"/me/player/devices"};return m(p,{},f)},d.prototype.getMyCurrentPlaybackState=function(f,p){var h={url:n+"/me/player"};return m(h,f,p)},d.prototype.getMyCurrentPlayingTrack=function(f,p){var h={url:n+"/me/player/currently-playing"};return m(h,f,p)},d.prototype.transferMyPlayback=function(f,p,h){var g=p||{};g.device_ids=f;var z={type:"PUT",url:n+"/me/player",postData:g};return m(z,p,h)},d.prototype.play=function(f,p){f=f||{};var h="device_id"in f?{device_id:f.device_id}:null,g={};["context_uri","uris","offset","position_ms"].forEach(function(w){w in f&&(g[w]=f[w])});var z={type:"PUT",url:n+"/me/player/play",params:h,postData:g},k=typeof f=="function"?f:{};return m(z,k,p)},d.prototype.queue=function(f,p,h){p=p||{};var g="device_id"in p?{uri:f,device_id:p.device_id}:{uri:f},z={type:"POST",url:n+"/me/player/queue",params:g};return m(z,p,h)},d.prototype.pause=function(f,p){f=f||{};var h="device_id"in f?{device_id:f.device_id}:null,g={type:"PUT",url:n+"/me/player/pause",params:h};return m(g,f,p)},d.prototype.skipToNext=function(f,p){f=f||{};var h="device_id"in f?{device_id:f.device_id}:null,g={type:"POST",url:n+"/me/player/next",params:h};return m(g,f,p)},d.prototype.skipToPrevious=function(f,p){f=f||{};var h="device_id"in f?{device_id:f.device_id}:null,g={type:"POST",url:n+"/me/player/previous",params:h};return m(g,f,p)},d.prototype.seek=function(f,p,h){p=p||{};var g={position_ms:f};"device_id"in p&&(g.device_id=p.device_id);var z={type:"PUT",url:n+"/me/player/seek",params:g};return m(z,p,h)},d.prototype.setRepeat=function(f,p,h){p=p||{};var g={state:f};"device_id"in p&&(g.device_id=p.device_id);var z={type:"PUT",url:n+"/me/player/repeat",params:g};return m(z,p,h)},d.prototype.setVolume=function(f,p,h){p=p||{};var g={volume_percent:f};"device_id"in p&&(g.device_id=p.device_id);var z={type:"PUT",url:n+"/me/player/volume",params:g};return m(z,p,h)},d.prototype.setShuffle=function(f,p,h){p=p||{};var g={state:f};"device_id"in p&&(g.device_id=p.device_id);var z={type:"PUT",url:n+"/me/player/shuffle",params:g};return m(z,p,h)},d.prototype.getShow=function(f,p,h){var g={};return g.url=n+"/shows/"+f,m(g,p,h)},d.prototype.getShows=function(f,p,h){var g={url:n+"/shows/",params:{ids:f.join(",")}};return m(g,p,h)},d.prototype.getMySavedShows=function(f,p){var h={url:n+"/me/shows"};return m(h,f,p)},d.prototype.addToMySavedShows=function(f,p,h){var g={url:n+"/me/shows",type:"PUT",postData:f};return m(g,p,h)},d.prototype.removeFromMySavedShows=function(f,p,h){var g={url:n+"/me/shows",type:"DELETE",postData:f};return m(g,p,h)},d.prototype.containsMySavedShows=function(f,p,h){var g={url:n+"/me/shows/contains",params:{ids:f.join(",")}};return m(g,p,h)},d.prototype.getShowEpisodes=function(f,p,h){var g={url:n+"/shows/"+f+"/episodes"};return m(g,p,h)},d.prototype.getEpisode=function(f,p,h){var g={};return g.url=n+"/episodes/"+f,m(g,p,h)},d.prototype.getEpisodes=function(f,p,h){var g={url:n+"/episodes/",params:{ids:f.join(",")}};return m(g,p,h)},d.prototype.getAccessToken=function(){return r},d.prototype.setAccessToken=function(f){r=f},d.prototype.setPromiseImplementation=function(f){var p=!1;try{var h=new f(function(g){g()});typeof h.then=="function"&&typeof h.catch=="function"&&(p=!0)}catch(g){console.error(g)}if(p)o=f;else throw new Error("Unsupported implementation of Promises/A+")},d}();e.exports=t})(Q1);var aI=Q1.exports;const ir=Yl(aI),lI={name:"ModalDialogTrack",props:{item:{required:!0,type:Object},show:Boolean},emits:["close","play-count-changed"],setup(){return{servicesStore:Pt()}},data(){return{spotify_track:{}}},watch:{item(){if(this.item&&this.item.data_kind==="spotify"&&this.item.media_kind!=="podcast"){const e=new ir;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getTrack(this.item.path.slice(this.item.path.lastIndexOf(":")+1)).then(t=>{this.spotify_track=t})}else this.spotify_track={}}},methods:{mark_new(){B.library_track_update(this.item.id,{play_count:"reset"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},mark_played(){B.library_track_update(this.item.id,{play_count:"increment"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},open_album(){this.item.data_kind==="spotify"&&this.item.media_kind!=="podcast"?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.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.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{media_kind:this.item.media_kind}})},play(){this.$emit("close"),B.player_play_uri(this.item.uri,!1)},queue_add(){this.$emit("close"),B.queue_add(this.item.uri)},queue_add_next(){this.$emit("close"),B.queue_add_next(this.item.uri)}}},cI={key:0,class:"modal is-active"},uI={class:"modal-content"},dI={class:"card"},mI={class:"card-content"},fI=["textContent"],pI=["textContent"],hI={key:0,class:"buttons"},_I=["textContent"],gI=["textContent"],yI={class:"content is-small"},zI={key:0},vI=["textContent"],bI=["textContent"],CI={key:1},wI=["textContent"],kI=["textContent"],SI={key:2},xI=["textContent"],EI=["textContent"],$I={key:3},TI=["textContent"],AI=["textContent"],OI={key:4},PI=["textContent"],II=["textContent"],LI={key:5},NI=["textContent"],DI=["textContent"],RI={key:6},MI=["textContent"],FI=["textContent"],VI={key:7},HI=["textContent"],UI=["textContent"],jI=["textContent"],BI=["textContent"],WI=["textContent"],qI={class:"title is-6"},GI=["textContent"],KI={key:8},ZI=["textContent"],YI={class:"title is-6"},XI=["textContent"],JI=["textContent"],QI=["textContent"],eL=["textContent"],tL=["textContent"],nL=["textContent"],rL=["textContent"],oL=["textContent"],sL={key:9},iL=["textContent"],aL=["textContent"],lL={class:"card-footer"},cL=["textContent"],uL=["textContent"],dL=["textContent"];function mL(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",cI,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",uI,[c("div",dI,[c("div",mI,[c("p",{class:"title is-4",textContent:y(n.item.title)},null,8,fI),c("p",{class:"subtitle",textContent:y(n.item.artist)},null,8,pI),n.item.media_kind==="podcast"?(x(),I("div",hI,[n.item.play_count>0?(x(),I("a",{key:0,class:"button is-small",onClick:t[1]||(t[1]=(...a)=>s.mark_new&&s.mark_new(...a)),textContent:y(e.$t("dialog.track.mark-as-new"))},null,8,_I)):ee("",!0),n.item.play_count===0?(x(),I("a",{key:1,class:"button is-small",onClick:t[2]||(t[2]=(...a)=>s.mark_played&&s.mark_played(...a)),textContent:y(e.$t("dialog.track.mark-as-played"))},null,8,gI)):ee("",!0)])):ee("",!0),c("div",yI,[n.item.album?(x(),I("p",zI,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.album"))},null,8,vI),c("a",{class:"title is-6 has-text-link",onClick:t[3]||(t[3]=(...a)=>s.open_album&&s.open_album(...a)),textContent:y(n.item.album)},null,8,bI)])):ee("",!0),n.item.album_artist&&n.item.media_kind!=="audiobook"?(x(),I("p",CI,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.album-artist"))},null,8,wI),c("a",{class:"title is-6 has-text-link",onClick:t[4]||(t[4]=(...a)=>s.open_album_artist&&s.open_album_artist(...a)),textContent:y(n.item.album_artist)},null,8,kI)])):ee("",!0),n.item.composer?(x(),I("p",SI,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.composer"))},null,8,xI),c("span",{class:"title is-6",textContent:y(n.item.composer)},null,8,EI)])):ee("",!0),n.item.date_released?(x(),I("p",$I,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.release-date"))},null,8,TI),c("span",{class:"title is-6",textContent:y(e.$filters.date(n.item.date_released))},null,8,AI)])):n.item.year?(x(),I("p",OI,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.year"))},null,8,PI),c("span",{class:"title is-6",textContent:y(n.item.year)},null,8,II)])):ee("",!0),n.item.genre?(x(),I("p",LI,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.genre"))},null,8,NI),c("a",{class:"title is-6 has-text-link",onClick:t[5]||(t[5]=(...a)=>s.open_genre&&s.open_genre(...a)),textContent:y(n.item.genre)},null,8,DI)])):ee("",!0),n.item.disc_number?(x(),I("p",RI,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.position"))},null,8,MI),c("span",{class:"title is-6",textContent:y([n.item.disc_number,n.item.track_number].join(" / "))},null,8,FI)])):ee("",!0),n.item.length_ms?(x(),I("p",VI,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.duration"))},null,8,HI),c("span",{class:"title is-6",textContent:y(e.$filters.durationInHours(n.item.length_ms))},null,8,UI)])):ee("",!0),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.path"))},null,8,jI),c("span",{class:"title is-6",textContent:y(n.item.path)},null,8,BI)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.type"))},null,8,WI),c("span",qI,[c("span",{textContent:y(`${e.$t(`media.kind.${n.item.media_kind}`)} - ${e.$t(`data.kind.${n.item.data_kind}`)}`)},null,8,GI)])]),n.item.samplerate?(x(),I("p",KI,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.quality"))},null,8,ZI),c("span",YI,[c("span",{textContent:y(n.item.type)},null,8,XI),n.item.samplerate?(x(),I("span",{key:0,textContent:y(e.$t("dialog.track.samplerate",{rate:n.item.samplerate}))},null,8,JI)):ee("",!0),n.item.channels?(x(),I("span",{key:1,textContent:y(e.$t("dialog.track.channels",{channels:e.$filters.channels(n.item.channels)}))},null,8,QI)):ee("",!0),n.item.bitrate?(x(),I("span",{key:2,textContent:y(e.$t("dialog.track.bitrate",{rate:n.item.bitrate}))},null,8,eL)):ee("",!0)])])):ee("",!0),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.added-on"))},null,8,tL),c("span",{class:"title is-6",textContent:y(e.$filters.datetime(n.item.time_added))},null,8,nL)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.rating"))},null,8,rL),c("span",{class:"title is-6",textContent:y(e.$t("dialog.track.rating-value",{rating:Math.floor(n.item.rating/10)}))},null,8,oL)]),n.item.comment?(x(),I("p",sL,[c("span",{class:"heading",textContent:y(e.$t("dialog.track.comment"))},null,8,iL),c("span",{class:"title is-6",textContent:y(n.item.comment)},null,8,aL)])):ee("",!0)])]),c("footer",lL,[c("a",{class:"card-footer-item has-text-dark",onClick:t[6]||(t[6]=(...a)=>s.queue_add&&s.queue_add(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.track.add"))},null,8,cL)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[7]||(t[7]=(...a)=>s.queue_add_next&&s.queue_add_next(...a))},[b(i,{class:"icon",name:"playlist-play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.track.add-next"))},null,8,uL)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[8]||(t[8]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.track.play"))},null,8,dL)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[9]||(t[9]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const fL=ae(lI,[["render",mL]]),pL={name:"ListTracks",components:{ModalDialogTrack:fL},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(e){this.selected_item=e,this.show_details_modal=!0},play(e){this.uris?B.player_play_uri(this.uris,!1,this.items.items.indexOf(e)):this.expression?B.player_play_expression(this.expression,!1,this.items.items.indexOf(e)):B.player_play_uri(e.uri,!1)}}},hL={key:0,class:"mt-6 mb-5 py-2"},_L=["id","textContent"],gL=["onClick"],yL={key:0,class:"media-left is-clickable"},zL={class:"media-content is-clickable is-clipped"},vL=["textContent"],bL=["textContent"],CL=["textContent"],wL=["max","value"],kL={class:"media-right"},SL=["onClick"];function xL(e,t,n,r,o,s){const i=O("mdicon"),a=O("modal-dialog-track");return x(),I(ve,null,[(x(!0),I(ve,null,_t(n.items,l=>(x(),I(ve,{key:l.itemId},[l.isItem?(x(),I("div",{key:1,class:ke(["media is-align-items-center",{"with-progress":n.show_progress}]),onClick:u=>s.play(l.item)},[n.show_icon?(x(),I("figure",yL,[b(i,{class:"icon",name:"file-outline",size:"16"})])):ee("",!0),c("div",zL,[c("h1",{class:ke(["title is-6",{"has-text-grey":l.item.media_kind==="podcast"&&l.item.play_count>0}]),textContent:y(l.item.title)},null,10,vL),c("h2",{class:"subtitle is-7 has-text-grey has-text-weight-bold",textContent:y(l.item.artist)},null,8,bL),c("h2",{class:"subtitle is-7 has-text-grey",textContent:y(l.item.album)},null,8,CL),n.show_progress&&l.item.seek_ms>0?(x(),I("progress",{key:0,class:"progress is-info",max:l.item.length_ms,value:l.item.seek_ms},null,8,wL)):ee("",!0)]),c("div",kL,[c("a",{onClick:gt(u=>s.open_dialog(l.item),["prevent","stop"])},[b(i,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,SL)])],10,gL)):(x(),I("div",hL,[c("span",{id:`index_${l.index}`,class:"tag is-info is-light is-small has-text-weight-bold",textContent:y(l.index)},null,8,_L)]))],64))),128)),(x(),we(Hn,{to:"#app"},[b(a,{item:o.selected_item,show:o.show_details_modal,onClose:t[0]||(t[0]=l=>o.show_details_modal=!1),onPlayCountChanged:t[1]||(t[1]=l=>e.$emit("play-count-changed"))},null,8,["item","show"])]))],64)}const gn=ae(pL,[["render",xL],["__scopeId","data-v-84498238"]]),EL={name:"ModalDialogAlbum",components:{CoverArtwork:Lr},props:{item:{required:!0,type:Object},media_kind:{default:"",type:String},show:Boolean},emits:["close","remove-podcast","play-count-changed"],data(){return{artwork_visible:!1}},computed:{media_kind_resolved(){return this.media_kind||this.item.media_kind}},methods:{mark_played(){B.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}})},play(){this.$emit("close"),B.player_play_uri(this.item.uri,!1)},queue_add(){this.$emit("close"),B.queue_add(this.item.uri)},queue_add_next(){this.$emit("close"),B.queue_add_next(this.item.uri)}}},$L={key:0,class:"modal is-active"},TL={class:"modal-content"},AL={class:"card"},OL={class:"card-content"},PL={class:"title is-4"},IL=["textContent"],LL={key:0,class:"buttons"},NL=["textContent"],DL=["textContent"],RL={class:"content is-small"},ML={key:0},FL=["textContent"],VL=["textContent"],HL={key:1},UL=["textContent"],jL=["textContent"],BL={key:2},WL=["textContent"],qL=["textContent"],GL=["textContent"],KL=["textContent"],ZL=["textContent"],YL=["textContent"],XL=["textContent"],JL=["textContent"],QL=["textContent"],e4=["textContent"],t4={class:"card-footer"},n4=["textContent"],r4=["textContent"],o4=["textContent"];function s4(e,t,n,r,o,s){const i=O("cover-artwork"),a=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",$L,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=l=>e.$emit("close"))}),c("div",TL,[c("div",AL,[c("div",OL,[b(i,{url:n.item.artwork_url,artist:n.item.artist,album:n.item.name,class:"fd-has-shadow fd-cover fd-cover-normal-image mb-5"},null,8,["url","artist","album"]),c("p",PL,[c("a",{class:"has-text-link",onClick:t[1]||(t[1]=(...l)=>s.open&&s.open(...l)),textContent:y(n.item.name)},null,8,IL)]),s.media_kind_resolved==="podcast"?(x(),I("div",LL,[c("a",{class:"button is-small",onClick:t[2]||(t[2]=(...l)=>s.mark_played&&s.mark_played(...l)),textContent:y(e.$t("dialog.album.mark-as-played"))},null,8,NL),n.item.data_kind==="url"?(x(),I("a",{key:0,class:"button is-small",onClick:t[3]||(t[3]=l=>e.$emit("remove-podcast")),textContent:y(e.$t("dialog.album.remove-podcast"))},null,8,DL)):ee("",!0)])):ee("",!0),c("div",RL,[n.item.artist?(x(),I("p",ML,[c("span",{class:"heading",textContent:y(e.$t("dialog.album.artist"))},null,8,FL),c("a",{class:"title is-6 has-text-link",onClick:t[4]||(t[4]=(...l)=>s.open_artist&&s.open_artist(...l)),textContent:y(n.item.artist)},null,8,VL)])):ee("",!0),n.item.date_released?(x(),I("p",HL,[c("span",{class:"heading",textContent:y(e.$t("dialog.album.release-date"))},null,8,UL),c("span",{class:"title is-6",textContent:y(e.$filters.date(n.item.date_released))},null,8,jL)])):n.item.year?(x(),I("p",BL,[c("span",{class:"heading",textContent:y(e.$t("dialog.album.year"))},null,8,WL),c("span",{class:"title is-6",textContent:y(n.item.year)},null,8,qL)])):ee("",!0),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.album.tracks"))},null,8,GL),c("span",{class:"title is-6",textContent:y(n.item.track_count)},null,8,KL)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.album.duration"))},null,8,ZL),c("span",{class:"title is-6",textContent:y(e.$filters.durationInHours(n.item.length_ms))},null,8,YL)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.album.type"))},null,8,XL),c("span",{class:"title is-6",textContent:y(`${e.$t(`media.kind.${n.item.media_kind}`)} - ${e.$t(`data.kind.${n.item.data_kind}`)}`)},null,8,JL)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.album.added-on"))},null,8,QL),c("span",{class:"title is-6",textContent:y(e.$filters.datetime(n.item.time_added))},null,8,e4)])])]),c("footer",t4,[c("a",{class:"card-footer-item has-text-dark",onClick:t[5]||(t[5]=(...l)=>s.queue_add&&s.queue_add(...l))},[b(a,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.album.add"))},null,8,n4)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[6]||(t[6]=(...l)=>s.queue_add_next&&s.queue_add_next(...l))},[b(a,{class:"icon",name:"playlist-play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.album.add-next"))},null,8,r4)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[7]||(t[7]=(...l)=>s.play&&s.play(...l))},[b(a,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.album.play"))},null,8,o4)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[8]||(t[8]=l=>e.$emit("close"))})])):ee("",!0)]),_:1})}const oc=ae(EL,[["render",s4]]),qp={load(e){return Promise.all([B.library_album(e.params.id),B.library_album_tracks(e.params.id)])},set(e,t){e.album=t[0].data,e.tracks=new Ee(t[1].data,{criteria:[{field:"disc_number",type:Number}],index:{field:"disc_number",type:Number}}),e.tracks.indices.length<2&&e.tracks.group()}},i4={name:"PageAlbum",components:{ContentWithHero:rc,CoverArtwork:Lr,ListTracks:gn,ModalDialogAlbum:oc},beforeRouteEnter(e,t,n){qp.load(e).then(r=>{n(o=>qp.set(o,r))})},data(){return{album:{},show_details_modal:!1,tracks:new Ee}},methods:{open_artist(){this.show_details_modal=!1,this.$router.push({name:"music-artist",params:{id:this.album.artist_id}})},play(){B.player_play_uri(this.album.uri,!0)}}},a4=["textContent"],l4={class:"subtitle is-6 has-text-link"},c4=["textContent"],u4={class:"buttons fd-is-centered-mobile mt-5"},d4=["textContent"],m4=["textContent"];function f4(e,t,n,r,o,s){const i=O("mdicon"),a=O("cover-artwork"),l=O("list-tracks"),u=O("modal-dialog-album"),m=O("content-with-hero");return x(),I("div",null,[b(m,null,{"heading-left":N(()=>[c("h1",{class:"title is-5",textContent:y(o.album.name)},null,8,a4),c("h2",l4,[c("a",{class:"has-text-link",onClick:t[0]||(t[0]=(...d)=>s.open_artist&&s.open_artist(...d)),textContent:y(o.album.artist)},null,8,c4)]),c("div",u4,[c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...d)=>s.play&&s.play(...d))},[b(i,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.album.shuffle"))},null,8,d4)]),c("a",{class:"button is-small is-light is-rounded",onClick:t[2]||(t[2]=d=>o.show_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})])])]),"heading-right":N(()=>[b(a,{url:o.album.artwork_url,artist:o.album.artist,album:o.album.name,class:"is-clickable fd-has-shadow fd-cover fd-cover-medium-image",onClick:t[3]||(t[3]=d=>o.show_details_modal=!0)},null,8,["url","artist","album"])]),content:N(()=>[c("p",{class:"heading has-text-centered-mobile mt-5",textContent:y(e.$t("page.album.track-count",{count:o.album.track_count}))},null,8,m4),b(l,{items:o.tracks,uris:o.album.uri},null,8,["items","uris"]),b(u,{item:o.album,show:o.show_details_modal,onClose:t[4]||(t[4]=d=>o.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const p4=ae(i4,[["render",f4]]),h4={name:"ModalDialogTrackSpotify",props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],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}})},play(){this.$emit("close"),B.player_play_uri(this.item.uri,!1)},queue_add(){this.$emit("close"),B.queue_add(this.item.uri)},queue_add_next(){this.$emit("close"),B.queue_add_next(this.item.uri)}}},_4={key:0,class:"modal is-active"},g4={class:"modal-content"},y4={class:"card"},z4={class:"card-content"},v4=["textContent"],b4=["textContent"],C4={class:"content is-small"},w4=["textContent"],k4=["textContent"],S4=["textContent"],x4=["textContent"],E4=["textContent"],$4=["textContent"],T4=["textContent"],A4=["textContent"],O4=["textContent"],P4=["textContent"],I4=["textContent"],L4=["textContent"],N4={class:"card-footer"},D4=["textContent"],R4=["textContent"],M4=["textContent"];function F4(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",_4,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",g4,[c("div",y4,[c("div",z4,[c("p",{class:"title is-4",textContent:y(n.item.name)},null,8,v4),c("p",{class:"subtitle",textContent:y(n.item.artists[0].name)},null,8,b4),c("div",C4,[c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.track.album"))},null,8,w4),c("a",{class:"title is-6 has-text-link",onClick:t[1]||(t[1]=(...a)=>s.open_album&&s.open_album(...a)),textContent:y(n.item.album.name)},null,8,k4)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.track.album-artist"))},null,8,S4),c("a",{class:"title is-6 has-text-link",onClick:t[2]||(t[2]=(...a)=>s.open_artist&&s.open_artist(...a)),textContent:y(n.item.artists[0].name)},null,8,x4)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.track.release-date"))},null,8,E4),c("span",{class:"title is-6",textContent:y(e.$filters.date(n.item.album.release_date))},null,8,$4)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.track.position"))},null,8,T4),c("span",{class:"title is-6",textContent:y([n.item.disc_number,n.item.track_number].join(" / "))},null,8,A4)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.track.duration"))},null,8,O4),c("span",{class:"title is-6",textContent:y(e.$filters.durationInHours(n.item.duration_ms))},null,8,P4)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.track.path"))},null,8,I4),c("span",{class:"title is-6",textContent:y(n.item.uri)},null,8,L4)])])]),c("footer",N4,[c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=(...a)=>s.queue_add&&s.queue_add(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.track.add"))},null,8,D4)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[4]||(t[4]=(...a)=>s.queue_add_next&&s.queue_add_next(...a))},[b(i,{class:"icon",name:"playlist-play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.track.add-next"))},null,8,R4)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[5]||(t[5]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.track.play"))},null,8,M4)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[6]||(t[6]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const V4=ae(h4,[["render",F4]]),H4={name:"ListTracksSpotify",components:{ModalDialogTrackSpotify:V4},props:{context_uri:{default:"",type:String},items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open_dialog(e){this.selected_item=e,this.show_details_modal=!0},play(e){e.is_playable&&B.player_play_uri(this.context_uri||e.uri,!1,e.position||0)}}},U4=["onClick"],j4=["textContent"],B4=["textContent"],W4=["textContent"],q4={key:0,class:"subtitle is-7"},G4=["textContent"],K4=["textContent"],Z4={class:"media-right"},Y4=["onClick"];function X4(e,t,n,r,o,s){const i=O("mdicon"),a=O("modal-dialog-track-spotify");return x(),I(ve,null,[(x(!0),I(ve,null,_t(n.items,l=>{var u;return x(),I("div",{key:l.id,class:"media is-align-items-center"},[c("div",{class:ke(["media-content is-clipped",{"is-clickable":l.is_playable,"fd-is-not-allowed":!l.is_playable}]),onClick:m=>s.play(l)},[c("h1",{class:ke(["title is-6",{"has-text-grey-light":!l.is_playable}]),textContent:y(l.name)},null,10,j4),c("h2",{class:ke(["subtitle is-7 has-text-weight-bold",{"has-text-grey":l.is_playable,"has-text-grey-light":!l.is_playable}]),textContent:y(l.artists[0].name)},null,10,B4),c("h2",{class:"subtitle is-7 has-text-grey",textContent:y(l.album.name)},null,8,W4),l.is_playable?ee("",!0):(x(),I("h2",q4,[Dt(" ("),c("span",{textContent:y(e.$t("list.spotify.not-playable-track"))},null,8,G4),(u=l.restrictions)!=null&&u.reason?(x(),I("span",{key:0,textContent:y(e.$t("list.spotify.restriction-reason",{reason:l.restrictions.reason}))},null,8,K4)):ee("",!0),Dt(") ")]))],10,U4),c("div",Z4,[c("a",{onClick:gt(m=>s.open_dialog(l),["prevent","stop"])},[b(i,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,Y4)])])}),128)),(x(),we(Hn,{to:"#app"},[b(a,{item:o.selected_item,show:o.show_details_modal,onClose:t[0]||(t[0]=l=>o.show_details_modal=!1)},null,8,["item","show"])]))],64)}const dl=ae(H4,[["render",X4]]),J4={name:"ModalDialogAlbumSpotify",components:{CoverArtwork:Lr},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],data(){return{artwork_visible:!1}},methods:{artwork_error(){this.artwork_visible=!1},artwork_loaded(){this.artwork_visible=!0},artwork_url(e){var t,n;return((n=(t=e.images)==null?void 0:t[0])==null?void 0:n.url)||""},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}})},play(){this.$emit("close"),B.player_play_uri(this.item.uri,!1)},queue_add(){this.$emit("close"),B.queue_add(this.item.uri)},queue_add_next(){this.$emit("close"),B.queue_add_next(this.item.uri)}}},Q4={key:0,class:"modal is-active"},e6={class:"modal-content"},t6={class:"card"},n6={class:"card-content"},r6={class:"title is-4"},o6=["textContent"],s6={class:"content is-small"},i6=["textContent"],a6=["textContent"],l6=["textContent"],c6=["textContent"],u6=["textContent"],d6=["textContent"],m6={class:"card-footer"},f6=["textContent"],p6=["textContent"],h6=["textContent"];function _6(e,t,n,r,o,s){const i=O("cover-artwork"),a=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",Q4,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=l=>e.$emit("close"))}),c("div",e6,[c("div",t6,[c("div",n6,[b(i,{url:s.artwork_url(n.item),artist:n.item.artist,album:n.item.name,class:"fd-has-shadow fd-cover fd-cover-normal-image mb-5",onLoad:s.artwork_loaded,onError:s.artwork_error},null,8,["url","artist","album","onLoad","onError"]),c("p",r6,[c("a",{class:"has-text-link",onClick:t[1]||(t[1]=(...l)=>s.open&&s.open(...l)),textContent:y(n.item.name)},null,8,o6)]),c("div",s6,[c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.album.album-artist"))},null,8,i6),c("a",{class:"title is-6 has-text-link",onClick:t[2]||(t[2]=(...l)=>s.open_artist&&s.open_artist(...l)),textContent:y(n.item.artists[0].name)},null,8,a6)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.album.release-date"))},null,8,l6),c("span",{class:"title is-6",textContent:y(e.$filters.date(n.item.release_date))},null,8,c6)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.album.type"))},null,8,u6),c("span",{class:"title is-6",textContent:y(n.item.album_type)},null,8,d6)])])]),c("footer",m6,[c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=(...l)=>s.queue_add&&s.queue_add(...l))},[b(a,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.album.add"))},null,8,f6)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[4]||(t[4]=(...l)=>s.queue_add_next&&s.queue_add_next(...l))},[b(a,{class:"icon",name:"playlist-play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.album.add-next"))},null,8,p6)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[5]||(t[5]=(...l)=>s.play&&s.play(...l))},[b(a,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.album.play"))},null,8,h6)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[6]||(t[6]=l=>e.$emit("close"))})])):ee("",!0)]),_:1})}const ez=ae(J4,[["render",_6]]),Gp={load(e){const t=new ir;return t.setAccessToken(Pt().spotify.webapi_token),t.getAlbum(e.params.id,{market:Pt().spotify.webapi_country})},set(e,t){e.album=t}},g6={name:"PageAlbumSpotify",components:{ContentWithHero:rc,CoverArtwork:Lr,ListTracksSpotify:dl,ModalDialogAlbumSpotify:ez},beforeRouteEnter(e,t,n){Gp.load(e).then(r=>{n(o=>Gp.set(o,r))})},setup(){return{servicesStore:Pt()}},data(){return{album:{artists:[{}],tracks:{}},show_details_modal:!1}},computed:{tracks(){const{album:e}=this;return e.tracks.total?e.tracks.items.map(t=>({...t,album:e})):{}}},methods:{artwork_url(e){var t,n;return((n=(t=e.images)==null?void 0:t[0])==null?void 0:n.url)??""},open_artist(){this.$router.push({name:"music-spotify-artist",params:{id:this.album.artists[0].id}})},play(){this.show_details_modal=!1,B.player_play_uri(this.album.uri,!0)}}},y6=["textContent"],z6={class:"subtitle is-6 has-text-link"},v6=["textContent"],b6={class:"buttons fd-is-centered-mobile mt-5"},C6=["textContent"],w6=["textContent"];function k6(e,t,n,r,o,s){const i=O("mdicon"),a=O("cover-artwork"),l=O("list-tracks-spotify"),u=O("modal-dialog-album-spotify"),m=O("content-with-hero");return x(),I("div",null,[b(m,null,{"heading-left":N(()=>[c("h1",{class:"title is-5",textContent:y(o.album.name)},null,8,y6),c("h2",z6,[c("a",{class:"has-text-link",onClick:t[0]||(t[0]=(...d)=>s.open_artist&&s.open_artist(...d)),textContent:y(o.album.artists[0].name)},null,8,v6)]),c("div",b6,[c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...d)=>s.play&&s.play(...d))},[b(i,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.spotify.album.shuffle"))},null,8,C6)]),c("a",{class:"button is-small is-light is-rounded",onClick:t[2]||(t[2]=d=>o.show_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})])])]),"heading-right":N(()=>[b(a,{url:s.artwork_url(o.album),artist:o.album.artists[0].name,album:o.album.name,class:"is-clickable fd-has-shadow fd-cover fd-cover-medium-image",onClick:t[3]||(t[3]=d=>o.show_details_modal=!0)},null,8,["url","artist","album"])]),content:N(()=>[c("p",{class:"heading has-text-centered-mobile mt-5",textContent:y(e.$t("page.spotify.album.track-count",{count:o.album.tracks.total}))},null,8,w6),b(l,{items:s.tracks,context_uri:o.album.uri},null,8,["items","context_uri"]),b(u,{item:o.album,show:o.show_details_modal,onClose:t[4]||(t[4]=d=>o.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const S6=ae(g6,[["render",k6]]),x6={name:"ContentWithHeading",data(){return{options_visible:!1}},computed:{icon_name(){return this.options_visible?"chevron-up":"chevron-down"},position(){return{hash:this.options_visible?"#top":"#app",query:this.$route.query}}},mounted(){this.$slots.options&&(this.observer=new IntersectionObserver(this.onElementObserved,{rootMargin:"-82px 0px 0px 0px",threshold:1}),this.observer.observe(this.$refs.options))},methods:{onElementObserved(e){e.forEach(({isIntersecting:t})=>{this.options_visible=t})},visibilityChanged(e){this.options_visible=e}}},E6={class:"section"},$6={class:"container"},T6={class:"columns is-centered"},A6={class:"column is-four-fifths"},O6={key:0},P6={ref:"options",style:{height:"1px"}},I6={class:"buttons is-centered mt-4 mb-2"},L6={id:"top",class:"level is-clipped"},N6={class:"level-left is-flex-shrink-1"},D6={class:"level-item is-flex-shrink-1 has-text-centered-mobile"},R6={class:"level-right has-text-centered-mobile"},M6={class:"mt-4"};function F6(e,t,n,r,o,s){const i=O("mdicon"),a=O("router-link");return x(),I("section",E6,[c("div",$6,[c("div",T6,[c("div",A6,[e.$slots.options?(x(),I("section",O6,[c("div",P6,null,512),vt(e.$slots,"options"),c("nav",I6,[b(a,{class:"button is-small is-white",to:s.position},{default:N(()=>[b(i,{class:"icon is-small",name:s.icon_name,size:"16"},null,8,["name"])]),_:1},8,["to"])])])):ee("",!0),c("div",{class:ke({"is-full-height":e.$slots.options})},[c("nav",L6,[c("div",N6,[c("div",D6,[c("div",null,[vt(e.$slots,"heading-left")])])]),c("div",R6,[vt(e.$slots,"heading-right")])]),vt(e.$slots,"content"),c("div",M6,[vt(e.$slots,"footer")])],2)])])])])}const Qe=ae(x6,[["render",F6]]),V6={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(e=>e.id===this.value)}}},methods:{deactivate(){this.active=!1},select(e){this.active=!1,this.$emit("update:value",e.id)}}},H6={class:"dropdown-trigger"},U6=["textContent"],j6={id:"dropdown",class:"dropdown-menu",role:"menu"},B6={class:"dropdown-content"},W6=["onClick","textContent"];function q6(e,t,n,r,o,s){const i=O("mdicon"),a=kd("click-away");return ht((x(),I("div",{class:ke(["dropdown",{"is-active":o.active}])},[c("div",H6,[c("button",{class:"button","aria-haspopup":"true","aria-controls":"dropdown",onClick:t[0]||(t[0]=l=>o.active=!o.active)},[c("span",{textContent:y(s.option.name)},null,8,U6),b(i,{class:"icon",name:"chevron-down",size:"16"})])]),c("div",j6,[c("div",B6,[(x(!0),I(ve,null,_t(n.options,l=>(x(),I("a",{key:l.id,class:ke(["dropdown-item",{"is-active":n.value===l.id}]),onClick:u=>s.select(l),textContent:y(l.name)},null,10,W6))),128))])])],2)),[[a,s.deactivate]])}const Bo=ae(V6,[["render",q6]]),G6={name:"IndexButtonList",props:{indices:{required:!0,type:Array}}},K6={class:"buttons is-centered mb-4 fd-is-square"};function Z6(e,t,n,r,o,s){const i=O("router-link");return x(),I("section",null,[c("nav",K6,[(x(!0),I(ve,null,_t(n.indices,a=>(x(),we(i,{key:a,class:"button is-small",to:{hash:`#index_${a}`,query:e.$route.query}},{default:N(()=>[Dt(y(a),1)]),_:2},1032,["to"]))),128))])])}const ar=ae(G6,[["render",Z6]]),Y6={name:"ListAlbums",components:{CoverArtwork:Lr,ModalDialog:Zd,ModalDialogAlbum:oc},props:{items:{required:!0,type:Object},media_kind:{default:"",type:String}},emits:["play-count-changed","podcast-deleted"],setup(){return{settingsStore:sr()}},data(){return{rss_playlist_to_remove:{},selected_item:{},show_details_modal:!1,show_remove_podcast_modal:!1}},computed:{media_kind_resolved(){return this.media_kind||this.selected_item.media_kind}},methods:{open(e){this.selected_item=e,this.media_kind_resolved==="podcast"?this.$router.push({name:"podcast",params:{id:e.id}}):this.media_kind_resolved==="audiobook"?this.$router.push({name:"audiobooks-album",params:{id:e.id}}):this.$router.push({name:"music-album",params:{id:e.id}})},open_dialog(e){this.selected_item=e,this.show_details_modal=!0},open_remove_podcast_dialog(){B.library_album_tracks(this.selected_item.id,{limit:1}).then(({data:e})=>{B.library_track_playlists(e.items[0].id).then(({data:t})=>{[this.rss_playlist_to_remove]=t.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,B.library_playlist_delete(this.rss_playlist_to_remove.id).then(()=>{this.$emit("podcast-deleted")})}}},X6={key:0,class:"mt-6 mb-5 py-2"},J6=["id","textContent"],Q6=["onClick"],e5={key:0,class:"media-left"},t5={class:"media-content is-clickable is-clipped"},n5=["textContent"],r5=["textContent"],o5=["textContent"],s5={class:"media-right"},i5=["onClick"],a5=["textContent"],l5={class:"is-size-7"},c5=["textContent"],u5=["textContent"];function d5(e,t,n,r,o,s){const i=O("cover-artwork"),a=O("mdicon"),l=O("modal-dialog-album"),u=O("modal-dialog");return x(),I(ve,null,[(x(!0),I(ve,null,_t(n.items,m=>(x(),I(ve,{key:m.itemId},[m.isItem?(x(),I("div",{key:1,class:"media is-align-items-center",onClick:d=>s.open(m.item)},[r.settingsStore.show_cover_artwork_in_album_lists?(x(),I("div",e5,[b(i,{url:m.item.artwork_url,artist:m.item.artist,album:m.item.name,class:"is-clickable fd-has-shadow fd-cover fd-cover-small-image"},null,8,["url","artist","album"])])):ee("",!0),c("div",t5,[c("div",null,[c("h1",{class:"title is-6",textContent:y(m.item.name)},null,8,n5),c("h2",{class:"subtitle is-7 has-text-grey has-text-weight-bold",textContent:y(m.item.artist)},null,8,r5),m.item.date_released&&m.item.media_kind==="music"?(x(),I("h2",{key:0,class:"subtitle is-7 has-text-grey",textContent:y(e.$filters.date(m.item.date_released))},null,8,o5)):ee("",!0)])]),c("div",s5,[c("a",{onClick:gt(d=>s.open_dialog(m.item),["prevent","stop"])},[b(a,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,i5)])],8,Q6)):(x(),I("div",X6,[c("span",{id:`index_${m.index}`,class:"tag is-info is-light is-small has-text-weight-bold",textContent:y(m.index)},null,8,J6)]))],64))),128)),(x(),we(Hn,{to:"#app"},[b(l,{item:o.selected_item,media_kind:n.media_kind,show:o.show_details_modal,onClose:t[0]||(t[0]=m=>o.show_details_modal=!1),onRemovePodcast:t[1]||(t[1]=m=>s.open_remove_podcast_dialog()),onPlayCountChanged:t[2]||(t[2]=m=>s.play_count_changed())},null,8,["item","media_kind","show"]),b(u,{close_action:e.$t("page.podcast.cancel"),delete_action:e.$t("page.podcast.remove"),show:o.show_remove_podcast_modal,title:e.$t("page.podcast.remove-podcast"),onClose:t[3]||(t[3]=m=>o.show_remove_podcast_modal=!1),onDelete:s.remove_podcast},{"modal-content":N(()=>[c("p",{textContent:y(e.$t("list.albums.info-1"))},null,8,a5),c("p",l5,[Dt(" ("),c("span",{textContent:y(e.$t("list.albums.info-2"))},null,8,c5),c("b",{textContent:y(o.rss_playlist_to_remove.name)},null,8,u5),Dt(") ")])]),_:1},8,["close_action","delete_action","show","title","onDelete"])]))],64)}const wn=ae(Y6,[["render",d5]]),m5={name:"TabsMusic",setup(){return{servicesStore:Pt()}},computed:{spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid}}},f5={class:"section fd-tabs-section"},p5={class:"container"},h5={class:"columns is-centered"},_5={class:"column is-four-fifths"},g5={class:"tabs is-centered is-small"},y5=["onClick","onKeypress"],z5=["textContent"],v5=["onClick","onKeypress"],b5=["textContent"],C5=["onClick","onKeypress"],w5=["textContent"],k5=["onClick","onKeypress"],S5=["textContent"],x5=["onClick","onKeypress"],E5=["textContent"],$5=["onClick","onKeypress"],T5=["textContent"];function A5(e,t,n,r,o,s){const i=O("mdicon"),a=O("router-link");return x(),I("section",f5,[c("div",p5,[c("div",h5,[c("div",_5,[c("div",g5,[c("ul",null,[b(a,{to:{name:"music-history"},custom:""},{default:N(({navigate:l,isActive:u})=>[c("li",{class:ke({"is-active":u})},[c("a",{onClick:l,onKeypress:dn(l,["enter"])},[b(i,{class:"icon is-small",name:"history",size:"16"}),c("span",{class:"is-hidden-mobile",textContent:y(e.$t("page.music.tabs.history"))},null,8,z5)],40,y5)],2)]),_:1}),b(a,{to:{name:"music-artists"},custom:""},{default:N(({navigate:l,isActive:u})=>[c("li",{class:ke({"is-active":u})},[c("a",{onClick:l,onKeypress:dn(l,["enter"])},[b(i,{class:"icon is-small",name:"account-music",size:"16"}),c("span",{class:"is-hidden-mobile",textContent:y(e.$t("page.music.tabs.artists"))},null,8,b5)],40,v5)],2)]),_:1}),b(a,{to:{name:"music-albums"},custom:""},{default:N(({navigate:l,isActive:u})=>[c("li",{class:ke({"is-active":u})},[c("a",{onClick:l,onKeypress:dn(l,["enter"])},[b(i,{class:"icon is-small",name:"album",size:"16"}),c("span",{class:"is-hidden-mobile",textContent:y(e.$t("page.music.tabs.albums"))},null,8,w5)],40,C5)],2)]),_:1}),b(a,{to:{name:"music-genres"},custom:""},{default:N(({navigate:l,isActive:u})=>[c("li",{class:ke({"is-active":u})},[c("a",{onClick:l,onKeypress:dn(l,["enter"])},[b(i,{class:"icon is-small",name:"speaker",size:"16"}),c("span",{class:"is-hidden-mobile",textContent:y(e.$t("page.music.tabs.genres"))},null,8,S5)],40,k5)],2)]),_:1}),b(a,{to:{name:"music-composers"},custom:""},{default:N(({navigate:l,isActive:u})=>[c("li",{class:ke({"is-active":u})},[c("a",{onClick:l,onKeypress:dn(l,["enter"])},[b(i,{class:"icon is-small",name:"book-open-page-variant",size:"16"}),c("span",{class:"is-hidden-mobile",textContent:y(e.$t("page.music.tabs.composers"))},null,8,E5)],40,x5)],2)]),_:1}),s.spotify_enabled?(x(),we(a,{key:0,to:{name:"music-spotify"},custom:""},{default:N(({navigate:l,isActive:u})=>[c("li",{class:ke({"is-active":u})},[c("a",{onClick:l,onKeypress:dn(l,["enter"])},[b(i,{class:"icon is-small",name:"spotify",size:"16"}),c("span",{class:"is-hidden-mobile",textContent:y(e.$t("page.music.tabs.spotify"))},null,8,T5)],40,$5)],2)]),_:1})):ee("",!0)])])])])])])}const yr=ae(m5,[["render",A5]]),Kp={load(e){return B.library_albums("music")},set(e,t){e.albums_list=new Ee(t.data)}},O5={name:"PageAlbums",components:{ContentWithHeading:Qe,ControlDropdown:Bo,IndexButtonList:ar,ListAlbums:wn,TabsMusic:yr},beforeRouteEnter(e,t,n){Kp.load(e).then(r=>{n(o=>Kp.set(o,r))})},setup(){return{uiStore:yn(),servicesStore:Pt()}},data(){return{albums_list:new Ee,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:e}=this.groupings.find(t=>t.id===this.selected_grouping_id);return e.filters=[t=>!this.hide_singles||t.track_count>2,t=>!this.hide_spotify||t.data_kind!=="spotify"],this.albums_list.group(e)},hide_singles:{get(){return this.uiStore.hide_singles},set(e){this.uiStore.hide_singles=e}},hide_spotify:{get(){return this.uiStore.hide_spotify},set(e){this.uiStore.hide_spotify=e}},selected_grouping_id:{get(){return this.uiStore.albums_sort},set(e){this.uiStore.albums_sort=e}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid}}},P5={class:"fd-page-with-tabs"},I5={class:"columns"},L5={class:"column"},N5=["textContent"],D5={class:"field"},R5={class:"control"},M5=["textContent"],F5=["textContent"],V5={key:0,class:"field"},H5={class:"control"},U5=["textContent"],j5=["textContent"],B5={class:"column"},W5=["textContent"],q5=["textContent"],G5=["textContent"];function K5(e,t,n,r,o,s){const i=O("tabs-music"),a=O("index-button-list"),l=O("control-dropdown"),u=O("list-albums"),m=O("content-with-heading");return x(),I("div",P5,[b(i),b(m,null,{options:N(()=>[b(a,{indices:s.albums.indices},null,8,["indices"]),c("div",I5,[c("div",L5,[c("p",{class:"heading mb-5",textContent:y(e.$t("page.albums.filter"))},null,8,N5),c("div",D5,[c("div",R5,[ht(c("input",{id:"switchHideSingles","onUpdate:modelValue":t[0]||(t[0]=d=>s.hide_singles=d),type:"checkbox",class:"switch is-rounded"},null,512),[[Mn,s.hide_singles]]),c("label",{for:"switchHideSingles",textContent:y(e.$t("page.albums.hide-singles"))},null,8,M5)]),c("p",{class:"help",textContent:y(e.$t("page.albums.hide-singles-help"))},null,8,F5)]),s.spotify_enabled?(x(),I("div",V5,[c("div",H5,[ht(c("input",{id:"switchHideSpotify","onUpdate:modelValue":t[1]||(t[1]=d=>s.hide_spotify=d),type:"checkbox",class:"switch is-rounded"},null,512),[[Mn,s.hide_spotify]]),c("label",{for:"switchHideSpotify",textContent:y(e.$t("page.albums.hide-spotify"))},null,8,U5)]),c("p",{class:"help",textContent:y(e.$t("page.albums.hide-spotify-help"))},null,8,j5)])):ee("",!0)]),c("div",B5,[c("p",{class:"heading mb-5",textContent:y(e.$t("page.albums.sort.title"))},null,8,W5),b(l,{value:s.selected_grouping_id,"onUpdate:value":t[2]||(t[2]=d=>s.selected_grouping_id=d),options:o.groupings},null,8,["value","options"])])])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.albums.title"))},null,8,q5),c("p",{class:"heading",textContent:y(e.$t("page.albums.count",{count:s.albums.count}))},null,8,G5)]),"heading-right":N(()=>[]),content:N(()=>[b(u,{items:s.albums},null,8,["items"])]),_:1})])}const Z5=ae(O5,[["render",K5]]),Y5={name:"ModalDialogArtist",props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],methods:{open(){this.$emit("close"),this.$router.push({name:"music-artist",params:{id:this.item.id}})},play(){this.$emit("close"),B.player_play_uri(this.item.uri,!1)},queue_add(){this.$emit("close"),B.queue_add(this.item.uri)},queue_add_next(){this.$emit("close"),B.queue_add_next(this.item.uri)}}},X5={key:0,class:"modal is-active"},J5={class:"modal-content"},Q5={class:"card"},eN={class:"card-content"},tN={class:"title is-4"},nN=["textContent"],rN={class:"content is-small"},oN=["textContent"],sN=["textContent"],iN=["textContent"],aN=["textContent"],lN=["textContent"],cN=["textContent"],uN=["textContent"],dN=["textContent"],mN={class:"card-footer"},fN=["textContent"],pN=["textContent"],hN=["textContent"];function _N(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",X5,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",J5,[c("div",Q5,[c("div",eN,[c("p",tN,[c("a",{class:"has-text-link",onClick:t[1]||(t[1]=(...a)=>s.open&&s.open(...a)),textContent:y(n.item.name)},null,8,nN)]),c("div",rN,[c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.artist.albums"))},null,8,oN),c("span",{class:"title is-6",textContent:y(n.item.album_count)},null,8,sN)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.artist.tracks"))},null,8,iN),c("span",{class:"title is-6",textContent:y(n.item.track_count)},null,8,aN)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.artist.type"))},null,8,lN),c("span",{class:"title is-6",textContent:y(e.$t(`data.kind.${n.item.data_kind}`))},null,8,cN)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.artist.added-on"))},null,8,uN),c("span",{class:"title is-6",textContent:y(e.$filters.datetime(n.item.time_added))},null,8,dN)])])]),c("footer",mN,[c("a",{class:"card-footer-item has-text-dark",onClick:t[2]||(t[2]=(...a)=>s.queue_add&&s.queue_add(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.artist.add"))},null,8,fN)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=(...a)=>s.queue_add_next&&s.queue_add_next(...a))},[b(i,{class:"icon",name:"playlist-play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.artist.add-next"))},null,8,pN)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[4]||(t[4]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.artist.play"))},null,8,hN)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[5]||(t[5]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const sc=ae(Y5,[["render",_N]]),Zp={load(e){return Promise.all([B.library_artist(e.params.id),B.library_artist_albums(e.params.id)])},set(e,t){e.artist=t[0].data,e.albums_list=new Ee(t[1].data)}},gN={name:"PageArtist",components:{ContentWithHeading:Qe,ControlDropdown:Bo,ListAlbums:wn,ModalDialogArtist:sc},beforeRouteEnter(e,t,n){Zp.load(e).then(r=>{n(o=>Zp.set(o,r))})},setup(){return{servicesStore:Pt(),uiStore:yn()}},data(){return{albums_list:new Ee,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:e}=this.groupings.find(t=>t.id===this.selected_grouping_id);return e.filters=[t=>!this.hide_spotify||t.data_kind!=="spotify"],this.albums_list.group(e)},hide_spotify:{get(){return this.uiStore.hide_spotify},set(e){this.uiStore.hide_spotify=e}},selected_grouping_id:{get(){return this.uiStore.artist_albums_sort},set(e){this.uiStore.artist_albums_sort=e}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid},track_count(){return[...this.albums].reduce((e,t)=>e+(t.isItem?t.item.track_count:0),0)}},methods:{open_tracks(){this.$router.push({name:"music-artist-tracks",params:{id:this.artist.id}})},play(){B.player_play_uri(this.albums.items.map(e=>e.uri).join(),!0)}}},yN={class:"columns"},zN={class:"column"},vN=["textContent"],bN={key:0,class:"field"},CN={class:"control"},wN=["textContent"],kN=["textContent"],SN={class:"column"},xN=["textContent"],EN=["textContent"],$N={class:"buttons is-centered"},TN=["textContent"],AN={class:"heading has-text-centered-mobile"},ON=["textContent"],PN=c("span",null," | ",-1),IN=["textContent"];function LN(e,t,n,r,o,s){const i=O("control-dropdown"),a=O("mdicon"),l=O("list-albums"),u=O("modal-dialog-artist"),m=O("content-with-heading");return x(),I("div",null,[b(m,null,{options:N(()=>[c("div",yN,[c("div",zN,[c("p",{class:"heading mb-5",textContent:y(e.$t("page.artist.filter"))},null,8,vN),s.spotify_enabled?(x(),I("div",bN,[c("div",CN,[ht(c("input",{id:"switchHideSpotify","onUpdate:modelValue":t[0]||(t[0]=d=>s.hide_spotify=d),type:"checkbox",class:"switch is-rounded"},null,512),[[Mn,s.hide_spotify]]),c("label",{for:"switchHideSpotify",textContent:y(e.$t("page.artist.hide-spotify"))},null,8,wN)]),c("p",{class:"help",textContent:y(e.$t("page.artist.hide-spotify-help"))},null,8,kN)])):ee("",!0)]),c("div",SN,[c("p",{class:"heading mb-5",textContent:y(e.$t("page.artist.sort.title"))},null,8,xN),b(i,{value:s.selected_grouping_id,"onUpdate:value":t[1]||(t[1]=d=>s.selected_grouping_id=d),options:o.groupings},null,8,["value","options"])])])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(o.artist.name)},null,8,EN)]),"heading-right":N(()=>[c("div",$N,[c("a",{class:"button is-small is-light is-rounded",onClick:t[2]||(t[2]=d=>o.show_details_modal=!0)},[b(a,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[3]||(t[3]=(...d)=>s.play&&s.play(...d))},[b(a,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.artist.shuffle"))},null,8,TN)])])]),content:N(()=>[c("p",AN,[c("span",{textContent:y(e.$t("page.artist.album-count",{count:s.albums.count}))},null,8,ON),PN,c("a",{class:"has-text-link",onClick:t[4]||(t[4]=(...d)=>s.open_tracks&&s.open_tracks(...d)),textContent:y(e.$t("page.artist.track-count",{count:s.track_count}))},null,8,IN)]),b(l,{items:s.albums},null,8,["items"]),b(u,{item:o.artist,show:o.show_details_modal,onClose:t[5]||(t[5]=d=>o.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const NN=ae(gN,[["render",LN]]),DN={name:"ListAlbumsSpotify",components:{CoverArtwork:Lr,ModalDialogAlbumSpotify:ez},props:{items:{required:!0,type:Object}},setup(){return{settingsStore:sr()}},data(){return{selected_item:{},show_details_modal:!1}},methods:{artwork_url(e){var t,n;return((n=(t=e.images)==null?void 0:t[0])==null?void 0:n.url)??""},open(e){this.$router.push({name:"music-spotify-album",params:{id:e.id}})},open_dialog(e){this.selected_item=e,this.show_details_modal=!0}}},RN=["onClick"],MN={key:0,class:"media-left is-clickable"},FN={class:"media-content is-clickable is-clipped"},VN=["textContent"],HN=["textContent"],UN=["textContent"],jN={class:"media-right"},BN=["onClick"];function WN(e,t,n,r,o,s){const i=O("cover-artwork"),a=O("mdicon"),l=O("modal-dialog-album-spotify");return x(),I(ve,null,[(x(!0),I(ve,null,_t(n.items,u=>{var m;return x(),I("div",{key:u.id,class:"media is-align-items-center",onClick:d=>s.open(u)},[r.settingsStore.show_cover_artwork_in_album_lists?(x(),I("div",MN,[b(i,{url:s.artwork_url(u),artist:u.artist,album:u.name,class:"is-clickable fd-has-shadow fd-cover fd-cover-small-image"},null,8,["url","artist","album"])])):ee("",!0),c("div",FN,[c("h1",{class:"title is-6",textContent:y(u.name)},null,8,VN),c("h2",{class:"subtitle is-7 has-text-grey has-text-weight-bold",textContent:y((m=u.artists[0])==null?void 0:m.name)},null,8,HN),c("h2",{class:"subtitle is-7 has-text-grey",textContent:y([u.album_type,e.$filters.date(u.release_date)].join(", "))},null,8,UN)]),c("div",jN,[c("a",{onClick:gt(d=>s.open_dialog(u),["prevent","stop"])},[b(a,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,BN)])],8,RN)}),128)),(x(),we(Hn,{to:"#app"},[b(l,{item:o.selected_item,show:o.show_details_modal,onClose:t[0]||(t[0]=u=>o.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Ii=ae(DN,[["render",WN]]),qN={name:"ModalDialogArtistSpotify",props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],methods:{open(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.id}})},play(){this.$emit("close"),B.player_play_uri(this.item.uri,!1)},queue_add(){this.$emit("close"),B.queue_add(this.item.uri)},queue_add_next(){this.$emit("close"),B.queue_add_next(this.item.uri)}}},GN={key:0,class:"modal is-active"},KN={class:"modal-content"},ZN={class:"card"},YN={class:"card-content"},XN={class:"title is-4"},JN=["textContent"],QN={class:"content is-small"},e3=["textContent"],t3=["textContent"],n3=["textContent"],r3=["textContent"],o3={class:"card-footer"},s3=["textContent"],i3=["textContent"],a3=["textContent"];function l3(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",GN,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",KN,[c("div",ZN,[c("div",YN,[c("p",XN,[c("a",{class:"has-text-link",onClick:t[1]||(t[1]=(...a)=>s.open&&s.open(...a)),textContent:y(n.item.name)},null,8,JN)]),c("div",QN,[c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.artist.popularity"))},null,8,e3),c("span",{class:"title is-6",textContent:y([n.item.popularity,n.item.followers.total].join(" / "))},null,8,t3)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.artist.genres"))},null,8,n3),c("span",{class:"title is-6",textContent:y(n.item.genres.join(", "))},null,8,r3)])])]),c("footer",o3,[c("a",{class:"card-footer-item has-text-dark",onClick:t[2]||(t[2]=(...a)=>s.queue_add&&s.queue_add(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.artist.add"))},null,8,s3)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=(...a)=>s.queue_add_next&&s.queue_add_next(...a))},[b(i,{class:"icon",name:"playlist-play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.artist.add-next"))},null,8,i3)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[4]||(t[4]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.artist.play"))},null,8,a3)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[5]||(t[5]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const tz=ae(qN,[["render",l3]]);function c3(e){return e.scrollHeight}function u3(e){return e.scrollWidth}function d3(e,t){e.scrollTop=e.scrollHeight-t+e.scrollTop}function m3(e,t){e.scrollLeft=e.scrollWidth-t+e.scrollLeft}const f3=c("div",{class:"loading"},"Loading...",-1),p3=c("div",{class:"no-more"},"No more.",-1),h3=c("div",{class:"no-results"},"No results.",-1),_3=c("div",{class:"error"},"Error.",-1),cm=Pr({__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(e,{emit:t}){const n=e,r=Ln();let o=Ln("loading"),s=Ln(n.isInitial),i=0;function a(){Uo(()=>{var _,v;n.position==="top"?d3((_=n.container)!=null?_:document.documentElement,i):n.position==="left"&&m3((v=n.container)!=null?v:document.documentElement,i)})}function l(_,v){return _===0?s.value?(m(),"no-results"):(u(),"no-more"):_!==void 0&&v!==void 0&&_{var v,S;_.isIntersecting&&(n.position==="top"?i=c3((v=n.container)!=null?v:document.documentElement):n.position==="left"&&(i=u3((S=n.container)!=null?S:document.documentElement)),g(),n.load({loaded:l,noMore:u,noResults:m,error:d},{isFirstLoad:s.value}))},{root:n.container,threshold:0,rootMargin:n.margin})}let w;return typeof IntersectionObserver<"u"&&G_(()=>{w&&g(),w=k(),z()},{flush:"post"}),Dn(()=>n.isInitial,_=>{_&&f()}),Dn(s,_=>{_||t("update:isInitial",!1)}),(_,v)=>(x(),I("div",{class:"vue-eternal-loading",ref_key:"rootRef",ref:r},[Cn(o)==="loading"?vt(_.$slots,"loading",Ks(is({key:0},{isFirstLoad:Cn(s)})),()=>[f3]):Cn(o)==="no-more"?vt(_.$slots,"no-more",Ks(is({key:1},{retry:p})),()=>[p3]):Cn(o)==="no-results"?vt(_.$slots,"no-results",Ks(is({key:2},{retry:p})),()=>[h3]):Cn(o)==="error"?vt(_.$slots,"error",Ks(is({key:3},{retry:p})),()=>[_3]):ee("",!0)],512))}}),Zu=50,Yp={load(e){const t=new ir;return t.setAccessToken(Pt().spotify.webapi_token),Promise.all([t.getArtist(e.params.id),t.getArtistAlbums(e.params.id,{include_groups:"album,single",limit:Zu,market:Pt().spotify.webapi_country,offset:0})])},set(e,t){e.artist=t.shift(),e.albums=[],e.total=0,e.offset=0,e.append_albums(t.shift())}},g3={name:"PageArtistSpotify",components:{ContentWithHeading:Qe,ListAlbumsSpotify:Ii,ModalDialogArtistSpotify:tz,VueEternalLoading:cm},beforeRouteEnter(e,t,n){Yp.load(e).then(r=>{n(o=>Yp.set(o,r))})},setup(){return{servicesStore:Pt()}},data(){return{albums:[],artist:{},offset:0,show_details_modal:!1,total:0}},methods:{append_albums(e){this.albums=this.albums.concat(e.items),this.total=e.total,this.offset+=e.limit},load_next({loaded:e}){const t=new ir;t.setAccessToken(this.servicesStore.spotify.webapi_token),t.getArtistAlbums(this.artist.id,{include_groups:"album,single",limit:Zu,offset:this.offset}).then(n=>{this.append_albums(n),e(n.items.length,Zu)})},play(){this.show_album_details_modal=!1,B.player_play_uri(this.artist.uri,!0)}}},y3=["textContent"],z3={class:"buttons is-centered"},v3=["textContent"],b3=["textContent"],C3={class:"columns is-centered"},w3={class:"column has-text-centered"},k3=c("br",null,null,-1),S3=c("br",null,null,-1);function x3(e,t,n,r,o,s){const i=O("mdicon"),a=O("list-albums-spotify"),l=O("VueEternalLoading"),u=O("modal-dialog-artist-spotify"),m=O("content-with-heading");return x(),I("div",null,[b(m,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(o.artist.name)},null,8,y3)]),"heading-right":N(()=>[c("div",z3,[c("a",{class:"button is-small is-light is-rounded",onClick:t[0]||(t[0]=d=>o.show_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...d)=>s.play&&s.play(...d))},[b(i,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.spotify.artist.shuffle"))},null,8,v3)])])]),content:N(()=>[c("p",{class:"heading has-text-centered-mobile",textContent:y(e.$t("page.spotify.artist.album-count",{count:o.total}))},null,8,b3),b(a,{items:o.albums},null,8,["items"]),o.offset[c("div",C3,[c("div",w3,[b(i,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":N(()=>[k3]),"no-results":N(()=>[S3]),_:1},8,["load"])):ee("",!0),b(u,{item:o.artist,show:o.show_details_modal,onClose:t[2]||(t[2]=d=>o.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const E3=ae(g3,[["render",x3]]),Xp={load(e){return Promise.all([B.library_artist(e.params.id),B.library_artist_tracks(e.params.id)])},set(e,t){e.artist=t[0].data,e.tracks_list=new Ee(t[1].data.tracks)}},$3={name:"PageArtistTracks",components:{ContentWithHeading:Qe,ControlDropdown:Bo,IndexButtonList:ar,ListTracks:gn,ModalDialogArtist:sc},beforeRouteEnter(e,t,n){Xp.load(e).then(r=>{n(o=>Xp.set(o,r))})},setup(){return{servicesStore:Pt(),uiStore:yn()}},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 Ee}},computed:{album_count(){return new Set([...this.tracks].filter(e=>e.isItem).map(e=>e.item.album_id)).size},hide_spotify:{get(){return this.uiStore.hide_spotify},set(e){this.uiStore.hide_spotify=e}},selected_grouping_id:{get(){return this.uiStore.artist_tracks_sort},set(e){this.uiStore.artist_tracks_sort=e}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid},track_uris(){return this.tracks_list.items.map(e=>e.uri).join()},tracks(){const{options:e}=this.groupings.find(t=>t.id===this.selected_grouping_id);return e.filters=[t=>!this.hide_spotify||t.data_kind!=="spotify"],this.tracks_list.group(e)}},methods:{open_artist(){this.show_details_modal=!1,this.$router.push({name:"music-artist",params:{id:this.artist.id}})},play(){B.player_play_uri(this.tracks_list.items.map(e=>e.uri).join(),!0)}}},T3={class:"columns"},A3={class:"column"},O3=["textContent"],P3={key:0,class:"field"},I3={class:"control"},L3=["textContent"],N3=["textContent"],D3={class:"column"},R3=["textContent"],M3=["textContent"],F3={class:"buttons is-centered"},V3=["textContent"],H3={class:"heading has-text-centered-mobile"},U3=["textContent"],j3=c("span",null," | ",-1),B3=["textContent"];function W3(e,t,n,r,o,s){const i=O("index-button-list"),a=O("control-dropdown"),l=O("mdicon"),u=O("list-tracks"),m=O("modal-dialog-artist"),d=O("content-with-heading");return x(),I("div",null,[b(d,null,{options:N(()=>[b(i,{indices:s.tracks.indices},null,8,["indices"]),c("div",T3,[c("div",A3,[c("p",{class:"heading mb-5",textContent:y(e.$t("page.artist.filter"))},null,8,O3),s.spotify_enabled?(x(),I("div",P3,[c("div",I3,[ht(c("input",{id:"switchHideSpotify","onUpdate:modelValue":t[0]||(t[0]=f=>s.hide_spotify=f),type:"checkbox",class:"switch is-rounded"},null,512),[[Mn,s.hide_spotify]]),c("label",{for:"switchHideSpotify",textContent:y(e.$t("page.artist.hide-spotify"))},null,8,L3)]),c("p",{class:"help",textContent:y(e.$t("page.artist.hide-spotify-help"))},null,8,N3)])):ee("",!0)]),c("div",D3,[c("p",{class:"heading mb-5",textContent:y(e.$t("page.artist.sort.title"))},null,8,R3),b(a,{value:s.selected_grouping_id,"onUpdate:value":t[1]||(t[1]=f=>s.selected_grouping_id=f),options:o.groupings},null,8,["value","options"])])])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(o.artist.name)},null,8,M3)]),"heading-right":N(()=>[c("div",F3,[c("a",{class:"button is-small is-light is-rounded",onClick:t[2]||(t[2]=f=>o.show_details_modal=!0)},[b(l,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[3]||(t[3]=(...f)=>s.play&&s.play(...f))},[b(l,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.artist.shuffle"))},null,8,V3)])])]),content:N(()=>[c("p",H3,[c("a",{class:"has-text-link",onClick:t[4]||(t[4]=(...f)=>s.open_artist&&s.open_artist(...f)),textContent:y(e.$t("page.artist.album-count",{count:s.album_count}))},null,8,U3),j3,c("span",{textContent:y(e.$t("page.artist.track-count",{count:s.tracks.count}))},null,8,B3)]),b(u,{items:s.tracks,uris:s.track_uris},null,8,["items","uris"]),b(m,{item:o.artist,show:o.show_details_modal,onClose:t[5]||(t[5]=f=>o.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const q3=ae($3,[["render",W3]]),G3={name:"ListArtists",components:{ModalDialogArtist:sc},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(e){this.selected_item=e;const t=e.media_kind==="audiobook"?"audiobooks-artist":"music-artist";this.$router.push({name:t,params:{id:e.id}})},open_dialog(e){this.selected_item=e,this.show_details_modal=!0}}},K3={key:0,class:"mt-6 mb-5 py-2"},Z3={class:"media-content is-clipped"},Y3=["id","textContent"],X3=["onClick"],J3={class:"media-content is-clickable is-clipped"},Q3=["textContent"],eD={class:"media-right"},tD=["onClick"];function nD(e,t,n,r,o,s){const i=O("mdicon"),a=O("modal-dialog-artist");return x(),I(ve,null,[(x(!0),I(ve,null,_t(n.items,l=>(x(),I(ve,{key:l.itemId},[l.isItem?(x(),I("div",{key:1,class:"media is-align-items-center",onClick:u=>s.open(l.item)},[c("div",J3,[c("h1",{class:"title is-6",textContent:y(l.item.name)},null,8,Q3)]),c("div",eD,[c("a",{onClick:gt(u=>s.open_dialog(l.item),["prevent","stop"])},[b(i,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,tD)])],8,X3)):(x(),I("div",K3,[c("div",Z3,[c("span",{id:`index_${l.index}`,class:"tag is-info is-light is-small has-text-weight-bold",textContent:y(l.index)},null,8,Y3)])]))],64))),128)),(x(),we(Hn,{to:"#app"},[b(a,{item:o.selected_item,show:o.show_details_modal,onClose:t[0]||(t[0]=l=>o.show_details_modal=!1)},null,8,["item","show"])]))],64)}const ml=ae(G3,[["render",nD]]),Jp={load(e){return B.library_artists("music")},set(e,t){e.artists_list=new Ee(t.data)}},rD={name:"PageArtists",components:{ContentWithHeading:Qe,ControlDropdown:Bo,IndexButtonList:ar,ListArtists:ml,TabsMusic:yr},beforeRouteEnter(e,t,n){Jp.load(e).then(r=>{n(o=>Jp.set(o,r))})},setup(){return{servicesStore:Pt(),uiStore:yn()}},data(){return{artists_list:new Ee,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:e}=this.groupings.find(t=>t.id===this.selected_grouping_id);return e.filters=[t=>!this.hide_singles||t.track_count>t.album_count*2,t=>!this.hide_spotify||t.data_kind!=="spotify"],this.artists_list.group(e)},hide_singles:{get(){return this.uiStore.hide_singles},set(e){this.uiStore.hide_singles=e}},hide_spotify:{get(){return this.uiStore.hide_spotify},set(e){this.uiStore.hide_spotify=e}},selected_grouping_id:{get(){return this.uiStore.artists_sort},set(e){this.uiStore.artists_sort=e}},spotify_enabled(){return this.servicesStore.spotify.webapi_token_valid}}},oD={class:"fd-page-with-tabs"},sD={class:"columns"},iD={class:"column"},aD=["textContent"],lD={class:"field"},cD={class:"control"},uD=["textContent"],dD=["textContent"],mD={key:0,class:"field"},fD={class:"control"},pD=["textContent"],hD=["textContent"],_D={class:"column"},gD=["textContent"],yD=["textContent"],zD=["textContent"];function vD(e,t,n,r,o,s){const i=O("tabs-music"),a=O("index-button-list"),l=O("control-dropdown"),u=O("list-artists"),m=O("content-with-heading");return x(),I("div",oD,[b(i),b(m,null,{options:N(()=>[b(a,{indices:s.artists.indices},null,8,["indices"]),c("div",sD,[c("div",iD,[c("p",{class:"heading mb-5",textContent:y(e.$t("page.artists.filter"))},null,8,aD),c("div",lD,[c("div",cD,[ht(c("input",{id:"switchHideSingles","onUpdate:modelValue":t[0]||(t[0]=d=>s.hide_singles=d),type:"checkbox",class:"switch is-rounded"},null,512),[[Mn,s.hide_singles]]),c("label",{for:"switchHideSingles",textContent:y(e.$t("page.artists.hide-singles"))},null,8,uD)]),c("p",{class:"help",textContent:y(e.$t("page.artists.hide-singles-help"))},null,8,dD)]),s.spotify_enabled?(x(),I("div",mD,[c("div",fD,[ht(c("input",{id:"switchHideSpotify","onUpdate:modelValue":t[1]||(t[1]=d=>s.hide_spotify=d),type:"checkbox",class:"switch is-rounded"},null,512),[[Mn,s.hide_spotify]]),c("label",{for:"switchHideSpotify",textContent:y(e.$t("page.artists.hide-spotify"))},null,8,pD)]),c("p",{class:"help",textContent:y(e.$t("page.artists.hide-spotify-help"))},null,8,hD)])):ee("",!0)]),c("div",_D,[c("p",{class:"heading mb-5",textContent:y(e.$t("page.artists.sort.title"))},null,8,gD),b(l,{value:s.selected_grouping_id,"onUpdate:value":t[2]||(t[2]=d=>s.selected_grouping_id=d),options:o.groupings},null,8,["value","options"])])])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.artists.title"))},null,8,yD),c("p",{class:"heading",textContent:y(e.$t("page.artists.count",{count:s.artists.count}))},null,8,zD)]),"heading-right":N(()=>[]),content:N(()=>[b(u,{items:s.artists},null,8,["items"])]),_:1})])}const bD=ae(rD,[["render",vD]]),Qp={load(e){return Promise.all([B.library_album(e.params.id),B.library_album_tracks(e.params.id)])},set(e,t){e.album=t[0].data,e.tracks=new Ee(t[1].data)}},CD={name:"PageAudiobooksAlbum",components:{ContentWithHero:rc,CoverArtwork:Lr,ListTracks:gn,ModalDialogAlbum:oc},beforeRouteEnter(e,t,n){Qp.load(e).then(r=>{n(o=>Qp.set(o,r))})},data(){return{album:{},show_details_modal:!1,tracks:new Ee}},methods:{open_artist(){this.show_details_modal=!1,this.$router.push({name:"audiobooks-artist",params:{id:this.album.artist_id}})},play(){B.player_play_uri(this.album.uri,!1)}}},wD=["textContent"],kD={class:"subtitle is-6 has-text-link"},SD=["textContent"],xD={class:"buttons fd-is-centered-mobile mt-5"},ED=["textContent"],$D=["textContent"];function TD(e,t,n,r,o,s){const i=O("mdicon"),a=O("cover-artwork"),l=O("list-tracks"),u=O("modal-dialog-album"),m=O("content-with-hero");return x(),I("div",null,[b(m,null,{"heading-left":N(()=>[c("h1",{class:"title is-5",textContent:y(o.album.name)},null,8,wD),c("h2",kD,[c("a",{class:"has-text-link",onClick:t[0]||(t[0]=(...d)=>s.open_artist&&s.open_artist(...d)),textContent:y(o.album.artist)},null,8,SD)]),c("div",xD,[c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...d)=>s.play&&s.play(...d))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{textContent:y(e.$t("page.audiobooks.album.play"))},null,8,ED)]),c("a",{class:"button is-small is-light is-rounded",onClick:t[2]||(t[2]=d=>o.show_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})])])]),"heading-right":N(()=>[b(a,{url:o.album.artwork_url,artist:o.album.artist,album:o.album.name,class:"is-clickable fd-has-shadow fd-cover fd-cover-medium-image",onClick:t[3]||(t[3]=d=>o.show_details_modal=!0)},null,8,["url","artist","album"])]),content:N(()=>[c("p",{class:"heading has-text-centered-mobile mt-5",textContent:y(e.$t("page.audiobooks.album.track-count",{count:o.album.track_count}))},null,8,$D),b(l,{items:o.tracks,show_progress:!0,uris:o.album.uri},null,8,["items","uris"]),b(u,{item:o.album,show:o.show_details_modal,media_kind:"audiobook",onClose:t[4]||(t[4]=d=>o.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const AD=ae(CD,[["render",TD]]),OD={name:"TabsAudiobooks"},PD={class:"section fd-tabs-section"},ID={class:"container"},LD={class:"columns is-centered"},ND={class:"column is-four-fifths"},DD={class:"tabs is-centered is-small"},RD=["onClick","onKeypress"],MD=["textContent"],FD=["onClick","onKeypress"],VD=["textContent"],HD=["onClick","onKeypress"],UD=["textContent"];function jD(e,t,n,r,o,s){const i=O("mdicon"),a=O("router-link");return x(),I("section",PD,[c("div",ID,[c("div",LD,[c("div",ND,[c("div",DD,[c("ul",null,[b(a,{to:{name:"audiobooks-artists"},custom:""},{default:N(({navigate:l,isActive:u})=>[c("li",{class:ke({"is-active":u})},[c("a",{onClick:l,onKeypress:dn(l,["enter"])},[b(i,{class:"icon is-small",name:"account-music",size:"16"}),c("span",{class:"is-hidden-mobile",textContent:y(e.$t("page.audiobooks.tabs.authors"))},null,8,MD)],40,RD)],2)]),_:1}),b(a,{to:{name:"audiobooks-albums"},custom:""},{default:N(({navigate:l,isActive:u})=>[c("li",{class:ke({"is-active":u})},[c("a",{onClick:l,onKeypress:dn(l,["enter"])},[b(i,{class:"icon is-small",name:"album",size:"16"}),c("span",{class:"is-hidden-mobile",textContent:y(e.$t("page.audiobooks.tabs.audiobooks"))},null,8,VD)],40,FD)],2)]),_:1}),b(a,{to:{name:"audiobooks-genres"},custom:""},{default:N(({navigate:l,isActive:u})=>[c("li",{class:ke({"is-active":u})},[c("a",{onClick:l,onKeypress:dn(l,["enter"])},[b(i,{class:"icon is-small",name:"speaker",size:"16"}),c("span",{class:"is-hidden-mobile",textContent:y(e.$t("page.audiobooks.tabs.genres"))},null,8,UD)],40,HD)],2)]),_:1})])])])])])])}const um=ae(OD,[["render",jD]]),eh={load(e){return B.library_albums("audiobook")},set(e,t){e.albums=new Ee(t.data,{index:{field:"name_sort",type:String}})}},BD={name:"PageAudiobooksAlbums",components:{ContentWithHeading:Qe,IndexButtonList:ar,ListAlbums:wn,TabsAudiobooks:um},beforeRouteEnter(e,t,n){eh.load(e).then(r=>{n(o=>eh.set(o,r))})},data(){return{albums:new Ee}}},WD={class:"fd-page-with-tabs"},qD=["textContent"],GD=["textContent"];function KD(e,t,n,r,o,s){const i=O("tabs-audiobooks"),a=O("index-button-list"),l=O("list-albums"),u=O("content-with-heading");return x(),I("div",WD,[b(i),b(u,null,{options:N(()=>[b(a,{indices:o.albums.indices},null,8,["indices"])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.audiobooks.albums.title"))},null,8,qD),c("p",{class:"heading",textContent:y(e.$t("page.audiobooks.albums.count",{count:o.albums.count}))},null,8,GD)]),content:N(()=>[b(l,{items:o.albums},null,8,["items"])]),_:1})])}const ZD=ae(BD,[["render",KD]]),th={load(e){return Promise.all([B.library_artist(e.params.id),B.library_artist_albums(e.params.id)])},set(e,t){e.artist=t[0].data,e.albums=new Ee(t[1].data)}},YD={name:"PageAudiobooksArtist",components:{ContentWithHeading:Qe,ListAlbums:wn,ModalDialogArtist:sc},beforeRouteEnter(e,t,n){th.load(e).then(r=>{n(o=>th.set(o,r))})},data(){return{albums:new Ee,artist:{},show_details_modal:!1}},methods:{play(){B.player_play_uri(this.albums.items.map(e=>e.uri).join(),!1)}}},XD=["textContent"],JD={class:"buttons is-centered"},QD=["textContent"],eR=["textContent"];function tR(e,t,n,r,o,s){const i=O("mdicon"),a=O("list-albums"),l=O("modal-dialog-artist"),u=O("content-with-heading");return x(),I("div",null,[b(u,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(o.artist.name)},null,8,XD)]),"heading-right":N(()=>[c("div",JD,[c("a",{class:"button is-small is-light is-rounded",onClick:t[0]||(t[0]=m=>o.show_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...m)=>s.play&&s.play(...m))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{textContent:y(e.$t("page.audiobooks.artist.play"))},null,8,QD)])])]),content:N(()=>[c("p",{class:"heading has-text-centered-mobile",textContent:y(e.$t("page.audiobooks.artist.album-count",{count:o.artist.album_count}))},null,8,eR),b(a,{items:o.albums},null,8,["items"]),b(l,{item:o.artist,show:o.show_details_modal,onClose:t[2]||(t[2]=m=>o.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const nR=ae(YD,[["render",tR]]),nh={load(e){return B.library_artists("audiobook")},set(e,t){e.artists=new Ee(t.data,{index:{field:"name_sort",type:String}})}},rR={name:"PageAudiobooksArtists",components:{ContentWithHeading:Qe,IndexButtonList:ar,ListArtists:ml,TabsAudiobooks:um},beforeRouteEnter(e,t,n){nh.load(e).then(r=>{n(o=>nh.set(o,r))})},data(){return{artists:new Ee}}},oR={class:"fd-page-with-tabs"},sR=["textContent"],iR=["textContent"];function aR(e,t,n,r,o,s){const i=O("tabs-audiobooks"),a=O("index-button-list"),l=O("list-artists"),u=O("content-with-heading");return x(),I("div",oR,[b(i),b(u,null,{options:N(()=>[b(a,{indices:o.artists.indices},null,8,["indices"])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.audiobooks.artists.title"))},null,8,sR),c("p",{class:"heading",textContent:y(e.$t("page.audiobooks.artists.count",{count:o.artists.count}))},null,8,iR)]),"heading-right":N(()=>[]),content:N(()=>[b(l,{items:o.artists},null,8,["items"])]),_:1})])}const lR=ae(rR,[["render",aR]]),cR={name:"ModalDialogGenre",props:{item:{required:!0,type:Object},media_kind:{required:!0,type:String},show:Boolean},emits:["close"],computed:{expression(){return`genre is "${this.item.name}" and media_kind is ${this.media_kind}`}},methods:{open(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.name},query:{media_kind:this.media_kind}})},play(){this.$emit("close"),B.player_play_expression(this.expression,!1)},queue_add(){this.$emit("close"),B.queue_expression_add(this.expression)},queue_add_next(){this.$emit("close"),B.queue_expression_add_next(this.expression)}}},uR={key:0,class:"modal is-active"},dR={class:"modal-content"},mR={class:"card"},fR={class:"card-content"},pR={class:"title is-4"},hR=["textContent"],_R={class:"content is-small"},gR=["textContent"],yR=["textContent"],zR=["textContent"],vR=["textContent"],bR=["textContent"],CR=["textContent"],wR={class:"card-footer"},kR=["textContent"],SR=["textContent"],xR=["textContent"];function ER(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",uR,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",dR,[c("div",mR,[c("div",fR,[c("p",pR,[c("a",{class:"has-text-link",onClick:t[1]||(t[1]=(...a)=>s.open&&s.open(...a)),textContent:y(n.item.name)},null,8,hR)]),c("div",_R,[c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.genre.albums"))},null,8,gR),c("span",{class:"title is-6",textContent:y(n.item.album_count)},null,8,yR)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.genre.tracks"))},null,8,zR),c("span",{class:"title is-6",textContent:y(n.item.track_count)},null,8,vR)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.genre.duration"))},null,8,bR),c("span",{class:"title is-6",textContent:y(e.$filters.durationInHours(n.item.length_ms))},null,8,CR)])])]),c("footer",wR,[c("a",{class:"card-footer-item has-text-dark",onClick:t[2]||(t[2]=(...a)=>s.queue_add&&s.queue_add(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.genre.add"))},null,8,kR)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=(...a)=>s.queue_add_next&&s.queue_add_next(...a))},[b(i,{class:"icon",name:"playlist-play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.genre.add-next"))},null,8,SR)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[4]||(t[4]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.genre.play"))},null,8,xR)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[5]||(t[5]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const dm=ae(cR,[["render",ER]]),$R={name:"ListGenres",components:{ModalDialogGenre:dm},props:{items:{required:!0,type:Object},media_kind:{required:!0,type:String}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(e){this.$router.push({name:"genre-albums",params:{name:e.name},query:{media_kind:this.media_kind}})},open_dialog(e){this.selected_item=e,this.show_details_modal=!0}}},TR={key:0,class:"mt-6 mb-5 py-2"},AR={class:"media-content is-clipped"},OR=["id","textContent"],PR=["onClick"],IR={class:"media-content is-clickable is-clipped"},LR=["textContent"],NR={class:"media-right"},DR=["onClick"];function RR(e,t,n,r,o,s){const i=O("mdicon"),a=O("modal-dialog-genre");return x(),I(ve,null,[(x(!0),I(ve,null,_t(n.items,l=>(x(),I(ve,{key:l.itemId},[l.isItem?(x(),I("div",{key:1,class:"media is-align-items-center",onClick:u=>s.open(l.item)},[c("div",IR,[c("h1",{class:"title is-6",textContent:y(l.item.name)},null,8,LR)]),c("div",NR,[c("a",{onClick:gt(u=>s.open_dialog(l.item),["prevent","stop"])},[b(i,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,DR)])],8,PR)):(x(),I("div",TR,[c("div",AR,[c("span",{id:`index_${l.index}`,class:"tag is-info is-light is-small has-text-weight-bold",textContent:y(l.index)},null,8,OR)])]))],64))),128)),(x(),we(Hn,{to:"#app"},[b(a,{item:o.selected_item,media_kind:n.media_kind,show:o.show_details_modal,onClose:t[0]||(t[0]=l=>o.show_details_modal=!1)},null,8,["item","media_kind","show"])]))],64)}const nz=ae($R,[["render",RR]]),rh={load(e){return B.library_genres("audiobook")},set(e,t){e.genres=new Ee(t.data.genres,{index:{field:"name_sort",type:String}})}},MR={name:"PageAudiobooksGenres",components:{ContentWithHeading:Qe,IndexButtonList:ar,ListGenres:nz,TabsAudiobooks:um},beforeRouteEnter(e,t,n){rh.load(e).then(r=>{n(o=>rh.set(o,r))})},data(){return{genres:new Ee}}},FR={class:"fd-page-with-tabs"},VR=["textContent"],HR=["textContent"];function UR(e,t,n,r,o,s){const i=O("tabs-audiobooks"),a=O("index-button-list"),l=O("list-genres"),u=O("content-with-heading");return x(),I("div",FR,[b(i),b(u,null,{options:N(()=>[b(a,{indices:o.genres.indices},null,8,["indices"])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.genres.title"))},null,8,VR),c("p",{class:"heading",textContent:y(e.$t("page.genres.count",{count:o.genres.total}))},null,8,HR)]),content:N(()=>[b(l,{items:o.genres,media_kind:"audiobook"},null,8,["items"])]),_:1})])}const jR=ae(MR,[["render",UR]]),BR={name:"ModalDialogComposer",props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],methods:{open_albums(){this.$emit("close"),this.$router.push({name:"music-composer-albums",params:{name:this.item.name}})},open_tracks(){this.$router.push({name:"music-composer-tracks",params:{name:this.item.name}})},play(){this.$emit("close"),B.player_play_expression(`composer is "${this.item.name}" and media_kind is music`,!1)},queue_add(){this.$emit("close"),B.queue_expression_add(`composer is "${this.item.name}" and media_kind is music`)},queue_add_next(){this.$emit("close"),B.queue_expression_add_next(`composer is "${this.item.name}" and media_kind is music`)}}},WR={key:0,class:"modal is-active"},qR={class:"modal-content"},GR={class:"card"},KR={class:"card-content"},ZR={class:"title is-4"},YR=["textContent"],XR=["textContent"],JR=["textContent"],QR=["textContent"],eM=["textContent"],tM=["textContent"],nM=["textContent"],rM={class:"card-footer"},oM=["textContent"],sM=["textContent"],iM=["textContent"];function aM(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",WR,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",qR,[c("div",GR,[c("div",KR,[c("p",ZR,[c("a",{class:"has-text-link",onClick:t[1]||(t[1]=(...a)=>s.open_albums&&s.open_albums(...a)),textContent:y(n.item.name)},null,8,YR)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.composer.albums"))},null,8,XR),c("a",{class:"has-text-link is-6",onClick:t[2]||(t[2]=(...a)=>s.open_albums&&s.open_albums(...a)),textContent:y(n.item.album_count)},null,8,JR)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.composer.tracks"))},null,8,QR),c("a",{class:"has-text-link is-6",onClick:t[3]||(t[3]=(...a)=>s.open_tracks&&s.open_tracks(...a)),textContent:y(n.item.track_count)},null,8,eM)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.composer.duration"))},null,8,tM),c("span",{class:"title is-6",textContent:y(e.$filters.durationInHours(n.item.length_ms))},null,8,nM)])]),c("footer",rM,[c("a",{class:"card-footer-item has-text-dark",onClick:t[4]||(t[4]=(...a)=>s.queue_add&&s.queue_add(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.composer.add"))},null,8,oM)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[5]||(t[5]=(...a)=>s.queue_add_next&&s.queue_add_next(...a))},[b(i,{class:"icon",name:"playlist-play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.composer.add-next"))},null,8,sM)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[6]||(t[6]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.composer.play"))},null,8,iM)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[7]||(t[7]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const mm=ae(BR,[["render",aM]]),oh={load(e){return Promise.all([B.library_composer(e.params.name),B.library_composer_albums(e.params.name)])},set(e,t){e.composer=t[0].data,e.albums=new Ee(t[1].data.albums)}},lM={name:"PageComposerAlbums",components:{ContentWithHeading:Qe,ListAlbums:wn,ModalDialogComposer:mm},beforeRouteEnter(e,t,n){oh.load(e).then(r=>{n(o=>oh.set(o,r))})},data(){return{albums:new Ee,composer:{},show_details_modal:!1}},methods:{open_tracks(){this.$router.push({name:"music-composer-tracks",params:{name:this.composer.name}})},play(){B.player_play_expression(`composer is "${this.composer.name}" and media_kind is music`,!0)}}},cM=["textContent"],uM={class:"buttons is-centered"},dM=["textContent"],mM={class:"heading has-text-centered-mobile"},fM=["textContent"],pM=c("span",null," | ",-1),hM=["textContent"];function _M(e,t,n,r,o,s){const i=O("mdicon"),a=O("list-albums"),l=O("modal-dialog-composer"),u=O("content-with-heading");return x(),I("div",null,[b(u,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(o.composer.name)},null,8,cM)]),"heading-right":N(()=>[c("div",uM,[c("a",{class:"button is-small is-light is-rounded",onClick:t[0]||(t[0]=m=>o.show_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...m)=>s.play&&s.play(...m))},[b(i,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.composer.shuffle"))},null,8,dM)])])]),content:N(()=>[c("p",mM,[c("span",{textContent:y(e.$t("page.composer.album-count",{count:o.composer.album_count}))},null,8,fM),pM,c("a",{class:"has-text-link",onClick:t[2]||(t[2]=(...m)=>s.open_tracks&&s.open_tracks(...m)),textContent:y(e.$t("page.composer.track-count",{count:o.composer.track_count}))},null,8,hM)]),b(a,{items:o.albums},null,8,["items"]),b(l,{item:o.composer,show:o.show_details_modal,onClose:t[3]||(t[3]=m=>o.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const gM=ae(lM,[["render",_M]]),sh={load(e){return Promise.all([B.library_composer(e.params.name),B.library_composer_tracks(e.params.name)])},set(e,t){e.composer=t[0].data,e.tracks_list=new Ee(t[1].data.tracks)}},yM={name:"PageComposerTracks",components:{ContentWithHeading:Qe,ControlDropdown:Bo,IndexButtonList:ar,ListTracks:gn,ModalDialogComposer:mm},beforeRouteEnter(e,t,n){sh.load(e).then(r=>{n(o=>sh.set(o,r))})},setup(){return{uiStore:yn()}},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 Ee}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},selected_grouping_id:{get(){return this.uiStore.composer_tracks_sort},set(e){this.uiStore.composer_tracks_sort=e}},tracks(){const{options:e}=this.groupings.find(t=>t.id===this.selected_grouping_id);return this.tracks_list.group(e)}},methods:{open_albums(){this.show_details_modal=!1,this.$router.push({name:"music-composer-albums",params:{name:this.composer.name}})},play(){B.player_play_expression(this.expression,!0)}}},zM={class:"columns"},vM={class:"column"},bM=["textContent"],CM=["textContent"],wM={class:"buttons is-centered"},kM=["textContent"],SM={class:"heading has-text-centered-mobile"},xM=["textContent"],EM=c("span",null," | ",-1),$M=["textContent"];function TM(e,t,n,r,o,s){const i=O("index-button-list"),a=O("control-dropdown"),l=O("mdicon"),u=O("list-tracks"),m=O("modal-dialog-composer"),d=O("content-with-heading");return x(),I("div",null,[b(d,null,{options:N(()=>[b(i,{indices:s.tracks.indices},null,8,["indices"]),c("div",zM,[c("div",vM,[c("p",{class:"heading mb-5",textContent:y(e.$t("page.artist.sort.title"))},null,8,bM),b(a,{value:s.selected_grouping_id,"onUpdate:value":t[0]||(t[0]=f=>s.selected_grouping_id=f),options:o.groupings},null,8,["value","options"])])])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(o.composer.name)},null,8,CM)]),"heading-right":N(()=>[c("div",wM,[c("a",{class:"button is-small is-light is-rounded",onClick:t[1]||(t[1]=f=>o.show_details_modal=!0)},[b(l,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[2]||(t[2]=(...f)=>s.play&&s.play(...f))},[b(l,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.composer.shuffle"))},null,8,kM)])])]),content:N(()=>[c("p",SM,[c("a",{class:"has-text-link",onClick:t[3]||(t[3]=(...f)=>s.open_albums&&s.open_albums(...f)),textContent:y(e.$t("page.composer.album-count",{count:o.composer.album_count}))},null,8,xM),EM,c("span",{textContent:y(e.$t("page.composer.track-count",{count:o.composer.track_count}))},null,8,$M)]),b(u,{items:s.tracks,expression:s.expression},null,8,["items","expression"]),b(m,{item:o.composer,show:o.show_details_modal,onClose:t[4]||(t[4]=f=>o.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const AM=ae(yM,[["render",TM]]),OM={name:"ListComposers",components:{ModalDialogComposer:mm},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(e){this.selected_item=e,this.$router.push({name:"music-composer-albums",params:{name:e.name}})},open_dialog(e){this.selected_item=e,this.show_details_modal=!0}}},PM={key:0,class:"mt-6 mb-5 py-2"},IM={class:"media-content is-clipped"},LM=["id","textContent"],NM=["onClick"],DM={class:"media-content is-clickable is-clipped"},RM=["textContent"],MM={class:"media-right"},FM=["onClick"];function VM(e,t,n,r,o,s){const i=O("mdicon"),a=O("modal-dialog-composer");return x(),I(ve,null,[(x(!0),I(ve,null,_t(n.items,l=>(x(),I(ve,{key:l.itemId},[l.isItem?(x(),I("div",{key:1,class:"media is-align-items-center",onClick:u=>s.open(l.item)},[c("div",DM,[c("h1",{class:"title is-6",textContent:y(l.item.name)},null,8,RM)]),c("div",MM,[c("a",{onClick:gt(u=>s.open_dialog(l.item),["prevent","stop"])},[b(i,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,FM)])],8,NM)):(x(),I("div",PM,[c("div",IM,[c("span",{id:`index_${l.index}`,class:"tag is-info is-light is-small has-text-weight-bold",textContent:y(l.index)},null,8,LM)])]))],64))),128)),(x(),we(Hn,{to:"#app"},[b(a,{item:o.selected_item,show:o.show_details_modal,onClose:t[0]||(t[0]=l=>o.show_details_modal=!1)},null,8,["item","show"])]))],64)}const Yu=ae(OM,[["render",VM]]),ih={load(e){return B.library_composers("music")},set(e,t){e.composers=new Ee(t.data,{index:{field:"name_sort",type:String}})}},HM={name:"PageComposers",components:{ContentWithHeading:Qe,IndexButtonList:ar,ListComposers:Yu,TabsMusic:yr},beforeRouteEnter(e,t,n){ih.load(e).then(r=>{n(o=>ih.set(o,r))})},data(){return{composers:new Ee}}},UM={class:"fd-page-with-tabs"},jM=["textContent"],BM=["textContent"];function WM(e,t,n,r,o,s){const i=O("tabs-music"),a=O("index-button-list"),l=O("list-composers"),u=O("content-with-heading");return x(),I("div",UM,[b(i),b(u,null,{options:N(()=>[b(a,{indices:o.composers.indices},null,8,["indices"])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.composers.title"))},null,8,jM),c("p",{class:"heading",textContent:y(e.$t("page.composers.count",{count:o.composers.total}))},null,8,BM)]),content:N(()=>[b(l,{items:o.composers},null,8,["items"])]),_:1})])}const qM=ae(HM,[["render",WM]]),GM={name:"ModalDialogDirectory",props:{item:{required:!0,type:String},show:Boolean},emits:["close"],methods:{play(){this.$emit("close"),B.player_play_expression(`path starts with "${this.item}" order by path asc`,!1)},queue_add(){this.$emit("close"),B.queue_expression_add(`path starts with "${this.item}" order by path asc`)},queue_add_next(){this.$emit("close"),B.queue_expression_add_next(`path starts with "${this.item}" order by path asc`)}}},KM={key:0,class:"modal is-active"},ZM={class:"modal-content"},YM={class:"card"},XM={class:"card-content"},JM=["textContent"],QM={class:"card-footer"},eF=["textContent"],tF=["textContent"],nF=["textContent"];function rF(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",KM,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",ZM,[c("div",YM,[c("div",XM,[c("p",{class:"title is-4",textContent:y(n.item)},null,8,JM)]),c("footer",QM,[c("a",{class:"card-footer-item has-text-dark",onClick:t[1]||(t[1]=(...a)=>s.queue_add&&s.queue_add(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.directory.add"))},null,8,eF)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[2]||(t[2]=(...a)=>s.queue_add_next&&s.queue_add_next(...a))},[b(i,{class:"icon",name:"playlist-play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.directory.add-next"))},null,8,tF)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.directory.play"))},null,8,nF)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[4]||(t[4]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const rz=ae(GM,[["render",rF]]),oF={name:"ListDirectories",components:{ModalDialogDirectory:rz},props:{items:{required:!0,type:Array}},data(){return{selected_item:"",show_details_modal:!1}},computed:{directories(){var n;const e=[];let t="";return(n=this.$route.query)==null||n.directory.split("/").slice(1,-1).forEach((r,o)=>{t=`${t}/${r}`,e.push({index:o,name:r,path:t})}),e}},methods:{open(e){const t={name:"files"};e.index!==0&&(t.query={directory:e.path}),this.$router.push(t)},open_dialog(e){this.selected_item=e.path,this.show_details_modal=!0},open_parent(){this.open(this.directories.slice(-1).pop())}}},sF={key:0,class:"media is-align-items-center"},iF={class:"media-content is-clipped"},aF={class:"breadcrumb"},lF=["onClick"],cF=["textContent"],uF={class:"media-right"},dF=["onClick"],mF={class:"media-left is-clickable"},fF={class:"media-content is-clickable is-clipped"},pF=["textContent"],hF={class:"media-right"},_F=["onClick"];function gF(e,t,n,r,o,s){const i=O("mdicon"),a=O("modal-dialog-directory");return x(),I(ve,null,[e.$route.query.directory?(x(),I("div",sF,[c("figure",{class:"media-left is-clickable",onClick:t[0]||(t[0]=(...l)=>s.open_parent&&s.open_parent(...l))},[b(i,{class:"icon",name:"chevron-left",size:"16"})]),c("div",iF,[c("nav",aF,[c("ul",null,[(x(!0),I(ve,null,_t(s.directories,l=>(x(),I("li",{key:l.index},[c("a",{onClick:u=>s.open(l)},[c("span",{textContent:y(l.name)},null,8,cF)],8,lF)]))),128))])])]),c("div",uF,[vt(e.$slots,"actions")])])):ee("",!0),(x(!0),I(ve,null,_t(n.items,l=>(x(),I("div",{key:l.path,class:"media is-align-items-center",onClick:u=>s.open(l)},[c("figure",mF,[b(i,{class:"icon",name:"folder",size:"16"})]),c("div",fF,[c("h1",{class:"title is-6",textContent:y(l.name)},null,8,pF)]),c("div",hF,[c("a",{onClick:gt(u=>s.open_dialog(l),["prevent","stop"])},[b(i,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,_F)])],8,dF))),128)),(x(),we(Hn,{to:"#app"},[b(a,{item:o.selected_item,show:o.show_details_modal,onClose:t[1]||(t[1]=l=>o.show_details_modal=!1)},null,8,["item","show"])]))],64)}const yF=ae(oF,[["render",gF]]),zF={name:"ModalDialogPlaylist",props:{item:{required:!0,type:Object},show:Boolean,uris:{default:"",type:String}},emits:["close"],methods:{open(){this.$emit("close"),this.$router.push({name:"playlist",params:{id:this.item.id}})},play(){this.$emit("close"),B.player_play_uri(this.uris||this.item.uri,!1)},queue_add(){this.$emit("close"),B.queue_add(this.uris||this.item.uri)},queue_add_next(){this.$emit("close"),B.queue_add_next(this.uris||this.item.uri)}}},vF={key:0,class:"modal is-active"},bF={class:"modal-content"},CF={class:"card"},wF={class:"card-content"},kF={class:"title is-4"},SF=["textContent"],xF={class:"content is-small"},EF=["textContent"],$F=["textContent"],TF=["textContent"],AF=["textContent"],OF={key:0},PF=["textContent"],IF=["textContent"],LF={key:0,class:"card-footer"},NF=["textContent"],DF=["textContent"],RF=["textContent"];function MF(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",vF,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",bF,[c("div",CF,[c("div",wF,[c("p",kF,[c("a",{class:"has-text-link",onClick:t[1]||(t[1]=(...a)=>s.open&&s.open(...a)),textContent:y(n.item.name)},null,8,SF)]),c("div",xF,[c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.playlist.path"))},null,8,EF),c("span",{class:"title is-6",textContent:y(n.item.path)},null,8,$F)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.playlist.type"))},null,8,TF),c("span",{class:"title is-6",textContent:y(e.$t(`playlist.type.${n.item.type}`))},null,8,AF)]),n.item.folder?ee("",!0):(x(),I("p",OF,[c("span",{class:"heading",textContent:y(e.$t("dialog.playlist.tracks"))},null,8,PF),c("span",{class:"title is-6",textContent:y(n.item.item_count)},null,8,IF)]))])]),n.item.folder?ee("",!0):(x(),I("footer",LF,[c("a",{class:"card-footer-item has-text-dark",onClick:t[2]||(t[2]=(...a)=>s.queue_add&&s.queue_add(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.playlist.add"))},null,8,NF)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=(...a)=>s.queue_add_next&&s.queue_add_next(...a))},[b(i,{class:"icon",name:"playlist-play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.playlist.add-next"))},null,8,DF)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[4]||(t[4]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.playlist.play"))},null,8,RF)])]))])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[5]||(t[5]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const oz=ae(zF,[["render",MF]]),FF={name:"ListPlaylists",components:{ModalDialogPlaylist:oz},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{icon_name(e){return e.type==="folder"?"folder":e.type==="rss"?"rss":"music-box-multiple"},open(e){e.type==="folder"?this.$router.push({name:"playlist-folder",params:{id:e.id}}):this.$router.push({name:"playlist",params:{id:e.id}})},open_dialog(e){this.selected_item=e,this.show_details_modal=!0}}},VF=["onClick"],HF={class:"media-left is-clickable"},UF={class:"media-content is-clickable is-clipped"},jF=["textContent"],BF={class:"media-right"},WF=["onClick"];function qF(e,t,n,r,o,s){const i=O("mdicon"),a=O("modal-dialog-playlist");return x(),I(ve,null,[(x(!0),I(ve,null,_t(n.items,l=>(x(),I("div",{key:l.itemId,class:"media is-align-items-center",onClick:u=>s.open(l.item)},[c("figure",HF,[b(i,{class:"icon",name:s.icon_name(l.item),size:"16"},null,8,["name"])]),c("div",UF,[c("h1",{class:"title is-6",textContent:y(l.item.name)},null,8,jF)]),c("div",BF,[c("a",{onClick:gt(u=>s.open_dialog(l.item),["prevent","stop"])},[b(i,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,WF)])],8,VF))),128)),(x(),we(Hn,{to:"#app"},[b(a,{item:o.selected_item,show:o.show_details_modal,onClose:t[0]||(t[0]=l=>o.show_details_modal=!1)},null,8,["item","show"])]))],64)}const fl=ae(FF,[["render",qF]]),za={load(e){return e.query.directory?B.library_files(e.query.directory):Promise.resolve()},set(e,t){t?e.directories=t.data.directories.map(n=>e.transform(n.path)):Fo().directories?e.directories=Fo().directories.map(n=>e.transform(n)):B.config().then(n=>{e.directories=n.data.directories.map(r=>e.transform(r))}),e.playlists=new Ee(t==null?void 0:t.data.playlists),e.tracks=new Ee(t==null?void 0:t.data.tracks)}},GF={name:"PageFiles",components:{ContentWithHeading:Qe,ListDirectories:yF,ListPlaylists:fl,ListTracks:gn,ModalDialogDirectory:rz},beforeRouteEnter(e,t,n){za.load(e).then(r=>{n(o=>za.set(o,r))})},beforeRouteUpdate(e,t,n){za.load(e).then(r=>{za.set(this,r),n()})},setup(){return{configurationStore:Fo()}},data(){return{directories:[],playlists:new Ee,show_details_modal:!1,tracks:new Ee}},computed:{current(){var e;return((e=this.$route.query)==null?void 0:e.directory)||"/"},name(){var e;return this.current!=="/"?(e=this.current)==null?void 0:e.slice(this.current.lastIndexOf("/")+1):this.$t("page.files.title")},play_expression(){return`path starts with "${this.current}" order by path asc`}},methods:{play(){B.player_play_expression(this.play_expression,!1)},transform(e){return{name:e.slice(e.lastIndexOf("/")+1),path:e}}}},KF=["textContent"],ZF={class:"buttons is-centered"},YF=["textContent"];function XF(e,t,n,r,o,s){const i=O("mdicon"),a=O("list-directories"),l=O("list-playlists"),u=O("list-tracks"),m=O("modal-dialog-directory"),d=O("content-with-heading");return x(),I("div",null,[b(d,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(s.name)},null,8,KF)]),"heading-right":N(()=>[c("div",ZF,[c("a",{class:"button is-small is-light is-rounded",onClick:t[0]||(t[0]=f=>o.show_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...f)=>s.play&&s.play(...f))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{textContent:y(e.$t("page.files.play"))},null,8,YF)])])]),content:N(()=>[b(a,{items:o.directories},null,8,["items"]),b(l,{items:o.playlists},null,8,["items"]),b(u,{expression:s.play_expression,items:o.tracks,show_icon:!0},null,8,["expression","items"]),b(m,{item:s.current,show:o.show_details_modal,onClose:t[2]||(t[2]=f=>o.show_details_modal=!1)},null,8,["item","show"])]),_:1})])}const JF=ae(GF,[["render",XF]]),ah={load(e){return Promise.all([B.library_genre(e.params.name,e.query.media_kind),B.library_genre_albums(e.params.name,e.query.media_kind)])},set(e,t){e.genre=t[0].data.genres.items.shift(),e.albums=new Ee(t[1].data.albums,{index:{field:"name_sort",type:String}})}},QF={name:"PageGenreAlbums",components:{ContentWithHeading:Qe,IndexButtonList:ar,ListAlbums:wn,ModalDialogGenre:dm},beforeRouteEnter(e,t,n){ah.load(e).then(r=>{n(o=>ah.set(o,r))})},data(){return{albums:new Ee,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(){B.player_play_expression(`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`,!0)}}},e7=["textContent"],t7={class:"buttons is-centered"},n7=["textContent"],r7={class:"heading has-text-centered-mobile"},o7=["textContent"],s7=c("span",null," | ",-1),i7=["textContent"];function a7(e,t,n,r,o,s){const i=O("index-button-list"),a=O("mdicon"),l=O("list-albums"),u=O("modal-dialog-genre"),m=O("content-with-heading");return x(),I("div",null,[b(m,null,{options:N(()=>[b(i,{indices:o.albums.indices},null,8,["indices"])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(o.genre.name)},null,8,e7)]),"heading-right":N(()=>[c("div",t7,[c("a",{class:"button is-small is-light is-rounded",onClick:t[0]||(t[0]=d=>o.show_details_modal=!0)},[b(a,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...d)=>s.play&&s.play(...d))},[b(a,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.genre.shuffle"))},null,8,n7)])])]),content:N(()=>[c("p",r7,[c("span",{textContent:y(e.$t("page.genre.album-count",{count:o.genre.album_count}))},null,8,o7),s7,c("a",{class:"has-text-link",onClick:t[2]||(t[2]=(...d)=>s.open_tracks&&s.open_tracks(...d)),textContent:y(e.$t("page.genre.track-count",{count:o.genre.track_count}))},null,8,i7)]),b(l,{items:o.albums},null,8,["items"]),b(u,{item:o.genre,media_kind:o.media_kind,show:o.show_details_modal,onClose:t[3]||(t[3]=d=>o.show_details_modal=!1)},null,8,["item","media_kind","show"])]),_:1})])}const l7=ae(QF,[["render",a7]]),lh={load(e){return Promise.all([B.library_genre(e.params.name,e.query.media_kind),B.library_genre_tracks(e.params.name,e.query.media_kind)])},set(e,t){e.genre=t[0].data.genres.items.shift(),e.tracks_list=new Ee(t[1].data.tracks)}},c7={name:"PageGenreTracks",components:{ContentWithHeading:Qe,ControlDropdown:Bo,IndexButtonList:ar,ListTracks:gn,ModalDialogGenre:dm},beforeRouteEnter(e,t,n){lh.load(e).then(r=>{n(o=>lh.set(o,r))})},setup(){return{uiStore:yn()}},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 Ee}},computed:{expression(){return`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`},selected_grouping_id:{get(){return this.uiStore.genre_tracks_sort},set(e){this.uiStore.genre_tracks_sort=e}},tracks(){const{options:e}=this.groupings.find(t=>t.id===this.selected_grouping_id);return this.tracks_list.group(e)}},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(){B.player_play_expression(this.expression,!0)}}},u7={class:"columns"},d7={class:"column"},m7=["textContent"],f7=["textContent"],p7={class:"buttons is-centered"},h7=["textContent"],_7={class:"heading has-text-centered-mobile"},g7=["textContent"],y7=c("span",null," | ",-1),z7=["textContent"];function v7(e,t,n,r,o,s){const i=O("index-button-list"),a=O("control-dropdown"),l=O("mdicon"),u=O("list-tracks"),m=O("modal-dialog-genre"),d=O("content-with-heading");return x(),I("div",null,[b(d,null,{options:N(()=>[b(i,{indices:s.tracks.indices},null,8,["indices"]),c("div",u7,[c("div",d7,[c("p",{class:"heading mb-5",textContent:y(e.$t("page.genre.sort.title"))},null,8,m7),b(a,{value:s.selected_grouping_id,"onUpdate:value":t[0]||(t[0]=f=>s.selected_grouping_id=f),options:o.groupings},null,8,["value","options"])])])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(o.genre.name)},null,8,f7)]),"heading-right":N(()=>[c("div",p7,[c("a",{class:"button is-small is-light is-rounded",onClick:t[1]||(t[1]=f=>o.show_details_modal=!0)},[b(l,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[2]||(t[2]=(...f)=>s.play&&s.play(...f))},[b(l,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.genre.shuffle"))},null,8,h7)])])]),content:N(()=>[c("p",_7,[c("a",{class:"has-text-link",onClick:t[3]||(t[3]=(...f)=>s.open_genre&&s.open_genre(...f)),textContent:y(e.$t("page.genre.album-count",{count:o.genre.album_count}))},null,8,g7),y7,c("span",{textContent:y(e.$t("page.genre.track-count",{count:o.genre.track_count}))},null,8,z7)]),b(u,{items:s.tracks,expression:s.expression},null,8,["items","expression"]),b(m,{item:o.genre,media_kind:o.media_kind,show:o.show_details_modal,onClose:t[4]||(t[4]=f=>o.show_details_modal=!1)},null,8,["item","media_kind","show"])]),_:1})])}const b7=ae(c7,[["render",v7]]),ch={load(e){return B.library_genres("music")},set(e,t){e.genres=new Ee(t.data.genres,{index:{field:"name_sort",type:String}})}},C7={name:"PageGenres",components:{ContentWithHeading:Qe,IndexButtonList:ar,ListGenres:nz,TabsMusic:yr},beforeRouteEnter(e,t,n){ch.load(e).then(r=>{n(o=>ch.set(o,r))})},data(){return{genres:new Ee}}},w7={class:"fd-page-with-tabs"},k7=["textContent"],S7=["textContent"];function x7(e,t,n,r,o,s){const i=O("tabs-music"),a=O("index-button-list"),l=O("list-genres"),u=O("content-with-heading");return x(),I("div",w7,[b(i),b(u,null,{options:N(()=>[b(a,{indices:o.genres.indices},null,8,["indices"])]),"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.genres.title"))},null,8,k7),c("p",{class:"heading",textContent:y(e.$t("page.genres.count",{count:o.genres.total}))},null,8,S7)]),content:N(()=>[b(l,{items:o.genres,media_kind:"music"},null,8,["items"])]),_:1})])}const E7=ae(C7,[["render",x7]]),uh={load(e){return Promise.all([B.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"}),B.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:3,type:"track"})])},set(e,t){e.albums=new Ee(t[0].data.albums),e.tracks=new Ee(t[1].data.tracks)}},$7={name:"PageMusic",components:{ContentWithHeading:Qe,ListAlbums:wn,ListTracks:gn,TabsMusic:yr},beforeRouteEnter(e,t,n){uh.load(e).then(r=>{n(o=>uh.set(o,r))})},data(){return{albums:[],tracks:{items:[]},selected_track:{}}}},T7={class:"fd-page-with-tabs"},A7=["textContent"],O7={class:"level"},P7={class:"level-item"},I7=["textContent"],L7={class:"level"},N7={class:"level-item"};function D7(e,t,n,r,o,s){const i=O("tabs-music"),a=O("list-albums"),l=O("router-link"),u=O("content-with-heading"),m=O("list-tracks");return x(),I("div",T7,[b(i),b(u,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.music.recently-added.title"))},null,8,A7)]),content:N(()=>[b(a,{items:o.albums},null,8,["items"])]),footer:N(()=>[c("nav",O7,[c("p",P7,[b(l,{class:"button is-light is-small is-rounded",to:{name:"music-recently-added"}},{default:N(()=>[Dt(y(e.$t("page.music.show-more")),1)]),_:1})])])]),_:1}),b(u,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.music.recently-played.title"))},null,8,I7)]),content:N(()=>[b(m,{items:o.tracks},null,8,["items"])]),footer:N(()=>[c("nav",L7,[c("p",N7,[b(l,{class:"button is-light is-small is-rounded",to:{name:"music-recently-played"}},{default:N(()=>[Dt(y(e.$t("page.music.show-more")),1)]),_:1})])])]),_:1})])}const R7=ae($7,[["render",D7]]),dh={load(e){const t=sr().recently_added_limit;return B.search({expression:"media_kind is music having track_count > 3 order by time_added desc",limit:t,type:"album"})},set(e,t){e.albums=new Ee(t.data.albums,{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}})}},M7={name:"PageMusicRecentlyAdded",components:{ContentWithHeading:Qe,ListAlbums:wn,TabsMusic:yr},beforeRouteEnter(e,t,n){dh.load(e).then(r=>{n(o=>dh.set(o,r))})},setup(){return{settingsStore:sr()}},data(){return{albums:new Ee}}},F7={class:"fd-page-with-tabs"},V7=["textContent"];function H7(e,t,n,r,o,s){const i=O("tabs-music"),a=O("list-albums"),l=O("content-with-heading");return x(),I("div",F7,[b(i),b(l,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.music.recently-added.title"))},null,8,V7)]),content:N(()=>[b(a,{items:o.albums},null,8,["items"])]),_:1})])}const U7=ae(M7,[["render",H7]]),mh={load(e){return B.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:50,type:"track"})},set(e,t){e.tracks=new Ee(t.data.tracks)}},j7={name:"PageMusicRecentlyPlayed",components:{ContentWithHeading:Qe,ListTracks:gn,TabsMusic:yr},beforeRouteEnter(e,t,n){mh.load(e).then(r=>{n(o=>mh.set(o,r))})},data(){return{tracks:{}}}},B7={class:"fd-page-with-tabs"},W7=["textContent"];function q7(e,t,n,r,o,s){const i=O("tabs-music"),a=O("list-tracks"),l=O("content-with-heading");return x(),I("div",B7,[b(i),b(l,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.music.recently-played.title"))},null,8,W7)]),content:N(()=>[b(a,{items:o.tracks},null,8,["items"])]),_:1})])}const G7=ae(j7,[["render",q7]]),K7={name:"ModalDialogPlaylistSpotify",props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],methods:{open(){this.$emit("close"),this.$router.push({name:"playlist-spotify",params:{id:this.item.id}})},play(){this.$emit("close"),B.player_play_uri(this.item.uri,!1)},queue_add(){this.$emit("close"),B.queue_add(this.item.uri)},queue_add_next(){this.$emit("close"),B.queue_add_next(this.item.uri)}}},Z7={key:0,class:"modal is-active"},Y7={class:"modal-content"},X7={class:"card"},J7={class:"card-content"},Q7={class:"title is-4"},eV=["textContent"],tV={class:"content is-small"},nV=["textContent"],rV=["textContent"],oV=["textContent"],sV=["textContent"],iV=["textContent"],aV=["textContent"],lV={class:"card-footer"},cV=["textContent"],uV=["textContent"],dV=["textContent"];function mV(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",Z7,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",Y7,[c("div",X7,[c("div",J7,[c("p",Q7,[c("a",{class:"has-text-link",onClick:t[1]||(t[1]=(...a)=>s.open&&s.open(...a)),textContent:y(n.item.name)},null,8,eV)]),c("div",tV,[c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.playlist.owner"))},null,8,nV),c("span",{class:"title is-6",textContent:y(n.item.owner.display_name)},null,8,rV)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.playlist.tracks"))},null,8,oV),c("span",{class:"title is-6",textContent:y(n.item.tracks.total)},null,8,sV)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.spotify.playlist.path"))},null,8,iV),c("span",{class:"title is-6",textContent:y(n.item.uri)},null,8,aV)])])]),c("footer",lV,[c("a",{class:"card-footer-item has-text-dark",onClick:t[2]||(t[2]=(...a)=>s.queue_add&&s.queue_add(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.playlist.add"))},null,8,cV)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=(...a)=>s.queue_add_next&&s.queue_add_next(...a))},[b(i,{class:"icon",name:"playlist-play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.playlist.add-next"))},null,8,uV)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[4]||(t[4]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.spotify.playlist.play"))},null,8,dV)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[5]||(t[5]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const sz=ae(K7,[["render",mV]]),fV={name:"ListPlaylistsSpotify",components:{ModalDialogPlaylistSpotify:sz},props:{items:{required:!0,type:Object}},data(){return{selected_item:{},show_details_modal:!1}},methods:{open(e){this.$router.push({name:"playlist-spotify",params:{id:e.id}})},open_dialog(e){this.selected_item=e,this.show_details_modal=!0}}},pV=["onClick"],hV=["textContent"],_V=["textContent"],gV={class:"media-right"},yV=["onClick"];function zV(e,t,n,r,o,s){const i=O("mdicon"),a=O("modal-dialog-playlist-spotify");return x(),I(ve,null,[(x(!0),I(ve,null,_t(n.items,l=>(x(),I("div",{key:l.id,class:"media is-align-items-center"},[c("div",{class:"media-content is-clickable is-clipped",onClick:u=>s.open(l)},[c("h1",{class:"title is-6",textContent:y(l.name)},null,8,hV),c("h2",{class:"subtitle is-7",textContent:y(l.owner.display_name)},null,8,_V)],8,pV),c("div",gV,[c("a",{onClick:gt(u=>s.open_dialog(l),["prevent","stop"])},[b(i,{class:"icon has-text-dark",name:"dots-vertical",size:"16"})],8,yV)])]))),128)),(x(),we(Hn,{to:"#app"},[b(a,{item:o.selected_item,show:o.show_details_modal,onClose:t[0]||(t[0]=l=>o.show_details_modal=!1)},null,8,["item","show"])]))],64)}const pl=ae(fV,[["render",zV]]),fh={load(e){return B.spotify().then(({data:t})=>{const n=new ir;return n.setAccessToken(t.webapi_token),Promise.all([n.getNewReleases({country:t.webapi_country,limit:3}),n.getFeaturedPlaylists({country:t.webapi_country,limit:3})])})},set(e,t){e.albums=t[0].albums.items,e.playlists=t[1].playlists.items}},vV={name:"PageMusicSpotify",components:{ContentWithHeading:Qe,ListAlbumsSpotify:Ii,ListPlaylistsSpotify:pl,TabsMusic:yr},beforeRouteEnter(e,t,n){fh.load(e).then(r=>{n(o=>fh.set(o,r))})},data(){return{playlists:[],albums:[]}}},bV={class:"fd-page-with-tabs"},CV=["textContent"],wV={class:"level"},kV={class:"level-item"},SV=["textContent"],xV={class:"level"},EV={class:"level-item"};function $V(e,t,n,r,o,s){const i=O("tabs-music"),a=O("list-albums-spotify"),l=O("router-link"),u=O("content-with-heading"),m=O("list-playlists-spotify");return x(),I("div",bV,[b(i),b(u,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.spotify.music.new-releases"))},null,8,CV)]),content:N(()=>[b(a,{items:o.albums},null,8,["items"])]),footer:N(()=>[c("nav",wV,[c("p",kV,[b(l,{to:{name:"music-spotify-new-releases"},class:"button is-light is-small is-rounded"},{default:N(()=>[Dt(y(e.$t("page.spotify.music.show-more")),1)]),_:1})])])]),_:1}),b(u,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.spotify.music.featured-playlists"))},null,8,SV)]),content:N(()=>[b(m,{items:o.playlists},null,8,["items"])]),footer:N(()=>[c("nav",xV,[c("p",EV,[b(l,{to:{name:"music-spotify-featured-playlists"},class:"button is-light is-small is-rounded"},{default:N(()=>[Dt(y(e.$t("page.spotify.music.show-more")),1)]),_:1})])])]),_:1})])}const TV=ae(vV,[["render",$V]]),ph={load(e){return B.spotify().then(({data:t})=>{const n=new ir;return n.setAccessToken(t.webapi_token),n.getFeaturedPlaylists({country:t.webapi_country,limit:50})})},set(e,t){e.playlists=t.playlists.items}},AV={name:"PageMusicSpotifyFeaturedPlaylists",components:{ContentWithHeading:Qe,ListPlaylistsSpotify:pl,TabsMusic:yr},beforeRouteEnter(e,t,n){ph.load(e).then(r=>{n(o=>ph.set(o,r))})},data(){return{playlists:[]}}},OV={class:"fd-page-with-tabs"},PV=["textContent"];function IV(e,t,n,r,o,s){const i=O("tabs-music"),a=O("list-playlists-spotify"),l=O("content-with-heading");return x(),I("div",OV,[b(i),b(l,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.spotify.music.featured-playlists"))},null,8,PV)]),content:N(()=>[b(a,{items:o.playlists},null,8,["items"])]),_:1})])}const LV=ae(AV,[["render",IV]]),hh={load(e){return B.spotify().then(({data:t})=>{const n=new ir;return n.setAccessToken(t.webapi_token),n.getNewReleases({country:t.webapi_country,limit:50})})},set(e,t){e.albums=t.albums.items}},NV={name:"PageMusicSpotifyNewReleases",components:{ContentWithHeading:Qe,ListAlbumsSpotify:Ii,TabsMusic:yr},beforeRouteEnter(e,t,n){hh.load(e).then(r=>{n(o=>hh.set(o,r))})},data(){return{albums:[]}}},DV={class:"fd-page-with-tabs"},RV=["textContent"];function MV(e,t,n,r,o,s){const i=O("tabs-music"),a=O("list-albums-spotify"),l=O("content-with-heading");return x(),I("div",DV,[b(i),b(l,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.spotify.music.new-releases"))},null,8,RV)]),content:N(()=>[b(a,{items:o.albums},null,8,["items"])]),_:1})])}const FV=ae(NV,[["render",MV]]),VV={name:"LyricsPane",setup(){return{lyricsStore:Zl(),playerStore:En()}},data(){return this.lastIndex=-1,this.scrollingTimer=null,this.lastItemId=-1,{autoScrolling:!0}},computed:{is_playing(){return this.playerStore.state==="play"},lyrics(){const e=this.lyricsStore.content,t=[];if(e.length>0){const n=/\[(?\d+):(?\d+)(?:\.(?\d+))?\] ?(?.*)/u;e.split(` -`).forEach(r=>{const{text:o,minutes:s,seconds:i,hundredths:a}=n.exec(r).groups;if(o){const l={text:o,time:s*60+Number(i)+ +`.${a||0}`};t.push(l)}}),t.forEach((r,o,s)=>{const i=(s[o+1].time-r.time||3)/r.text.length;let a=0;r.words=r.text.match(/\S+\s*/gu).map(l=>{const u=l.length*i;return a+=u,{duration:u,delay:a,text:l}})})}return t},verse_index(){var e;if(this.lyrics.length&&this.lyrics[0].time){const t=this.playerStore.item_progress_ms/1e3,n=this.lyrics,r=this.playerStore.item_id!==this.lastItemId,o=this.lastIndex>=0&&this.lastIndext;if((r||o)&&this.reset_scrolling(),this.lastIndext||this.lastIndex===n.length-1)return this.lastIndex;if(this.lastIndext)return this.lastIndex+1;let s=n.length-1,i=-1,a=0;for(;a<=s;){i=a+s>>1;const l=n[i].time,u=(e=n[i+1])==null?void 0:e.time;if(l<=t&&(u>t||!u))break;l>1)+(t.offsetHeight>>1)-e.scrollTop})},start_scrolling(e){(e.screenX??e.screenY)&&(this.autoScrolling=!1,clearTimeout(this.scrollingTimer),this.scrollingTimer=setTimeout(this.autoScrolling=!0,2e3))}}},HV=["textContent"],UV={key:1};function jV(e,t,n,r,o,s){return x(),I("div",{ref:"lyrics",class:"lyrics",onTouchstart:t[0]||(t[0]=i=>o.autoScrolling=!1),onTouchend:t[1]||(t[1]=i=>o.autoScrolling=!0),onScrollPassive:t[2]||(t[2]=(...i)=>s.start_scrolling&&s.start_scrolling(...i)),onWheelPassive:t[3]||(t[3]=(...i)=>s.start_scrolling&&s.start_scrolling(...i))},[(x(!0),I(ve,null,_t(s.lyrics,(i,a)=>(x(),I(ve,{key:a},[a===s.verse_index?(x(),I("div",{key:0,class:ke({"is-highlighted":s.is_playing})},[(x(!0),I(ve,null,_t(i.words,l=>(x(),I("span",{key:l,class:"has-text-weight-bold is-size-5"},[c("span",{style:co({"animation-duration":`${l.delay}s`}),textContent:y(l.text)},null,12,HV)]))),128))],2)):(x(),I("div",UV,y(i.text),1))],64))),128))],544)}const BV=ae(VV,[["render",jV],["__scopeId","data-v-a97a7574"]]),WV={name:"ModalDialogQueueItem",props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],setup(){return{servicesStore:Pt()}},data(){return{spotify_track:{}}},watch:{item(){var e;if(((e=this.item)==null?void 0:e.data_kind)==="spotify"){const t=new ir;t.setAccessToken(this.servicesStore.spotify.webapi_token),t.getTrack(this.item.path.slice(this.item.path.lastIndexOf(":")+1)).then(n=>{this.spotify_track=n})}else this.spotify_track={}}},methods:{open_album(){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.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.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{media_kind:this.item.media_kind}})},play(){this.$emit("close"),B.player_play({item_id:this.item.id})},remove(){this.$emit("close"),B.queue_remove(this.item.id)}}},qV={key:0,class:"modal is-active"},GV={class:"modal-content"},KV={class:"card"},ZV={class:"card-content"},YV=["textContent"],XV=["textContent"],JV={class:"content is-small"},QV={key:0},e9=["textContent"],t9=["textContent"],n9={key:1},r9=["textContent"],o9=["textContent"],s9={key:2},i9=["textContent"],a9=["textContent"],l9={key:3},c9=["textContent"],u9=["textContent"],d9={key:4},m9=["textContent"],f9=["textContent"],p9={key:5},h9=["textContent"],_9=["textContent"],g9={key:6},y9=["textContent"],z9=["textContent"],v9=["textContent"],b9=["textContent"],C9=["textContent"],w9={class:"title is-6"},k9=["textContent"],S9={key:7},x9=["textContent"],E9={class:"title is-6"},$9=["textContent"],T9=["textContent"],A9=["textContent"],O9=["textContent"],P9={class:"card-footer"},I9=["textContent"],L9=["textContent"];function N9(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",qV,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",GV,[c("div",KV,[c("div",ZV,[c("p",{class:"title is-4",textContent:y(n.item.title)},null,8,YV),c("p",{class:"subtitle",textContent:y(n.item.artist)},null,8,XV),c("div",JV,[n.item.album?(x(),I("p",QV,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.album"))},null,8,e9),c("a",{class:"title is-6 has-text-link",onClick:t[1]||(t[1]=(...a)=>s.open_album&&s.open_album(...a)),textContent:y(n.item.album)},null,8,t9)])):ee("",!0),n.item.album_artist?(x(),I("p",n9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.album-artist"))},null,8,r9),c("a",{class:"title is-6 has-text-link",onClick:t[2]||(t[2]=(...a)=>s.open_album_artist&&s.open_album_artist(...a)),textContent:y(n.item.album_artist)},null,8,o9)])):ee("",!0),n.item.composer?(x(),I("p",s9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.composer"))},null,8,i9),c("span",{class:"title is-6",textContent:y(n.item.composer)},null,8,a9)])):ee("",!0),n.item.year?(x(),I("p",l9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.year"))},null,8,c9),c("span",{class:"title is-6",textContent:y(n.item.year)},null,8,u9)])):ee("",!0),n.item.genre?(x(),I("p",d9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.genre"))},null,8,m9),c("a",{class:"title is-6 has-text-link",onClick:t[3]||(t[3]=(...a)=>s.open_genre&&s.open_genre(...a)),textContent:y(n.item.genre)},null,8,f9)])):ee("",!0),n.item.disc_number?(x(),I("p",p9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.position"))},null,8,h9),c("span",{class:"title is-6",textContent:y([n.item.disc_number,n.item.track_number].join(" / "))},null,8,_9)])):ee("",!0),n.item.length_ms?(x(),I("p",g9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.duration"))},null,8,y9),c("span",{class:"title is-6",textContent:y(e.$filters.durationInHours(n.item.length_ms))},null,8,z9)])):ee("",!0),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.path"))},null,8,v9),c("span",{class:"title is-6",textContent:y(n.item.path)},null,8,b9)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.type"))},null,8,C9),c("span",w9,[c("span",{textContent:y(`${e.$t(`media.kind.${n.item.media_kind}`)} - ${e.$t(`data.kind.${n.item.data_kind}`)}`)},null,8,k9)])]),n.item.samplerate?(x(),I("p",S9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.quality"))},null,8,x9),c("span",E9,[c("span",{textContent:y(n.item.type)},null,8,$9),n.item.samplerate?(x(),I("span",{key:0,textContent:y(e.$t("dialog.queue-item.samplerate",{rate:n.item.samplerate}))},null,8,T9)):ee("",!0),n.item.channels?(x(),I("span",{key:1,textContent:y(e.$t("dialog.queue-item.channels",{channels:e.$filters.channels(n.item.channels)}))},null,8,A9)):ee("",!0),n.item.bitrate?(x(),I("span",{key:2,textContent:y(e.$t("dialog.queue-item.bitrate",{rate:n.item.bitrate}))},null,8,O9)):ee("",!0)])])):ee("",!0)])]),c("footer",P9,[c("a",{class:"card-footer-item has-text-dark",onClick:t[4]||(t[4]=(...a)=>s.remove&&s.remove(...a))},[b(i,{class:"icon",name:"delete",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.queue-item.remove"))},null,8,I9)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[5]||(t[5]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.queue-item.play"))},null,8,L9)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[6]||(t[6]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const iz=ae(WV,[["render",N9]]),jr=1e3,D9={name:"PageNowPlaying",components:{ControlSlider:Yd,CoverArtwork:Lr,LyricsPane:BV,ModalDialogQueueItem:iz},setup(){return{lyricsStore:Zl(),playerStore:En(),queueStore:tr(),settingsStore:sr()}},data(){return{INTERVAL:jr,cursor:Kl,interval_id:0,is_dragged:!1,selected_item:{},show_details_modal:!1}},computed:{composer(){if(this.settingsStore.show_composer_now_playing){const e=this.settingsStore.show_composer_for_genre;if(!e||this.track.genre&&e.toLowerCase().split(",").findIndex(t=>this.track.genre.toLowerCase().indexOf(t.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.durationInHours(this.track_progress*jr)},track_progress:{get(){return Math.floor(this.playerStore.item_progress_ms/jr)},set(e){this.playerStore.item_progress_ms=e*jr}},track_progress_max(){return this.is_live?1:Math.floor(this.track.length_ms/jr)},track_total_time(){return this.is_live?this.$t("page.now-playing.live"):this.$filters.durationInHours(this.track.length_ms)}},watch:{playerStore(){this.interval_id>0&&(window.clearTimeout(this.interval_id),this.interval_id=0),this.playerStore.state==="play"&&(this.interval_id=window.setInterval(this.tick,jr))}},created(){B.player_status().then(({data:e})=>{this.playerStore.$state=e,this.playerStore.state==="play"&&(this.interval_id=window.setInterval(this.tick,jr))})},unmounted(){this.interval_id>0&&(window.clearTimeout(this.interval_id),this.interval_id=0)},methods:{end_dragging(){this.is_dragged=!1},open_dialog(e){this.selected_item=e,this.show_details_modal=!0},seek(){this.is_live||B.player_seek_to_pos(this.track_progress*jr)},start_dragging(){this.is_dragged=!0},tick(){this.is_dragged||(this.track_progress+=1)}}},R9={class:"hero is-full-height"},M9={key:0,class:"hero-body is-flex is-align-items-center"},F9={class:"container has-text-centered",style:{"max-width":"500px"}},V9={class:"is-flex is-justify-content-space-between"},H9=["textContent"],U9=["textContent"],j9=["textContent"],B9=["textContent"],W9=["textContent"],q9=["textContent"],G9=["textContent"],K9={key:1,class:"hero-body is-flex is-align-items-center"},Z9={class:"container has-text-centered"},Y9=["textContent"],X9=["textContent"];function J9(e,t,n,r,o,s){const i=O("cover-artwork"),a=O("lyrics-pane"),l=O("control-slider"),u=O("modal-dialog-queue-item");return x(),I("div",R9,[s.track.id>0?(x(),I("div",M9,[c("div",F9,[b(i,{url:s.track.artwork_url,artist:s.track.artist,album:s.track.album,class:ke(["is-clickable fd-has-shadow fd-cover-big-image",{"is-masked":r.lyricsStore.pane}]),onClick:t[0]||(t[0]=m=>s.open_dialog(s.track))},null,8,["url","artist","album","class"]),r.lyricsStore.pane?(x(),we(a,{key:0})):ee("",!0),b(l,{value:s.track_progress,"onUpdate:value":t[1]||(t[1]=m=>s.track_progress=m),class:"mt-5",disabled:s.is_live,max:s.track_progress_max,cursor:o.cursor,onChange:s.seek,onMousedown:s.start_dragging,onMouseup:s.end_dragging},null,8,["value","disabled","max","cursor","onChange","onMousedown","onMouseup"]),c("div",V9,[c("p",{class:"subtitle is-7",textContent:y(s.track_elapsed_time)},null,8,H9),c("p",{class:"subtitle is-7",textContent:y(s.track_total_time)},null,8,U9)]),c("p",{class:"title is-5",textContent:y(s.track.title)},null,8,j9),c("p",{class:"title is-6",textContent:y(s.track.artist)},null,8,B9),s.composer?(x(),I("p",{key:1,class:"subtitle is-6 has-text-grey has-text-weight-bold",textContent:y(s.composer)},null,8,W9)):ee("",!0),s.track.album?(x(),I("p",{key:2,class:"subtitle is-6",textContent:y(s.track.album)},null,8,q9)):ee("",!0),r.settingsStore.show_filepath_now_playing?(x(),I("p",{key:3,class:"subtitle is-6 has-text-grey",textContent:y(s.track.path)},null,8,G9)):ee("",!0)])])):(x(),I("div",K9,[c("div",Z9,[c("p",{class:"title is-5",textContent:y(e.$t("page.now-playing.title"))},null,8,Y9),c("p",{class:"subtitle",textContent:y(e.$t("page.now-playing.info"))},null,8,X9)])])),b(u,{show:o.show_details_modal,item:o.selected_item,onClose:t[2]||(t[2]=m=>o.show_details_modal=!1)},null,8,["show","item"])])}const Q9=ae(D9,[["render",J9]]),va={load(e){return Promise.all([B.library_playlist(e.params.id),B.library_playlist_folder(e.params.id)])},set(e,t){e.playlist=t[0].data,e.playlists_list=new Ee(t[1].data)}},eH={name:"PagePlaylistFolder",components:{ContentWithHeading:Qe,ListPlaylists:fl},beforeRouteEnter(e,t,n){va.load(e).then(r=>{n(o=>va.set(o,r))})},beforeRouteUpdate(e,t,n){va.load(e).then(r=>{va.set(this,r),n()})},setup(){return{configurationStore:Fo()}},data(){return{playlist:{},playlists_list:new Ee}},computed:{playlists(){return this.playlists_list.group({filters:[e=>e.folder||this.radio_playlists||e.stream_count===0||e.item_count>e.stream_count]})},radio_playlists(){return this.configurationStore.radio_playlists}}},tH=["textContent"],nH=["textContent"];function rH(e,t,n,r,o,s){const i=O("list-playlists"),a=O("content-with-heading");return x(),I("div",null,[b(a,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(o.playlist.id===0?e.$t("page.playlists.title"):o.playlist.name)},null,8,tH),c("p",{class:"heading",textContent:y(e.$t("page.playlists.count",{count:s.playlists.count}))},null,8,nH)]),content:N(()=>[b(i,{items:s.playlists},null,8,["items"])]),_:1})])}const oH=ae(eH,[["render",rH]]),_h={load(e){return Promise.all([B.library_playlist(e.params.id),B.library_playlist_tracks(e.params.id)])},set(e,t){e.playlist=t[0].data,e.tracks=new Ee(t[1].data)}},sH={name:"PagePlaylistTracks",components:{ContentWithHeading:Qe,ListTracks:gn,ModalDialogPlaylist:oz},beforeRouteEnter(e,t,n){_h.load(e).then(r=>{n(o=>_h.set(o,r))})},data(){return{playlist:{},show_details_modal:!1,tracks:new Ee}},computed:{uris(){return this.playlist.random?this.tracks.map(e=>e.uri).join():this.playlist.uri}},methods:{play(){B.player_play_uri(this.uris,!0)}}},iH=["textContent"],aH={class:"buttons is-centered"},lH=["textContent"],cH=["textContent"];function uH(e,t,n,r,o,s){const i=O("mdicon"),a=O("list-tracks"),l=O("modal-dialog-playlist"),u=O("content-with-heading");return x(),I("div",null,[b(u,null,{"heading-left":N(()=>[c("div",{class:"title is-4",textContent:y(o.playlist.name)},null,8,iH)]),"heading-right":N(()=>[c("div",aH,[c("a",{class:"button is-small is-light is-rounded",onClick:t[0]||(t[0]=m=>o.show_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...m)=>s.play&&s.play(...m))},[b(i,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.playlist.shuffle"))},null,8,lH)])])]),content:N(()=>[c("p",{class:"heading has-text-centered-mobile",textContent:y(e.$t("page.playlist.track-count",{count:o.tracks.count}))},null,8,cH),b(a,{items:o.tracks,uris:s.uris},null,8,["items","uris"]),b(l,{item:o.playlist,show:o.show_details_modal,uris:s.uris,onClose:t[2]||(t[2]=m=>o.show_details_modal=!1)},null,8,["item","show","uris"])]),_:1})])}const dH=ae(sH,[["render",uH]]),Xu=50,gh={load(e){const t=new ir;return t.setAccessToken(Pt().spotify.webapi_token),Promise.all([t.getPlaylist(e.params.id),t.getPlaylistTracks(e.params.id,{limit:Xu,market:Pt().$state.spotify.webapi_country,offset:0})])},set(e,t){e.playlist=t.shift(),e.tracks=[],e.total=0,e.offset=0,e.append_tracks(t.shift())}},mH={name:"PagePlaylistTracksSpotify",components:{ContentWithHeading:Qe,ListTracksSpotify:dl,ModalDialogPlaylistSpotify:sz,VueEternalLoading:cm},beforeRouteEnter(e,t,n){gh.load(e).then(r=>{n(o=>gh.set(o,r))})},setup(){return{servicesStore:Pt()}},data(){return{offset:0,playlist:{tracks:{}},show_playlist_details_modal:!1,total:0,tracks:[]}},methods:{append_tracks(e){let t=Math.max(-1,...this.tracks.map(n=>n.position).filter(n=>n));e.items.forEach(n=>{const{track:r}=n;r&&(r.is_playable&&(r.position=++t),this.tracks.push(r))}),this.total=e.total,this.offset+=e.limit},load_next({loaded:e}){const t=new ir;t.setAccessToken(this.servicesStore.spotify.webapi_token),t.getPlaylistTracks(this.playlist.id,{limit:Xu,market:this.servicesStore.spotify.webapi_country,offset:this.offset}).then(n=>{this.append_tracks(n),e(n.items.length,Xu)})},play(){this.show_details_modal=!1,B.player_play_uri(this.playlist.uri,!0)}}},fH=["textContent"],pH={class:"buttons is-centered"},hH=["textContent"],_H=["textContent"],gH={class:"columns is-centered"},yH={class:"column has-text-centered"},zH=c("br",null,null,-1);function vH(e,t,n,r,o,s){const i=O("mdicon"),a=O("list-tracks-spotify"),l=O("VueEternalLoading"),u=O("modal-dialog-playlist-spotify"),m=O("content-with-heading");return x(),I("div",null,[b(m,null,{"heading-left":N(()=>[c("div",{class:"title is-4",textContent:y(o.playlist.name)},null,8,fH)]),"heading-right":N(()=>[c("div",pH,[c("a",{class:"button is-small is-light is-rounded",onClick:t[0]||(t[0]=d=>o.show_playlist_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...d)=>s.play&&s.play(...d))},[b(i,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.spotify.playlist.shuffle"))},null,8,hH)])])]),content:N(()=>[c("p",{class:"heading has-text-centered-mobile",textContent:y(e.$t("page.spotify.playlist.count",{count:o.playlist.tracks.total}))},null,8,_H),b(a,{items:o.tracks,context_uri:o.playlist.uri},null,8,["items","context_uri"]),o.offset[c("div",gH,[c("div",yH,[b(i,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":N(()=>[zH]),_:1},8,["load"])):ee("",!0),b(u,{item:o.playlist,show:o.show_playlist_details_modal,onClose:t[2]||(t[2]=d=>o.show_playlist_details_modal=!1)},null,8,["item","show"])]),_:1})])}const bH=ae(mH,[["render",vH]]),yh={load(e){return Promise.all([B.library_album(e.params.id),B.library_podcast_episodes(e.params.id)])},set(e,t){e.album=t[0].data,e.tracks=new Ee(t[1].data.tracks)}},CH={name:"PagePodcast",components:{ContentWithHero:rc,CoverArtwork:Lr,ListTracks:gn,ModalDialog:Zd,ModalDialogAlbum:oc},beforeRouteEnter(e,t,n){yh.load(e).then(r=>{n(o=>yh.set(o,r))})},data(){return{album:{},rss_playlist_to_remove:{},show_details_modal:!1,show_remove_podcast_modal:!1,tracks:new Ee}},methods:{open_remove_podcast_dialog(){B.library_track_playlists(this.tracks.items[0].id).then(({data:e})=>{[this.rss_playlist_to_remove]=e.items.filter(t=>t.type==="rss"),this.show_remove_podcast_modal=!0,this.show_details_modal=!1})},play(){B.player_play_uri(this.album.uri,!1)},reload_tracks(){B.library_podcast_episodes(this.album.id).then(({data:e})=>{this.tracks=new Ee(e.tracks)})},remove_podcast(){this.show_remove_podcast_modal=!1,B.library_playlist_delete(this.rss_playlist_to_remove.id).then(()=>{this.$router.replace({name:"podcasts"})})}}},wH=["textContent"],kH=c("h2",{class:"subtitle is-6"},[c("br")],-1),SH={class:"buttons fd-is-centered-mobile mt-5"},xH=["textContent"],EH=["textContent"],$H=["textContent"],TH={class:"is-size-7"},AH=["textContent"],OH=["textContent"];function PH(e,t,n,r,o,s){const i=O("mdicon"),a=O("cover-artwork"),l=O("list-tracks"),u=O("modal-dialog-album"),m=O("modal-dialog"),d=O("content-with-hero");return x(),I("div",null,[b(d,null,{"heading-left":N(()=>[c("h1",{class:"title is-5",textContent:y(o.album.name)},null,8,wH),kH,c("div",SH,[c("a",{class:"button is-small is-dark is-rounded",onClick:t[0]||(t[0]=(...f)=>s.play&&s.play(...f))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{textContent:y(e.$t("page.podcast.play"))},null,8,xH)]),c("a",{class:"button is-small is-light is-rounded",onClick:t[1]||(t[1]=f=>o.show_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})])])]),"heading-right":N(()=>[b(a,{url:o.album.artwork_url,artist:o.album.artist,album:o.album.name,class:"is-clickable fd-has-shadow fd-cover fd-cover-medium-image",onClick:t[2]||(t[2]=f=>o.show_details_modal=!0)},null,8,["url","artist","album"])]),content:N(()=>[c("p",{class:"heading has-text-centered-mobile mt-5",textContent:y(e.$t("page.podcast.track-count",{count:o.album.track_count}))},null,8,EH),b(l,{items:o.tracks,show_progress:!0,onPlayCountChanged:s.reload_tracks},null,8,["items","onPlayCountChanged"]),b(u,{item:o.album,show:o.show_details_modal,media_kind:"podcast",onClose:t[3]||(t[3]=f=>o.show_details_modal=!1),onPlayCountChanged:s.reload_tracks,onRemovePodcast:s.open_remove_podcast_dialog},null,8,["item","show","onPlayCountChanged","onRemovePodcast"]),b(m,{show:o.show_remove_podcast_modal,title:e.$t("page.podcast.remove-podcast"),close_action:e.$t("page.podcast.cancel"),delete_action:e.$t("page.podcast.remove"),onClose:t[4]||(t[4]=f=>o.show_remove_podcast_modal=!1),onDelete:s.remove_podcast},{"modal-content":N(()=>[c("p",{textContent:y(e.$t("page.podcast.remove-info-1"))},null,8,$H),c("p",TH,[Dt(" ("),c("span",{textContent:y(e.$t("page.podcast.remove-info-2"))},null,8,AH),c("b",{textContent:y(o.rss_playlist_to_remove.name)},null,8,OH),Dt(") ")])]),_:1},8,["show","title","close_action","delete_action","onDelete"])]),_:1})])}const IH=ae(CH,[["render",PH]]),LH={name:"ModalDialogAddRss",props:{show:Boolean},emits:["close","podcast-added"],data(){return{disabled:!0,loading:!1,url:""}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.url_field.focus()},10))}},methods:{add_stream(){this.loading=!0,B.library_add(this.url).then(()=>{this.$emit("close"),this.$emit("podcast-added"),this.url=""}).catch(()=>{this.loading=!1})},check_url(e){const{validity:t}=e.target;this.disabled=t.patternMismatch||t.valueMissing}}},NH={key:0,class:"modal is-active"},DH={class:"modal-content"},RH={class:"card-content"},MH=["textContent"],FH={class:"field"},VH={class:"control has-icons-left"},HH=["placeholder","disabled"],UH=["textContent"],jH={key:0,class:"card-footer"},BH={class:"card-footer-item has-text-dark"},WH=["textContent"],qH={key:1,class:"card-footer is-clipped"},GH=["textContent"],KH=["textContent"];function ZH(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",NH,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",DH,[c("form",{class:"card",onSubmit:t[5]||(t[5]=gt((...a)=>s.add_stream&&s.add_stream(...a),["prevent"]))},[c("div",RH,[c("p",{class:"title is-4",textContent:y(e.$t("dialog.add.rss.title"))},null,8,MH),c("div",FH,[c("p",VH,[ht(c("input",{ref:"url_field","onUpdate:modelValue":t[1]||(t[1]=a=>o.url=a),class:"input is-shadowless",type:"url",pattern:"http[s]?://.+",required:"",placeholder:e.$t("dialog.add.rss.placeholder"),disabled:o.loading,onInput:t[2]||(t[2]=(...a)=>s.check_url&&s.check_url(...a))},null,40,HH),[[_n,o.url]]),b(i,{class:"icon is-left",name:"rss",size:"16"})]),c("p",{class:"help",textContent:y(e.$t("dialog.add.rss.help"))},null,8,UH)])]),o.loading?(x(),I("footer",jH,[c("a",BH,[b(i,{class:"icon",name:"web",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.rss.processing"))},null,8,WH)])])):(x(),I("footer",qH,[c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=a=>e.$emit("close"))},[b(i,{class:"icon",name:"cancel",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.rss.cancel"))},null,8,GH)]),c("a",{class:ke([{"is-disabled":o.disabled},"card-footer-item has-background-info has-text-white has-text-weight-bold"]),onClick:t[4]||(t[4]=(...a)=>s.add_stream&&s.add_stream(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.rss.add"))},null,8,KH)],2)]))],32)]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[6]||(t[6]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const YH=ae(LH,[["render",ZH]]),zh={load(e){return Promise.all([B.library_albums("podcast"),B.library_podcasts_new_episodes()])},set(e,t){e.albums=new Ee(t[0].data),e.tracks=new Ee(t[1].data.tracks)}},XH={name:"PagePodcasts",components:{ContentWithHeading:Qe,ListAlbums:wn,ListTracks:gn,ModalDialogAddRss:YH},beforeRouteEnter(e,t,n){zh.load(e).then(r=>{n(o=>zh.set(o,r))})},setup(){return{libraryStore:Gl(),uiStore:yn()}},data(){return{albums:[],tracks:{items:[]},show_url_modal:!1}},computed:{rss(){return this.libraryStore.rss}},methods:{mark_all_played(){this.tracks.items.forEach(e=>{B.library_track_update(e.id,{play_count:"increment"})}),this.tracks.items={}},open_add_podcast_dialog(){this.show_url_modal=!0},reload_new_episodes(){B.library_podcasts_new_episodes().then(({data:e})=>{this.tracks=new Ee(e.tracks)})},reload_podcasts(){B.library_albums("podcast").then(({data:e})=>{this.albums=new Ee(e),this.reload_new_episodes()})},update_rss(){this.libraryStore.update_dialog_scan_kind="rss",this.uiStore.show_update_dialog=!0}}},JH=["textContent"],QH={class:"buttons is-centered"},eU=["textContent"],tU=["textContent"],nU=["textContent"],rU={class:"buttons is-centered"},oU=["textContent"],sU=["textContent"];function iU(e,t,n,r,o,s){const i=O("mdicon"),a=O("list-tracks"),l=O("content-with-heading"),u=O("list-albums"),m=O("modal-dialog-add-rss");return x(),I("div",null,[o.tracks.items.length>0?(x(),we(l,{key:0},{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.podcasts.new-episodes"))},null,8,JH)]),"heading-right":N(()=>[c("div",QH,[c("a",{class:"button is-small",onClick:t[0]||(t[0]=(...d)=>s.mark_all_played&&s.mark_all_played(...d))},[b(i,{class:"icon",name:"pencil",size:"16"}),c("span",{textContent:y(e.$t("page.podcasts.mark-all-played"))},null,8,eU)])])]),content:N(()=>[b(a,{items:o.tracks,show_progress:!0,onPlayCountChanged:s.reload_new_episodes},null,8,["items","onPlayCountChanged"])]),_:1})):ee("",!0),b(l,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.podcasts.title"))},null,8,tU),c("p",{class:"heading",textContent:y(e.$t("page.podcasts.count",{count:o.albums.total}))},null,8,nU)]),"heading-right":N(()=>[c("div",rU,[s.rss.tracks>0?(x(),I("a",{key:0,class:"button is-small",onClick:t[1]||(t[1]=(...d)=>s.update_rss&&s.update_rss(...d))},[b(i,{class:"icon",name:"refresh",size:"16"}),c("span",{textContent:y(e.$t("page.podcasts.update"))},null,8,oU)])):ee("",!0),c("a",{class:"button is-small",onClick:t[2]||(t[2]=(...d)=>s.open_add_podcast_dialog&&s.open_add_podcast_dialog(...d))},[b(i,{class:"icon",name:"rss",size:"16"}),c("span",{textContent:y(e.$t("page.podcasts.add"))},null,8,sU)])])]),content:N(()=>[b(u,{items:o.albums,onPlayCountChanged:t[3]||(t[3]=d=>s.reload_new_episodes()),onPodcastDeleted:t[4]||(t[4]=d=>s.reload_podcasts())},null,8,["items"]),b(m,{show:o.show_url_modal,onClose:t[5]||(t[5]=d=>o.show_url_modal=!1),onPodcastAdded:t[6]||(t[6]=d=>s.reload_podcasts())},null,8,["show"])]),_:1})])}const aU=ae(XH,[["render",iU]]),lU={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:En()}},computed:{is_next(){return this.current_position<0||this.position>=this.current_position},player(){return this.playerStore}},methods:{play(){B.player_play({item_id:this.item.id})}}},cU={key:0,class:"media is-align-items-center"},uU={key:0,class:"media-left"},dU=["textContent"],mU=["textContent"],fU=["textContent"],pU={class:"media-right"};function hU(e,t,n,r,o,s){const i=O("mdicon");return s.is_next||!n.show_only_next_items?(x(),I("div",cU,[n.edit_mode?(x(),I("div",uU,[b(i,{class:"icon has-text-grey fd-is-movable handle",name:"drag-horizontal",size:"16"})])):ee("",!0),c("div",{class:"media-content is-clickable is-clipped",onClick:t[0]||(t[0]=(...a)=>s.play&&s.play(...a))},[c("h1",{class:ke(["title is-6",{"has-text-primary":n.item.id===s.player.item_id,"has-text-grey-light":!s.is_next}]),textContent:y(n.item.title)},null,10,dU),c("h2",{class:ke(["subtitle is-7 has-text-weight-bold",{"has-text-primary":n.item.id===s.player.item_id,"has-text-grey-light":!s.is_next,"has-text-grey":s.is_next&&n.item.id!==s.player.item_id}]),textContent:y(n.item.artist)},null,10,mU),c("h2",{class:ke(["subtitle is-7",{"has-text-primary":n.item.id===s.player.item_id,"has-text-grey-light":!s.is_next,"has-text-grey":s.is_next&&n.item.id!==s.player.item_id}]),textContent:y(n.item.album)},null,10,fU)]),c("div",pU,[vt(e.$slots,"actions")])])):ee("",!0)}const _U=ae(lU,[["render",hU]]),gU={name:"ModalDialogAddUrlStream",props:{show:Boolean},emits:["close"],data(){return{disabled:!0,loading:!1,url:""}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.url_field.focus()},10))}},methods:{add_stream(){this.loading=!0,B.queue_add(this.url).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})},check_url(e){const{validity:t}=e.target;this.disabled=t.patternMismatch||t.valueMissing},play(){this.loading=!0,B.player_play_uri(this.url,!1).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})}}},yU={key:0,class:"modal is-active"},zU={class:"modal-content"},vU={class:"card-content"},bU=["textContent"],CU={class:"field"},wU={class:"control has-icons-left"},kU=["placeholder","disabled"],SU={key:0,class:"card-footer"},xU={class:"card-footer-item has-text-dark"},EU=["textContent"],$U={key:1,class:"card-footer is-clipped"},TU=["textContent"],AU=["textContent"],OU=["textContent"];function PU(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",yU,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",zU,[c("form",{class:"card",onSubmit:t[6]||(t[6]=gt((...a)=>s.play&&s.play(...a),["prevent"]))},[c("div",vU,[c("p",{class:"title is-4",textContent:y(e.$t("dialog.add.stream.title"))},null,8,bU),c("div",CU,[c("p",wU,[ht(c("input",{ref:"url_field","onUpdate:modelValue":t[1]||(t[1]=a=>o.url=a),class:"input is-shadowless",type:"url",pattern:"http[s]?://.+",required:"",placeholder:e.$t("dialog.add.stream.placeholder"),disabled:o.loading,onInput:t[2]||(t[2]=(...a)=>s.check_url&&s.check_url(...a))},null,40,kU),[[_n,o.url]]),b(i,{class:"icon is-left",name:"web",size:"16"})])])]),o.loading?(x(),I("footer",SU,[c("a",xU,[b(i,{class:"icon",name:"web",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.stream.loading"))},null,8,EU)])])):(x(),I("footer",$U,[c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=a=>e.$emit("close"))},[b(i,{class:"icon",name:"cancel",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.stream.cancel"))},null,8,TU)]),c("a",{class:ke([{"is-disabled":o.disabled},"card-footer-item has-text-dark"]),onClick:t[4]||(t[4]=(...a)=>s.add_stream&&s.add_stream(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.stream.add"))},null,8,AU)],2),c("a",{class:ke([{"is-disabled":o.disabled},"card-footer-item has-background-info has-text-white has-text-weight-bold"]),onClick:t[5]||(t[5]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.stream.play"))},null,8,OU)],2)]))],32)]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[7]||(t[7]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const IU=ae(gU,[["render",PU]]),LU={name:"ModalDialogPlaylistSave",props:{show:Boolean},emits:["close"],data(){return{disabled:!0,loading:!1,playlist_name:""}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.playlist_name_field.focus()},10))}},methods:{check_name(e){const{validity:t}=e.target;this.disabled=t.patternMismatch||t.valueMissing},save(){this.loading=!0,B.queue_save_playlist(this.playlist_name).then(()=>{this.$emit("close"),this.playlist_name=""}).catch(()=>{this.loading=!1})}}},NU={key:0,class:"modal is-active"},DU={class:"modal-content"},RU={class:"card-content"},MU=["textContent"],FU={class:"field"},VU={class:"control has-icons-left"},HU=["placeholder","disabled"],UU={key:0,class:"card-footer"},jU={class:"card-footer-item has-text-dark"},BU=["textContent"],WU={key:1,class:"card-footer is-clipped"},qU=["textContent"],GU=["textContent"];function KU(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",NU,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",DU,[c("form",{class:"card",onSubmit:t[5]||(t[5]=gt((...a)=>s.save&&s.save(...a),["prevent"]))},[c("div",RU,[c("p",{class:"title is-4",textContent:y(e.$t("dialog.playlist.save.title"))},null,8,MU),c("div",FU,[c("p",VU,[ht(c("input",{ref:"playlist_name_field","onUpdate:modelValue":t[1]||(t[1]=a=>o.playlist_name=a),class:"input is-shadowless",type:"text",pattern:".+",required:"",placeholder:e.$t("dialog.playlist.save.playlist-name"),disabled:o.loading,onInput:t[2]||(t[2]=(...a)=>s.check_name&&s.check_name(...a))},null,40,HU),[[_n,o.playlist_name]]),b(i,{class:"icon is-left",name:"file-music",size:"16"})])])]),o.loading?(x(),I("footer",UU,[c("a",jU,[b(i,{class:"icon",name:"web",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.playlist.save.saving"))},null,8,BU)])])):(x(),I("footer",WU,[c("a",{class:"card-footer-item has-text-danger",onClick:t[3]||(t[3]=a=>e.$emit("close"))},[b(i,{class:"icon",name:"cancel",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.playlist.save.cancel"))},null,8,qU)]),c("a",{class:ke([{"is-disabled":o.disabled},"card-footer-item has-background-info has-text-white has-text-weight-bold"]),onClick:t[4]||(t[4]=(...a)=>s.save&&s.save(...a))},[b(i,{class:"icon",name:"content-save",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.playlist.save.save"))},null,8,GU)],2)]))],32)]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[6]||(t[6]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const ZU=ae(LU,[["render",KU]]);var az={exports:{}};/**! +`).forEach(r=>{const{text:o,minutes:s,seconds:i,hundredths:a}=n.exec(r).groups;if(o){const l={text:o,time:s*60+Number(i)+ +`.${a||0}`};t.push(l)}}),t.forEach((r,o,s)=>{const i=(s[o+1].time-r.time||3)/r.text.length;let a=0;r.words=r.text.match(/\S+\s*/gu).map(l=>{const u=l.length*i;return a+=u,{duration:u,delay:a,text:l}})})}return t},verse_index(){var e;if(this.lyrics.length&&this.lyrics[0].time){const t=this.playerStore.item_progress_ms/1e3,n=this.lyrics,r=this.playerStore.item_id!==this.lastItemId,o=this.lastIndex>=0&&this.lastIndext;if((r||o)&&this.reset_scrolling(),this.lastIndext||this.lastIndex===n.length-1)return this.lastIndex;if(this.lastIndext)return this.lastIndex+1;let s=n.length-1,i=-1,a=0;for(;a<=s;){i=a+s>>1;const l=n[i].time,u=(e=n[i+1])==null?void 0:e.time;if(l<=t&&(u>t||!u))break;l>1)+(t.offsetHeight>>1)-e.scrollTop})},start_scrolling(e){(e.screenX??e.screenY)&&(this.autoScrolling=!1,clearTimeout(this.scrollingTimer),this.scrollingTimer=setTimeout(this.autoScrolling=!0,2e3))}}},HV=["textContent"],UV={key:1};function jV(e,t,n,r,o,s){return x(),I("div",{ref:"lyrics",class:"lyrics",onTouchstart:t[0]||(t[0]=i=>o.autoScrolling=!1),onTouchend:t[1]||(t[1]=i=>o.autoScrolling=!0),onScrollPassive:t[2]||(t[2]=(...i)=>s.start_scrolling&&s.start_scrolling(...i)),onWheelPassive:t[3]||(t[3]=(...i)=>s.start_scrolling&&s.start_scrolling(...i))},[(x(!0),I(ve,null,_t(s.lyrics,(i,a)=>(x(),I(ve,{key:a},[a===s.verse_index?(x(),I("div",{key:0,class:ke({"is-highlighted":s.is_playing})},[(x(!0),I(ve,null,_t(i.words,l=>(x(),I("span",{key:l,class:"has-text-weight-bold is-size-5"},[c("span",{style:co({"animation-duration":`${l.delay}s`}),textContent:y(l.text)},null,12,HV)]))),128))],2)):(x(),I("div",UV,y(i.text),1))],64))),128))],544)}const BV=ae(VV,[["render",jV],["__scopeId","data-v-a97a7574"]]),WV={name:"ModalDialogQueueItem",props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],setup(){return{servicesStore:Pt()}},data(){return{spotify_track:{}}},watch:{item(){var e;if(((e=this.item)==null?void 0:e.data_kind)==="spotify"){const t=new ir;t.setAccessToken(this.servicesStore.spotify.webapi_token),t.getTrack(this.item.path.slice(this.item.path.lastIndexOf(":")+1)).then(n=>{this.spotify_track=n})}else this.spotify_track={}}},methods:{open_album(){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.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.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{media_kind:this.item.media_kind}})},play(){this.$emit("close"),B.player_play({item_id:this.item.id})},remove(){this.$emit("close"),B.queue_remove(this.item.id)}}},qV={key:0,class:"modal is-active"},GV={class:"modal-content"},KV={class:"card"},ZV={class:"card-content"},YV=["textContent"],XV=["textContent"],JV={class:"content is-small"},QV={key:0},e9=["textContent"],t9=["textContent"],n9={key:1},r9=["textContent"],o9=["textContent"],s9={key:2},i9=["textContent"],a9=["textContent"],l9={key:3},c9=["textContent"],u9=["textContent"],d9={key:4},m9=["textContent"],f9=["textContent"],p9={key:5},h9=["textContent"],_9=["textContent"],g9={key:6},y9=["textContent"],z9=["textContent"],v9=["textContent"],b9=["textContent"],C9=["textContent"],w9={class:"title is-6"},k9=["textContent"],S9={key:7},x9=["textContent"],E9={class:"title is-6"},$9=["textContent"],T9=["textContent"],A9=["textContent"],O9=["textContent"],P9={class:"card-footer"},I9=["textContent"],L9=["textContent"];function N9(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",qV,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",GV,[c("div",KV,[c("div",ZV,[c("p",{class:"title is-4",textContent:y(n.item.title)},null,8,YV),c("p",{class:"subtitle",textContent:y(n.item.artist)},null,8,XV),c("div",JV,[n.item.album?(x(),I("p",QV,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.album"))},null,8,e9),c("a",{class:"title is-6 has-text-link",onClick:t[1]||(t[1]=(...a)=>s.open_album&&s.open_album(...a)),textContent:y(n.item.album)},null,8,t9)])):ee("",!0),n.item.album_artist?(x(),I("p",n9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.album-artist"))},null,8,r9),c("a",{class:"title is-6 has-text-link",onClick:t[2]||(t[2]=(...a)=>s.open_album_artist&&s.open_album_artist(...a)),textContent:y(n.item.album_artist)},null,8,o9)])):ee("",!0),n.item.composer?(x(),I("p",s9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.composer"))},null,8,i9),c("span",{class:"title is-6",textContent:y(n.item.composer)},null,8,a9)])):ee("",!0),n.item.year?(x(),I("p",l9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.year"))},null,8,c9),c("span",{class:"title is-6",textContent:y(n.item.year)},null,8,u9)])):ee("",!0),n.item.genre?(x(),I("p",d9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.genre"))},null,8,m9),c("a",{class:"title is-6 has-text-link",onClick:t[3]||(t[3]=(...a)=>s.open_genre&&s.open_genre(...a)),textContent:y(n.item.genre)},null,8,f9)])):ee("",!0),n.item.disc_number?(x(),I("p",p9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.position"))},null,8,h9),c("span",{class:"title is-6",textContent:y([n.item.disc_number,n.item.track_number].join(" / "))},null,8,_9)])):ee("",!0),n.item.length_ms?(x(),I("p",g9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.duration"))},null,8,y9),c("span",{class:"title is-6",textContent:y(e.$filters.durationInHours(n.item.length_ms))},null,8,z9)])):ee("",!0),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.path"))},null,8,v9),c("span",{class:"title is-6",textContent:y(n.item.path)},null,8,b9)]),c("p",null,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.type"))},null,8,C9),c("span",w9,[c("span",{textContent:y(`${e.$t(`media.kind.${n.item.media_kind}`)} - ${e.$t(`data.kind.${n.item.data_kind}`)}`)},null,8,k9)])]),n.item.samplerate?(x(),I("p",S9,[c("span",{class:"heading",textContent:y(e.$t("dialog.queue-item.quality"))},null,8,x9),c("span",E9,[c("span",{textContent:y(n.item.type)},null,8,$9),n.item.samplerate?(x(),I("span",{key:0,textContent:y(e.$t("dialog.queue-item.samplerate",{rate:n.item.samplerate}))},null,8,T9)):ee("",!0),n.item.channels?(x(),I("span",{key:1,textContent:y(e.$t("dialog.queue-item.channels",{channels:e.$filters.channels(n.item.channels)}))},null,8,A9)):ee("",!0),n.item.bitrate?(x(),I("span",{key:2,textContent:y(e.$t("dialog.queue-item.bitrate",{rate:n.item.bitrate}))},null,8,O9)):ee("",!0)])])):ee("",!0)])]),c("footer",P9,[c("a",{class:"card-footer-item has-text-dark",onClick:t[4]||(t[4]=(...a)=>s.remove&&s.remove(...a))},[b(i,{class:"icon",name:"delete",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.queue-item.remove"))},null,8,I9)]),c("a",{class:"card-footer-item has-text-dark",onClick:t[5]||(t[5]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.queue-item.play"))},null,8,L9)])])])]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[6]||(t[6]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const iz=ae(WV,[["render",N9]]),jr=1e3,D9={name:"PageNowPlaying",components:{ControlSlider:Yd,CoverArtwork:Lr,LyricsPane:BV,ModalDialogQueueItem:iz},setup(){return{lyricsStore:Zl(),playerStore:En(),queueStore:tr(),settingsStore:sr()}},data(){return{INTERVAL:jr,cursor:Kl,interval_id:0,is_dragged:!1,selected_item:{},show_details_modal:!1}},computed:{composer(){if(this.settingsStore.show_composer_now_playing){const e=this.settingsStore.show_composer_for_genre;if(!e||this.track.genre&&e.toLowerCase().split(",").findIndex(t=>this.track.genre.toLowerCase().indexOf(t.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.durationInHours(this.track_progress*jr)},track_progress:{get(){return Math.floor(this.playerStore.item_progress_ms/jr)},set(e){this.playerStore.item_progress_ms=e*jr}},track_progress_max(){return this.is_live?1:Math.floor(this.track.length_ms/jr)},track_total_time(){return this.is_live?this.$t("page.now-playing.live"):this.$filters.durationInHours(this.track.length_ms)}},watch:{"playerStore.state"(e){this.interval_id>0&&(window.clearTimeout(this.interval_id),this.interval_id=0),e==="play"&&(this.interval_id=window.setInterval(this.tick,jr))}},created(){B.player_status().then(({data:e})=>{this.playerStore.$state=e,this.playerStore.state==="play"&&(this.interval_id=window.setInterval(this.tick,jr))})},unmounted(){this.interval_id>0&&(window.clearTimeout(this.interval_id),this.interval_id=0)},methods:{end_dragging(){this.is_dragged=!1},open_dialog(e){this.selected_item=e,this.show_details_modal=!0},seek(){this.is_live||B.player_seek_to_pos(this.track_progress*jr)},start_dragging(){this.is_dragged=!0},tick(){this.is_dragged||(this.track_progress+=1)}}},R9={class:"hero is-full-height"},M9={key:0,class:"hero-body is-flex is-align-items-center"},F9={class:"container has-text-centered",style:{"max-width":"500px"}},V9={class:"is-flex is-justify-content-space-between"},H9=["textContent"],U9=["textContent"],j9=["textContent"],B9=["textContent"],W9=["textContent"],q9=["textContent"],G9=["textContent"],K9={key:1,class:"hero-body is-flex is-align-items-center"},Z9={class:"container has-text-centered"},Y9=["textContent"],X9=["textContent"];function J9(e,t,n,r,o,s){const i=O("cover-artwork"),a=O("lyrics-pane"),l=O("control-slider"),u=O("modal-dialog-queue-item");return x(),I("div",R9,[s.track.id>0?(x(),I("div",M9,[c("div",F9,[b(i,{url:s.track.artwork_url,artist:s.track.artist,album:s.track.album,class:ke(["is-clickable fd-has-shadow fd-cover-big-image",{"is-masked":r.lyricsStore.pane}]),onClick:t[0]||(t[0]=m=>s.open_dialog(s.track))},null,8,["url","artist","album","class"]),r.lyricsStore.pane?(x(),we(a,{key:0})):ee("",!0),b(l,{value:s.track_progress,"onUpdate:value":t[1]||(t[1]=m=>s.track_progress=m),class:"mt-5",disabled:s.is_live,max:s.track_progress_max,cursor:o.cursor,onChange:s.seek,onMousedown:s.start_dragging,onMouseup:s.end_dragging},null,8,["value","disabled","max","cursor","onChange","onMousedown","onMouseup"]),c("div",V9,[c("p",{class:"subtitle is-7",textContent:y(s.track_elapsed_time)},null,8,H9),c("p",{class:"subtitle is-7",textContent:y(s.track_total_time)},null,8,U9)]),c("p",{class:"title is-5",textContent:y(s.track.title)},null,8,j9),c("p",{class:"title is-6",textContent:y(s.track.artist)},null,8,B9),s.composer?(x(),I("p",{key:1,class:"subtitle is-6 has-text-grey has-text-weight-bold",textContent:y(s.composer)},null,8,W9)):ee("",!0),s.track.album?(x(),I("p",{key:2,class:"subtitle is-6",textContent:y(s.track.album)},null,8,q9)):ee("",!0),r.settingsStore.show_filepath_now_playing?(x(),I("p",{key:3,class:"subtitle is-6 has-text-grey",textContent:y(s.track.path)},null,8,G9)):ee("",!0)])])):(x(),I("div",K9,[c("div",Z9,[c("p",{class:"title is-5",textContent:y(e.$t("page.now-playing.title"))},null,8,Y9),c("p",{class:"subtitle",textContent:y(e.$t("page.now-playing.info"))},null,8,X9)])])),b(u,{show:o.show_details_modal,item:o.selected_item,onClose:t[2]||(t[2]=m=>o.show_details_modal=!1)},null,8,["show","item"])])}const Q9=ae(D9,[["render",J9]]),va={load(e){return Promise.all([B.library_playlist(e.params.id),B.library_playlist_folder(e.params.id)])},set(e,t){e.playlist=t[0].data,e.playlists_list=new Ee(t[1].data)}},eH={name:"PagePlaylistFolder",components:{ContentWithHeading:Qe,ListPlaylists:fl},beforeRouteEnter(e,t,n){va.load(e).then(r=>{n(o=>va.set(o,r))})},beforeRouteUpdate(e,t,n){va.load(e).then(r=>{va.set(this,r),n()})},setup(){return{configurationStore:Fo()}},data(){return{playlist:{},playlists_list:new Ee}},computed:{playlists(){return this.playlists_list.group({filters:[e=>e.folder||this.radio_playlists||e.stream_count===0||e.item_count>e.stream_count]})},radio_playlists(){return this.configurationStore.radio_playlists}}},tH=["textContent"],nH=["textContent"];function rH(e,t,n,r,o,s){const i=O("list-playlists"),a=O("content-with-heading");return x(),I("div",null,[b(a,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(o.playlist.id===0?e.$t("page.playlists.title"):o.playlist.name)},null,8,tH),c("p",{class:"heading",textContent:y(e.$t("page.playlists.count",{count:s.playlists.count}))},null,8,nH)]),content:N(()=>[b(i,{items:s.playlists},null,8,["items"])]),_:1})])}const oH=ae(eH,[["render",rH]]),_h={load(e){return Promise.all([B.library_playlist(e.params.id),B.library_playlist_tracks(e.params.id)])},set(e,t){e.playlist=t[0].data,e.tracks=new Ee(t[1].data)}},sH={name:"PagePlaylistTracks",components:{ContentWithHeading:Qe,ListTracks:gn,ModalDialogPlaylist:oz},beforeRouteEnter(e,t,n){_h.load(e).then(r=>{n(o=>_h.set(o,r))})},data(){return{playlist:{},show_details_modal:!1,tracks:new Ee}},computed:{uris(){return this.playlist.random?this.tracks.map(e=>e.uri).join():this.playlist.uri}},methods:{play(){B.player_play_uri(this.uris,!0)}}},iH=["textContent"],aH={class:"buttons is-centered"},lH=["textContent"],cH=["textContent"];function uH(e,t,n,r,o,s){const i=O("mdicon"),a=O("list-tracks"),l=O("modal-dialog-playlist"),u=O("content-with-heading");return x(),I("div",null,[b(u,null,{"heading-left":N(()=>[c("div",{class:"title is-4",textContent:y(o.playlist.name)},null,8,iH)]),"heading-right":N(()=>[c("div",aH,[c("a",{class:"button is-small is-light is-rounded",onClick:t[0]||(t[0]=m=>o.show_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...m)=>s.play&&s.play(...m))},[b(i,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.playlist.shuffle"))},null,8,lH)])])]),content:N(()=>[c("p",{class:"heading has-text-centered-mobile",textContent:y(e.$t("page.playlist.track-count",{count:o.tracks.count}))},null,8,cH),b(a,{items:o.tracks,uris:s.uris},null,8,["items","uris"]),b(l,{item:o.playlist,show:o.show_details_modal,uris:s.uris,onClose:t[2]||(t[2]=m=>o.show_details_modal=!1)},null,8,["item","show","uris"])]),_:1})])}const dH=ae(sH,[["render",uH]]),Xu=50,gh={load(e){const t=new ir;return t.setAccessToken(Pt().spotify.webapi_token),Promise.all([t.getPlaylist(e.params.id),t.getPlaylistTracks(e.params.id,{limit:Xu,market:Pt().$state.spotify.webapi_country,offset:0})])},set(e,t){e.playlist=t.shift(),e.tracks=[],e.total=0,e.offset=0,e.append_tracks(t.shift())}},mH={name:"PagePlaylistTracksSpotify",components:{ContentWithHeading:Qe,ListTracksSpotify:dl,ModalDialogPlaylistSpotify:sz,VueEternalLoading:cm},beforeRouteEnter(e,t,n){gh.load(e).then(r=>{n(o=>gh.set(o,r))})},setup(){return{servicesStore:Pt()}},data(){return{offset:0,playlist:{tracks:{}},show_playlist_details_modal:!1,total:0,tracks:[]}},methods:{append_tracks(e){let t=Math.max(-1,...this.tracks.map(n=>n.position).filter(n=>n));e.items.forEach(n=>{const{track:r}=n;r&&(r.is_playable&&(r.position=++t),this.tracks.push(r))}),this.total=e.total,this.offset+=e.limit},load_next({loaded:e}){const t=new ir;t.setAccessToken(this.servicesStore.spotify.webapi_token),t.getPlaylistTracks(this.playlist.id,{limit:Xu,market:this.servicesStore.spotify.webapi_country,offset:this.offset}).then(n=>{this.append_tracks(n),e(n.items.length,Xu)})},play(){this.show_details_modal=!1,B.player_play_uri(this.playlist.uri,!0)}}},fH=["textContent"],pH={class:"buttons is-centered"},hH=["textContent"],_H=["textContent"],gH={class:"columns is-centered"},yH={class:"column has-text-centered"},zH=c("br",null,null,-1);function vH(e,t,n,r,o,s){const i=O("mdicon"),a=O("list-tracks-spotify"),l=O("VueEternalLoading"),u=O("modal-dialog-playlist-spotify"),m=O("content-with-heading");return x(),I("div",null,[b(m,null,{"heading-left":N(()=>[c("div",{class:"title is-4",textContent:y(o.playlist.name)},null,8,fH)]),"heading-right":N(()=>[c("div",pH,[c("a",{class:"button is-small is-light is-rounded",onClick:t[0]||(t[0]=d=>o.show_playlist_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})]),c("a",{class:"button is-small is-dark is-rounded",onClick:t[1]||(t[1]=(...d)=>s.play&&s.play(...d))},[b(i,{class:"icon",name:"shuffle",size:"16"}),c("span",{textContent:y(e.$t("page.spotify.playlist.shuffle"))},null,8,hH)])])]),content:N(()=>[c("p",{class:"heading has-text-centered-mobile",textContent:y(e.$t("page.spotify.playlist.count",{count:o.playlist.tracks.total}))},null,8,_H),b(a,{items:o.tracks,context_uri:o.playlist.uri},null,8,["items","context_uri"]),o.offset[c("div",gH,[c("div",yH,[b(i,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":N(()=>[zH]),_:1},8,["load"])):ee("",!0),b(u,{item:o.playlist,show:o.show_playlist_details_modal,onClose:t[2]||(t[2]=d=>o.show_playlist_details_modal=!1)},null,8,["item","show"])]),_:1})])}const bH=ae(mH,[["render",vH]]),yh={load(e){return Promise.all([B.library_album(e.params.id),B.library_podcast_episodes(e.params.id)])},set(e,t){e.album=t[0].data,e.tracks=new Ee(t[1].data.tracks)}},CH={name:"PagePodcast",components:{ContentWithHero:rc,CoverArtwork:Lr,ListTracks:gn,ModalDialog:Zd,ModalDialogAlbum:oc},beforeRouteEnter(e,t,n){yh.load(e).then(r=>{n(o=>yh.set(o,r))})},data(){return{album:{},rss_playlist_to_remove:{},show_details_modal:!1,show_remove_podcast_modal:!1,tracks:new Ee}},methods:{open_remove_podcast_dialog(){B.library_track_playlists(this.tracks.items[0].id).then(({data:e})=>{[this.rss_playlist_to_remove]=e.items.filter(t=>t.type==="rss"),this.show_remove_podcast_modal=!0,this.show_details_modal=!1})},play(){B.player_play_uri(this.album.uri,!1)},reload_tracks(){B.library_podcast_episodes(this.album.id).then(({data:e})=>{this.tracks=new Ee(e.tracks)})},remove_podcast(){this.show_remove_podcast_modal=!1,B.library_playlist_delete(this.rss_playlist_to_remove.id).then(()=>{this.$router.replace({name:"podcasts"})})}}},wH=["textContent"],kH=c("h2",{class:"subtitle is-6"},[c("br")],-1),SH={class:"buttons fd-is-centered-mobile mt-5"},xH=["textContent"],EH=["textContent"],$H=["textContent"],TH={class:"is-size-7"},AH=["textContent"],OH=["textContent"];function PH(e,t,n,r,o,s){const i=O("mdicon"),a=O("cover-artwork"),l=O("list-tracks"),u=O("modal-dialog-album"),m=O("modal-dialog"),d=O("content-with-hero");return x(),I("div",null,[b(d,null,{"heading-left":N(()=>[c("h1",{class:"title is-5",textContent:y(o.album.name)},null,8,wH),kH,c("div",SH,[c("a",{class:"button is-small is-dark is-rounded",onClick:t[0]||(t[0]=(...f)=>s.play&&s.play(...f))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{textContent:y(e.$t("page.podcast.play"))},null,8,xH)]),c("a",{class:"button is-small is-light is-rounded",onClick:t[1]||(t[1]=f=>o.show_details_modal=!0)},[b(i,{class:"icon",name:"dots-horizontal",size:"16"})])])]),"heading-right":N(()=>[b(a,{url:o.album.artwork_url,artist:o.album.artist,album:o.album.name,class:"is-clickable fd-has-shadow fd-cover fd-cover-medium-image",onClick:t[2]||(t[2]=f=>o.show_details_modal=!0)},null,8,["url","artist","album"])]),content:N(()=>[c("p",{class:"heading has-text-centered-mobile mt-5",textContent:y(e.$t("page.podcast.track-count",{count:o.album.track_count}))},null,8,EH),b(l,{items:o.tracks,show_progress:!0,onPlayCountChanged:s.reload_tracks},null,8,["items","onPlayCountChanged"]),b(u,{item:o.album,show:o.show_details_modal,media_kind:"podcast",onClose:t[3]||(t[3]=f=>o.show_details_modal=!1),onPlayCountChanged:s.reload_tracks,onRemovePodcast:s.open_remove_podcast_dialog},null,8,["item","show","onPlayCountChanged","onRemovePodcast"]),b(m,{show:o.show_remove_podcast_modal,title:e.$t("page.podcast.remove-podcast"),close_action:e.$t("page.podcast.cancel"),delete_action:e.$t("page.podcast.remove"),onClose:t[4]||(t[4]=f=>o.show_remove_podcast_modal=!1),onDelete:s.remove_podcast},{"modal-content":N(()=>[c("p",{textContent:y(e.$t("page.podcast.remove-info-1"))},null,8,$H),c("p",TH,[Dt(" ("),c("span",{textContent:y(e.$t("page.podcast.remove-info-2"))},null,8,AH),c("b",{textContent:y(o.rss_playlist_to_remove.name)},null,8,OH),Dt(") ")])]),_:1},8,["show","title","close_action","delete_action","onDelete"])]),_:1})])}const IH=ae(CH,[["render",PH]]),LH={name:"ModalDialogAddRss",props:{show:Boolean},emits:["close","podcast-added"],data(){return{disabled:!0,loading:!1,url:""}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.url_field.focus()},10))}},methods:{add_stream(){this.loading=!0,B.library_add(this.url).then(()=>{this.$emit("close"),this.$emit("podcast-added"),this.url=""}).catch(()=>{this.loading=!1})},check_url(e){const{validity:t}=e.target;this.disabled=t.patternMismatch||t.valueMissing}}},NH={key:0,class:"modal is-active"},DH={class:"modal-content"},RH={class:"card-content"},MH=["textContent"],FH={class:"field"},VH={class:"control has-icons-left"},HH=["placeholder","disabled"],UH=["textContent"],jH={key:0,class:"card-footer"},BH={class:"card-footer-item has-text-dark"},WH=["textContent"],qH={key:1,class:"card-footer is-clipped"},GH=["textContent"],KH=["textContent"];function ZH(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",NH,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",DH,[c("form",{class:"card",onSubmit:t[5]||(t[5]=gt((...a)=>s.add_stream&&s.add_stream(...a),["prevent"]))},[c("div",RH,[c("p",{class:"title is-4",textContent:y(e.$t("dialog.add.rss.title"))},null,8,MH),c("div",FH,[c("p",VH,[ht(c("input",{ref:"url_field","onUpdate:modelValue":t[1]||(t[1]=a=>o.url=a),class:"input is-shadowless",type:"url",pattern:"http[s]?://.+",required:"",placeholder:e.$t("dialog.add.rss.placeholder"),disabled:o.loading,onInput:t[2]||(t[2]=(...a)=>s.check_url&&s.check_url(...a))},null,40,HH),[[_n,o.url]]),b(i,{class:"icon is-left",name:"rss",size:"16"})]),c("p",{class:"help",textContent:y(e.$t("dialog.add.rss.help"))},null,8,UH)])]),o.loading?(x(),I("footer",jH,[c("a",BH,[b(i,{class:"icon",name:"web",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.rss.processing"))},null,8,WH)])])):(x(),I("footer",qH,[c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=a=>e.$emit("close"))},[b(i,{class:"icon",name:"cancel",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.rss.cancel"))},null,8,GH)]),c("a",{class:ke([{"is-disabled":o.disabled},"card-footer-item has-background-info has-text-white has-text-weight-bold"]),onClick:t[4]||(t[4]=(...a)=>s.add_stream&&s.add_stream(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.rss.add"))},null,8,KH)],2)]))],32)]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[6]||(t[6]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const YH=ae(LH,[["render",ZH]]),zh={load(e){return Promise.all([B.library_albums("podcast"),B.library_podcasts_new_episodes()])},set(e,t){e.albums=new Ee(t[0].data),e.tracks=new Ee(t[1].data.tracks)}},XH={name:"PagePodcasts",components:{ContentWithHeading:Qe,ListAlbums:wn,ListTracks:gn,ModalDialogAddRss:YH},beforeRouteEnter(e,t,n){zh.load(e).then(r=>{n(o=>zh.set(o,r))})},setup(){return{libraryStore:Gl(),uiStore:yn()}},data(){return{albums:[],tracks:{items:[]},show_url_modal:!1}},computed:{rss(){return this.libraryStore.rss}},methods:{mark_all_played(){this.tracks.items.forEach(e=>{B.library_track_update(e.id,{play_count:"increment"})}),this.tracks.items={}},open_add_podcast_dialog(){this.show_url_modal=!0},reload_new_episodes(){B.library_podcasts_new_episodes().then(({data:e})=>{this.tracks=new Ee(e.tracks)})},reload_podcasts(){B.library_albums("podcast").then(({data:e})=>{this.albums=new Ee(e),this.reload_new_episodes()})},update_rss(){this.libraryStore.update_dialog_scan_kind="rss",this.uiStore.show_update_dialog=!0}}},JH=["textContent"],QH={class:"buttons is-centered"},eU=["textContent"],tU=["textContent"],nU=["textContent"],rU={class:"buttons is-centered"},oU=["textContent"],sU=["textContent"];function iU(e,t,n,r,o,s){const i=O("mdicon"),a=O("list-tracks"),l=O("content-with-heading"),u=O("list-albums"),m=O("modal-dialog-add-rss");return x(),I("div",null,[o.tracks.items.length>0?(x(),we(l,{key:0},{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.podcasts.new-episodes"))},null,8,JH)]),"heading-right":N(()=>[c("div",QH,[c("a",{class:"button is-small",onClick:t[0]||(t[0]=(...d)=>s.mark_all_played&&s.mark_all_played(...d))},[b(i,{class:"icon",name:"pencil",size:"16"}),c("span",{textContent:y(e.$t("page.podcasts.mark-all-played"))},null,8,eU)])])]),content:N(()=>[b(a,{items:o.tracks,show_progress:!0,onPlayCountChanged:s.reload_new_episodes},null,8,["items","onPlayCountChanged"])]),_:1})):ee("",!0),b(l,null,{"heading-left":N(()=>[c("p",{class:"title is-4",textContent:y(e.$t("page.podcasts.title"))},null,8,tU),c("p",{class:"heading",textContent:y(e.$t("page.podcasts.count",{count:o.albums.total}))},null,8,nU)]),"heading-right":N(()=>[c("div",rU,[s.rss.tracks>0?(x(),I("a",{key:0,class:"button is-small",onClick:t[1]||(t[1]=(...d)=>s.update_rss&&s.update_rss(...d))},[b(i,{class:"icon",name:"refresh",size:"16"}),c("span",{textContent:y(e.$t("page.podcasts.update"))},null,8,oU)])):ee("",!0),c("a",{class:"button is-small",onClick:t[2]||(t[2]=(...d)=>s.open_add_podcast_dialog&&s.open_add_podcast_dialog(...d))},[b(i,{class:"icon",name:"rss",size:"16"}),c("span",{textContent:y(e.$t("page.podcasts.add"))},null,8,sU)])])]),content:N(()=>[b(u,{items:o.albums,onPlayCountChanged:t[3]||(t[3]=d=>s.reload_new_episodes()),onPodcastDeleted:t[4]||(t[4]=d=>s.reload_podcasts())},null,8,["items"]),b(m,{show:o.show_url_modal,onClose:t[5]||(t[5]=d=>o.show_url_modal=!1),onPodcastAdded:t[6]||(t[6]=d=>s.reload_podcasts())},null,8,["show"])]),_:1})])}const aU=ae(XH,[["render",iU]]),lU={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:En()}},computed:{is_next(){return this.current_position<0||this.position>=this.current_position},player(){return this.playerStore}},methods:{play(){B.player_play({item_id:this.item.id})}}},cU={key:0,class:"media is-align-items-center"},uU={key:0,class:"media-left"},dU=["textContent"],mU=["textContent"],fU=["textContent"],pU={class:"media-right"};function hU(e,t,n,r,o,s){const i=O("mdicon");return s.is_next||!n.show_only_next_items?(x(),I("div",cU,[n.edit_mode?(x(),I("div",uU,[b(i,{class:"icon has-text-grey fd-is-movable handle",name:"drag-horizontal",size:"16"})])):ee("",!0),c("div",{class:"media-content is-clickable is-clipped",onClick:t[0]||(t[0]=(...a)=>s.play&&s.play(...a))},[c("h1",{class:ke(["title is-6",{"has-text-primary":n.item.id===s.player.item_id,"has-text-grey-light":!s.is_next}]),textContent:y(n.item.title)},null,10,dU),c("h2",{class:ke(["subtitle is-7 has-text-weight-bold",{"has-text-primary":n.item.id===s.player.item_id,"has-text-grey-light":!s.is_next,"has-text-grey":s.is_next&&n.item.id!==s.player.item_id}]),textContent:y(n.item.artist)},null,10,mU),c("h2",{class:ke(["subtitle is-7",{"has-text-primary":n.item.id===s.player.item_id,"has-text-grey-light":!s.is_next,"has-text-grey":s.is_next&&n.item.id!==s.player.item_id}]),textContent:y(n.item.album)},null,10,fU)]),c("div",pU,[vt(e.$slots,"actions")])])):ee("",!0)}const _U=ae(lU,[["render",hU]]),gU={name:"ModalDialogAddUrlStream",props:{show:Boolean},emits:["close"],data(){return{disabled:!0,loading:!1,url:""}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.url_field.focus()},10))}},methods:{add_stream(){this.loading=!0,B.queue_add(this.url).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})},check_url(e){const{validity:t}=e.target;this.disabled=t.patternMismatch||t.valueMissing},play(){this.loading=!0,B.player_play_uri(this.url,!1).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})}}},yU={key:0,class:"modal is-active"},zU={class:"modal-content"},vU={class:"card-content"},bU=["textContent"],CU={class:"field"},wU={class:"control has-icons-left"},kU=["placeholder","disabled"],SU={key:0,class:"card-footer"},xU={class:"card-footer-item has-text-dark"},EU=["textContent"],$U={key:1,class:"card-footer is-clipped"},TU=["textContent"],AU=["textContent"],OU=["textContent"];function PU(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",yU,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",zU,[c("form",{class:"card",onSubmit:t[6]||(t[6]=gt((...a)=>s.play&&s.play(...a),["prevent"]))},[c("div",vU,[c("p",{class:"title is-4",textContent:y(e.$t("dialog.add.stream.title"))},null,8,bU),c("div",CU,[c("p",wU,[ht(c("input",{ref:"url_field","onUpdate:modelValue":t[1]||(t[1]=a=>o.url=a),class:"input is-shadowless",type:"url",pattern:"http[s]?://.+",required:"",placeholder:e.$t("dialog.add.stream.placeholder"),disabled:o.loading,onInput:t[2]||(t[2]=(...a)=>s.check_url&&s.check_url(...a))},null,40,kU),[[_n,o.url]]),b(i,{class:"icon is-left",name:"web",size:"16"})])])]),o.loading?(x(),I("footer",SU,[c("a",xU,[b(i,{class:"icon",name:"web",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.stream.loading"))},null,8,EU)])])):(x(),I("footer",$U,[c("a",{class:"card-footer-item has-text-dark",onClick:t[3]||(t[3]=a=>e.$emit("close"))},[b(i,{class:"icon",name:"cancel",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.stream.cancel"))},null,8,TU)]),c("a",{class:ke([{"is-disabled":o.disabled},"card-footer-item has-text-dark"]),onClick:t[4]||(t[4]=(...a)=>s.add_stream&&s.add_stream(...a))},[b(i,{class:"icon",name:"playlist-plus",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.stream.add"))},null,8,AU)],2),c("a",{class:ke([{"is-disabled":o.disabled},"card-footer-item has-background-info has-text-white has-text-weight-bold"]),onClick:t[5]||(t[5]=(...a)=>s.play&&s.play(...a))},[b(i,{class:"icon",name:"play",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.add.stream.play"))},null,8,OU)],2)]))],32)]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[7]||(t[7]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const IU=ae(gU,[["render",PU]]),LU={name:"ModalDialogPlaylistSave",props:{show:Boolean},emits:["close"],data(){return{disabled:!0,loading:!1,playlist_name:""}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.playlist_name_field.focus()},10))}},methods:{check_name(e){const{validity:t}=e.target;this.disabled=t.patternMismatch||t.valueMissing},save(){this.loading=!0,B.queue_save_playlist(this.playlist_name).then(()=>{this.$emit("close"),this.playlist_name=""}).catch(()=>{this.loading=!1})}}},NU={key:0,class:"modal is-active"},DU={class:"modal-content"},RU={class:"card-content"},MU=["textContent"],FU={class:"field"},VU={class:"control has-icons-left"},HU=["placeholder","disabled"],UU={key:0,class:"card-footer"},jU={class:"card-footer-item has-text-dark"},BU=["textContent"],WU={key:1,class:"card-footer is-clipped"},qU=["textContent"],GU=["textContent"];function KU(e,t,n,r,o,s){const i=O("mdicon");return x(),we(Rt,{name:"fade"},{default:N(()=>[n.show?(x(),I("div",NU,[c("div",{class:"modal-background",onClick:t[0]||(t[0]=a=>e.$emit("close"))}),c("div",DU,[c("form",{class:"card",onSubmit:t[5]||(t[5]=gt((...a)=>s.save&&s.save(...a),["prevent"]))},[c("div",RU,[c("p",{class:"title is-4",textContent:y(e.$t("dialog.playlist.save.title"))},null,8,MU),c("div",FU,[c("p",VU,[ht(c("input",{ref:"playlist_name_field","onUpdate:modelValue":t[1]||(t[1]=a=>o.playlist_name=a),class:"input is-shadowless",type:"text",pattern:".+",required:"",placeholder:e.$t("dialog.playlist.save.playlist-name"),disabled:o.loading,onInput:t[2]||(t[2]=(...a)=>s.check_name&&s.check_name(...a))},null,40,HU),[[_n,o.playlist_name]]),b(i,{class:"icon is-left",name:"file-music",size:"16"})])])]),o.loading?(x(),I("footer",UU,[c("a",jU,[b(i,{class:"icon",name:"web",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.playlist.save.saving"))},null,8,BU)])])):(x(),I("footer",WU,[c("a",{class:"card-footer-item has-text-danger",onClick:t[3]||(t[3]=a=>e.$emit("close"))},[b(i,{class:"icon",name:"cancel",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.playlist.save.cancel"))},null,8,qU)]),c("a",{class:ke([{"is-disabled":o.disabled},"card-footer-item has-background-info has-text-white has-text-weight-bold"]),onClick:t[4]||(t[4]=(...a)=>s.save&&s.save(...a))},[b(i,{class:"icon",name:"content-save",size:"16"}),c("span",{class:"is-size-7",textContent:y(e.$t("dialog.playlist.save.save"))},null,8,GU)],2)]))],32)]),c("button",{class:"modal-close is-large","aria-label":"close",onClick:t[6]||(t[6]=a=>e.$emit("close"))})])):ee("",!0)]),_:1})}const ZU=ae(LU,[["render",KU]]);var az={exports:{}};/**! * Sortable 1.14.0 * @author RubaXa * @author owenm