mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-29 00:23:23 -05:00
2 lines
242 KiB
JavaScript
2 lines
242 KiB
JavaScript
import{c as Ys,o as l,a as _,b as t,r as O,d as y,n as C,e as v,t as m,S as F,f as u,w as d,g as $,T as N,h as D,i as U,v as M,j as Qs,k as h,l as w,s as Js,m as Zt,P as Xt,p as B,F as T,q as I,u as Q,x as ts,y as J,z as bs,A as zt,B as Vt,C as ss,D as Zs,E as Xs,G as te,H as Y,I as se,R as ee,J as ie,K as oe,V as ae,L as ne,M as le,N as re}from"./vendor.js";const de=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const n of i.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&r(n)}).observe(document,{childList:!0,subtree:!0});function a(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerpolicy&&(i.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?i.credentials="include":o.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=a(o);fetch(o.href,i)}};de();const ks="UPDATE_CONFIG",ws="UPDATE_SETTINGS",Bt="UPDATE_SETTINGS_OPTION",vs="UPDATE_LIBRARY_STATS",$s="UPDATE_LIBRARY_AUDIOBOOKS_COUNT",xs="UPDATE_LIBRARY_PODCASTS_COUNT",Cs="UPDATE_LIBRARY_RSS_COUNT",qs="UPDATE_OUTPUTS",es="UPDATE_PLAYER_STATUS",Ss="UPDATE_QUEUE",Ps="UPDATE_LASTFM",As="UPDATE_SPOTIFY",Ts="UPDATE_PAIRING",is="SPOTIFY_NEW_RELEASES",os="SPOTIFY_FEATURED_PLAYLISTS",gs="ADD_NOTIFICATION",Wt="DELETE_NOTIFICATION",Yt="SEARCH_PATH",as="ADD_RECENT_SEARCH",Mt="HIDE_SINGLES",ns="HIDE_SPOTIFY",Rs="ARTISTS_SORT",Es="ARTIST_ALBUMS_SORT",Is="ALBUMS_SORT",Us="SHOW_ONLY_NEXT_ITEMS",Z="SHOW_BURGER_MENU",X="SHOW_PLAYER_MENU",ot="SHOW_UPDATE_DIALOG",ls="UPDATE_DIALOG_SCAN_KIND";var A=Ys({state(){return{config:{websocket_port:0,version:"",buildoptions:[]},settings:{categories:[]},library:{artists:0,albums:0,songs:0,db_playtime:0,updating:!1},audiobooks_count:{},podcasts_count:{},rss_count:{},outputs:[],player:{state:"stop",repeat:"off",consume:!1,shuffle:!1,volume:0,item_id:0,item_length_ms:0,item_progress_ms:0},queue:{version:0,count:0,items:[]},lastfm:{},spotify:{},pairing:{},spotify_new_releases:[],spotify_featured_playlists:[],notifications:{next_id:1,list:[]},search_path:"/search/library",recent_searches:[],hide_singles:!1,hide_spotify:!1,artists_sort:"Name",artist_albums_sort:"Name",albums_sort:"Name",show_only_next_items:!1,show_burger_menu:!1,show_player_menu:!1,show_update_dialog:!1,update_dialog_scan_kind:""}},getters:{now_playing:s=>{const e=s.queue.items.find(function(a){return a.id===s.player.item_id});return e===void 0?{}:e},settings_webinterface:s=>s.settings?s.settings.categories.find(e=>e.name==="webinterface"):null,settings_option_recently_added_limit:(s,e)=>{if(e.settings_webinterface){const a=e.settings_webinterface.options.find(r=>r.name==="recently_added_limit");if(a)return a.value}return 100},settings_option_show_composer_now_playing:(s,e)=>{if(e.settings_webinterface){const a=e.settings_webinterface.options.find(r=>r.name==="show_composer_now_playing");if(a)return a.value}return!1},settings_option_show_composer_for_genre:(s,e)=>{if(e.settings_webinterface){const a=e.settings_webinterface.options.find(r=>r.name==="show_composer_for_genre");if(a)return a.value}return null},settings_category:s=>e=>s.settings.categories.find(a=>a.name===e),settings_option:s=>(e,a)=>{const r=s.settings.categories.find(o=>o.name===e);return r?r.options.find(o=>o.name===a):{}}},mutations:{[ks](s,e){s.config=e},[ws](s,e){s.settings=e},[Bt](s,e){const r=s.settings.categories.find(o=>o.name===e.category).options.find(o=>o.name===e.name);r.value=e.value},[vs](s,e){s.library=e},[$s](s,e){s.audiobooks_count=e},[xs](s,e){s.podcasts_count=e},[Cs](s,e){s.rss_count=e},[qs](s,e){s.outputs=e},[es](s,e){s.player=e},[Ss](s,e){s.queue=e},[Ps](s,e){s.lastfm=e},[As](s,e){s.spotify=e},[Ts](s,e){s.pairing=e},[is](s,e){s.spotify_new_releases=e},[os](s,e){s.spotify_featured_playlists=e},[gs](s,e){if(e.topic){const a=s.notifications.list.findIndex(r=>r.topic===e.topic);if(a>=0){s.notifications.list.splice(a,1,e);return}}s.notifications.list.push(e)},[Wt](s,e){const a=s.notifications.list.indexOf(e);a!==-1&&s.notifications.list.splice(a,1)},[Yt](s,e){s.search_path=e},[as](s,e){const a=s.recent_searches.findIndex(r=>r===e);a>=0&&s.recent_searches.splice(a,1),s.recent_searches.splice(0,0,e),s.recent_searches.length>5&&s.recent_searches.pop()},[Mt](s,e){s.hide_singles=e},[ns](s,e){s.hide_spotify=e},[Rs](s,e){s.artists_sort=e},[Es](s,e){s.artist_albums_sort=e},[Is](s,e){s.albums_sort=e},[Us](s,e){s.show_only_next_items=e},[Z](s,e){s.show_burger_menu=e},[X](s,e){s.show_player_menu=e},[ot](s,e){s.show_update_dialog=e},[ls](s,e){s.update_dialog_scan_kind=e}},actions:{add_notification({commit:s,state:e},a){const r={id:e.notifications.next_id++,type:a.type,text:a.text,topic:a.topic,timeout:a.timeout};s(gs,r),a.timeout>0&&setTimeout(()=>{s(Wt,r)},a.timeout)}}}),k=(s,e)=>{const a=s.__vccOpts||s;for(const[r,o]of e)a[r]=o;return a};const _e={name:"ContentWithHeading",data(){return{options_visible:!1}},mounted(){this.$slots.options&&(this.observer=new IntersectionObserver(this.onElementObserved,{rootMargin:"-82px 0px 0px 0px",threshold:1}),this.observer.observe(this.$refs.options_ref))},methods:{onElementObserved(s){s.forEach(({target:e,isIntersecting:a})=>{this.options_visible=a})},scroll_to_top:function(){window.scrollTo({top:0,behavior:"smooth"})},scroll_to_content:function(){this.$route.meta.has_tabs?this.$scrollTo("#top",{offset:-140}):this.$scrollTo("#top",{offset:-110})},visibilityChanged:function(s){this.options_visible=s}}},ce={class:"section fd-content"},ue={class:"container"},me={class:"columns is-centered"},he={class:"column is-four-fifths"},pe={key:0},fe={ref:"options_ref",style:{height:"1px"}},ye={class:"buttons is-centered",style:{"margin-bottom":"6px","margin-top":"16px"}},ge=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-chevron-up"})],-1),be=[ge],ke=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-chevron-down"})],-1),we=[ke],ve={id:"top",class:"level"},$e={class:"level-left"},xe={class:"level-item has-text-centered-mobile"},Ce={class:"level-right has-text-centered-mobile"},qe={style:{"margin-top":"16px"}};function Se(s,e,a,r,o,i){return l(),_("section",ce,[t("div",ue,[t("div",me,[t("div",he,[s.$slots.options?(l(),_("section",pe,[t("div",fe,null,512),O(s.$slots,"options"),t("nav",ye,[o.options_visible?(l(),_("a",{key:1,class:"button is-small is-white",onClick:e[1]||(e[1]=(...n)=>i.scroll_to_content&&i.scroll_to_content(...n))},we)):(l(),_("a",{key:0,class:"button is-small is-white",onClick:e[0]||(e[0]=(...n)=>i.scroll_to_top&&i.scroll_to_top(...n))},be))])])):y("",!0),t("div",{class:C({"fd-content-with-option":s.$slots.options})},[t("nav",ve,[t("div",$e,[t("div",xe,[t("div",null,[O(s.$slots,"heading-left")])])]),t("div",Ce,[O(s.$slots,"heading-right")])]),O(s.$slots,"content"),t("div",qe,[O(s.$slots,"footer")])],2)])])])])}var R=k(_e,[["render",Se]]);v.interceptors.response.use(function(s){return s},function(s){return s.request.status&&s.request.responseURL&&A.dispatch("add_notification",{text:"Request failed (status: "+s.request.status+" "+s.request.statusText+", url: "+s.request.responseURL+")",type:"danger"}),Promise.reject(s)});var f={config(){return v.get("./api/config")},settings(){return v.get("./api/settings")},settings_update(s,e){return v.put("./api/settings/"+s+"/"+e.name,e)},library_stats(){return v.get("./api/library")},library_update(s){const e={};return s&&(e.scan_kind=s),v.put("./api/update",void 0,{params:e})},library_rescan(s){const e={};return s&&(e.scan_kind=s),v.put("./api/rescan",void 0,{params:e})},library_count(s){return v.get("./api/library/count?expression="+s)},queue(){return v.get("./api/queue")},queue_clear(){return v.put("./api/queue/clear")},queue_remove(s){return v.delete("./api/queue/items/"+s)},queue_move(s,e){return v.put("./api/queue/items/"+s+"?new_position="+e)},queue_add(s){return v.post("./api/queue/items/add?uris="+s).then(e=>(A.dispatch("add_notification",{text:e.data.count+" tracks appended to queue",type:"info",timeout:2e3}),Promise.resolve(e)))},queue_add_next(s){let e=0;return A.getters.now_playing&&A.getters.now_playing.id&&(e=A.getters.now_playing.position+1),v.post("./api/queue/items/add?uris="+s+"&position="+e).then(a=>(A.dispatch("add_notification",{text:a.data.count+" tracks appended to queue",type:"info",timeout:2e3}),Promise.resolve(a)))},queue_expression_add(s){const e={};return e.expression=s,v.post("./api/queue/items/add",void 0,{params:e}).then(a=>(A.dispatch("add_notification",{text:a.data.count+" tracks appended to queue",type:"info",timeout:2e3}),Promise.resolve(a)))},queue_expression_add_next(s){const e={};return e.expression=s,e.position=0,A.getters.now_playing&&A.getters.now_playing.id&&(e.position=A.getters.now_playing.position+1),v.post("./api/queue/items/add",void 0,{params:e}).then(a=>(A.dispatch("add_notification",{text:a.data.count+" tracks appended to queue",type:"info",timeout:2e3}),Promise.resolve(a)))},queue_save_playlist(s){return v.post("./api/queue/save",void 0,{params:{name:s}}).then(e=>(A.dispatch("add_notification",{text:'Queue saved to playlist "'+s+'"',type:"info",timeout:2e3}),Promise.resolve(e)))},player_status(){return v.get("./api/player")},player_play_uri(s,e,a=void 0){const r={};return r.uris=s,r.shuffle=e?"true":"false",r.clear="true",r.playback="start",r.playback_from_position=a,v.post("./api/queue/items/add",void 0,{params:r})},player_play_expression(s,e,a=void 0){const r={};return r.expression=s,r.shuffle=e?"true":"false",r.clear="true",r.playback="start",r.playback_from_position=a,v.post("./api/queue/items/add",void 0,{params:r})},player_play(s={}){return v.put("./api/player/play",void 0,{params:s})},player_playpos(s){return v.put("./api/player/play?position="+s)},player_playid(s){return v.put("./api/player/play?item_id="+s)},player_pause(){return v.put("./api/player/pause")},player_stop(){return v.put("./api/player/stop")},player_next(){return v.put("./api/player/next")},player_previous(){return v.put("./api/player/previous")},player_shuffle(s){const e=s?"true":"false";return v.put("./api/player/shuffle?state="+e)},player_consume(s){const e=s?"true":"false";return v.put("./api/player/consume?state="+e)},player_repeat(s){return v.put("./api/player/repeat?state="+s)},player_volume(s){return v.put("./api/player/volume?volume="+s)},player_output_volume(s,e){return v.put("./api/player/volume?volume="+e+"&output_id="+s)},player_seek_to_pos(s){return v.put("./api/player/seek?position_ms="+s)},player_seek(s){return v.put("./api/player/seek?seek_ms="+s)},outputs(){return v.get("./api/outputs")},output_update(s,e){return v.put("./api/outputs/"+s,e)},output_toggle(s){return v.put("./api/outputs/"+s+"/toggle")},library_artists(s=void 0){return v.get("./api/library/artists",{params:{media_kind:s}})},library_artist(s){return v.get("./api/library/artists/"+s)},library_artist_albums(s){return v.get("./api/library/artists/"+s+"/albums")},library_albums(s=void 0){return v.get("./api/library/albums",{params:{media_kind:s}})},library_album(s){return v.get("./api/library/albums/"+s)},library_album_tracks(s,e={limit:-1,offset:0}){return v.get("./api/library/albums/"+s+"/tracks",{params:e})},library_album_track_update(s,e){return v.put("./api/library/albums/"+s+"/tracks",void 0,{params:e})},library_genres(){return v.get("./api/library/genres")},library_genre(s){const e={type:"albums",media_kind:"music",expression:'genre is "'+s+'"'};return v.get("./api/search",{params:e})},library_genre_tracks(s){const e={type:"tracks",media_kind:"music",expression:'genre is "'+s+'"'};return v.get("./api/search",{params:e})},library_radio_streams(){const s={type:"tracks",media_kind:"music",expression:"data_kind is url and song_length = 0"};return v.get("./api/search",{params:s})},library_composers(){return v.get("./api/library/composers")},library_composer(s){const e={type:"albums",media_kind:"music",expression:'composer is "'+s+'"'};return v.get("./api/search",{params:e})},library_composer_tracks(s){const e={type:"tracks",media_kind:"music",expression:'composer is "'+s+'"'};return v.get("./api/search",{params:e})},library_artist_tracks(s){if(s){const e={type:"tracks",expression:'songartistid is "'+s+'"'};return v.get("./api/search",{params:e})}},library_podcasts_new_episodes(){const s={type:"tracks",expression:"media_kind is podcast and play_count = 0 ORDER BY time_added DESC"};return v.get("./api/search",{params:s})},library_podcast_episodes(s){const e={type:"tracks",expression:'media_kind is podcast and songalbumid is "'+s+'" ORDER BY date_released DESC'};return v.get("./api/search",{params:e})},library_add(s){return v.post("./api/library/add",void 0,{params:{url:s}})},library_playlist_delete(s){return v.delete("./api/library/playlists/"+s,void 0)},library_playlists(){return v.get("./api/library/playlists")},library_playlist_folder(s=0){return v.get("./api/library/playlists/"+s+"/playlists")},library_playlist(s){return v.get("./api/library/playlists/"+s)},library_playlist_tracks(s){return v.get("./api/library/playlists/"+s+"/tracks")},library_track(s){return v.get("./api/library/tracks/"+s)},library_track_playlists(s){return v.get("./api/library/tracks/"+s+"/playlists")},library_track_update(s,e={}){return v.put("./api/library/tracks/"+s,void 0,{params:e})},library_files(s=void 0){const e={directory:s};return v.get("./api/library/files",{params:e})},search(s){return v.get("./api/search",{params:s})},spotify(){return v.get("./api/spotify")},spotify_login(s){return v.post("./api/spotify-login",s)},spotify_logout(){return v.get("./api/spotify-logout")},lastfm(){return v.get("./api/lastfm")},lastfm_login(s){return v.post("./api/lastfm-login",s)},lastfm_logout(s){return v.get("./api/lastfm-logout")},pairing(){return v.get("./api/pairing")},pairing_kickoff(s){return v.post("./api/pairing",s)},artwork_url_append_size_params(s,e=600,a=600){return s&&s.startsWith("/")?s.includes("?")?s+"&maxwidth="+e+"&maxheight="+a:s+"?maxwidth="+e+"&maxheight="+a:s}};const Pe={name:"ListItemQueueItem",props:["item","position","current_position","show_only_next_items","edit_mode"],computed:{state(){return this.$store.state.player},is_next(){return this.current_position<0||this.position>=this.current_position}},methods:{play:function(){f.player_play({item_id:this.item.id})}}},Ae={key:0,class:"media"},Te={key:0,class:"media-left"},Re=t("span",{class:"icon has-text-grey fd-is-movable handle"},[t("i",{class:"mdi mdi-drag-horizontal mdi-18px"})],-1),Ee=[Re],Ie={class:"media-right"};function Ue(s,e,a,r,o,i){return i.is_next||!a.show_only_next_items?(l(),_("div",Ae,[a.edit_mode?(l(),_("div",Te,Ee)):y("",!0),t("div",{class:"media-content fd-has-action is-clipped",onClick:e[0]||(e[0]=(...n)=>i.play&&i.play(...n))},[t("h1",{class:C(["title is-6",{"has-text-primary":a.item.id===i.state.item_id,"has-text-grey-light":!i.is_next}])},m(a.item.title),3),t("h2",{class:C(["subtitle is-7",{"has-text-primary":a.item.id===i.state.item_id,"has-text-grey-light":!i.is_next,"has-text-grey":i.is_next&&a.item.id!==i.state.item_id}])},[t("b",null,m(a.item.artist),1)],2),t("h2",{class:C(["subtitle is-7",{"has-text-primary":a.item.id===i.state.item_id,"has-text-grey-light":!i.is_next,"has-text-grey":i.is_next&&a.item.id!==i.state.item_id}])},m(a.item.album),3)]),t("div",Ie,[O(s.$slots,"actions")])])):y("",!0)}var Le=k(Pe,[["render",Ue]]);const Oe={name:"ModalDialogQueueItem",props:["show","item"],emits:["close"],data(){return{spotify_track:{}}},watch:{item(){if(this.item&&this.item.data_kind==="spotify"){const s=new F;s.setAccessToken(this.$store.state.spotify.webapi_token),s.getTrack(this.item.path.slice(this.item.path.lastIndexOf(":")+1)).then(e=>{this.spotify_track=e})}else this.spotify_track={}}},methods:{remove:function(){this.$emit("close"),f.queue_remove(this.item.id)},play:function(){this.$emit("close"),f.player_play({item_id:this.item.id})},open_album:function(){this.media_kind==="podcast"?this.$router.push({path:"/podcasts/"+this.item.album_id}):this.media_kind==="audiobook"?this.$router.push({path:"/audiobooks/"+this.item.album_id}):this.$router.push({path:"/music/albums/"+this.item.album_id})},open_album_artist:function(){this.$router.push({path:"/music/artists/"+this.item.album_artist_id})},open_genre:function(){this.$router.push({name:"Genre",params:{genre:this.item.genre}})},open_spotify_artist:function(){this.$emit("close"),this.$router.push({path:"/music/spotify/artists/"+this.spotify_track.artists[0].id})},open_spotify_album:function(){this.$emit("close"),this.$router.push({path:"/music/spotify/albums/"+this.spotify_track.album.id})}}},De={key:0,class:"modal is-active"},ze={class:"modal-content fd-modal-card"},Ne={class:"card"},Ve={class:"card-content"},Be={class:"title is-4"},Me={class:"subtitle"},Fe={class:"content is-small"},Ge=t("span",{class:"heading"},"Album",-1),je={key:1,class:"title is-6"},Ke={key:0},He=t("span",{class:"heading"},"Album artist",-1),We={key:1,class:"title is-6"},Ye={key:1},Qe=t("span",{class:"heading"},"Composer",-1),Je={class:"title is-6"},Ze={key:2},Xe=t("span",{class:"heading"},"Year",-1),ti={class:"title is-6"},si={key:3},ei=t("span",{class:"heading"},"Genre",-1),ii=t("span",{class:"heading"},"Track / Disc",-1),oi={class:"title is-6"},ai=t("span",{class:"heading"},"Length",-1),ni={class:"title is-6"},li=t("span",{class:"heading"},"Path",-1),ri={class:"title is-6"},di=t("span",{class:"heading"},"Type",-1),_i={class:"title is-6"},ci={key:0,class:"has-text-weight-normal"},ui=$("("),mi=$(", "),hi=$(")"),pi=t("span",{class:"heading"},"Quality",-1),fi={class:"title is-6"},yi={key:0},gi={key:1},bi={key:2},ki={class:"card-footer"},wi=t("span",{class:"icon"},[t("i",{class:"mdi mdi-delete"})],-1),vi=t("span",{class:"is-size-7"},"Remove",-1),$i=[wi,vi],xi=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),Ci=t("span",{class:"is-size-7"},"Play",-1),qi=[xi,Ci];function Si(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",De,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",ze,[t("div",Ne,[t("div",Ve,[t("p",Be,m(a.item.title),1),t("p",Me,m(a.item.artist),1),t("div",Fe,[t("p",null,[Ge,a.item.album_id?(l(),_("a",{key:0,class:"title is-6 has-text-link",onClick:e[1]||(e[1]=(...n)=>i.open_album&&i.open_album(...n))},m(a.item.album),1)):(l(),_("span",je,m(a.item.album),1))]),a.item.album_artist?(l(),_("p",Ke,[He,a.item.album_artist_id?(l(),_("a",{key:0,class:"title is-6 has-text-link",onClick:e[2]||(e[2]=(...n)=>i.open_album_artist&&i.open_album_artist(...n))},m(a.item.album_artist),1)):(l(),_("span",We,m(a.item.album_artist),1))])):y("",!0),a.item.composer?(l(),_("p",Ye,[Qe,t("span",Je,m(a.item.composer),1)])):y("",!0),a.item.year>0?(l(),_("p",Ze,[Xe,t("span",ti,m(a.item.year),1)])):y("",!0),a.item.genre?(l(),_("p",si,[ei,t("a",{class:"title is-6 has-text-link",onClick:e[3]||(e[3]=(...n)=>i.open_genre&&i.open_genre(...n))},m(a.item.genre),1)])):y("",!0),t("p",null,[ii,t("span",oi,m(a.item.track_number)+" / "+m(a.item.disc_number),1)]),t("p",null,[ai,t("span",ni,m(s.$filters.duration(a.item.length_ms)),1)]),t("p",null,[li,t("span",ri,m(a.item.path),1)]),t("p",null,[di,t("span",_i,[$(m(a.item.media_kind)+" - "+m(a.item.data_kind)+" ",1),a.item.data_kind==="spotify"?(l(),_("span",ci,[ui,t("a",{onClick:e[4]||(e[4]=(...n)=>i.open_spotify_artist&&i.open_spotify_artist(...n))},"artist"),mi,t("a",{onClick:e[5]||(e[5]=(...n)=>i.open_spotify_album&&i.open_spotify_album(...n))},"album"),hi])):y("",!0)])]),t("p",null,[pi,t("span",fi,[$(m(a.item.type)+" ",1),a.item.samplerate?(l(),_("span",yi," | "+m(a.item.samplerate)+" Hz",1)):y("",!0),a.item.channels?(l(),_("span",gi," | "+m(s.$filters.channels(a.item.channels)),1)):y("",!0),a.item.bitrate?(l(),_("span",bi," | "+m(a.item.bitrate)+" Kb/s",1)):y("",!0)])])])]),t("footer",ki,[t("a",{class:"card-footer-item has-text-dark",onClick:e[6]||(e[6]=(...n)=>i.remove&&i.remove(...n))},$i),t("a",{class:"card-footer-item has-text-dark",onClick:e[7]||(e[7]=(...n)=>i.play&&i.play(...n))},qi)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[8]||(e[8]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var Ls=k(Oe,[["render",Si]]);const Pi={name:"ModalDialogAddUrlStream",props:["show"],emits:["close"],data(){return{url:"",loading:!1}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.url_field.focus()},10))}},methods:{add_stream:function(){this.loading=!0,f.queue_add(this.url).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})},play:function(){this.loading=!0,f.player_play_uri(this.url,!1).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})}}},Ai={key:0,class:"modal is-active"},Ti={class:"modal-content fd-modal-card"},Ri={class:"card"},Ei={class:"card-content"},Ii=t("p",{class:"title is-4"},"Add stream URL",-1),Ui={class:"field"},Li={class:"control is-expanded has-icons-left"},Oi=["disabled"],Di=t("span",{class:"icon is-left"},[t("i",{class:"mdi mdi-web"})],-1),zi={key:0,class:"card-footer"},Ni=t("a",{class:"card-footer-item has-text-dark"},[t("span",{class:"icon"},[t("i",{class:"mdi mdi-web"})]),t("span",{class:"is-size-7"},"Loading ...")],-1),Vi=[Ni],Bi={key:1,class:"card-footer"},Mi=t("span",{class:"icon"},[t("i",{class:"mdi mdi-cancel"})],-1),Fi=t("span",{class:"is-size-7"},"Cancel",-1),Gi=[Mi,Fi],ji=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),Ki=t("span",{class:"is-size-7"},"Add",-1),Hi=[ji,Ki],Wi=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),Yi=t("span",{class:"is-size-7"},"Play",-1),Qi=[Wi,Yi];function Ji(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",Ai,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",Ti,[t("div",Ri,[t("div",Ei,[Ii,t("form",{class:"fd-has-margin-bottom",onSubmit:e[2]||(e[2]=D((...n)=>i.play&&i.play(...n),["prevent"]))},[t("div",Ui,[t("p",Li,[U(t("input",{ref:"url_field","onUpdate:modelValue":e[1]||(e[1]=n=>o.url=n),class:"input is-shadowless",type:"text",placeholder:"http://url-to-stream",disabled:o.loading},null,8,Oi),[[M,o.url]]),Di])])],32)]),o.loading?(l(),_("footer",zi,Vi)):(l(),_("footer",Bi,[t("a",{class:"card-footer-item has-text-danger",onClick:e[3]||(e[3]=n=>s.$emit("close"))},Gi),t("a",{class:"card-footer-item has-text-dark",onClick:e[4]||(e[4]=(...n)=>i.add_stream&&i.add_stream(...n))},Hi),t("a",{class:"card-footer-item has-background-info has-text-white has-text-weight-bold",onClick:e[5]||(e[5]=(...n)=>i.play&&i.play(...n))},Qi)]))])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[6]||(e[6]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var Zi=k(Pi,[["render",Ji]]);const Xi={name:"ModalDialogPlaylistSave",props:["show"],emits:["close"],data(){return{playlist_name:"",loading:!1}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.playlist_name_field.focus()},10))}},methods:{save:function(){this.playlist_name.length<1||(this.loading=!0,f.queue_save_playlist(this.playlist_name).then(()=>{this.$emit("close"),this.playlist_name=""}).catch(()=>{this.loading=!1}))}}},to={key:0,class:"modal is-active"},so={class:"modal-content fd-modal-card"},eo={class:"card"},io={class:"card-content"},oo=t("p",{class:"title is-4"},"Save queue to playlist",-1),ao={class:"field"},no={class:"control is-expanded has-icons-left"},lo=["disabled"],ro=t("span",{class:"icon is-left"},[t("i",{class:"mdi mdi-file-music"})],-1),_o={key:0,class:"card-footer"},co=t("a",{class:"card-footer-item has-text-dark"},[t("span",{class:"icon"},[t("i",{class:"mdi mdi-web"})]),t("span",{class:"is-size-7"},"Saving ...")],-1),uo=[co],mo={key:1,class:"card-footer"},ho=t("span",{class:"icon"},[t("i",{class:"mdi mdi-cancel"})],-1),po=t("span",{class:"is-size-7"},"Cancel",-1),fo=[ho,po],yo=t("span",{class:"icon"},[t("i",{class:"mdi mdi-content-save"})],-1),go=t("span",{class:"is-size-7"},"Save",-1),bo=[yo,go];function ko(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",to,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",so,[t("div",eo,[t("div",io,[oo,t("form",{class:"fd-has-margin-bottom",onSubmit:e[2]||(e[2]=D((...n)=>i.save&&i.save(...n),["prevent"]))},[t("div",ao,[t("p",no,[U(t("input",{ref:"playlist_name_field","onUpdate:modelValue":e[1]||(e[1]=n=>o.playlist_name=n),class:"input is-shadowless",type:"text",placeholder:"Playlist name",disabled:o.loading},null,8,lo),[[M,o.playlist_name]]),ro])])],32)]),o.loading?(l(),_("footer",_o,uo)):(l(),_("footer",mo,[t("a",{class:"card-footer-item has-text-danger",onClick:e[3]||(e[3]=n=>s.$emit("close"))},fo),t("a",{class:"card-footer-item has-background-info has-text-white has-text-weight-bold",onClick:e[4]||(e[4]=(...n)=>i.save&&i.save(...n))},bo)]))])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[5]||(e[5]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var wo=k(Xi,[["render",ko]]);const vo={name:"PageQueue",components:{ContentWithHeading:R,ListItemQueueItem:Le,draggable:Qs,ModalDialogQueueItem:Ls,ModalDialogAddUrlStream:Zi,ModalDialogPlaylistSave:wo},data(){return{edit_mode:!1,show_details_modal:!1,show_url_modal:!1,show_pls_save_modal:!1,selected_item:{}}},computed:{state(){return this.$store.state.player},is_queue_save_allowed(){return this.$store.state.config.allow_modifying_stored_playlists&&this.$store.state.config.default_playlist_directory},queue(){return this.$store.state.queue},queue_items:{get(){return this.$store.state.queue.items},set(s){}},current_position(){const s=this.$store.getters.now_playing;return s===void 0||s.position===void 0?-1:this.$store.getters.now_playing.position},show_only_next_items(){return this.$store.state.show_only_next_items}},methods:{queue_clear:function(){f.queue_clear()},update_show_next_items:function(s){this.$store.commit(Us,!this.show_only_next_items)},remove:function(s){f.queue_remove(s.id)},move_item:function(s){const e=this.show_only_next_items?s.oldIndex+this.current_position:s.oldIndex,a=this.queue_items[e],r=a.position+(s.newIndex-s.oldIndex);r!==e&&f.queue_move(a.id,r)},open_dialog:function(s){this.selected_item=s,this.show_details_modal=!0},open_add_stream_dialog:function(s){this.show_url_modal=!0},save_dialog:function(s){this.queue_items.length>0&&(this.show_pls_save_modal=!0)}}},$o={class:"heading"},xo=t("p",{class:"title is-4"},"Queue",-1),Co={class:"buttons is-centered"},qo=t("span",{class:"icon"},[t("i",{class:"mdi mdi-arrow-collapse-down"})],-1),So=t("span",null,"Hide previous",-1),Po=[qo,So],Ao=t("span",{class:"icon"},[t("i",{class:"mdi mdi-web"})],-1),To=t("span",null,"Add Stream",-1),Ro=[Ao,To],Eo=t("span",{class:"icon"},[t("i",{class:"mdi mdi-pencil"})],-1),Io=t("span",null,"Edit",-1),Uo=[Eo,Io],Lo=t("span",{class:"icon"},[t("i",{class:"mdi mdi-delete-empty"})],-1),Oo=t("span",null,"Clear",-1),Do=[Lo,Oo],zo=["disabled"],No=t("span",{class:"icon"},[t("i",{class:"mdi mdi-content-save"})],-1),Vo=t("span",null,"Save",-1),Bo=[No,Vo],Mo=["onClick"],Fo=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),Go=[Fo],jo=["onClick"],Ko=t("span",{class:"icon has-text-grey"},[t("i",{class:"mdi mdi-delete mdi-18px"})],-1),Ho=[Ko];function Wo(s,e,a,r,o,i){const n=h("list-item-queue-item"),c=h("draggable"),p=h("modal-dialog-queue-item"),g=h("modal-dialog-add-url-stream"),b=h("modal-dialog-playlist-save"),x=h("content-with-heading");return l(),w(x,null,{"heading-left":d(()=>[t("p",$o,m(i.queue.count)+" tracks",1),xo]),"heading-right":d(()=>[t("div",Co,[t("a",{class:C(["button is-small",{"is-info":i.show_only_next_items}]),onClick:e[0]||(e[0]=(...q)=>i.update_show_next_items&&i.update_show_next_items(...q))},Po,2),t("a",{class:"button is-small",onClick:e[1]||(e[1]=(...q)=>i.open_add_stream_dialog&&i.open_add_stream_dialog(...q))},Ro),t("a",{class:C(["button is-small",{"is-info":o.edit_mode}]),onClick:e[2]||(e[2]=q=>o.edit_mode=!o.edit_mode)},Uo,2),t("a",{class:"button is-small",onClick:e[3]||(e[3]=(...q)=>i.queue_clear&&i.queue_clear(...q))},Do),i.is_queue_save_allowed?(l(),_("a",{key:0,class:"button is-small",disabled:i.queue_items.length===0,onClick:e[4]||(e[4]=(...q)=>i.save_dialog&&i.save_dialog(...q))},Bo,8,zo)):y("",!0)])]),content:d(()=>[u(c,{modelValue:i.queue_items,"onUpdate:modelValue":e[5]||(e[5]=q=>i.queue_items=q),handle:".handle","item-key":"id",onEnd:i.move_item},{item:d(({element:q,index:z})=>[u(n,{item:q,position:z,current_position:i.current_position,show_only_next_items:i.show_only_next_items,edit_mode:o.edit_mode},{actions:d(()=>[o.edit_mode?y("",!0):(l(),_("a",{key:0,onClick:D(S=>i.open_dialog(q),["prevent","stop"])},Go,8,Mo)),q.id!==i.state.item_id&&o.edit_mode?(l(),_("a",{key:1,onClick:D(S=>i.remove(q),["prevent","stop"])},Ho,8,jo)):y("",!0)]),_:2},1032,["item","position","current_position","show_only_next_items","edit_mode"])]),_:1},8,["modelValue","onEnd"]),u(p,{show:o.show_details_modal,item:o.selected_item,onClose:e[6]||(e[6]=q=>o.show_details_modal=!1)},null,8,["show","item"]),u(g,{show:o.show_url_modal,onClose:e[7]||(e[7]=q=>o.show_url_modal=!1)},null,8,["show"]),i.is_queue_save_allowed?(l(),w(b,{key:0,show:o.show_pls_save_modal,onClose:e[8]||(e[8]=q=>o.show_pls_save_modal=!1)},null,8,["show"])):y("",!0)]),_:1})}var Yo=k(vo,[["render",Wo]]);function Qo(s){const e=s.replace(/#/,""),a=parseInt(e.substr(0,2),16),r=parseInt(e.substr(2,2),16),o=parseInt(e.substr(4,2),16);return[.299*a,.587*r,.114*o].reduce((n,c)=>n+c)/255>.5}function Jo(s){return Qo(s)?"#000000":"#ffffff"}function Zo(s){const e='<svg width="'+s.width+'" height="'+s.height+'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+s.width+" "+s.height+'" preserveAspectRatio="none"><defs><style type="text/css"> #holder text { fill: '+s.textColor+"; font-family: "+s.fontFamily+"; font-size: "+s.fontSize+"px; font-weight: "+s.fontWeight+'; } </style></defs><g id="holder"> <rect width="100%" height="100%" fill="'+s.backgroundColor+'"></rect> <g> <text text-anchor="middle" x="50%" y="50%" dy=".3em">'+s.caption+"</text> </g></g></svg>";return"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(e)}function Os(s,e,a){const r=Js(e),o=Jo(r),i={width:a.width,height:a.height,textColor:o,backgroundColor:r,caption:s,fontFamily:a.font_family,fontSize:a.font_size,fontWeight:a.font_weight};return Zo(i)}const Xo={name:"CoverArtwork",props:["artist","album","artwork_url","maxwidth","maxheight"],emits:["click"],data(){return{width:600,height:600,font_family:"sans-serif",font_size:200,font_weight:600,lazy_lifecycle:{error:s=>{s.src=this.dataURI()}}}},computed:{artwork_url_with_size:function(){return this.maxwidth>0&&this.maxheight>0?f.artwork_url_append_size_params(this.artwork_url,this.maxwidth,this.maxheight):f.artwork_url_append_size_params(this.artwork_url)},alt_text(){return this.artist+" - "+this.album},caption(){return this.album?this.album.substring(0,2):this.artist?this.artist.substring(0,2):""}},methods:{dataURI:function(){return Os(this.caption,this.alt_text,{width:this.width,height:this.height,font_family:this.font_family,font_size:this.font_size,font_weight:this.font_weight})}}};function ta(s,e,a,r,o,i){const n=Zt("lazy");return l(),_("figure",null,[U(t("img",{onClick:e[0]||(e[0]=c=>s.$emit("click"))},null,512),[[n,{src:i.artwork_url_with_size,lifecycle:o.lazy_lifecycle}]])])}var K=k(Xo,[["render",ta]]);const sa={name:"PageNowPlaying",components:{ModalDialogQueueItem:Ls,Slider:Xt,CoverArtwork:K},data(){return{item_progress_ms:0,interval_id:0,show_details_modal:!1,selected_item:{}}},computed:{state(){return this.$store.state.player},now_playing(){return this.$store.getters.now_playing},settings_option_show_composer_now_playing(){return this.$store.getters.settings_option_show_composer_now_playing},settings_option_show_composer_for_genre(){return this.$store.getters.settings_option_show_composer_for_genre},composer(){return this.settings_option_show_composer_now_playing&&(!this.settings_option_show_composer_for_genre||this.now_playing.genre&&this.settings_option_show_composer_for_genre.toLowerCase().split(",").findIndex(s=>this.now_playing.genre.toLowerCase().indexOf(s.trim())>=0)>=0)?this.now_playing.composer:null}},watch:{state(){this.interval_id>0&&(window.clearTimeout(this.interval_id),this.interval_id=0),this.item_progress_ms=this.state.item_progress_ms,this.state.state==="play"&&(this.interval_id=window.setInterval(this.tick,1e3))}},created(){this.item_progress_ms=this.state.item_progress_ms,f.player_status().then(({data:s})=>{this.$store.commit(es,s),this.state.state==="play"&&(this.interval_id=window.setInterval(this.tick,1e3))})},unmounted(){this.interval_id>0&&(window.clearTimeout(this.interval_id),this.interval_id=0)},methods:{tick:function(){this.item_progress_ms+=1e3},seek:function(s){f.player_seek_to_pos(s).catch(()=>{this.item_progress_ms=this.state.item_progress_ms})},open_dialog:function(s){this.selected_item=s,this.show_details_modal=!0}}},ea={key:0,class:"fd-is-fullheight"},ia={class:"fd-is-expanded"},oa={class:"fd-has-padding-left-right"},aa={class:"container has-text-centered"},na={class:"control has-text-centered fd-progress-now-playing"},la={class:"content"},ra={class:"fd-has-padding-left-right"},da={class:"container has-text-centered fd-has-margin-top"},_a={class:"title is-5"},ca={class:"title is-6"},ua={key:0,class:"subtitle is-6 has-text-grey has-text-weight-bold"},ma={class:"subtitle is-6"},ha={key:1,class:"fd-is-fullheight"},pa=t("div",{class:"fd-is-expanded fd-has-padding-left-right",style:{"flex-direction":"column"}},[t("div",{class:"content has-text-centered"},[t("h1",{class:"title is-5"},"Your play queue is empty"),t("p",null,"Add some tracks by browsing your library")])],-1),fa=[pa];function ya(s,e,a,r,o,i){const n=h("cover-artwork"),c=h("Slider"),p=h("modal-dialog-queue-item");return l(),_("section",null,[i.now_playing.id>0?(l(),_("div",ea,[t("div",ia,[u(n,{artwork_url:i.now_playing.artwork_url,artist:i.now_playing.artist,album:i.now_playing.album,class:"fd-cover-image fd-has-action",onClick:e[0]||(e[0]=g=>i.open_dialog(i.now_playing))},null,8,["artwork_url","artist","album"])]),t("div",oa,[t("div",aa,[t("p",na,[u(c,{modelValue:o.item_progress_ms,"onUpdate:modelValue":e[1]||(e[1]=g=>o.item_progress_ms=g),min:0,max:i.state.item_length_ms,step:1e3,tooltips:!1,disabled:i.state.state==="stop",classes:{target:"seek-slider"},onChange:i.seek},null,8,["modelValue","max","disabled","onChange"])]),t("p",la,[t("span",null,m(s.$filters.duration(o.item_progress_ms))+" / "+m(s.$filters.duration(i.now_playing.length_ms)),1)])])]),t("div",ra,[t("div",da,[t("h1",_a,m(i.now_playing.title),1),t("h2",ca,m(i.now_playing.artist),1),i.composer?(l(),_("h2",ua,m(i.composer),1)):y("",!0),t("h3",ma,m(i.now_playing.album),1)])])])):(l(),_("div",ha,fa)),u(p,{show:o.show_details_modal,item:o.selected_item,onClose:e[2]||(e[2]=g=>o.show_details_modal=!1)},null,8,["show","item"])])}var ga=k(sa,[["render",ya]]);const ba={name:"TabsMusic",computed:{spotify_enabled(){return this.$store.state.spotify.webapi_token_valid}}},ka={class:"section fd-tabs-section"},wa={class:"container"},va={class:"columns is-centered"},$a={class:"column is-four-fifths"},xa={class:"tabs is-centered is-small"},Ca=["onClick","onKeypress"],qa=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-web"})],-1),Sa=t("span",{class:""},"Browse",-1),Pa=[qa,Sa],Aa=["onClick","onKeypress"],Ta=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-artist"})],-1),Ra=t("span",{class:""},"Artists",-1),Ea=[Ta,Ra],Ia=["onClick","onKeypress"],Ua=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-album"})],-1),La=t("span",{class:""},"Albums",-1),Oa=[Ua,La],Da=["onClick","onKeypress"],za=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-speaker"})],-1),Na=t("span",{class:""},"Genres",-1),Va=[za,Na],Ba=["onClick","onKeypress"],Ma=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-book-open-page-variant"})],-1),Fa=t("span",{class:""},"Composers",-1),Ga=[Ma,Fa],ja=["onClick","onKeypress"],Ka=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-spotify"})],-1),Ha=t("span",{class:""},"Spotify",-1),Wa=[Ka,Ha];function Ya(s,e,a,r,o,i){const n=h("router-link");return l(),_("section",ka,[t("div",wa,[t("div",va,[t("div",$a,[t("div",xa,[t("ul",null,[u(n,{to:"/music/browse",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},Pa,40,Ca)],2)]),_:1}),u(n,{to:"/music/artists",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},Ea,40,Aa)],2)]),_:1}),u(n,{to:"/music/albums",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},Oa,40,Ia)],2)]),_:1}),u(n,{to:"/music/genres",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},Va,40,Da)],2)]),_:1}),u(n,{to:"/music/composers",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},Ga,40,Ba)],2)]),_:1}),i.spotify_enabled?(l(),w(n,{key:0,to:"/music/spotify",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},Wa,40,ja)],2)]),_:1})):y("",!0)])])])])])])}var G=k(ba,[["render",Ya]]);const Qa={name:"ModalDialogAlbum",components:{CoverArtwork:K},props:["show","album","media_kind","new_tracks"],emits:["close","remove-podcast","play-count-changed"],data(){return{artwork_visible:!1}},computed:{artwork_url:function(){return f.artwork_url_append_size_params(this.album.artwork_url)},media_kind_resolved:function(){return this.media_kind?this.media_kind:this.album.media_kind}},methods:{play:function(){this.$emit("close"),f.player_play_uri(this.album.uri,!1)},queue_add:function(){this.$emit("close"),f.queue_add(this.album.uri)},queue_add_next:function(){this.$emit("close"),f.queue_add_next(this.album.uri)},open_album:function(){this.media_kind_resolved==="podcast"?this.$router.push({path:"/podcasts/"+this.album.id}):this.media_kind_resolved==="audiobook"?this.$router.push({path:"/audiobooks/"+this.album.id}):this.$router.push({path:"/music/albums/"+this.album.id})},open_artist:function(){this.media_kind_resolved==="podcast"||(this.media_kind_resolved==="audiobook"?this.$router.push({path:"/audiobooks/artists/"+this.album.artist_id}):this.$router.push({path:"/music/artists/"+this.album.artist_id}))},mark_played:function(){f.library_album_track_update(this.album.id,{play_count:"played"}).then(({data:s})=>{this.$emit("play-count-changed"),this.$emit("close")})},artwork_loaded:function(){this.artwork_visible=!0},artwork_error:function(){this.artwork_visible=!1}}},Ja={key:0,class:"modal is-active"},Za={class:"modal-content fd-modal-card"},Xa={class:"card"},tn={class:"card-content"},sn={class:"title is-4"},en={key:0,class:"buttons"},on={class:"content is-small"},an={key:0},nn=t("span",{class:"heading"},"Album artist",-1),ln={key:1},rn=t("span",{class:"heading"},"Release date",-1),dn={class:"title is-6"},_n={key:2},cn=t("span",{class:"heading"},"Year",-1),un={class:"title is-6"},mn=t("span",{class:"heading"},"Tracks",-1),hn={class:"title is-6"},pn=t("span",{class:"heading"},"Length",-1),fn={class:"title is-6"},yn=t("span",{class:"heading"},"Type",-1),gn={class:"title is-6"},bn=t("span",{class:"heading"},"Added at",-1),kn={class:"title is-6"},wn={class:"card-footer"},vn=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),$n=t("span",{class:"is-size-7"},"Add",-1),xn=[vn,$n],Cn=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-play"})],-1),qn=t("span",{class:"is-size-7"},"Add Next",-1),Sn=[Cn,qn],Pn=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),An=t("span",{class:"is-size-7"},"Play",-1),Tn=[Pn,An];function Rn(s,e,a,r,o,i){const n=h("cover-artwork");return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",Ja,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=c=>s.$emit("close"))}),t("div",Za,[t("div",Xa,[t("div",tn,[u(n,{artwork_url:a.album.artwork_url,artist:a.album.artist,album:a.album.name,class:"image is-square fd-has-margin-bottom fd-has-shadow"},null,8,["artwork_url","artist","album"]),t("p",sn,[t("a",{class:"has-text-link",onClick:e[1]||(e[1]=(...c)=>i.open_album&&i.open_album(...c))},m(a.album.name),1)]),i.media_kind_resolved==="podcast"?(l(),_("div",en,[t("a",{class:"button is-small",onClick:e[2]||(e[2]=(...c)=>i.mark_played&&i.mark_played(...c))},"Mark as played"),t("a",{class:"button is-small",onClick:e[3]||(e[3]=c=>s.$emit("remove-podcast"))},"Remove podcast")])):y("",!0),t("div",on,[a.album.artist?(l(),_("p",an,[nn,t("a",{class:"title is-6 has-text-link",onClick:e[4]||(e[4]=(...c)=>i.open_artist&&i.open_artist(...c))},m(a.album.artist),1)])):y("",!0),a.album.date_released?(l(),_("p",ln,[rn,t("span",dn,m(s.$filters.time(a.album.date_released,"L")),1)])):a.album.year>0?(l(),_("p",_n,[cn,t("span",un,m(a.album.year),1)])):y("",!0),t("p",null,[mn,t("span",hn,m(a.album.track_count),1)]),t("p",null,[pn,t("span",fn,m(s.$filters.duration(a.album.length_ms)),1)]),t("p",null,[yn,t("span",gn,m(a.album.media_kind)+" - "+m(a.album.data_kind),1)]),t("p",null,[bn,t("span",kn,m(s.$filters.time(a.album.time_added,"L LT")),1)])])]),t("footer",wn,[t("a",{class:"card-footer-item has-text-dark",onClick:e[5]||(e[5]=(...c)=>i.queue_add&&i.queue_add(...c))},xn),t("a",{class:"card-footer-item has-text-dark",onClick:e[6]||(e[6]=(...c)=>i.queue_add_next&&i.queue_add_next(...c))},Sn),t("a",{class:"card-footer-item has-text-dark",onClick:e[7]||(e[7]=(...c)=>i.play&&i.play(...c))},Tn)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[8]||(e[8]=c=>s.$emit("close"))})])):y("",!0)]),_:1})])}var Ft=k(Qa,[["render",Rn]]);const En={name:"ModalDialog",props:["show","title","ok_action","delete_action","close_action"],emits:["delete","close","ok"]},In={key:0,class:"modal is-active"},Un={class:"modal-content fd-modal-card"},Ln={class:"card"},On={class:"card-content"},Dn={key:0,class:"title is-4"},zn={class:"card-footer"},Nn=t("span",{class:"icon"},[t("i",{class:"mdi mdi-cancel"})],-1),Vn={class:"is-size-7"},Bn=t("span",{class:"icon"},[t("i",{class:"mdi mdi-delete"})],-1),Mn={class:"is-size-7"},Fn=t("span",{class:"icon"},[t("i",{class:"mdi mdi-check"})],-1),Gn={class:"is-size-7"};function jn(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",In,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",Un,[t("div",Ln,[t("div",On,[a.title?(l(),_("p",Dn,m(a.title),1)):y("",!0),O(s.$slots,"modal-content")]),t("footer",zn,[t("a",{class:"card-footer-item has-text-dark",onClick:e[1]||(e[1]=n=>s.$emit("close"))},[Nn,t("span",Vn,m(a.close_action?a.close_action:"Cancel"),1)]),a.delete_action?(l(),_("a",{key:0,class:"card-footer-item has-background-danger has-text-white has-text-weight-bold",onClick:e[2]||(e[2]=n=>s.$emit("delete"))},[Bn,t("span",Mn,m(a.delete_action),1)])):y("",!0),a.ok_action?(l(),_("a",{key:1,class:"card-footer-item has-background-info has-text-white has-text-weight-bold",onClick:e[3]||(e[3]=n=>s.$emit("ok"))},[Fn,t("span",Gn,m(a.ok_action),1)])):y("",!0)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[4]||(e[4]=n=>s.$emit("close"))})])):y("",!0)]),_:3})])}var rs=k(En,[["render",jn]]);const Kn={name:"ListAlbums",components:{ModalDialogAlbum:Ft,ModalDialog:rs},props:["albums","media_kind","hide_group_title"],emits:["play-count-changed","podcast-deleted"],data(){return{show_details_modal:!1,selected_album:{},show_remove_podcast_modal:!1,rss_playlist_to_remove:{},artwork_options:{width:600,height:600,font_family:"sans-serif",font_size:200,font_weight:600,lazy_lifecycle:{error:s=>{s.src=this.dataURI(s.attributes.album.value,s.attributes.artist.value)}}}}},computed:{is_visible_artwork(){return this.$store.getters.settings_option("webinterface","show_cover_artwork_in_album_lists").value},media_kind_resolved:function(){return this.media_kind?this.media_kind:this.selected_album.media_kind}},methods:{open_album:function(s){this.selected_album=s,this.media_kind_resolved==="podcast"?this.$router.push({path:"/podcasts/"+s.id}):this.media_kind_resolved==="audiobook"?this.$router.push({path:"/audiobooks/"+s.id}):this.$router.push({path:"/music/albums/"+s.id})},open_dialog:function(s){this.selected_album=s,this.show_details_modal=!0},open_remove_podcast_dialog:function(){f.library_album_tracks(this.selected_album.id,{limit:1}).then(({data:s})=>{f.library_track_playlists(s.items[0].id).then(({data:e})=>{const a=e.items.filter(r=>r.type==="rss");if(a.length!==1){this.$store.dispatch("add_notification",{text:"Podcast cannot be removed. Probably it was not added as an RSS playlist.",type:"danger"});return}this.rss_playlist_to_remove=a[0],this.show_remove_podcast_modal=!0,this.show_details_modal=!1})})},play_count_changed:function(){this.$emit("play-count-changed")},remove_podcast:function(){this.show_remove_podcast_modal=!1,f.library_playlist_delete(this.rss_playlist_to_remove.id).then(()=>{this.$emit("podcast-deleted")})},artwork_url_with_size:function(s){return this.artwork_options.width>0&&this.artwork_options.height>0?f.artwork_url_append_size_params(s,this.artwork_options.width,this.artwork_options.height):f.artwork_url_append_size_params(s)},alt_text(s,e){return e+" - "+s},caption(s,e){return s?s.substring(0,2):e?e.substring(0,2):""},dataURI:function(s,e){const a=this.caption(s,e),r=this.alt_text(s,e);return Os(a,r,{width:this.artwork_options.width,height:this.artwork_options.height,font_family:this.artwork_options.font_family,font_size:this.artwork_options.font_size,font_weight:this.artwork_options.font_weight})}}},Hn={key:0,class:"mt-6 mb-5 py-2"},Wn=["id"],Yn=["onClick"],Qn={key:0,class:"media-left fd-has-action"},Jn={class:"image is-64x64 fd-has-shadow fd-has-action"},Zn=["album","artist"],Xn={class:"media-content fd-has-action is-clipped"},tl={style:{"margin-top":"0.7rem"}},sl={class:"title is-6"},el={class:"subtitle is-7 has-text-grey"},il={key:0,class:"subtitle is-7 has-text-grey has-text-weight-normal"},ol={class:"media-right",style:{"padding-top":"0.7rem"}},al=["onClick"],nl=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),ll=[nl],rl=t("p",null,"Permanently remove this podcast from your library?",-1),dl={class:"is-size-7"},_l=$(" (This will also remove the RSS playlist "),cl=$(".) ");function ul(s,e,a,r,o,i){const n=h("modal-dialog-album"),c=h("modal-dialog"),p=Zt("lazy");return l(),_(T,null,[(l(!0),_(T,null,I(a.albums,g=>(l(),_(T,{key:g.itemId},[!g.isItem&&!a.hide_group_title?(l(),_("div",Hn,[t("span",{id:"index_"+g.groupKey,class:"tag is-info is-light is-small has-text-weight-bold"},m(g.groupKey),9,Wn)])):g.isItem?(l(),_("div",{key:1,class:"media",onClick:b=>i.open_album(g.item)},[i.is_visible_artwork?(l(),_("div",Qn,[t("p",Jn,[t("figure",null,[U(t("img",{album:g.item.name,artist:g.item.artist},null,8,Zn),[[p,{src:i.artwork_url_with_size(g.item.artwork_url),lifecycle:o.artwork_options.lazy_lifecycle}]])])])])):y("",!0),t("div",Xn,[t("div",tl,[t("h1",sl,m(g.item.name),1),t("h2",el,[t("b",null,m(g.item.artist),1)]),g.item.date_released&&g.item.media_kind==="music"?(l(),_("h2",il,m(s.$filters.time(g.item.date_released,"L")),1)):y("",!0)])]),t("div",ol,[t("a",{onClick:D(b=>i.open_dialog(g.item),["prevent","stop"])},ll,8,al)])],8,Yn)):y("",!0)],64))),128)),(l(),w(Q,{to:"#app"},[u(n,{show:o.show_details_modal,album:o.selected_album,media_kind:a.media_kind,onRemovePodcast:e[0]||(e[0]=g=>i.open_remove_podcast_dialog()),onPlayCountChanged:e[1]||(e[1]=g=>i.play_count_changed()),onClose:e[2]||(e[2]=g=>o.show_details_modal=!1)},null,8,["show","album","media_kind"]),u(c,{show:o.show_remove_podcast_modal,title:"Remove podcast",delete_action:"Remove",onClose:e[3]||(e[3]=g=>o.show_remove_podcast_modal=!1),onDelete:i.remove_podcast},{"modal-content":d(()=>[rl,t("p",dl,[_l,t("b",null,m(o.rss_playlist_to_remove.name),1),cl])]),_:1},8,["show","onDelete"])]))],64)}var j=k(Kn,[["render",ul]]);const ml={name:"ModalDialogTrack",props:["show","track"],emits:["close","play-count-changed"],data(){return{spotify_track:{}}},watch:{track(){if(this.track&&this.track.data_kind==="spotify"){const s=new F;s.setAccessToken(this.$store.state.spotify.webapi_token),s.getTrack(this.track.path.slice(this.track.path.lastIndexOf(":")+1)).then(e=>{this.spotify_track=e})}else this.spotify_track={}}},methods:{play_track:function(){this.$emit("close"),f.player_play_uri(this.track.uri,!1)},queue_add:function(){this.$emit("close"),f.queue_add(this.track.uri)},queue_add_next:function(){this.$emit("close"),f.queue_add_next(this.track.uri)},open_album:function(){this.$emit("close"),this.track.media_kind==="podcast"?this.$router.push({path:"/podcasts/"+this.track.album_id}):this.track.media_kind==="audiobook"?this.$router.push({path:"/audiobooks/"+this.track.album_id}):this.$router.push({path:"/music/albums/"+this.track.album_id})},open_artist:function(){this.$emit("close"),this.$router.push({path:"/music/artists/"+this.track.album_artist_id})},open_genre:function(){this.$router.push({name:"Genre",params:{genre:this.track.genre}})},open_spotify_artist:function(){this.$emit("close"),this.$router.push({path:"/music/spotify/artists/"+this.spotify_track.artists[0].id})},open_spotify_album:function(){this.$emit("close"),this.$router.push({path:"/music/spotify/albums/"+this.spotify_track.album.id})},mark_new:function(){f.library_track_update(this.track.id,{play_count:"reset"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},mark_played:function(){f.library_track_update(this.track.id,{play_count:"increment"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})}}},hl={key:0,class:"modal is-active"},pl={class:"modal-content fd-modal-card"},fl={class:"card"},yl={class:"card-content"},gl={class:"title is-4"},bl={class:"subtitle"},kl={key:0,class:"buttons"},wl={class:"content is-small"},vl=t("span",{class:"heading"},"Album",-1),$l={key:0},xl=t("span",{class:"heading"},"Album artist",-1),Cl={key:1},ql=t("span",{class:"heading"},"Composer",-1),Sl={class:"title is-6"},Pl={key:2},Al=t("span",{class:"heading"},"Release date",-1),Tl={class:"title is-6"},Rl={key:3},El=t("span",{class:"heading"},"Year",-1),Il={class:"title is-6"},Ul={key:4},Ll=t("span",{class:"heading"},"Genre",-1),Ol=t("span",{class:"heading"},"Track / Disc",-1),Dl={class:"title is-6"},zl=t("span",{class:"heading"},"Length",-1),Nl={class:"title is-6"},Vl=t("span",{class:"heading"},"Path",-1),Bl={class:"title is-6"},Ml=t("span",{class:"heading"},"Type",-1),Fl={class:"title is-6"},Gl={key:0,class:"has-text-weight-normal"},jl=$("("),Kl=$(", "),Hl=$(")"),Wl=t("span",{class:"heading"},"Quality",-1),Yl={class:"title is-6"},Ql={key:0},Jl={key:1},Zl={key:2},Xl=t("span",{class:"heading"},"Added at",-1),tr={class:"title is-6"},sr=t("span",{class:"heading"},"Rating",-1),er={class:"title is-6"},ir={key:5},or=t("span",{class:"heading"},"Comment",-1),ar={class:"title is-6"},nr={class:"card-footer"},lr=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),rr=t("span",{class:"is-size-7"},"Add",-1),dr=[lr,rr],_r=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-play"})],-1),cr=t("span",{class:"is-size-7"},"Add Next",-1),ur=[_r,cr],mr=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),hr=t("span",{class:"is-size-7"},"Play",-1),pr=[mr,hr];function fr(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",hl,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",pl,[t("div",fl,[t("div",yl,[t("p",gl,m(a.track.title),1),t("p",bl,m(a.track.artist),1),a.track.media_kind==="podcast"?(l(),_("div",kl,[a.track.play_count>0?(l(),_("a",{key:0,class:"button is-small",onClick:e[1]||(e[1]=(...n)=>i.mark_new&&i.mark_new(...n))},"Mark as new")):y("",!0),a.track.play_count===0?(l(),_("a",{key:1,class:"button is-small",onClick:e[2]||(e[2]=(...n)=>i.mark_played&&i.mark_played(...n))},"Mark as played")):y("",!0)])):y("",!0),t("div",wl,[t("p",null,[vl,t("a",{class:"title is-6 has-text-link",onClick:e[3]||(e[3]=(...n)=>i.open_album&&i.open_album(...n))},m(a.track.album),1)]),a.track.album_artist&&a.track.media_kind!=="audiobook"?(l(),_("p",$l,[xl,t("a",{class:"title is-6 has-text-link",onClick:e[4]||(e[4]=(...n)=>i.open_artist&&i.open_artist(...n))},m(a.track.album_artist),1)])):y("",!0),a.track.composer?(l(),_("p",Cl,[ql,t("span",Sl,m(a.track.composer),1)])):y("",!0),a.track.date_released?(l(),_("p",Pl,[Al,t("span",Tl,m(s.$filters.time(a.track.date_released,"L")),1)])):a.track.year>0?(l(),_("p",Rl,[El,t("span",Il,m(a.track.year),1)])):y("",!0),a.track.genre?(l(),_("p",Ul,[Ll,t("a",{class:"title is-6 has-text-link",onClick:e[5]||(e[5]=(...n)=>i.open_genre&&i.open_genre(...n))},m(a.track.genre),1)])):y("",!0),t("p",null,[Ol,t("span",Dl,m(a.track.track_number)+" / "+m(a.track.disc_number),1)]),t("p",null,[zl,t("span",Nl,m(s.$filters.duration(a.track.length_ms)),1)]),t("p",null,[Vl,t("span",Bl,m(a.track.path),1)]),t("p",null,[Ml,t("span",Fl,[$(m(a.track.media_kind)+" - "+m(a.track.data_kind)+" ",1),a.track.data_kind==="spotify"?(l(),_("span",Gl,[jl,t("a",{onClick:e[6]||(e[6]=(...n)=>i.open_spotify_artist&&i.open_spotify_artist(...n))},"artist"),Kl,t("a",{onClick:e[7]||(e[7]=(...n)=>i.open_spotify_album&&i.open_spotify_album(...n))},"album"),Hl])):y("",!0)])]),t("p",null,[Wl,t("span",Yl,[$(m(a.track.type)+" ",1),a.track.samplerate?(l(),_("span",Ql," | "+m(a.track.samplerate)+" Hz",1)):y("",!0),a.track.channels?(l(),_("span",Jl," | "+m(s.$filters.channels(a.track.channels)),1)):y("",!0),a.track.bitrate?(l(),_("span",Zl," | "+m(a.track.bitrate)+" Kb/s",1)):y("",!0)])]),t("p",null,[Xl,t("span",tr,m(s.$filters.time(a.track.time_added,"L LT")),1)]),t("p",null,[sr,t("span",er,m(Math.floor(a.track.rating/10))+" / 10",1)]),a.track.comment?(l(),_("p",ir,[or,t("span",ar,m(a.track.comment),1)])):y("",!0)])]),t("footer",nr,[t("a",{class:"card-footer-item has-text-dark",onClick:e[8]||(e[8]=(...n)=>i.queue_add&&i.queue_add(...n))},dr),t("a",{class:"card-footer-item has-text-dark",onClick:e[9]||(e[9]=(...n)=>i.queue_add_next&&i.queue_add_next(...n))},ur),t("a",{class:"card-footer-item has-text-dark",onClick:e[10]||(e[10]=(...n)=>i.play_track&&i.play_track(...n))},pr)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[11]||(e[11]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var yr=k(ml,[["render",fr]]);const gr={name:"ProgressBar",props:["max","value"],computed:{width(){return this.value>0&&this.max>0?parseInt(this.value*100/this.max):0},width_percent(){return this.width+"%"}}};function br(s,e,a,r,o,i){return i.width>0?(l(),_("div",{key:0,class:"progress-bar mt-2",style:ts({width:i.width_percent})},null,4)):y("",!0)}var kr=k(gr,[["render",br]]);const wr={name:"ListTracks",components:{ModalDialogTrack:yr,ProgressBar:kr},props:["tracks","uris","expression","show_progress","show_icon"],emits:["play-count-changed"],data(){return{show_details_modal:!1,selected_track:{}}},methods:{play_track:function(s,e){this.uris?f.player_play_uri(this.uris,!1,s):this.expression?f.player_play_expression(this.expression,!1,s):f.player_play_uri(e.uri,!1)},open_dialog:function(s){this.selected_track=s,this.show_details_modal=!0}}},vr=["id","onClick"],$r={key:0,class:"media-left fd-has-action"},xr=t("span",{class:"icon"},[t("i",{class:"mdi mdi-file-outline"})],-1),Cr=[xr],qr={class:"media-content fd-has-action is-clipped"},Sr={class:"subtitle is-7 has-text-grey"},Pr={class:"subtitle is-7 has-text-grey"},Ar={class:"media-right"},Tr=["onClick"],Rr=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),Er=[Rr];function Ir(s,e,a,r,o,i){const n=h("progress-bar"),c=h("modal-dialog-track");return l(),_(T,null,[(l(!0),_(T,null,I(a.tracks,(p,g)=>(l(),_("div",{id:"index_"+p.title_sort.charAt(0).toUpperCase(),key:p.id,class:C(["media",{"with-progress":a.show_progress}]),onClick:b=>i.play_track(g,p)},[a.show_icon?(l(),_("figure",$r,Cr)):y("",!0),t("div",qr,[t("h1",{class:C(["title is-6",{"has-text-grey":p.media_kind==="podcast"&&p.play_count>0}])},m(p.title),3),t("h2",Sr,[t("b",null,m(p.artist),1)]),t("h2",Pr,m(p.album),1),a.show_progress?(l(),w(n,{key:0,max:p.length_ms,value:p.seek_ms},null,8,["max","value"])):y("",!0)]),t("div",Ar,[t("a",{onClick:D(b=>i.open_dialog(p),["prevent","stop"])},Er,8,Tr)])],10,vr))),128)),(l(),w(Q,{to:"#app"},[u(c,{show:o.show_details_modal,track:o.selected_track,onClose:e[0]||(e[0]=p=>o.show_details_modal=!1),onPlayCountChanged:e[1]||(e[1]=p=>s.$emit("play-count-changed"))},null,8,["show","track"])]))],64)}var V=k(wr,[["render",Ir]]);const Ds="GROUP_KEY_NONE";function Ur(){return{compareFn:null,groupKeyFn:s=>Ds}}function tt(s,e="_"){return{compareFn:null,groupKeyFn:a=>(a[s]||e).charAt(0).toUpperCase()}}function zs(s,e="_"){return{compareFn:(a,r)=>{const o=a[s]||e,i=r[s]||e;return o.localeCompare(i)},groupKeyFn:a=>(a[s]||e).charAt(0).toUpperCase()}}function Nt(s,{direction:e="asc",defaultValue:a="0000"}){return{compareFn:(r,o)=>{const i=r[s]||a,n=o[s]||a,c=i.localeCompare(n);return e==="asc"?c:c*-1},groupKeyFn:r=>(r[s]||a).substring(0,4)}}function Lr(s,e="0000"){return{compareFn:(a,r)=>{const o=a[s]||e;return(r[s]||e).localeCompare(o)},groupKeyFn:a=>{const r=a[s];if(!r)return e;const o=new Date().getTime()-new Date(r).getTime();return o<864e5?"Today":o<6048e5?"Last week":o<2592e6?"Last month":r.substring(0,4)}}}class E{constructor({items:e=[],total:a=0,offset:r=0,limit:o=-1}={}){this.items=e,this.total=a,this.offset=r,this.limit=o,this.count=e.length,this.indexList=[],this.group(Ur())}get(){return this.itemsByGroup}isEmpty(){return!this.items||this.items.length<=0}group(e,a=[]){const r=a?this.items.filter(i=>a.every(n=>n(i))):this.items;this.count=r.length;let o=e.compareFn?[...r].sort(e.compareFn):r;this.indexList=[...new Set(o.map(e.groupKeyFn))],this.itemsByGroup=o.reduce((i,n)=>{const c=e.groupKeyFn(n);return i[c]=[...i[c]||[],n],i},{})}[Symbol.iterator](){let e=-1,a=-1;return{next:()=>{if(e>=this.indexList.length)return{done:!0};if(e<0&&(++e,a=0,this.indexList[e]!==Ds))return{value:{groupKey:this.indexList[e],itemId:this.indexList[e],isItem:!1,item:{}},done:!1};let r=this.indexList[e],o=this.itemsByGroup[r];if(a<o.length){const i=this.itemsByGroup[r][a++];return{value:{groupKey:r,itemId:i.id,isItem:!0,item:i},done:!1}}else return++e,a=0,e<this.indexList.length?(r=this.indexList[e],{value:{groupKey:r,itemId:r,isItem:!1,item:{}},done:!1}):{done:!0}}}}}const rt={load:function(s){return Promise.all([f.search({type:"album",expression:"time_added after 8 weeks ago and media_kind is music having track_count > 3 order by time_added desc",limit:3}),f.search({type:"track",expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:3})])},set:function(s,e){s.recently_added=new E(e[0].data.albums),s.recently_played=e[1].data.tracks}},Or={name:"PageBrowse",components:{ContentWithHeading:R,TabsMusic:G,ListAlbums:j,ListTracks:V},beforeRouteEnter(s,e,a){rt.load(s).then(r=>{a(o=>rt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;rt.load(s).then(o=>{rt.set(r,o),a()})},data(){return{recently_added:[],recently_played:{items:[]},show_track_details_modal:!1,selected_track:{}}},methods:{open_browse:function(s){this.$router.push({path:"/music/browse/"+s})}}},Dr={class:"fd-page-with-tabs"},zr=t("p",{class:"title is-4"},"Recently added",-1),Nr=t("p",{class:"heading"},"albums",-1),Vr={class:"level"},Br={class:"level-item"},Mr=t("p",{class:"title is-4"},"Recently played",-1),Fr=t("p",{class:"heading"},"tracks",-1),Gr={class:"level"},jr={class:"level-item"};function Kr(s,e,a,r,o,i){const n=h("tabs-music"),c=h("list-albums"),p=h("content-with-heading"),g=h("list-tracks");return l(),_("div",Dr,[u(n),u(p,null,{"heading-left":d(()=>[zr,Nr]),content:d(()=>[u(c,{albums:o.recently_added},null,8,["albums"])]),footer:d(()=>[t("nav",Vr,[t("p",Br,[t("a",{class:"button is-light is-small is-rounded",onClick:e[0]||(e[0]=b=>i.open_browse("recently_added"))},"Show more")])])]),_:1}),u(p,null,{"heading-left":d(()=>[Mr,Fr]),content:d(()=>[u(g,{tracks:o.recently_played.items},null,8,["tracks"])]),footer:d(()=>[t("nav",Gr,[t("p",jr,[t("a",{class:"button is-light is-small is-rounded",onClick:e[1]||(e[1]=b=>i.open_browse("recently_played"))},"Show more")])])]),_:1})])}var Hr=k(Or,[["render",Kr]]);const dt={load:function(s){const e=A.getters.settings_option_recently_added_limit;return f.search({type:"album",expression:"media_kind is music having track_count > 3 order by time_added desc",limit:e})},set:function(s,e){s.recently_added=new E(e.data.albums),s.recently_added.group(Lr("time_added",{direction:"desc",defaultValue:"0000"}))}},Wr={name:"PageBrowseType",components:{ContentWithHeading:R,TabsMusic:G,ListAlbums:j},beforeRouteEnter(s,e,a){dt.load(s).then(r=>{a(o=>dt.set(o,r))})},beforeRouteUpdate(s,e,a){if(!this.recently_added.isEmpty()){a();return}const r=this;dt.load(s).then(o=>{dt.set(r,o),a()})},data(){return{recently_added:new E}}},Yr={class:"fd-page-with-tabs"},Qr=t("p",{class:"title is-4"},"Recently added",-1),Jr=t("p",{class:"heading"},"albums",-1);function Zr(s,e,a,r,o,i){const n=h("tabs-music"),c=h("list-albums"),p=h("content-with-heading");return l(),_("div",Yr,[u(n),u(p,null,{"heading-left":d(()=>[Qr,Jr]),content:d(()=>[u(c,{albums:o.recently_added},null,8,["albums"])]),_:1})])}var Xr=k(Wr,[["render",Zr]]);const _t={load:function(s){return f.search({type:"track",expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:50})},set:function(s,e){s.recently_played=e.data.tracks}},td={name:"PageBrowseType",components:{ContentWithHeading:R,TabsMusic:G,ListTracks:V},beforeRouteEnter(s,e,a){_t.load(s).then(r=>{a(o=>_t.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;_t.load(s).then(o=>{_t.set(r,o),a()})},data(){return{recently_played:{}}}},sd={class:"fd-page-with-tabs"},ed=t("p",{class:"title is-4"},"Recently played",-1),id=t("p",{class:"heading"},"tracks",-1);function od(s,e,a,r,o,i){const n=h("tabs-music"),c=h("list-tracks"),p=h("content-with-heading");return l(),_("div",sd,[u(n),u(p,null,{"heading-left":d(()=>[ed,id]),content:d(()=>[u(c,{tracks:o.recently_played.items},null,8,["tracks"])]),_:1})])}var ad=k(td,[["render",od]]);const nd={name:"IndexButtonList",props:["index"],computed:{filtered_index(){if(!this.index)return[];const s="!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~";return this.index.filter(e=>!s.includes(e))}},methods:{nav:function(s){this.$router.push({hash:"#index_"+s})},scroll_to_top:function(){window.scrollTo({top:0,behavior:"smooth"})}}},ld={class:"buttons is-centered fd-is-square",style:{"margin-bottom":"16px"}},rd=["onClick"];function dd(s,e,a,r,o,i){return l(),_("section",null,[t("nav",ld,[(l(!0),_(T,null,I(i.filtered_index,n=>(l(),_("a",{key:n,class:"button is-small",onClick:c=>i.nav(n)},m(n),9,rd))),128))])])}var H=k(nd,[["render",dd]]);const _d={name:"ModalDialogArtist",props:["show","artist"],emits:["close"],methods:{play:function(){this.$emit("close"),f.player_play_uri(this.artist.uri,!1)},queue_add:function(){this.$emit("close"),f.queue_add(this.artist.uri)},queue_add_next:function(){this.$emit("close"),f.queue_add_next(this.artist.uri)},open_artist:function(){this.$emit("close"),this.$router.push({path:"/music/artists/"+this.artist.id})}}},cd={key:0,class:"modal is-active"},ud={class:"modal-content fd-modal-card"},md={class:"card"},hd={class:"card-content"},pd={class:"title is-4"},fd={class:"content is-small"},yd=t("span",{class:"heading"},"Albums",-1),gd={class:"title is-6"},bd=t("span",{class:"heading"},"Tracks",-1),kd={class:"title is-6"},wd=t("span",{class:"heading"},"Type",-1),vd={class:"title is-6"},$d=t("span",{class:"heading"},"Added at",-1),xd={class:"title is-6"},Cd={class:"card-footer"},qd=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),Sd=t("span",{class:"is-size-7"},"Add",-1),Pd=[qd,Sd],Ad=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-play"})],-1),Td=t("span",{class:"is-size-7"},"Add Next",-1),Rd=[Ad,Td],Ed=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),Id=t("span",{class:"is-size-7"},"Play",-1),Ud=[Ed,Id];function Ld(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",cd,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",ud,[t("div",md,[t("div",hd,[t("p",pd,[t("a",{class:"has-text-link",onClick:e[1]||(e[1]=(...n)=>i.open_artist&&i.open_artist(...n))},m(a.artist.name),1)]),t("div",fd,[t("p",null,[yd,t("span",gd,m(a.artist.album_count),1)]),t("p",null,[bd,t("span",kd,m(a.artist.track_count),1)]),t("p",null,[wd,t("span",vd,m(a.artist.data_kind),1)]),t("p",null,[$d,t("span",xd,m(s.$filters.time(a.artist.time_added,"L LT")),1)])])]),t("footer",Cd,[t("a",{class:"card-footer-item has-text-dark",onClick:e[2]||(e[2]=(...n)=>i.queue_add&&i.queue_add(...n))},Pd),t("a",{class:"card-footer-item has-text-dark",onClick:e[3]||(e[3]=(...n)=>i.queue_add_next&&i.queue_add_next(...n))},Rd),t("a",{class:"card-footer-item has-text-dark",onClick:e[4]||(e[4]=(...n)=>i.play&&i.play(...n))},Ud)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[5]||(e[5]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var Gt=k(_d,[["render",Ld]]);const Od={name:"ListArtists",components:{ModalDialogArtist:Gt},props:["artists","media_kind","hide_group_title"],data(){return{show_details_modal:!1,selected_artist:{}}},computed:{media_kind_resolved:function(){return this.media_kind?this.media_kind:this.selected_artist.media_kind}},methods:{open_artist:function(s){this.selected_artist=s,this.media_kind_resolved==="podcast"||(this.media_kind_resolved==="audiobook"?this.$router.push({path:"/audiobooks/artists/"+s.id}):this.$router.push({path:"/music/artists/"+s.id}))},open_dialog:function(s){this.selected_artist=s,this.show_details_modal=!0}}},Dd={key:0,class:"mt-6 mb-5 py-2"},zd={class:"media-content is-clipped"},Nd=["id"],Vd=["onClick"],Bd={class:"media-content fd-has-action is-clipped"},Md={class:"title is-6"},Fd={class:"media-right"},Gd=["onClick"],jd=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),Kd=[jd];function Hd(s,e,a,r,o,i){const n=h("modal-dialog-artist");return l(),_(T,null,[(l(!0),_(T,null,I(a.artists,c=>(l(),_(T,{key:c.itemId},[!c.isItem&&!a.hide_group_title?(l(),_("div",Dd,[t("div",zd,[t("span",{id:"index_"+c.groupKey,class:"tag is-info is-light is-small has-text-weight-bold"},m(c.groupKey),9,Nd)])])):c.isItem?(l(),_("div",{key:1,class:"media",onClick:p=>i.open_artist(c.item)},[t("div",Bd,[t("h1",Md,m(c.item.name),1)]),t("div",Fd,[t("a",{onClick:D(p=>i.open_dialog(c.item),["prevent","stop"])},Kd,8,Gd)])],8,Vd)):y("",!0)],64))),128)),(l(),w(Q,{to:"#app"},[u(n,{show:o.show_details_modal,artist:o.selected_artist,media_kind:a.media_kind,onClose:e[0]||(e[0]=c=>o.show_details_modal=!1)},null,8,["show","artist","media_kind"])]))],64)}var ds=k(Od,[["render",Hd]]);const Wd={name:"DropdownMenu",props:["modelValue","options"],emits:["update:modelValue"],data(){return{is_active:!1}},methods:{onClickOutside(s){this.is_active=!1},select(s){this.is_active=!1,this.$emit("update:modelValue",s)}}},Yd={class:"dropdown-trigger"},Qd=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-chevron-down","aria-hidden":"true"})],-1),Jd={id:"dropdown-menu",class:"dropdown-menu",role:"menu"},Zd={class:"dropdown-content"},Xd=["onClick"];function t_(s,e,a,r,o,i){const n=Zt("click-away");return U((l(),_("div",{class:C(["dropdown",{"is-active":o.is_active}])},[t("div",Yd,[t("button",{class:"button","aria-haspopup":"true","aria-controls":"dropdown-menu",onClick:e[0]||(e[0]=c=>o.is_active=!o.is_active)},[t("span",null,m(a.modelValue),1),Qd])]),t("div",Jd,[t("div",Zd,[(l(!0),_(T,null,I(a.options,c=>(l(),_("a",{key:c,class:C(["dropdown-item",{"is-active":a.modelValue===c}]),onClick:p=>i.select(c)},m(c),11,Xd))),128))])])],2)),[[n,i.onClickOutside]])}var _s=k(Wd,[["render",t_]]);const ct={load:function(s){return f.library_artists("music")},set:function(s,e){s.artists_list=new E(e.data)}},s_={name:"PageArtists",components:{ContentWithHeading:R,TabsMusic:G,IndexButtonList:H,ListArtists:ds,DropdownMenu:_s},beforeRouteEnter(s,e,a){ct.load(s).then(r=>{a(o=>ct.set(o,r))})},beforeRouteUpdate(s,e,a){if(!this.artists_list.isEmpty()){a();return}const r=this;ct.load(s).then(o=>{ct.set(r,o),a()})},data(){return{artists_list:new E,groupby_options:[{name:"Name",options:tt("name_sort")},{name:"Recently added",options:Nt("time_added",{direction:"desc",defaultValue:"0000"})}]}},computed:{artists(){if(!this.artists_list)return[];const s=this.groupby_options.find(e=>e.name===this.selected_groupby_option_name);return this.artists_list.group(s.options,[e=>!this.hide_singles||e.track_count>e.album_count*2,e=>!this.hide_spotify||e.data_kind!=="spotify"]),this.artists_list},groupby_option_names(){return[...this.groupby_options].map(s=>s.name)},selected_groupby_option_name:{get(){return this.$store.state.artists_sort},set(s){this.$store.commit(Rs,s)}},spotify_enabled(){return this.$store.state.spotify.webapi_token_valid},hide_singles:{get(){return this.$store.state.hide_singles},set(s){this.$store.commit(Mt,s)}},hide_spotify:{get(){return this.$store.state.hide_spotify},set(s){this.$store.commit(ns,s)}}},methods:{}},e_={class:"fd-page-with-tabs"},i_={class:"columns"},o_={class:"column"},a_=t("p",{class:"heading",style:{"margin-bottom":"24px"}},"Filter",-1),n_={class:"field"},l_={class:"control"},r_=t("label",{for:"switchHideSingles"},"Hide singles",-1),d_=t("p",{class:"help"}," If active, hides artists that only appear on singles or playlists. ",-1),__={key:0,class:"field"},c_={class:"control"},u_=t("label",{for:"switchHideSpotify"},"Hide artists from Spotify",-1),m_=t("p",{class:"help"}," If active, hides artists that only appear in your Spotify library. ",-1),h_={class:"column"},p_=t("p",{class:"heading",style:{"margin-bottom":"24px"}},"Sort by",-1),f_=t("p",{class:"title is-4"},"Artists",-1),y_={class:"heading"};function g_(s,e,a,r,o,i){const n=h("tabs-music"),c=h("index-button-list"),p=h("dropdown-menu"),g=h("list-artists"),b=h("content-with-heading");return l(),_("div",e_,[u(n),u(b,null,{options:d(()=>[u(c,{index:i.artists.indexList},null,8,["index"]),t("div",i_,[t("div",o_,[a_,t("div",n_,[t("div",l_,[U(t("input",{id:"switchHideSingles","onUpdate:modelValue":e[0]||(e[0]=x=>i.hide_singles=x),type:"checkbox",name:"switchHideSingles",class:"switch"},null,512),[[J,i.hide_singles]]),r_]),d_]),i.spotify_enabled?(l(),_("div",__,[t("div",c_,[U(t("input",{id:"switchHideSpotify","onUpdate:modelValue":e[1]||(e[1]=x=>i.hide_spotify=x),type:"checkbox",name:"switchHideSpotify",class:"switch"},null,512),[[J,i.hide_spotify]]),u_]),m_])):y("",!0)]),t("div",h_,[p_,u(p,{modelValue:i.selected_groupby_option_name,"onUpdate:modelValue":e[2]||(e[2]=x=>i.selected_groupby_option_name=x),options:i.groupby_option_names},null,8,["modelValue","options"])])])]),"heading-left":d(()=>[f_,t("p",y_,m(i.artists.count)+" Artists",1)]),"heading-right":d(()=>[]),content:d(()=>[u(g,{artists:i.artists},null,8,["artists"])]),_:1})])}var b_=k(s_,[["render",g_]]);const ut={load:function(s){return Promise.all([f.library_artist(s.params.artist_id),f.library_artist_albums(s.params.artist_id)])},set:function(s,e){s.artist=e[0].data,s.albums_list=new E(e[1].data)}},k_={name:"PageArtist",components:{ContentWithHeading:R,ListAlbums:j,ModalDialogArtist:Gt,DropdownMenu:_s},beforeRouteEnter(s,e,a){ut.load(s).then(r=>{a(o=>ut.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;ut.load(s).then(o=>{ut.set(r,o),a()})},data(){return{artist:{},albums_list:new E,groupby_options:[{name:"Name",options:tt("name_sort")},{name:"Release date",options:Nt("date_released",{direction:"asc",defaultValue:"0000"})}],show_artist_details_modal:!1}},computed:{albums(){const s=this.groupby_options.find(e=>e.name===this.selected_groupby_option_name);return this.albums_list.group(s.options),this.albums_list},groupby_option_names(){return[...this.groupby_options].map(s=>s.name)},selected_groupby_option_name:{get(){return this.$store.state.artist_albums_sort},set(s){this.$store.commit(Es,s)}}},methods:{open_tracks:function(){this.$router.push({path:"/music/artists/"+this.artist.id+"/tracks"})},play:function(){f.player_play_uri(this.albums.items.map(s=>s.uri).join(","),!0)}}},w_={class:"columns"},v_={class:"column"},$_=t("p",{class:"heading",style:{"margin-bottom":"24px"}},"Sort by",-1),x_={class:"title is-4"},C_={class:"buttons is-centered"},q_=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),S_=[q_],P_=t("span",{class:"icon"},[t("i",{class:"mdi mdi-shuffle"})],-1),A_=t("span",null,"Shuffle",-1),T_=[P_,A_],R_={class:"heading has-text-centered-mobile"};function E_(s,e,a,r,o,i){const n=h("dropdown-menu"),c=h("list-albums"),p=h("modal-dialog-artist"),g=h("content-with-heading");return l(),w(g,null,{options:d(()=>[t("div",w_,[t("div",v_,[$_,u(n,{modelValue:i.selected_groupby_option_name,"onUpdate:modelValue":e[0]||(e[0]=b=>i.selected_groupby_option_name=b),options:i.groupby_option_names},null,8,["modelValue","options"])])])]),"heading-left":d(()=>[t("p",x_,m(o.artist.name),1)]),"heading-right":d(()=>[t("div",C_,[t("a",{class:"button is-small is-light is-rounded",onClick:e[1]||(e[1]=b=>o.show_artist_details_modal=!0)},S_),t("a",{class:"button is-small is-dark is-rounded",onClick:e[2]||(e[2]=(...b)=>i.play&&i.play(...b))},T_)])]),content:d(()=>[t("p",R_,[$(m(o.artist.album_count)+" albums | ",1),t("a",{class:"has-text-link",onClick:e[3]||(e[3]=(...b)=>i.open_tracks&&i.open_tracks(...b))},m(o.artist.track_count)+" tracks",1)]),u(c,{albums:i.albums,hide_group_title:!0},null,8,["albums"]),u(p,{show:o.show_artist_details_modal,artist:o.artist,onClose:e[4]||(e[4]=b=>o.show_artist_details_modal=!1)},null,8,["show","artist"])]),_:1})}var I_=k(k_,[["render",E_]]);const mt={load:function(s){return f.library_albums("music")},set:function(s,e){s.albums_list=new E(e.data)}},U_={name:"PageAlbums",components:{ContentWithHeading:R,TabsMusic:G,IndexButtonList:H,ListAlbums:j,DropdownMenu:_s},beforeRouteEnter(s,e,a){mt.load(s).then(r=>{a(o=>mt.set(o,r))})},beforeRouteUpdate(s,e,a){if(!this.albums_list.isEmpty()){a();return}const r=this;mt.load(s).then(o=>{mt.set(r,o),a()})},data(){return{albums_list:new E,groupby_options:[{name:"Name",options:tt("name_sort")},{name:"Recently added",options:Nt("time_added",{direction:"desc",defaultValue:"0000"})},{name:"Recently released",options:Nt("date_released",{direction:"desc",defaultValue:"0000"})}]}},computed:{albums(){const s=this.groupby_options.find(e=>e.name===this.selected_groupby_option_name);return this.albums_list.group(s.options,[e=>!this.hide_singles||e.track_count>2,e=>!this.hide_spotify||e.data_kind!=="spotify"]),this.albums_list},groupby_option_names(){return[...this.groupby_options].map(s=>s.name)},selected_groupby_option_name:{get(){return this.$store.state.albums_sort},set(s){this.$store.commit(Is,s)}},spotify_enabled(){return this.$store.state.spotify.webapi_token_valid},hide_singles:{get(){return this.$store.state.hide_singles},set(s){this.$store.commit(Mt,s)}},hide_spotify:{get(){return this.$store.state.hide_spotify},set(s){this.$store.commit(ns,s)}}},methods:{scrollToTop:function(){window.scrollTo({top:0,behavior:"smooth"})}}},L_={class:"fd-page-with-tabs"},O_={class:"columns"},D_={class:"column"},z_=t("p",{class:"heading",style:{"margin-bottom":"24px"}},"Filter",-1),N_={class:"field"},V_={class:"control"},B_=t("label",{for:"switchHideSingles"},"Hide singles",-1),M_=t("p",{class:"help"}," If active, hides singles and albums with tracks that only appear in playlists. ",-1),F_={key:0,class:"field"},G_={class:"control"},j_=t("label",{for:"switchHideSpotify"},"Hide albums from Spotify",-1),K_=t("p",{class:"help"}," If active, hides albums that only appear in your Spotify library. ",-1),H_={class:"column"},W_=t("p",{class:"heading",style:{"margin-bottom":"24px"}},"Sort by",-1),Y_=t("p",{class:"title is-4"},"Albums",-1),Q_={class:"heading"};function J_(s,e,a,r,o,i){const n=h("tabs-music"),c=h("index-button-list"),p=h("dropdown-menu"),g=h("list-albums"),b=h("content-with-heading");return l(),_("div",L_,[u(n),u(b,null,{options:d(()=>[u(c,{index:i.albums.indexList},null,8,["index"]),t("div",O_,[t("div",D_,[z_,t("div",N_,[t("div",V_,[U(t("input",{id:"switchHideSingles","onUpdate:modelValue":e[0]||(e[0]=x=>i.hide_singles=x),type:"checkbox",name:"switchHideSingles",class:"switch"},null,512),[[J,i.hide_singles]]),B_]),M_]),i.spotify_enabled?(l(),_("div",F_,[t("div",G_,[U(t("input",{id:"switchHideSpotify","onUpdate:modelValue":e[1]||(e[1]=x=>i.hide_spotify=x),type:"checkbox",name:"switchHideSpotify",class:"switch"},null,512),[[J,i.hide_spotify]]),j_]),K_])):y("",!0)]),t("div",H_,[W_,u(p,{modelValue:i.selected_groupby_option_name,"onUpdate:modelValue":e[2]||(e[2]=x=>i.selected_groupby_option_name=x),options:i.groupby_option_names},null,8,["modelValue","options"])])])]),"heading-left":d(()=>[Y_,t("p",Q_,m(i.albums.count)+" Albums",1)]),"heading-right":d(()=>[]),content:d(()=>[u(g,{albums:i.albums},null,8,["albums"])]),_:1})])}var Z_=k(U_,[["render",J_]]);const X_={},tc={class:"hero is-light is-bold fd-content"},sc={class:"hero-body"},ec={class:"container"},ic={class:"columns is-centered"},oc={class:"column is-four-fifths"},ac={class:"columns",style:{"flex-direction":"row-reverse"}},nc={class:"column fd-has-cover"},lc={class:"column is-three-fifths has-text-centered-mobile",style:{margin:"auto 0"}},rc={class:"section fd-content"},dc={class:"container"},_c={class:"columns is-centered"},cc={class:"column is-four-fifths"},uc={style:{"margin-top":"16px"}};function mc(s,e){return l(),_("div",null,[t("section",tc,[t("div",sc,[t("div",ec,[t("div",ic,[t("div",oc,[t("div",ac,[t("div",nc,[O(s.$slots,"heading-right")]),t("div",lc,[O(s.$slots,"heading-left")])])])])])])]),t("section",rc,[t("div",dc,[t("div",_c,[t("div",cc,[O(s.$slots,"content"),t("div",uc,[O(s.$slots,"footer")])])])])])])}var cs=k(X_,[["render",mc]]);const ht={load:function(s){return Promise.all([f.library_album(s.params.album_id),f.library_album_tracks(s.params.album_id)])},set:function(s,e){s.album=e[0].data,s.tracks=e[1].data.items}},hc={name:"PageAlbum",components:{ContentWithHero:cs,ListTracks:V,ModalDialogAlbum:Ft,CoverArtwork:K},beforeRouteEnter(s,e,a){ht.load(s).then(r=>{a(o=>ht.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;ht.load(s).then(o=>{ht.set(r,o),a()})},data(){return{album:{},tracks:[],show_album_details_modal:!1}},methods:{open_artist:function(){this.show_details_modal=!1,this.$router.push({path:"/music/artists/"+this.album.artist_id})},play:function(){f.player_play_uri(this.album.uri,!0)}}},pc={class:"title is-5"},fc={class:"subtitle is-6 has-text-link has-text-weight-normal"},yc={class:"buttons fd-is-centered-mobile fd-has-margin-top"},gc=t("span",{class:"icon"},[t("i",{class:"mdi mdi-shuffle"})],-1),bc=t("span",null,"Shuffle",-1),kc=[gc,bc],wc=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),vc=[wc],$c={class:"image is-square fd-has-shadow fd-has-action"},xc={class:"heading is-7 has-text-centered-mobile fd-has-margin-top"};function Cc(s,e,a,r,o,i){const n=h("cover-artwork"),c=h("list-tracks"),p=h("modal-dialog-album"),g=h("content-with-hero");return l(),w(g,null,{"heading-left":d(()=>[t("h1",pc,m(o.album.name),1),t("h2",fc,[t("a",{class:"has-text-link",onClick:e[0]||(e[0]=(...b)=>i.open_artist&&i.open_artist(...b))},m(o.album.artist),1)]),t("div",yc,[t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...b)=>i.play&&i.play(...b))},kc),t("a",{class:"button is-small is-light is-rounded",onClick:e[2]||(e[2]=b=>o.show_album_details_modal=!0)},vc)])]),"heading-right":d(()=>[t("p",$c,[u(n,{artwork_url:o.album.artwork_url,artist:o.album.artist,album:o.album.name,onClick:e[3]||(e[3]=b=>o.show_album_details_modal=!0)},null,8,["artwork_url","artist","album"])])]),content:d(()=>[t("p",xc,m(o.album.track_count)+" tracks ",1),u(c,{tracks:o.tracks,uris:o.album.uri},null,8,["tracks","uris"]),u(p,{show:o.show_album_details_modal,album:o.album,onClose:e[4]||(e[4]=b=>o.show_album_details_modal=!1)},null,8,["show","album"])]),_:1})}var qc=k(hc,[["render",Cc]]);const Sc={name:"ModalDialogGenre",props:["show","genre"],emits:["close"],methods:{play:function(){this.$emit("close"),f.player_play_expression('genre is "'+this.genre.name+'" and media_kind is music',!1)},queue_add:function(){this.$emit("close"),f.queue_expression_add('genre is "'+this.genre.name+'" and media_kind is music')},queue_add_next:function(){this.$emit("close"),f.queue_expression_add_next('genre is "'+this.genre.name+'" and media_kind is music')},open_genre:function(){this.$emit("close"),this.$router.push({name:"Genre",params:{genre:this.genre.name}})}}},Pc={key:0,class:"modal is-active"},Ac={class:"modal-content fd-modal-card"},Tc={class:"card"},Rc={class:"card-content"},Ec={class:"title is-4"},Ic={class:"card-footer"},Uc=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),Lc=t("span",{class:"is-size-7"},"Add",-1),Oc=[Uc,Lc],Dc=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-play"})],-1),zc=t("span",{class:"is-size-7"},"Add Next",-1),Nc=[Dc,zc],Vc=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),Bc=t("span",{class:"is-size-7"},"Play",-1),Mc=[Vc,Bc];function Fc(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",Pc,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",Ac,[t("div",Tc,[t("div",Rc,[t("p",Ec,[t("a",{class:"has-text-link",onClick:e[1]||(e[1]=(...n)=>i.open_genre&&i.open_genre(...n))},m(a.genre.name),1)])]),t("footer",Ic,[t("a",{class:"card-footer-item has-text-dark",onClick:e[2]||(e[2]=(...n)=>i.queue_add&&i.queue_add(...n))},Oc),t("a",{class:"card-footer-item has-text-dark",onClick:e[3]||(e[3]=(...n)=>i.queue_add_next&&i.queue_add_next(...n))},Nc),t("a",{class:"card-footer-item has-text-dark",onClick:e[4]||(e[4]=(...n)=>i.play&&i.play(...n))},Mc)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[5]||(e[5]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var us=k(Sc,[["render",Fc]]);const Gc={name:"ListGenres",components:{ModalDialogGenre:us},props:["genres","media_kind","hide_group_title"],data(){return{show_details_modal:!1,selected_genre:{}}},computed:{media_kind_resolved:function(){return this.media_kind?this.media_kind:this.selected_genre.media_kind}},methods:{open_genre:function(s){this.$router.push({name:"Genre",params:{genre:s.name}})},open_dialog:function(s){this.selected_genre=s,this.show_details_modal=!0}}},jc={key:0,class:"mt-6 mb-5 py-2"},Kc={class:"media-content is-clipped"},Hc=["id"],Wc=["onClick"],Yc={class:"media-content fd-has-action is-clipped"},Qc={class:"title is-6"},Jc={class:"media-right"},Zc=["onClick"],Xc=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),tu=[Xc];function su(s,e,a,r,o,i){const n=h("modal-dialog-genre");return l(),_(T,null,[(l(!0),_(T,null,I(a.genres,c=>(l(),_(T,{key:c.itemId},[!c.isItem&&!a.hide_group_title?(l(),_("div",jc,[t("div",Kc,[t("span",{id:"index_"+c.groupKey,class:"tag is-info is-light is-small has-text-weight-bold"},m(c.groupKey),9,Hc)])])):c.isItem?(l(),_("div",{key:1,class:"media",onClick:p=>i.open_genre(c.item)},[t("div",Yc,[t("h1",Qc,m(c.item.name),1)]),t("div",Jc,[t("a",{onClick:D(p=>i.open_dialog(c.item),["prevent","stop"])},tu,8,Zc)])],8,Wc)):y("",!0)],64))),128)),(l(),w(Q,{to:"#app"},[u(n,{show:o.show_details_modal,genre:o.selected_genre,onClose:e[0]||(e[0]=c=>o.show_details_modal=!1)},null,8,["show","genre"])]))],64)}var eu=k(Gc,[["render",su]]);const pt={load:function(s){return f.library_genres()},set:function(s,e){s.genres=e.data,s.genres=new E(e.data),s.genres.group(zs("name_sort"))}},iu={name:"PageGenres",components:{ContentWithHeading:R,TabsMusic:G,IndexButtonList:H,ListGenres:eu},beforeRouteEnter(s,e,a){pt.load(s).then(r=>{a(o=>pt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;pt.load(s).then(o=>{pt.set(r,o),a()})},data(){return{genres:new E}},computed:{},methods:{}},ou={class:"fd-page-with-tabs"},au=t("p",{class:"title is-4"},"Genres",-1),nu={class:"heading"};function lu(s,e,a,r,o,i){const n=h("tabs-music"),c=h("index-button-list"),p=h("list-genres"),g=h("content-with-heading");return l(),_("div",ou,[u(n),u(g,null,{options:d(()=>[u(c,{index:o.genres.indexList},null,8,["index"])]),"heading-left":d(()=>[au,t("p",nu,m(o.genres.total)+" genres",1)]),content:d(()=>[u(p,{genres:o.genres},null,8,["genres"])]),_:1})])}var ru=k(iu,[["render",lu]]);const ft={load:function(s){return f.library_genre(s.params.genre)},set:function(s,e){s.name=s.$route.params.genre,s.albums_list=new E(e.data.albums),s.albums_list.group(tt("name_sort"))}},du={name:"PageGenre",components:{ContentWithHeading:R,IndexButtonList:H,ListAlbums:j,ModalDialogGenre:us},beforeRouteEnter(s,e,a){ft.load(s).then(r=>{a(o=>ft.set(o,r))})},beforeRouteUpdate(s,e,a){if(!this.albums_list.isEmpty()){a();return}const r=this;ft.load(s).then(o=>{ft.set(r,o),a()})},data(){return{name:"",albums_list:new E,show_genre_details_modal:!1}},methods:{open_tracks:function(){this.show_details_modal=!1,this.$router.push({name:"GenreTracks",params:{genre:this.name}})},play:function(){f.player_play_expression('genre is "'+this.name+'" and media_kind is music',!0)}}},_u={class:"title is-4"},cu={class:"buttons is-centered"},uu=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),mu=[uu],hu=t("span",{class:"icon"},[t("i",{class:"mdi mdi-shuffle"})],-1),pu=t("span",null,"Shuffle",-1),fu=[hu,pu],yu={class:"heading has-text-centered-mobile"};function gu(s,e,a,r,o,i){const n=h("index-button-list"),c=h("list-albums"),p=h("modal-dialog-genre"),g=h("content-with-heading");return l(),_("div",null,[u(g,null,{options:d(()=>[u(n,{index:o.albums_list.indexList},null,8,["index"])]),"heading-left":d(()=>[t("p",_u,m(o.name),1)]),"heading-right":d(()=>[t("div",cu,[t("a",{class:"button is-small is-light is-rounded",onClick:e[0]||(e[0]=b=>o.show_genre_details_modal=!0)},mu),t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...b)=>i.play&&i.play(...b))},fu)])]),content:d(()=>[t("p",yu,[$(m(o.albums_list.total)+" albums | ",1),t("a",{class:"has-text-link",onClick:e[2]||(e[2]=(...b)=>i.open_tracks&&i.open_tracks(...b))},"tracks")]),u(c,{albums:o.albums_list},null,8,["albums"]),u(p,{show:o.show_genre_details_modal,genre:{name:o.name},onClose:e[3]||(e[3]=b=>o.show_genre_details_modal=!1)},null,8,["show","genre"])]),_:1})])}var bu=k(du,[["render",gu]]);const yt={load:function(s){return f.library_genre_tracks(s.params.genre)},set:function(s,e){s.genre=s.$route.params.genre,s.tracks=e.data.tracks}},ku={name:"PageGenreTracks",components:{ContentWithHeading:R,ListTracks:V,IndexButtonList:H,ModalDialogGenre:us},beforeRouteEnter(s,e,a){yt.load(s).then(r=>{a(o=>yt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;yt.load(s).then(o=>{yt.set(r,o),a()})},data(){return{tracks:{items:[]},genre:"",show_genre_details_modal:!1}},computed:{index_list(){return[...new Set(this.tracks.items.map(s=>s.title_sort.charAt(0).toUpperCase()))]},expression(){return'genre is "'+this.genre+'" and media_kind is music'}},methods:{open_genre:function(){this.show_details_modal=!1,this.$router.push({name:"Genre",params:{genre:this.genre}})},play:function(){f.player_play_expression(this.expression,!0)}}},wu={class:"title is-4"},vu={class:"buttons is-centered"},$u=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),xu=[$u],Cu=t("span",{class:"icon"},[t("i",{class:"mdi mdi-shuffle"})],-1),qu=t("span",null,"Shuffle",-1),Su=[Cu,qu],Pu={class:"heading has-text-centered-mobile"};function Au(s,e,a,r,o,i){const n=h("index-button-list"),c=h("list-tracks"),p=h("modal-dialog-genre"),g=h("content-with-heading");return l(),_("div",null,[u(g,null,{options:d(()=>[u(n,{index:i.index_list},null,8,["index"])]),"heading-left":d(()=>[t("p",wu,m(o.genre),1)]),"heading-right":d(()=>[t("div",vu,[t("a",{class:"button is-small is-light is-rounded",onClick:e[0]||(e[0]=b=>o.show_genre_details_modal=!0)},xu),t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...b)=>i.play&&i.play(...b))},Su)])]),content:d(()=>[t("p",Pu,[t("a",{class:"has-text-link",onClick:e[2]||(e[2]=(...b)=>i.open_genre&&i.open_genre(...b))},"albums"),$(" | "+m(o.tracks.total)+" tracks ",1)]),u(c,{tracks:o.tracks.items,expression:i.expression},null,8,["tracks","expression"]),u(p,{show:o.show_genre_details_modal,genre:{name:o.genre},onClose:e[3]||(e[3]=b=>o.show_genre_details_modal=!1)},null,8,["show","genre"])]),_:1})])}var Tu=k(ku,[["render",Au]]);const gt={load:function(s){return Promise.all([f.library_artist(s.params.artist_id),f.library_artist_tracks(s.params.artist_id)])},set:function(s,e){s.artist=e[0].data,s.tracks=e[1].data.tracks}},Ru={name:"PageArtistTracks",components:{ContentWithHeading:R,ListTracks:V,IndexButtonList:H,ModalDialogArtist:Gt},beforeRouteEnter(s,e,a){gt.load(s).then(r=>{a(o=>gt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;gt.load(s).then(o=>{gt.set(r,o),a()})},data(){return{artist:{},tracks:{items:[]},show_artist_details_modal:!1}},computed:{index_list(){return[...new Set(this.tracks.items.map(s=>s.title_sort.charAt(0).toUpperCase()))]},track_uris(){return this.tracks.items.map(s=>s.uri).join(",")}},methods:{open_artist:function(){this.show_details_modal=!1,this.$router.push({path:"/music/artists/"+this.artist.id})},play:function(){f.player_play_uri(this.tracks.items.map(s=>s.uri).join(","),!0)}}},Eu={class:"title is-4"},Iu={class:"buttons is-centered"},Uu=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),Lu=[Uu],Ou=t("span",{class:"icon"},[t("i",{class:"mdi mdi-shuffle"})],-1),Du=t("span",null,"Shuffle",-1),zu=[Ou,Du],Nu={class:"heading has-text-centered-mobile"};function Vu(s,e,a,r,o,i){const n=h("index-button-list"),c=h("list-tracks"),p=h("modal-dialog-artist"),g=h("content-with-heading");return l(),_("div",null,[u(g,null,{options:d(()=>[u(n,{index:i.index_list},null,8,["index"])]),"heading-left":d(()=>[t("p",Eu,m(o.artist.name),1)]),"heading-right":d(()=>[t("div",Iu,[t("a",{class:"button is-small is-light is-rounded",onClick:e[0]||(e[0]=b=>o.show_artist_details_modal=!0)},Lu),t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...b)=>i.play&&i.play(...b))},zu)])]),content:d(()=>[t("p",Nu,[t("a",{class:"has-text-link",onClick:e[2]||(e[2]=(...b)=>i.open_artist&&i.open_artist(...b))},m(o.artist.album_count)+" albums",1),$(" | "+m(o.artist.track_count)+" tracks ",1)]),u(c,{tracks:o.tracks.items,uris:i.track_uris},null,8,["tracks","uris"]),u(p,{show:o.show_artist_details_modal,artist:o.artist,onClose:e[3]||(e[3]=b=>o.show_artist_details_modal=!1)},null,8,["show","artist"])]),_:1})])}var Bu=k(Ru,[["render",Vu]]);const Mu={name:"ModalDialogComposer",props:["show","composer"],emits:["close"],methods:{play:function(){this.$emit("close"),f.player_play_expression('composer is "'+this.composer.name+'" and media_kind is music',!1)},queue_add:function(){this.$emit("close"),f.queue_expression_add('composer is "'+this.composer.name+'" and media_kind is music')},queue_add_next:function(){this.$emit("close"),f.queue_expression_add_next('composer is "'+this.composer.name+'" and media_kind is music')},open_albums:function(){this.$emit("close"),this.$router.push({name:"ComposerAlbums",params:{composer:this.composer.name}})},open_tracks:function(){this.show_details_modal=!1,this.$router.push({name:"ComposerTracks",params:{composer:this.composer.name}})}}},Fu={key:0,class:"modal is-active"},Gu={class:"modal-content fd-modal-card"},ju={class:"card"},Ku={class:"card-content"},Hu={class:"title is-4"},Wu=t("span",{class:"heading"},"Albums",-1),Yu=t("span",{class:"heading"},"Tracks",-1),Qu={class:"card-footer"},Ju=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),Zu=t("span",{class:"is-size-7"},"Add",-1),Xu=[Ju,Zu],tm=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-play"})],-1),sm=t("span",{class:"is-size-7"},"Add Next",-1),em=[tm,sm],im=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),om=t("span",{class:"is-size-7"},"Play",-1),am=[im,om];function nm(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",Fu,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",Gu,[t("div",ju,[t("div",Ku,[t("p",Hu,[t("a",{class:"has-text-link",onClick:e[1]||(e[1]=(...n)=>i.open_albums&&i.open_albums(...n))},m(a.composer.name),1)]),t("p",null,[Wu,t("a",{class:"has-text-link is-6",onClick:e[2]||(e[2]=(...n)=>i.open_albums&&i.open_albums(...n))},m(a.composer.album_count),1)]),t("p",null,[Yu,t("a",{class:"has-text-link is-6",onClick:e[3]||(e[3]=(...n)=>i.open_tracks&&i.open_tracks(...n))},m(a.composer.track_count),1)])]),t("footer",Qu,[t("a",{class:"card-footer-item has-text-dark",onClick:e[4]||(e[4]=(...n)=>i.queue_add&&i.queue_add(...n))},Xu),t("a",{class:"card-footer-item has-text-dark",onClick:e[5]||(e[5]=(...n)=>i.queue_add_next&&i.queue_add_next(...n))},em),t("a",{class:"card-footer-item has-text-dark",onClick:e[6]||(e[6]=(...n)=>i.play&&i.play(...n))},am)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[7]||(e[7]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var ms=k(Mu,[["render",nm]]);const lm={name:"ListComposers",components:{ModalDialogComposer:ms},props:["composers","media_kind","hide_group_title"],data(){return{show_details_modal:!1,selected_composer:{}}},computed:{media_kind_resolved:function(){return this.media_kind?this.media_kind:this.selected_composer.media_kind}},methods:{open_composer:function(s){this.selected_composer=s,this.$router.push({name:"ComposerTracks",params:{composer:s.name}})},open_dialog:function(s){this.selected_composer=s,this.show_details_modal=!0}}},rm={key:0,class:"mt-6 mb-5 py-2"},dm={class:"media-content is-clipped"},_m=["id"],cm=["onClick"],um={class:"media-content fd-has-action is-clipped"},mm={class:"title is-6"},hm={class:"media-right"},pm=["onClick"],fm=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),ym=[fm];function gm(s,e,a,r,o,i){const n=h("modal-dialog-composer");return l(),_(T,null,[(l(!0),_(T,null,I(a.composers,c=>(l(),_(T,{key:c.itemId},[!c.isItem&&!a.hide_group_title?(l(),_("div",rm,[t("div",dm,[t("span",{id:"index_"+c.groupKey,class:"tag is-info is-light is-small has-text-weight-bold"},m(c.groupKey),9,_m)])])):c.isItem?(l(),_("div",{key:1,class:"media",onClick:p=>i.open_composer(c.item)},[t("div",um,[t("h1",mm,m(c.item.name),1)]),t("div",hm,[t("a",{onClick:D(p=>i.open_dialog(c.item),["prevent","stop"])},ym,8,pm)])],8,cm)):y("",!0)],64))),128)),(l(),w(Q,{to:"#app"},[u(n,{show:o.show_details_modal,composer:o.selected_composer,media_kind:a.media_kind,onClose:e[0]||(e[0]=c=>o.show_details_modal=!1)},null,8,["show","composer","media_kind"])]))],64)}var Ns=k(lm,[["render",gm]]);const bt={load:function(s){return f.library_composers()},set:function(s,e){s.composers=new E(e.data),s.composers.group(zs("name_sort"))}},bm={name:"PageComposers",components:{ContentWithHeading:R,TabsMusic:G,IndexButtonList:H,ListComposers:Ns},beforeRouteEnter(s,e,a){bt.load(s).then(r=>{a(o=>bt.set(o,r))})},beforeRouteUpdate(s,e,a){if(!this.composers.isEmpty()){a();return}const r=this;bt.load(s).then(o=>{bt.set(r,o),a()})},data(){return{composers:new E}},methods:{}},km=t("p",{class:"title is-4"},"Composers",-1),wm={class:"heading"};function vm(s,e,a,r,o,i){const n=h("tabs-music"),c=h("index-button-list"),p=h("list-composers"),g=h("content-with-heading");return l(),_("div",null,[u(n),u(g,null,{options:d(()=>[u(c,{index:o.composers.indexList},null,8,["index"])]),"heading-left":d(()=>[km,t("p",wm,m(o.composers.total)+" composers",1)]),content:d(()=>[u(p,{composers:o.composers},null,8,["composers"])]),_:1})])}var $m=k(bm,[["render",vm]]);const kt={load:function(s){return f.library_composer(s.params.composer)},set:function(s,e){s.name=s.$route.params.composer,s.albums_list=new E(e.data.albums)}},xm={name:"PageComposer",components:{ContentWithHeading:R,ListAlbums:j,ModalDialogComposer:ms},beforeRouteEnter(s,e,a){kt.load(s).then(r=>{a(o=>kt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;kt.load(s).then(o=>{kt.set(r,o),a()})},data(){return{name:"",albums_list:new E,show_composer_details_modal:!1}},methods:{open_tracks:function(){this.$router.push({name:"ComposerTracks",params:{composer:this.name}})},play:function(){f.player_play_expression('composer is "'+this.name+'" and media_kind is music',!0)}}},Cm={class:"title is-4"},qm={class:"buttons is-centered"},Sm=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),Pm=[Sm],Am=t("span",{class:"icon"},[t("i",{class:"mdi mdi-shuffle"})],-1),Tm=t("span",null,"Shuffle",-1),Rm=[Am,Tm],Em={class:"heading has-text-centered-mobile"};function Im(s,e,a,r,o,i){const n=h("list-albums"),c=h("modal-dialog-composer"),p=h("content-with-heading");return l(),_("div",null,[u(p,null,{"heading-left":d(()=>[t("p",Cm,m(o.name),1)]),"heading-right":d(()=>[t("div",qm,[t("a",{class:"button is-small is-light is-rounded",onClick:e[0]||(e[0]=g=>o.show_composer_details_modal=!0)},Pm),t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...g)=>i.play&&i.play(...g))},Rm)])]),content:d(()=>[t("p",Em,[$(m(o.albums_list.total)+" albums | ",1),t("a",{class:"has-text-link",onClick:e[2]||(e[2]=(...g)=>i.open_tracks&&i.open_tracks(...g))},"tracks")]),u(n,{albums:o.albums_list,hide_group_title:!0},null,8,["albums"]),u(c,{show:o.show_composer_details_modal,composer:{name:o.name},onClose:e[3]||(e[3]=g=>o.show_composer_details_modal=!1)},null,8,["show","composer"])]),_:1})])}var Um=k(xm,[["render",Im]]);const wt={load:function(s){return f.library_composer_tracks(s.params.composer)},set:function(s,e){s.composer=s.$route.params.composer,s.tracks=e.data.tracks}},Lm={name:"PageComposerTracks",components:{ContentWithHeading:R,ListTracks:V,ModalDialogComposer:ms},beforeRouteEnter(s,e,a){wt.load(s).then(r=>{a(o=>wt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;wt.load(s).then(o=>{wt.set(r,o),a()})},data(){return{tracks:{items:[]},composer:"",show_composer_details_modal:!1}},computed:{play_expression(){return'composer is "'+this.composer+'" and media_kind is music'}},methods:{open_albums:function(){this.show_details_modal=!1,this.$router.push({name:"ComposerAlbums",params:{composer:this.composer}})},play:function(){f.player_play_expression(this.play_expression,!0)}}},Om={class:"title is-4"},Dm={class:"buttons is-centered"},zm=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),Nm=[zm],Vm=t("span",{class:"icon"},[t("i",{class:"mdi mdi-shuffle"})],-1),Bm=t("span",null,"Shuffle",-1),Mm=[Vm,Bm],Fm={class:"heading has-text-centered-mobile"};function Gm(s,e,a,r,o,i){const n=h("list-tracks"),c=h("modal-dialog-composer"),p=h("content-with-heading");return l(),_("div",null,[u(p,null,{"heading-left":d(()=>[t("p",Om,m(o.composer),1)]),"heading-right":d(()=>[t("div",Dm,[t("a",{class:"button is-small is-light is-rounded",onClick:e[0]||(e[0]=g=>o.show_composer_details_modal=!0)},Nm),t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...g)=>i.play&&i.play(...g))},Mm)])]),content:d(()=>[t("p",Fm,[t("a",{class:"has-text-link",onClick:e[2]||(e[2]=(...g)=>i.open_albums&&i.open_albums(...g))},"albums"),$(" | "+m(o.tracks.total)+" tracks ",1)]),u(n,{tracks:o.tracks.items,expression:i.play_expression},null,8,["tracks","expression"]),u(c,{show:o.show_composer_details_modal,composer:{name:o.composer},onClose:e[3]||(e[3]=g=>o.show_composer_details_modal=!1)},null,8,["show","composer"])]),_:1})])}var jm=k(Lm,[["render",Gm]]);const Km={name:"ModalDialogAddRss",props:["show"],emits:["close","podcast-added"],data(){return{url:"",loading:!1}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.url_field.focus()},10))}},methods:{add_stream:function(){this.loading=!0,f.library_add(this.url).then(()=>{this.$emit("close"),this.$emit("podcast-added"),this.url=""}).catch(()=>{this.loading=!1})}}},Hm={key:0,class:"modal is-active"},Wm={class:"modal-content fd-modal-card"},Ym={class:"card"},Qm={class:"card-content"},Jm=t("p",{class:"title is-4"},"Add Podcast RSS feed URL",-1),Zm={class:"field"},Xm={class:"control is-expanded has-icons-left"},th=["disabled"],sh=t("span",{class:"icon is-left"},[t("i",{class:"mdi mdi-rss"})],-1),eh=t("p",{class:"help"}," Adding a podcast includes creating an RSS playlist, that will allow OwnTone to manage the podcast subscription. ",-1),ih={key:0,class:"card-footer"},oh=t("a",{class:"card-footer-item button is-loading"},[t("span",{class:"icon"},[t("i",{class:"mdi mdi-web"})]),t("span",{class:"is-size-7"},"Processing ...")],-1),ah=[oh],nh={key:1,class:"card-footer"},lh=t("span",{class:"icon"},[t("i",{class:"mdi mdi-cancel"})],-1),rh=t("span",{class:"is-size-7"},"Cancel",-1),dh=[lh,rh],_h=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),ch=t("span",{class:"is-size-7"},"Add",-1),uh=[_h,ch];function mh(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",Hm,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",Wm,[t("div",Ym,[t("div",Qm,[Jm,t("form",{onSubmit:e[2]||(e[2]=D((...n)=>i.add_stream&&i.add_stream(...n),["prevent"]))},[t("div",Zm,[t("p",Xm,[U(t("input",{ref:"url_field","onUpdate:modelValue":e[1]||(e[1]=n=>o.url=n),class:"input is-shadowless",type:"text",placeholder:"http://url-to-rss",disabled:o.loading},null,8,th),[[M,o.url]]),sh]),eh])],32)]),o.loading?(l(),_("footer",ih,ah)):(l(),_("footer",nh,[t("a",{class:"card-footer-item has-text-danger",onClick:e[3]||(e[3]=n=>s.$emit("close"))},dh),t("a",{class:"card-footer-item has-background-info has-text-white has-text-weight-bold",onClick:e[4]||(e[4]=(...n)=>i.add_stream&&i.add_stream(...n))},uh)]))])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[5]||(e[5]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var hh=k(Km,[["render",mh]]);const vt={load:function(s){return Promise.all([f.library_albums("podcast"),f.library_podcasts_new_episodes()])},set:function(s,e){s.albums=new E(e[0].data),s.new_episodes=e[1].data.tracks}},ph={name:"PagePodcasts",components:{ContentWithHeading:R,ListTracks:V,ListAlbums:j,ModalDialogAddRss:hh},beforeRouteEnter(s,e,a){vt.load(s).then(r=>{a(o=>vt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;vt.load(s).then(o=>{vt.set(r,o),a()})},data(){return{albums:[],new_episodes:{items:[]},show_url_modal:!1}},computed:{rss(){return this.$store.state.rss_count}},methods:{mark_all_played:function(){this.new_episodes.items.forEach(s=>{f.library_track_update(s.id,{play_count:"increment"})}),this.new_episodes.items={}},open_add_podcast_dialog:function(s){this.show_url_modal=!0},reload_new_episodes:function(){f.library_podcasts_new_episodes().then(({data:s})=>{this.new_episodes=s.tracks})},reload_podcasts:function(){f.library_albums("podcast").then(({data:s})=>{this.albums=new E(s),this.reload_new_episodes()})},update_rss:function(){this.$store.commit(ls,"rss"),this.$store.commit(ot,!0)}}},fh=t("p",{class:"title is-4"},"New episodes",-1),yh={class:"buttons is-centered"},gh=t("span",{class:"icon"},[t("i",{class:"mdi mdi-pencil"})],-1),bh=t("span",null,"Mark All Played",-1),kh=[gh,bh],wh=t("p",{class:"title is-4"},"Podcasts",-1),vh={class:"heading"},$h={class:"buttons is-centered"},xh=t("span",{class:"icon"},[t("i",{class:"mdi mdi-refresh"})],-1),Ch=t("span",null,"Update",-1),qh=[xh,Ch],Sh=t("span",{class:"icon"},[t("i",{class:"mdi mdi-rss"})],-1),Ph=t("span",null,"Add Podcast",-1),Ah=[Sh,Ph];function Th(s,e,a,r,o,i){const n=h("list-tracks"),c=h("content-with-heading"),p=h("list-albums"),g=h("modal-dialog-add-rss");return l(),_("div",null,[o.new_episodes.items.length>0?(l(),w(c,{key:0},{"heading-left":d(()=>[fh]),"heading-right":d(()=>[t("div",yh,[t("a",{class:"button is-small",onClick:e[0]||(e[0]=(...b)=>i.mark_all_played&&i.mark_all_played(...b))},kh)])]),content:d(()=>[u(n,{tracks:o.new_episodes.items,show_progress:!0,onPlayCountChanged:i.reload_new_episodes},null,8,["tracks","onPlayCountChanged"])]),_:1})):y("",!0),u(c,null,{"heading-left":d(()=>[wh,t("p",vh,m(o.albums.total)+" podcasts",1)]),"heading-right":d(()=>[t("div",$h,[i.rss.tracks>0?(l(),_("a",{key:0,class:"button is-small",onClick:e[1]||(e[1]=(...b)=>i.update_rss&&i.update_rss(...b))},qh)):y("",!0),t("a",{class:"button is-small",onClick:e[2]||(e[2]=(...b)=>i.open_add_podcast_dialog&&i.open_add_podcast_dialog(...b))},Ah)])]),content:d(()=>[u(p,{albums:o.albums,onPlayCountChanged:e[3]||(e[3]=b=>i.reload_new_episodes()),onPodcastDeleted:e[4]||(e[4]=b=>i.reload_podcasts())},null,8,["albums"]),u(g,{show:o.show_url_modal,onClose:e[5]||(e[5]=b=>o.show_url_modal=!1),onPodcastAdded:e[6]||(e[6]=b=>i.reload_podcasts())},null,8,["show"])]),_:1})])}var Rh=k(ph,[["render",Th]]);const $t={load:function(s){return Promise.all([f.library_album(s.params.album_id),f.library_podcast_episodes(s.params.album_id)])},set:function(s,e){s.album=e[0].data,s.tracks=e[1].data.tracks.items}},Eh={name:"PagePodcast",components:{ContentWithHeading:R,ListTracks:V,ModalDialogAlbum:Ft,ModalDialog:rs},beforeRouteEnter(s,e,a){$t.load(s).then(r=>{a(o=>$t.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;$t.load(s).then(o=>{$t.set(r,o),a()})},data(){return{album:{},tracks:[],show_album_details_modal:!1,show_remove_podcast_modal:!1,rss_playlist_to_remove:{}}},computed:{new_tracks(){return this.tracks.filter(s=>s.play_count===0).length}},methods:{play:function(){f.player_play_uri(this.album.uri,!1)},open_remove_podcast_dialog:function(){this.show_album_details_modal=!1,f.library_track_playlists(this.tracks[0].id).then(({data:s})=>{const e=s.items.filter(a=>a.type==="rss");if(e.length!==1){this.$store.dispatch("add_notification",{text:"Podcast cannot be removed. Probably it was not added as an RSS playlist.",type:"danger"});return}this.rss_playlist_to_remove=e[0],this.show_remove_podcast_modal=!0})},remove_podcast:function(){this.show_remove_podcast_modal=!1,f.library_playlist_delete(this.rss_playlist_to_remove.id).then(()=>{this.$router.replace({path:"/podcasts"})})},reload_tracks:function(){f.library_podcast_episodes(this.album.id).then(({data:s})=>{this.tracks=s.tracks.items})}}},Ih={class:"title is-4"},Uh={class:"buttons is-centered"},Lh=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),Oh=[Lh],Dh=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),zh=t("span",null,"Play",-1),Nh=[Dh,zh],Vh={class:"heading has-text-centered-mobile"},Bh=t("p",null,"Permanently remove this podcast from your library?",-1),Mh={class:"is-size-7"},Fh=$(" (This will also remove the RSS playlist "),Gh=$(".) ");function jh(s,e,a,r,o,i){const n=h("list-tracks"),c=h("modal-dialog-album"),p=h("modal-dialog"),g=h("content-with-heading");return l(),w(g,null,{"heading-left":d(()=>[t("div",Ih,m(o.album.name),1)]),"heading-right":d(()=>[t("div",Uh,[t("a",{class:"button is-small is-light is-rounded",onClick:e[0]||(e[0]=b=>o.show_album_details_modal=!0)},Oh),t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...b)=>i.play&&i.play(...b))},Nh)])]),content:d(()=>[t("p",Vh,m(o.album.track_count)+" tracks ",1),u(n,{tracks:o.tracks,show_progress:!0,onPlayCountChanged:i.reload_tracks},null,8,["tracks","onPlayCountChanged"]),u(c,{show:o.show_album_details_modal,album:o.album,media_kind:"podcast",new_tracks:i.new_tracks,onClose:e[2]||(e[2]=b=>o.show_album_details_modal=!1),onPlayCountChanged:i.reload_tracks,onRemovePodcast:i.open_remove_podcast_dialog},null,8,["show","album","new_tracks","onPlayCountChanged","onRemovePodcast"]),u(p,{show:o.show_remove_podcast_modal,title:"Remove podcast",delete_action:"Remove",onClose:e[3]||(e[3]=b=>o.show_remove_podcast_modal=!1),onDelete:i.remove_podcast},{"modal-content":d(()=>[Bh,t("p",Mh,[Fh,t("b",null,m(o.rss_playlist_to_remove.name),1),Gh])]),_:1},8,["show","onDelete"])]),_:1})}var Kh=k(Eh,[["render",jh]]);const Hh={name:"TabsAudiobooks"},Wh={class:"section fd-tabs-section"},Yh={class:"container"},Qh={class:"columns is-centered"},Jh={class:"column is-four-fifths"},Zh={class:"tabs is-centered is-small"},Xh=["onClick","onKeypress"],tp=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-artist"})],-1),sp=t("span",{class:""},"Authors",-1),ep=[tp,sp],ip=["onClick","onKeypress"],op=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-album"})],-1),ap=t("span",{class:""},"Audiobooks",-1),np=[op,ap];function lp(s,e,a,r,o,i){const n=h("router-link");return l(),_("section",Wh,[t("div",Yh,[t("div",Qh,[t("div",Jh,[t("div",Zh,[t("ul",null,[u(n,{to:"/audiobooks/artists",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},ep,40,Xh)],2)]),_:1}),u(n,{to:"/audiobooks/albums",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},np,40,ip)],2)]),_:1})])])])])])])}var Vs=k(Hh,[["render",lp]]);const xt={load:function(s){return f.library_albums("audiobook")},set:function(s,e){s.albums=new E(e.data),s.albums.group(tt("name_sort"))}},rp={name:"PageAudiobooksAlbums",components:{TabsAudiobooks:Vs,ContentWithHeading:R,IndexButtonList:H,ListAlbums:j},beforeRouteEnter(s,e,a){xt.load(s).then(r=>{a(o=>xt.set(o,r))})},beforeRouteUpdate(s,e,a){if(!this.albums.isEmpty()){a();return}const r=this;xt.load(s).then(o=>{xt.set(r,o),a()})},data(){return{albums:new E}},methods:{}},dp={class:"fd-page-with-tabs"},_p=t("p",{class:"title is-4"},"Audiobooks",-1),cp={class:"heading"};function up(s,e,a,r,o,i){const n=h("tabs-audiobooks"),c=h("index-button-list"),p=h("list-albums"),g=h("content-with-heading");return l(),_("div",dp,[u(n),u(g,null,{options:d(()=>[u(c,{index:o.albums.indexList},null,8,["index"])]),"heading-left":d(()=>[_p,t("p",cp,m(o.albums.count)+" Audiobooks",1)]),content:d(()=>[u(p,{albums:o.albums},null,8,["albums"])]),_:1})])}var mp=k(rp,[["render",up]]);const Ct={load:function(s){return f.library_artists("audiobook")},set:function(s,e){s.artists_list=new E(e.data)}},hp={name:"PageAudiobooksArtists",components:{ContentWithHeading:R,TabsAudiobooks:Vs,IndexButtonList:H,ListArtists:ds},beforeRouteEnter(s,e,a){Ct.load(s).then(r=>{a(o=>Ct.set(o,r))})},beforeRouteUpdate(s,e,a){if(!this.artists_list.isEmpty()){a();return}const r=this;Ct.load(s).then(o=>{Ct.set(r,o),a()})},data(){return{artists_list:new E}},computed:{artists(){return this.artists_list?(this.artists_list.group(tt("name_sort")),this.artists_list):[]}},methods:{}},pp={class:"fd-page-with-tabs"},fp=t("p",{class:"title is-4"},"Authors",-1),yp={class:"heading"};function gp(s,e,a,r,o,i){const n=h("tabs-audiobooks"),c=h("index-button-list"),p=h("list-artists"),g=h("content-with-heading");return l(),_("div",pp,[u(n),u(g,null,{options:d(()=>[u(c,{index:i.artists.indexList},null,8,["index"])]),"heading-left":d(()=>[fp,t("p",yp,m(i.artists.count)+" Authors",1)]),"heading-right":d(()=>[]),content:d(()=>[u(p,{artists:i.artists},null,8,["artists"])]),_:1})])}var bp=k(hp,[["render",gp]]);const qt={load:function(s){return Promise.all([f.library_artist(s.params.artist_id),f.library_artist_albums(s.params.artist_id)])},set:function(s,e){s.artist=e[0].data,s.albums=new E(e[1].data)}},kp={name:"PageAudiobooksArtist",components:{ContentWithHeading:R,ListAlbums:j,ModalDialogArtist:Gt},beforeRouteEnter(s,e,a){qt.load(s).then(r=>{a(o=>qt.set(o,r))})},beforeRouteUpdate(s,e,a){if(!this.albums.isEmpty()){a();return}const r=this;qt.load(s).then(o=>{qt.set(r,o),a()})},data(){return{artist:{},albums:new E,show_artist_details_modal:!1}},methods:{play:function(){f.player_play_uri(this.albums.items.map(s=>s.uri).join(","),!1)}}},wp={class:"title is-4"},vp={class:"buttons is-centered"},$p=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),xp=[$p],Cp=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),qp=t("span",null,"Shuffle",-1),Sp=[Cp,qp],Pp={class:"heading has-text-centered-mobile"};function Ap(s,e,a,r,o,i){const n=h("list-albums"),c=h("modal-dialog-artist"),p=h("content-with-heading");return l(),w(p,null,{"heading-left":d(()=>[t("p",wp,m(o.artist.name),1)]),"heading-right":d(()=>[t("div",vp,[t("a",{class:"button is-small is-light is-rounded",onClick:e[0]||(e[0]=g=>o.show_artist_details_modal=!0)},xp),t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...g)=>i.play&&i.play(...g))},Sp)])]),content:d(()=>[t("p",Pp,m(o.artist.album_count)+" albums ",1),u(n,{albums:o.albums},null,8,["albums"]),u(c,{show:o.show_artist_details_modal,artist:o.artist,onClose:e[2]||(e[2]=g=>o.show_artist_details_modal=!1)},null,8,["show","artist"])]),_:1})}var Tp=k(kp,[["render",Ap]]);const St={load:function(s){return Promise.all([f.library_album(s.params.album_id),f.library_album_tracks(s.params.album_id)])},set:function(s,e){s.album=e[0].data,s.tracks=e[1].data.items}},Rp={name:"PageAudiobooksAlbum",components:{ContentWithHero:cs,ListTracks:V,ModalDialogAlbum:Ft,CoverArtwork:K},beforeRouteEnter(s,e,a){St.load(s).then(r=>{a(o=>St.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;St.load(s).then(o=>{St.set(r,o),a()})},data(){return{album:{},tracks:[],show_album_details_modal:!1}},methods:{open_artist:function(){this.show_details_modal=!1,this.$router.push({path:"/audiobooks/artists/"+this.album.artist_id})},play:function(){f.player_play_uri(this.album.uri,!1)},play_track:function(s){f.player_play_uri(this.album.uri,!1,s)},open_dialog:function(s){this.selected_track=s,this.show_details_modal=!0}}},Ep={class:"title is-5"},Ip={class:"subtitle is-6 has-text-link has-text-weight-normal"},Up={class:"buttons fd-is-centered-mobile fd-has-margin-top"},Lp=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),Op=t("span",null,"Play",-1),Dp=[Lp,Op],zp=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),Np=[zp],Vp={class:"image is-square fd-has-shadow fd-has-action"},Bp={class:"heading is-7 has-text-centered-mobile fd-has-margin-top"};function Mp(s,e,a,r,o,i){const n=h("cover-artwork"),c=h("list-tracks"),p=h("modal-dialog-album"),g=h("content-with-hero");return l(),w(g,null,{"heading-left":d(()=>[t("h1",Ep,m(o.album.name),1),t("h2",Ip,[t("a",{class:"has-text-link",onClick:e[0]||(e[0]=(...b)=>i.open_artist&&i.open_artist(...b))},m(o.album.artist),1)]),t("div",Up,[t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...b)=>i.play&&i.play(...b))},Dp),t("a",{class:"button is-small is-light is-rounded",onClick:e[2]||(e[2]=b=>o.show_album_details_modal=!0)},Np)])]),"heading-right":d(()=>[t("p",Vp,[u(n,{artwork_url:o.album.artwork_url,artist:o.album.artist,album:o.album.name,onClick:e[3]||(e[3]=b=>o.show_album_details_modal=!0)},null,8,["artwork_url","artist","album"])])]),content:d(()=>[t("p",Bp,m(o.album.track_count)+" tracks ",1),u(c,{tracks:o.tracks,uris:o.album.uri},null,8,["tracks","uris"]),u(p,{show:o.show_album_details_modal,album:o.album,media_kind:"audiobook",onClose:e[4]||(e[4]=b=>o.show_album_details_modal=!1)},null,8,["show","album"])]),_:1})}var Fp=k(Rp,[["render",Mp]]);const Gp={name:"ModalDialogPlaylist",props:["show","playlist","uris"],emits:["close"],methods:{play:function(){this.$emit("close"),f.player_play_uri(this.uris?this.uris:this.playlist.uri,!1)},queue_add:function(){this.$emit("close"),f.queue_add(this.uris?this.uris:this.playlist.uri)},queue_add_next:function(){this.$emit("close"),f.queue_add_next(this.uris?this.uris:this.playlist.uri)},open_playlist:function(){this.$emit("close"),this.$router.push({path:"/playlists/"+this.playlist.id+"/tracks"})}}},jp={key:0,class:"modal is-active"},Kp={class:"modal-content fd-modal-card"},Hp={class:"card"},Wp={class:"card-content"},Yp={class:"title is-4"},Qp={class:"content is-small"},Jp=t("span",{class:"heading"},"Path",-1),Zp={class:"title is-6"},Xp=t("span",{class:"heading"},"Type",-1),tf={class:"title is-6"},sf={key:0,class:"card-footer"},ef=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),of=t("span",{class:"is-size-7"},"Add",-1),af=[ef,of],nf=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-play"})],-1),lf=t("span",{class:"is-size-7"},"Add Next",-1),rf=[nf,lf],df=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),_f=t("span",{class:"is-size-7"},"Play",-1),cf=[df,_f];function uf(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",jp,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",Kp,[t("div",Hp,[t("div",Wp,[t("p",Yp,[t("a",{class:"has-text-link",onClick:e[1]||(e[1]=(...n)=>i.open_playlist&&i.open_playlist(...n))},m(a.playlist.name),1)]),t("div",Qp,[t("p",null,[Jp,t("span",Zp,m(a.playlist.path),1)]),t("p",null,[Xp,t("span",tf,m(a.playlist.type),1)])])]),a.playlist.folder?y("",!0):(l(),_("footer",sf,[t("a",{class:"card-footer-item has-text-dark",onClick:e[2]||(e[2]=(...n)=>i.queue_add&&i.queue_add(...n))},af),t("a",{class:"card-footer-item has-text-dark",onClick:e[3]||(e[3]=(...n)=>i.queue_add_next&&i.queue_add_next(...n))},rf),t("a",{class:"card-footer-item has-text-dark",onClick:e[4]||(e[4]=(...n)=>i.play&&i.play(...n))},cf)]))])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[5]||(e[5]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var Bs=k(Gp,[["render",uf]]);const mf={name:"ListPlaylists",components:{ModalDialogPlaylist:Bs},props:["playlists"],data(){return{show_details_modal:!1,selected_playlist:{}}},methods:{open_playlist:function(s){s.type!=="folder"?this.$router.push({path:"/playlists/"+s.id+"/tracks"}):this.$router.push({path:"/playlists/"+s.id})},open_dialog:function(s){this.selected_playlist=s,this.show_details_modal=!0}}},hf=["playlist","onClick"],pf={class:"media-left fd-has-action"},ff={class:"icon"},yf={class:"media-content fd-has-action is-clipped"},gf={class:"title is-6"},bf={class:"media-right"},kf=["onClick"],wf=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),vf=[wf];function $f(s,e,a,r,o,i){const n=h("modal-dialog-playlist");return l(),_(T,null,[(l(!0),_(T,null,I(a.playlists,c=>(l(),_("div",{key:c.id,class:"media",playlist:c,onClick:p=>i.open_playlist(c)},[t("figure",pf,[t("span",ff,[t("i",{class:C(["mdi",{"mdi-library-music":c.type!=="folder","mdi-rss":c.type==="rss","mdi-folder":c.type==="folder"}])},null,2)])]),t("div",yf,[t("h1",gf,m(c.name),1)]),t("div",bf,[t("a",{onClick:D(p=>i.open_dialog(c),["prevent","stop"])},vf,8,kf)])],8,hf))),128)),(l(),w(Q,{to:"#app"},[u(n,{show:o.show_details_modal,playlist:o.selected_playlist,onClose:e[0]||(e[0]=c=>o.show_details_modal=!1)},null,8,["show","playlist"])]))],64)}var hs=k(mf,[["render",$f]]);const Pt={load:function(s){return Promise.all([f.library_playlist(s.params.playlist_id),f.library_playlist_folder(s.params.playlist_id)])},set:function(s,e){s.playlist=e[0].data,s.playlists=e[1].data}},xf={name:"PagePlaylists",components:{ContentWithHeading:R,ListPlaylists:hs},beforeRouteEnter(s,e,a){Pt.load(s).then(r=>{a(o=>Pt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;Pt.load(s).then(o=>{Pt.set(r,o),a()})},data(){return{playlist:{},playlists:{}}}},Cf={class:"title is-4"},qf={class:"heading"};function Sf(s,e,a,r,o,i){const n=h("list-playlists"),c=h("content-with-heading");return l(),w(c,null,{"heading-left":d(()=>[t("p",Cf,m(o.playlist.name),1),t("p",qf,m(o.playlists.total)+" playlists",1)]),content:d(()=>[u(n,{playlists:o.playlists.items},null,8,["playlists"])]),_:1})}var Pf=k(xf,[["render",Sf]]);const At={load:function(s){return Promise.all([f.library_playlist(s.params.playlist_id),f.library_playlist_tracks(s.params.playlist_id)])},set:function(s,e){s.playlist=e[0].data,s.tracks=e[1].data.items}},Af={name:"PagePlaylist",components:{ContentWithHeading:R,ListTracks:V,ModalDialogPlaylist:Bs},beforeRouteEnter(s,e,a){At.load(s).then(r=>{a(o=>At.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;At.load(s).then(o=>{At.set(r,o),a()})},data(){return{playlist:{},tracks:[],show_playlist_details_modal:!1}},computed:{uris(){return this.playlist.random?this.tracks.map(s=>s.uri).join(","):this.playlist.uri}},methods:{play:function(){f.player_play_uri(this.uris,!0)}}},Tf={class:"title is-4"},Rf={class:"buttons is-centered"},Ef=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),If=[Ef],Uf=t("span",{class:"icon"},[t("i",{class:"mdi mdi-shuffle"})],-1),Lf=t("span",null,"Shuffle",-1),Of=[Uf,Lf],Df={class:"heading has-text-centered-mobile"};function zf(s,e,a,r,o,i){const n=h("list-tracks"),c=h("modal-dialog-playlist"),p=h("content-with-heading");return l(),w(p,null,{"heading-left":d(()=>[t("div",Tf,m(o.playlist.name),1)]),"heading-right":d(()=>[t("div",Rf,[t("a",{class:"button is-small is-light is-rounded",onClick:e[0]||(e[0]=g=>o.show_playlist_details_modal=!0)},If),t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...g)=>i.play&&i.play(...g))},Of)])]),content:d(()=>[t("p",Df,m(o.tracks.length)+" tracks",1),u(n,{tracks:o.tracks,uris:i.uris},null,8,["tracks","uris"]),u(c,{show:o.show_playlist_details_modal,playlist:o.playlist,uris:i.uris,onClose:e[2]||(e[2]=g=>o.show_playlist_details_modal=!1)},null,8,["show","playlist","uris"])]),_:1})}var Nf=k(Af,[["render",zf]]);const Vf={name:"ModalDialogDirectory",props:["show","directory"],emits:["close"],methods:{play:function(){this.$emit("close"),f.player_play_expression('path starts with "'+this.directory.path+'" order by path asc',!1)},queue_add:function(){this.$emit("close"),f.queue_expression_add('path starts with "'+this.directory.path+'" order by path asc')},queue_add_next:function(){this.$emit("close"),f.queue_expression_add_next('path starts with "'+this.directory.path+'" order by path asc')}}},Bf={key:0,class:"modal is-active"},Mf={class:"modal-content fd-modal-card"},Ff={class:"card"},Gf={class:"card-content"},jf={class:"title is-4"},Kf={class:"card-footer"},Hf=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),Wf=t("span",{class:"is-size-7"},"Add",-1),Yf=[Hf,Wf],Qf=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-play"})],-1),Jf=t("span",{class:"is-size-7"},"Add Next",-1),Zf=[Qf,Jf],Xf=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),ty=t("span",{class:"is-size-7"},"Play",-1),sy=[Xf,ty];function ey(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",Bf,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",Mf,[t("div",Ff,[t("div",Gf,[t("p",jf,m(a.directory.path),1)]),t("footer",Kf,[t("a",{class:"card-footer-item has-text-dark",onClick:e[1]||(e[1]=(...n)=>i.queue_add&&i.queue_add(...n))},Yf),t("a",{class:"card-footer-item has-text-dark",onClick:e[2]||(e[2]=(...n)=>i.queue_add_next&&i.queue_add_next(...n))},Zf),t("a",{class:"card-footer-item has-text-dark",onClick:e[3]||(e[3]=(...n)=>i.play&&i.play(...n))},sy)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[4]||(e[4]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var iy=k(Vf,[["render",ey]]);const oy={name:"ListDirectories",components:{ModalDialogDirectory:iy},props:["directories"],data(){return{show_details_modal:!1,selected_directory:{}}},computed:{current_directory(){return this.$route.query&&this.$route.query.directory?this.$route.query.directory:"/"}},methods:{open_parent_directory:function(){this.current_directory.slice(0,this.current_directory.lastIndexOf("/"))===""||this.$store.state.config.directories.includes(this.current_directory)?this.$router.push({path:"/files"}):this.$router.push({path:"/files",query:{directory:this.current_directory.slice(0,this.current_directory.lastIndexOf("/"))}})},open_directory:function(s){this.$router.push({path:"/files",query:{directory:s.path}})},open_dialog:function(s){this.selected_directory=s,this.show_details_modal=!0}}},ay=bs('<figure class="media-left fd-has-action"><span class="icon"><i class="mdi mdi-subdirectory-arrow-left"></i></span></figure><div class="media-content fd-has-action is-clipped"><h1 class="title is-6">..</h1></div>',2),ny={class:"media-right"},ly=["onClick"],ry=t("figure",{class:"media-left fd-has-action"},[t("span",{class:"icon"},[t("i",{class:"mdi mdi-folder"})])],-1),dy={class:"media-content fd-has-action is-clipped"},_y={class:"title is-6"},cy={class:"subtitle is-7 has-text-grey-light"},uy={class:"media-right"},my=["onClick"],hy=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),py=[hy];function fy(s,e,a,r,o,i){const n=h("modal-dialog-directory");return l(),_(T,null,[s.$route.query.directory?(l(),_("div",{key:0,class:"media",onClick:e[0]||(e[0]=c=>i.open_parent_directory())},[ay,t("div",ny,[O(s.$slots,"actions")])])):y("",!0),(l(!0),_(T,null,I(a.directories,c=>(l(),_("div",{key:c.path,class:"media",onClick:p=>i.open_directory(c)},[ry,t("div",dy,[t("h1",_y,m(c.path.substring(c.path.lastIndexOf("/")+1)),1),t("h2",cy,m(c.path),1)]),t("div",uy,[t("a",{onClick:D(p=>i.open_dialog(c),["prevent","stop"])},py,8,my)])],8,ly))),128)),(l(),w(Q,{to:"#app"},[u(n,{show:o.show_details_modal,directory:o.selected_directory,onClose:e[1]||(e[1]=c=>o.show_details_modal=!1)},null,8,["show","directory"])]))],64)}var yy=k(oy,[["render",fy]]);const Tt={load:function(s){return s.query.directory?f.library_files(s.query.directory):Promise.resolve()},set:function(s,e){e?s.files=e.data:s.files={directories:s.$store.state.config.directories.map(a=>({path:a})),tracks:{items:[]},playlists:{items:[]}}}},gy={name:"PageFiles",components:{ContentWithHeading:R,ListDirectories:yy,ListPlaylists:hs,ListTracks:V},beforeRouteEnter(s,e,a){Tt.load(s).then(r=>{a(o=>Tt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;Tt.load(s).then(o=>{Tt.set(r,o),a()})},data(){return{files:{directories:[],tracks:{items:[]},playlists:{items:[]}}}},computed:{current_directory(){return this.$route.query&&this.$route.query.directory?this.$route.query.directory:"/"},play_expression(){return'path starts with "'+this.current_directory+'" order by path asc'}},methods:{play:function(){f.player_play_expression(this.play_expression,!1)}}},by=t("p",{class:"title is-4"},"Files",-1),ky={class:"title is-7 has-text-grey"},wy={class:"buttons is-centered"},vy=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),$y=[vy],xy=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),Cy=t("span",null,"Play",-1),qy=[xy,Cy];function Sy(s,e,a,r,o,i){const n=h("list-directories"),c=h("list-playlists"),p=h("list-tracks"),g=h("modal-dialog-directory"),b=h("content-with-heading");return l(),_("div",null,[u(b,null,{"heading-left":d(()=>[by,t("p",ky,m(i.current_directory),1)]),"heading-right":d(()=>[t("div",wy,[t("a",{class:"button is-small is-light is-rounded",onClick:e[0]||(e[0]=x=>s.open_directory_dialog({path:i.current_directory}))},$y),t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...x)=>i.play&&i.play(...x))},qy)])]),content:d(()=>[u(n,{directories:o.files.directories},null,8,["directories"]),u(c,{playlists:o.files.playlists.items},null,8,["playlists"]),u(p,{tracks:o.files.tracks.items,expression:i.play_expression,show_icon:!0},null,8,["tracks","expression"]),u(g,{show:s.show_directory_details_modal,directory:s.selected_directory,onClose:e[2]||(e[2]=x=>s.show_directory_details_modal=!1)},null,8,["show","directory"])]),_:1})])}var Py=k(gy,[["render",Sy]]);const Rt={load:function(s){return f.library_radio_streams()},set:function(s,e){s.tracks=e.data.tracks}},Ay={name:"PageRadioStreams",components:{ContentWithHeading:R,ListTracks:V},beforeRouteEnter(s,e,a){Rt.load(s).then(r=>{a(o=>Rt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;Rt.load(s).then(o=>{Rt.set(r,o),a()})},data(){return{tracks:{items:[]}}}},Ty=t("p",{class:"title is-4"},"Radio",-1),Ry={class:"heading has-text-centered-mobile"};function Ey(s,e,a,r,o,i){const n=h("list-tracks"),c=h("content-with-heading");return l(),_("div",null,[u(c,null,{"heading-left":d(()=>[Ty]),content:d(()=>[t("p",Ry,m(o.tracks.total)+" tracks ",1),u(n,{tracks:o.tracks.items},null,8,["tracks"])]),_:1})])}var Iy=k(Ay,[["render",Ey]]);const Uy={name:"ContentText"},Ly={class:"section fd-content py-3"},Oy={class:"container"},Dy={class:"columns is-centered"},zy={class:"column is-four-fifths"};function Ny(s,e,a,r,o,i){return l(),_("section",Ly,[t("div",Oy,[t("div",Dy,[t("div",zy,[O(s.$slots,"content")])])])])}var Ms=k(Uy,[["render",Ny]]);const Vy={name:"TabsSearch",props:["query"],computed:{spotify_enabled(){return this.$store.state.spotify.webapi_token_valid},route_query:function(){return this.query?{type:"track,artist,album,playlist,audiobook,podcast",query:this.query,limit:3,offset:0}:null}},methods:{search_library:function(){this.$store.commit(Yt,"/search/library"),this.$router.push({path:this.$store.state.search_path,query:this.route_query})},search_spotify:function(){this.$store.commit(Yt,"/search/spotify"),this.$router.push({path:this.$store.state.search_path,query:this.route_query})}}},By={key:0,class:"section fd-remove-padding-bottom"},My={class:"container"},Fy={class:"columns is-centered"},Gy={class:"column is-four-fifths"},jy={class:"tabs is-centered is-small is-toggle is-toggle-rounded"},Ky=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-library-books"})],-1),Hy=t("span",{class:""},"Library",-1),Wy=[Ky,Hy],Yy=t("span",{class:"icon is-small"},[t("i",{class:"mdi mdi-spotify"})],-1),Qy=t("span",{class:""},"Spotify",-1),Jy=[Yy,Qy];function Zy(s,e,a,r,o,i){return i.spotify_enabled?(l(),_("section",By,[t("div",My,[t("div",Fy,[t("div",Gy,[t("div",jy,[t("ul",null,[t("li",{class:C({"is-active":s.$store.state.search_path==="/search/library"})},[t("a",{onClick:e[0]||(e[0]=(...n)=>i.search_library&&i.search_library(...n))},Wy)],2),t("li",{class:C({"is-active":s.$store.state.search_path==="/search/spotify"})},[t("a",{onClick:e[1]||(e[1]=(...n)=>i.search_spotify&&i.search_spotify(...n))},Jy)],2)])])])])])])):y("",!0)}var Fs=k(Vy,[["render",Zy]]);const Xy={name:"PageSearch",components:{ContentWithHeading:R,ContentText:Ms,TabsSearch:Fs,ListTracks:V,ListArtists:ds,ListAlbums:j,ListPlaylists:hs,ListComposers:Ns},data(){return{search_query:"",tracks:{items:[],total:0},artists:new E,albums:new E,composers:{items:[],total:0},playlists:{items:[],total:0},audiobooks:new E,podcasts:new E}},computed:{recent_searches(){return this.$store.state.recent_searches},show_tracks(){return this.$route.query.type&&this.$route.query.type.includes("track")},show_all_tracks_button(){return this.tracks.total>this.tracks.items.length},show_artists(){return this.$route.query.type&&this.$route.query.type.includes("artist")},show_all_artists_button(){return this.artists.total>this.artists.items.length},show_albums(){return this.$route.query.type&&this.$route.query.type.includes("album")},show_all_albums_button(){return this.albums.total>this.albums.items.length},show_composers(){return this.$route.query.type&&this.$route.query.type.includes("composer")},show_all_composers_button(){return this.composers.total>this.composers.items.length},show_playlists(){return this.$route.query.type&&this.$route.query.type.includes("playlist")},show_all_playlists_button(){return this.playlists.total>this.playlists.items.length},show_audiobooks(){return this.$route.query.type&&this.$route.query.type.includes("audiobook")},show_all_audiobooks_button(){return this.audiobooks.total>this.audiobooks.items.length},show_podcasts(){return this.$route.query.type&&this.$route.query.type.includes("podcast")},show_all_podcasts_button(){return this.podcasts.total>this.podcasts.items.length},is_visible_artwork(){return this.$store.getters.settings_option("webinterface","show_cover_artwork_in_album_lists").value}},watch:{$route(s,e){this.search(s)}},mounted:function(){this.search(this.$route)},methods:{search:function(s){if(!s.query.query||s.query.query===""){this.search_query="",this.$refs.search_field.focus();return}this.search_query=s.query.query,this.searchMusic(s.query),this.searchAudiobooks(s.query),this.searchPodcasts(s.query),this.$store.commit(as,s.query.query)},searchMusic:function(s){if(s.type.indexOf("track")<0&&s.type.indexOf("artist")<0&&s.type.indexOf("album")<0&&s.type.indexOf("playlist")<0)return;const e={type:s.type,media_kind:"music"};s.query.startsWith("query:")?e.expression=s.query.replace(/^query:/,"").trim():e.query=s.query,s.limit&&(e.limit=s.limit,e.offset=s.offset),f.search(e).then(({data:a})=>{this.tracks=a.tracks?a.tracks:{items:[],total:0},this.artists=new E(a.artists),this.albums=new E(a.albums),this.composers=a.composers?a.composers:{items:[],total:0},this.playlists=a.playlists?a.playlists:{items:[],total:0}})},searchAudiobooks:function(s){if(s.type.indexOf("audiobook")<0)return;const e={type:"album",media_kind:"audiobook"};s.query.startsWith("query:")?e.expression=s.query.replace(/^query:/,"").trim():e.expression='((album includes "'+s.query+'" or artist includes "'+s.query+'") and media_kind is audiobook)',s.limit&&(e.limit=s.limit,e.offset=s.offset),f.search(e).then(({data:a})=>{this.audiobooks=new E(a.albums)})},searchPodcasts:function(s){if(s.type.indexOf("podcast")<0)return;const e={type:"album",media_kind:"podcast"};s.query.startsWith("query:")?e.expression=s.query.replace(/^query:/,"").trim():e.expression='((album includes "'+s.query+'" or artist includes "'+s.query+'") and media_kind is podcast)',s.limit&&(e.limit=s.limit,e.offset=s.offset),f.search(e).then(({data:a})=>{this.podcasts=new E(a.albums)})},new_search:function(){!this.search_query||(this.$router.push({path:this.$store.state.search_path,query:{type:"track,artist,album,playlist,audiobook,podcast,composer",query:this.search_query,limit:3,offset:0}}),this.$refs.search_field.blur())},open_search_tracks:function(){this.$router.push({path:"/search/library",query:{type:"track",query:this.$route.query.query}})},open_search_artists:function(){this.$router.push({path:"/search/library",query:{type:"artist",query:this.$route.query.query}})},open_search_albums:function(){this.$router.push({path:"/search/library",query:{type:"album",query:this.$route.query.query}})},open_search_composers:function(){this.$router.push({path:"/search/library",query:{type:"tracks",query:this.$route.query.query}})},open_search_playlists:function(){this.$router.push({path:"/search/library",query:{type:"playlist",query:this.$route.query.query}})},open_search_audiobooks:function(){this.$router.push({path:"/search/library",query:{type:"audiobook",query:this.$route.query.query}})},open_search_podcasts:function(){this.$router.push({path:"/search/library",query:{type:"podcast",query:this.$route.query.query}})},open_composer:function(s){this.$router.push({name:"ComposerAlbums",params:{composer:s.name}})},open_playlist:function(s){this.$router.push({path:"/playlists/"+s.id+"/tracks"})},open_recent_search:function(s){this.search_query=s,this.new_search()},open_track_dialog:function(s){this.selected_track=s,this.show_track_details_modal=!0},open_album_dialog:function(s){this.selected_album=s,this.show_album_details_modal=!0},open_artist_dialog:function(s){this.selected_artist=s,this.show_artist_details_modal=!0},open_composer_dialog:function(s){this.selected_composer=s,this.show_composer_details_modal=!0},open_playlist_dialog:function(s){this.selected_playlist=s,this.show_playlist_details_modal=!0}}},tg={class:"section fd-remove-padding-bottom"},sg={class:"container"},eg={class:"columns is-centered"},ig={class:"column is-four-fifths"},og={class:"field"},ag={class:"control is-expanded has-icons-left"},ng=t("span",{class:"icon is-left"},[t("i",{class:"mdi mdi-magnify"})],-1),lg=t("p",{class:"help has-text-centered"},[$(" Tip: you can search by a smart playlist query language "),t("a",{href:"https://github.com/owntone/owntone-server/blob/master/README_SMARTPL.md",target:"_blank"},"expression"),$(" if you prefix it with "),t("code",null,"query:"),$(". ")],-1),rg={class:"tags",style:{"margin-top":"16px"}},dg=["onClick"],_g=t("p",{class:"title is-4"},"Tracks",-1),cg={key:0,class:"level"},ug={class:"level-item"},mg=t("p",null,[t("i",null,"No tracks found")],-1),hg=t("p",{class:"title is-4"},"Artists",-1),pg={key:0,class:"level"},fg={class:"level-item"},yg=t("p",null,[t("i",null,"No artists found")],-1),gg=t("p",{class:"title is-4"},"Albums",-1),bg={key:0,class:"level"},kg={class:"level-item"},wg=t("p",null,[t("i",null,"No albums found")],-1),vg=t("p",{class:"title is-4"},"Composers",-1),$g={key:0,class:"level"},xg={class:"level-item"},Cg=t("p",null,[t("i",null,"No composers found")],-1),qg=t("p",{class:"title is-4"},"Playlists",-1),Sg={key:0,class:"level"},Pg={class:"level-item"},Ag=t("p",null,[t("i",null,"No playlists found")],-1),Tg=t("p",{class:"title is-4"},"Podcasts",-1),Rg={key:0,class:"level"},Eg={class:"level-item"},Ig=t("p",null,[t("i",null,"No podcasts found")],-1),Ug=t("p",{class:"title is-4"},"Audiobooks",-1),Lg={key:0,class:"level"},Og={class:"level-item"},Dg=t("p",null,[t("i",null,"No audiobooks found")],-1);function zg(s,e,a,r,o,i){const n=h("tabs-search"),c=h("list-tracks"),p=h("content-with-heading"),g=h("content-text"),b=h("list-artists"),x=h("list-albums"),q=h("list-composers"),z=h("list-playlists");return l(),_("div",null,[t("section",tg,[t("div",sg,[t("div",eg,[t("div",ig,[t("form",{onSubmit:e[1]||(e[1]=D((...S)=>i.new_search&&i.new_search(...S),["prevent"]))},[t("div",og,[t("p",ag,[U(t("input",{ref:"search_field","onUpdate:modelValue":e[0]||(e[0]=S=>o.search_query=S),class:"input is-rounded is-shadowless",type:"text",placeholder:"Search",autocomplete:"off"},null,512),[[M,o.search_query]]),ng]),lg])],32),t("div",rg,[(l(!0),_(T,null,I(i.recent_searches,S=>(l(),_("a",{key:S,class:"tag",onClick:W=>i.open_recent_search(S)},m(S),9,dg))),128))])])])])]),u(n,{query:o.search_query},null,8,["query"]),i.show_tracks&&o.tracks.total?(l(),w(p,{key:0},{"heading-left":d(()=>[_g]),content:d(()=>[u(c,{tracks:o.tracks.items},null,8,["tracks"])]),footer:d(()=>[i.show_all_tracks_button?(l(),_("nav",cg,[t("p",ug,[t("a",{class:"button is-light is-small is-rounded",onClick:e[2]||(e[2]=(...S)=>i.open_search_tracks&&i.open_search_tracks(...S))},"Show all "+m(o.tracks.total.toLocaleString())+" tracks",1)])])):y("",!0)]),_:1})):y("",!0),i.show_tracks&&!o.tracks.total?(l(),w(g,{key:1,class:"mt-6"},{content:d(()=>[mg]),_:1})):y("",!0),i.show_artists&&o.artists.total?(l(),w(p,{key:2},{"heading-left":d(()=>[hg]),content:d(()=>[u(b,{artists:o.artists,hide_group_title:!0},null,8,["artists"])]),footer:d(()=>[i.show_all_artists_button?(l(),_("nav",pg,[t("p",fg,[t("a",{class:"button is-light is-small is-rounded",onClick:e[3]||(e[3]=(...S)=>i.open_search_artists&&i.open_search_artists(...S))},"Show all "+m(o.artists.total.toLocaleString())+" artists",1)])])):y("",!0)]),_:1})):y("",!0),i.show_artists&&!o.artists.total?(l(),w(g,{key:3},{content:d(()=>[yg]),_:1})):y("",!0),i.show_albums&&o.albums.total?(l(),w(p,{key:4},{"heading-left":d(()=>[gg]),content:d(()=>[u(x,{albums:o.albums,hide_group_title:!0},null,8,["albums"])]),footer:d(()=>[i.show_all_albums_button?(l(),_("nav",bg,[t("p",kg,[t("a",{class:"button is-light is-small is-rounded",onClick:e[4]||(e[4]=(...S)=>i.open_search_albums&&i.open_search_albums(...S))},"Show all "+m(o.albums.total.toLocaleString())+" albums",1)])])):y("",!0)]),_:1})):y("",!0),i.show_albums&&!o.albums.total?(l(),w(g,{key:5},{content:d(()=>[wg]),_:1})):y("",!0),i.show_composers&&o.composers.total?(l(),w(p,{key:6},{"heading-left":d(()=>[vg]),content:d(()=>[u(q,{composers:o.composers.items},null,8,["composers"])]),footer:d(()=>[i.show_all_composers_button?(l(),_("nav",$g,[t("p",xg,[t("a",{class:"button is-light is-small is-rounded",onClick:e[5]||(e[5]=(...S)=>i.open_search_composers&&i.open_search_composers(...S))},"Show all "+m(o.composers.total)+" composers",1)])])):y("",!0)]),_:1})):y("",!0),i.show_composers&&!o.composers.total?(l(),w(g,{key:7},{content:d(()=>[Cg]),_:1})):y("",!0),i.show_playlists&&o.playlists.total?(l(),w(p,{key:8},{"heading-left":d(()=>[qg]),content:d(()=>[u(z,{playlists:o.playlists.items},null,8,["playlists"])]),footer:d(()=>[i.show_all_playlists_button?(l(),_("nav",Sg,[t("p",Pg,[t("a",{class:"button is-light is-small is-rounded",onClick:e[6]||(e[6]=(...S)=>i.open_search_playlists&&i.open_search_playlists(...S))},"Show all "+m(o.playlists.total.toLocaleString())+" playlists",1)])])):y("",!0)]),_:1})):y("",!0),i.show_playlists&&!o.playlists.total?(l(),w(g,{key:9},{content:d(()=>[Ag]),_:1})):y("",!0),i.show_podcasts&&o.podcasts.total?(l(),w(p,{key:10},{"heading-left":d(()=>[Tg]),content:d(()=>[u(x,{albums:o.podcasts},null,8,["albums"])]),footer:d(()=>[i.show_all_podcasts_button?(l(),_("nav",Rg,[t("p",Eg,[t("a",{class:"button is-light is-small is-rounded",onClick:e[7]||(e[7]=(...S)=>i.open_search_podcasts&&i.open_search_podcasts(...S))},"Show all "+m(o.podcasts.total.toLocaleString())+" podcasts",1)])])):y("",!0)]),_:1})):y("",!0),i.show_podcasts&&!o.podcasts.total?(l(),w(g,{key:11},{content:d(()=>[Ig]),_:1})):y("",!0),i.show_audiobooks&&o.audiobooks.total?(l(),w(p,{key:12},{"heading-left":d(()=>[Ug]),content:d(()=>[u(x,{albums:o.audiobooks},null,8,["albums"])]),footer:d(()=>[i.show_all_audiobooks_button?(l(),_("nav",Lg,[t("p",Og,[t("a",{class:"button is-light is-small is-rounded",onClick:e[8]||(e[8]=(...S)=>i.open_search_audiobooks&&i.open_search_audiobooks(...S))},"Show all "+m(o.audiobooks.total.toLocaleString())+" audiobooks",1)])])):y("",!0)]),_:1})):y("",!0),i.show_audiobooks&&!o.audiobooks.total?(l(),w(g,{key:13},{content:d(()=>[Dg]),_:1})):y("",!0)])}var Ng=k(Xy,[["render",zg]]);const Vg={name:"PageAbout",data(){return{show_update_dropdown:!1,show_update_library:!1}},computed:{config(){return this.$store.state.config},library(){return this.$store.state.library}},methods:{onClickOutside(s){this.show_update_dropdown=!1},showUpdateDialog(){this.$store.commit(ot,!0)}}},Bg={class:"section"},Mg={class:"container"},Fg={class:"columns is-centered"},Gg={class:"column is-four-fifths has-text-centered-mobile"},jg={class:"heading"},Kg=t("b",null,"OwnTone",-1),Hg={class:"title is-4"},Wg={class:"section"},Yg={class:"container"},Qg={class:"columns is-centered"},Jg={class:"column is-four-fifths"},Zg={class:"content"},Xg={class:"level is-mobile"},tb=t("div",{class:"level-left"},[t("div",{class:"level-item"},[t("h2",{class:"title is-5"},"Library")])],-1),sb={class:"level-right"},eb={key:0},ib=t("a",{class:"button is-small is-loading"},"Update",-1),ob=[ib],ab={key:1},nb={class:"table"},lb=t("th",null,"Artists",-1),rb={class:"has-text-right"},db=t("th",null,"Albums",-1),_b={class:"has-text-right"},cb=t("th",null,"Tracks",-1),ub={class:"has-text-right"},mb=t("th",null,"Total playtime",-1),hb={class:"has-text-right"},pb=t("th",null,"Library updated",-1),fb={class:"has-text-right"},yb={class:"has-text-grey"},gb=t("th",null,"Uptime",-1),bb={class:"has-text-right"},kb={class:"has-text-grey"},wb={class:"section"},vb={class:"container"},$b={class:"columns is-centered"},xb={class:"column is-four-fifths"},Cb={class:"content has-text-centered-mobile"},qb={class:"is-size-7"},Sb=bs('<p class="is-size-7"> Web interface built with <a href="http://bulma.io">Bulma</a>, <a href="https://materialdesignicons.com/">Material Design Icons</a>, <a href="https://vuejs.org/">Vue.js</a>, <a href="https://github.com/mzabriskie/axios">axios</a> and <a href="https://github.com/owntone/owntone-server/network/dependencies">more</a>. </p>',1);function Pb(s,e,a,r,o,i){return l(),_("div",null,[t("section",Bg,[t("div",Mg,[t("div",Fg,[t("div",Gg,[t("p",jg,[Kg,$(" - version "+m(i.config.version),1)]),t("h1",Hg,m(i.config.library_name),1)])])])]),t("section",Wg,[t("div",Yg,[t("div",Qg,[t("div",Jg,[t("div",Zg,[t("nav",Xg,[tb,t("div",sb,[i.library.updating?(l(),_("div",eb,ob)):(l(),_("div",ab,[t("a",{class:"button is-small",onClick:e[0]||(e[0]=n=>i.showUpdateDialog())},"Update")]))])]),t("table",nb,[t("tbody",null,[t("tr",null,[lb,t("td",rb,m(s.$filters.number(i.library.artists)),1)]),t("tr",null,[db,t("td",_b,m(s.$filters.number(i.library.albums)),1)]),t("tr",null,[cb,t("td",ub,m(s.$filters.number(i.library.songs)),1)]),t("tr",null,[mb,t("td",hb,m(s.$filters.duration(i.library.db_playtime*1e3,"y [years], d [days], h [hours], m [minutes]")),1)]),t("tr",null,[pb,t("td",fb,[$(m(s.$filters.timeFromNow(i.library.updated_at))+" ",1),t("span",yb,"("+m(s.$filters.time(i.library.updated_at,"lll"))+")",1)])]),t("tr",null,[gb,t("td",bb,[$(m(s.$filters.timeFromNow(i.library.started_at,!0))+" ",1),t("span",kb,"("+m(s.$filters.time(i.library.started_at,"ll"))+")",1)])])])])])])])])]),t("section",wb,[t("div",vb,[t("div",$b,[t("div",xb,[t("div",Cb,[t("p",qb," Compiled with support for "+m(i.config.buildoptions.join(", "))+". ",1),Sb])])])])])])}var Ab=k(Vg,[["render",Pb]]);const Tb={name:"SpotifyListItemAlbum",props:["album"]},Rb={class:"media"},Eb={key:0,class:"media-left fd-has-action"},Ib={class:"media-content fd-has-action is-clipped"},Ub={class:"title is-6"},Lb={class:"subtitle is-7 has-text-grey"},Ob={class:"subtitle is-7 has-text-grey has-text-weight-normal"},Db={class:"media-right"};function zb(s,e,a,r,o,i){return l(),_("div",Rb,[s.$slots.artwork?(l(),_("div",Eb,[O(s.$slots,"artwork")])):y("",!0),t("div",Ib,[t("h1",Ub,m(a.album.name),1),t("h2",Lb,[t("b",null,m(a.album.artists[0].name),1)]),t("h2",Ob," ("+m(a.album.album_type)+", "+m(s.$filters.time(a.album.release_date,"L"))+") ",1)]),t("div",Db,[O(s.$slots,"actions")])])}var jt=k(Tb,[["render",zb]]);const Nb={name:"SpotifyListItemPlaylist",props:["playlist"],methods:{open_playlist:function(){this.$router.push({path:"/music/spotify/playlists/"+this.playlist.id})}}},Vb={class:"media"},Bb={class:"title is-6"},Mb={class:"subtitle is-7"},Fb={class:"media-right"};function Gb(s,e,a,r,o,i){return l(),_("div",Vb,[t("div",{class:"media-content fd-has-action is-clipped",onClick:e[0]||(e[0]=(...n)=>i.open_playlist&&i.open_playlist(...n))},[t("h1",Bb,m(a.playlist.name),1),t("h2",Mb,m(a.playlist.owner.display_name),1)]),t("div",Fb,[O(s.$slots,"actions")])])}var ps=k(Nb,[["render",Gb]]);const jb={name:"SpotifyModalDialogAlbum",props:["show","album"],emits:["close"],data(){return{artwork_visible:!1}},computed:{artwork_url:function(){return this.album.images&&this.album.images.length>0?this.album.images[0].url:""}},methods:{play:function(){this.$emit("close"),f.player_play_uri(this.album.uri,!1)},queue_add:function(){this.$emit("close"),f.queue_add(this.album.uri)},queue_add_next:function(){this.$emit("close"),f.queue_add_next(this.album.uri)},open_album:function(){this.$router.push({path:"/music/spotify/albums/"+this.album.id})},open_artist:function(){this.$router.push({path:"/music/spotify/artists/"+this.album.artists[0].id})},artwork_loaded:function(){this.artwork_visible=!0},artwork_error:function(){this.artwork_visible=!1}}},Kb={key:0,class:"modal is-active"},Hb={class:"modal-content fd-modal-card"},Wb={class:"card"},Yb={class:"card-content"},Qb={class:"image is-square fd-has-margin-bottom"},Jb=["src"],Zb={class:"title is-4"},Xb={class:"content is-small"},t1=t("span",{class:"heading"},"Album artist",-1),s1=t("span",{class:"heading"},"Release date",-1),e1={class:"title is-6"},i1=t("span",{class:"heading"},"Type",-1),o1={class:"title is-6"},a1={class:"card-footer"},n1=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),l1=t("span",{class:"is-size-7"},"Add",-1),r1=[n1,l1],d1=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-play"})],-1),_1=t("span",{class:"is-size-7"},"Add Next",-1),c1=[d1,_1],u1=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),m1=t("span",{class:"is-size-7"},"Play",-1),h1=[u1,m1];function p1(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",Kb,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",Hb,[t("div",Wb,[t("div",Yb,[U(t("figure",Qb,[t("img",{src:i.artwork_url,class:"fd-has-shadow",onLoad:e[1]||(e[1]=(...n)=>i.artwork_loaded&&i.artwork_loaded(...n)),onError:e[2]||(e[2]=(...n)=>i.artwork_error&&i.artwork_error(...n))},null,40,Jb)],512),[[zt,o.artwork_visible]]),t("p",Zb,[t("a",{class:"has-text-link",onClick:e[3]||(e[3]=(...n)=>i.open_album&&i.open_album(...n))},m(a.album.name),1)]),t("div",Xb,[t("p",null,[t1,t("a",{class:"title is-6 has-text-link",onClick:e[4]||(e[4]=(...n)=>i.open_artist&&i.open_artist(...n))},m(a.album.artists[0].name),1)]),t("p",null,[s1,t("span",e1,m(s.$filters.time(a.album.release_date,"L")),1)]),t("p",null,[i1,t("span",o1,m(a.album.album_type),1)])])]),t("footer",a1,[t("a",{class:"card-footer-item has-text-dark",onClick:e[5]||(e[5]=(...n)=>i.queue_add&&i.queue_add(...n))},r1),t("a",{class:"card-footer-item has-text-dark",onClick:e[6]||(e[6]=(...n)=>i.queue_add_next&&i.queue_add_next(...n))},c1),t("a",{class:"card-footer-item has-text-dark",onClick:e[7]||(e[7]=(...n)=>i.play&&i.play(...n))},h1)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[8]||(e[8]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var at=k(jb,[["render",p1]]);const f1={name:"SpotifyModalDialogPlaylist",props:["show","playlist"],emits:["close"],methods:{play:function(){this.$emit("close"),f.player_play_uri(this.playlist.uri,!1)},queue_add:function(){this.$emit("close"),f.queue_add(this.playlist.uri)},queue_add_next:function(){this.$emit("close"),f.queue_add_next(this.playlist.uri)},open_playlist:function(){this.$router.push({path:"/music/spotify/playlists/"+this.playlist.id})}}},y1={key:0,class:"modal is-active"},g1={class:"modal-content fd-modal-card"},b1={class:"card"},k1={class:"card-content"},w1={class:"title is-4"},v1={class:"content is-small"},$1=t("span",{class:"heading"},"Owner",-1),x1={class:"title is-6"},C1=t("span",{class:"heading"},"Tracks",-1),q1={class:"title is-6"},S1=t("span",{class:"heading"},"Path",-1),P1={class:"title is-6"},A1={class:"card-footer"},T1=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),R1=t("span",{class:"is-size-7"},"Add",-1),E1=[T1,R1],I1=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-play"})],-1),U1=t("span",{class:"is-size-7"},"Add Next",-1),L1=[I1,U1],O1=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),D1=t("span",{class:"is-size-7"},"Play",-1),z1=[O1,D1];function N1(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",y1,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",g1,[t("div",b1,[t("div",k1,[t("p",w1,[t("a",{class:"has-text-link",onClick:e[1]||(e[1]=(...n)=>i.open_playlist&&i.open_playlist(...n))},m(a.playlist.name),1)]),t("div",v1,[t("p",null,[$1,t("span",x1,m(a.playlist.owner.display_name),1)]),t("p",null,[C1,t("span",q1,m(a.playlist.tracks.total),1)]),t("p",null,[S1,t("span",P1,m(a.playlist.uri),1)])])]),t("footer",A1,[t("a",{class:"card-footer-item has-text-dark",onClick:e[2]||(e[2]=(...n)=>i.queue_add&&i.queue_add(...n))},E1),t("a",{class:"card-footer-item has-text-dark",onClick:e[3]||(e[3]=(...n)=>i.queue_add_next&&i.queue_add_next(...n))},L1),t("a",{class:"card-footer-item has-text-dark",onClick:e[4]||(e[4]=(...n)=>i.play&&i.play(...n))},z1)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[5]||(e[5]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var Kt=k(f1,[["render",N1]]);const Et={load:function(s){if(A.state.spotify_new_releases.length>0&&A.state.spotify_featured_playlists.length>0)return Promise.resolve();const e=new F;return e.setAccessToken(A.state.spotify.webapi_token),Promise.all([e.getNewReleases({country:A.state.spotify.webapi_country,limit:50}),e.getFeaturedPlaylists({country:A.state.spotify.webapi_country,limit:50})])},set:function(s,e){e&&(A.commit(is,e[0].albums.items),A.commit(os,e[1].playlists.items))}},V1={name:"SpotifyPageBrowse",components:{ContentWithHeading:R,TabsMusic:G,SpotifyListItemAlbum:jt,SpotifyListItemPlaylist:ps,SpotifyModalDialogAlbum:at,SpotifyModalDialogPlaylist:Kt,CoverArtwork:K},beforeRouteEnter(s,e,a){Et.load(s).then(r=>{a(o=>Et.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;Et.load(s).then(o=>{Et.set(r,o),a()})},data(){return{show_album_details_modal:!1,selected_album:{},show_playlist_details_modal:!1,selected_playlist:{}}},computed:{new_releases(){return this.$store.state.spotify_new_releases.slice(0,3)},featured_playlists(){return this.$store.state.spotify_featured_playlists.slice(0,3)},is_visible_artwork(){return this.$store.getters.settings_option("webinterface","show_cover_artwork_in_album_lists").value}},methods:{open_album:function(s){this.$router.push({path:"/music/spotify/albums/"+s.id})},open_album_dialog:function(s){this.selected_album=s,this.show_album_details_modal=!0},open_playlist_dialog:function(s){this.selected_playlist=s,this.show_playlist_details_modal=!0},artwork_url:function(s){return s.images&&s.images.length>0?s.images[0].url:""}}},B1={class:"fd-page-with-tabs"},M1=t("p",{class:"title is-4"},"New Releases",-1),F1={class:"image is-64x64 fd-has-shadow fd-has-action"},G1=["onClick"],j1=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),K1=[j1],H1={class:"level"},W1={class:"level-item"},Y1=$(" Show more "),Q1=t("p",{class:"title is-4"},"Featured Playlists",-1),J1=["onClick"],Z1=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),X1=[Z1],tk={class:"level"},sk={class:"level-item"},ek=$(" Show more ");function ik(s,e,a,r,o,i){const n=h("tabs-music"),c=h("cover-artwork"),p=h("spotify-list-item-album"),g=h("spotify-modal-dialog-album"),b=h("router-link"),x=h("content-with-heading"),q=h("spotify-list-item-playlist"),z=h("spotify-modal-dialog-playlist");return l(),_("div",B1,[u(n),u(x,null,{"heading-left":d(()=>[M1]),content:d(()=>[(l(!0),_(T,null,I(i.new_releases,S=>(l(),w(p,{key:S.id,album:S,onClick:W=>i.open_album(S)},Vt({actions:d(()=>[t("a",{onClick:W=>i.open_album_dialog(S)},K1,8,G1)]),_:2},[i.is_visible_artwork?{name:"artwork",fn:d(()=>[t("p",F1,[u(c,{artwork_url:i.artwork_url(S),artist:S.artist,album:S.name,maxwidth:64,maxheight:64},null,8,["artwork_url","artist","album"])])])}:void 0]),1032,["album","onClick"]))),128)),u(g,{show:o.show_album_details_modal,album:o.selected_album,onClose:e[0]||(e[0]=S=>o.show_album_details_modal=!1)},null,8,["show","album"])]),footer:d(()=>[t("nav",H1,[t("p",W1,[u(b,{to:"/music/spotify/new-releases",class:"button is-light is-small is-rounded"},{default:d(()=>[Y1]),_:1})])])]),_:1}),u(x,null,{"heading-left":d(()=>[Q1]),content:d(()=>[(l(!0),_(T,null,I(i.featured_playlists,S=>(l(),w(q,{key:S.id,playlist:S},{actions:d(()=>[t("a",{onClick:W=>i.open_playlist_dialog(S)},X1,8,J1)]),_:2},1032,["playlist"]))),128)),u(z,{show:o.show_playlist_details_modal,playlist:o.selected_playlist,onClose:e[1]||(e[1]=S=>o.show_playlist_details_modal=!1)},null,8,["show","playlist"])]),footer:d(()=>[t("nav",tk,[t("p",sk,[u(b,{to:"/music/spotify/featured-playlists",class:"button is-light is-small is-rounded"},{default:d(()=>[ek]),_:1})])])]),_:1})])}var ok=k(V1,[["render",ik]]);const It={load:function(s){if(A.state.spotify_new_releases.length>0)return Promise.resolve();const e=new F;return e.setAccessToken(A.state.spotify.webapi_token),e.getNewReleases({country:A.state.spotify.webapi_country,limit:50})},set:function(s,e){e&&A.commit(is,e.albums.items)}},ak={name:"SpotifyPageBrowseNewReleases",components:{ContentWithHeading:R,TabsMusic:G,SpotifyListItemAlbum:jt,SpotifyModalDialogAlbum:at,CoverArtwork:K},beforeRouteEnter(s,e,a){It.load(s).then(r=>{a(o=>It.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;It.load(s).then(o=>{It.set(r,o),a()})},data(){return{show_album_details_modal:!1,selected_album:{}}},computed:{new_releases(){return this.$store.state.spotify_new_releases},is_visible_artwork(){return this.$store.getters.settings_option("webinterface","show_cover_artwork_in_album_lists").value}},methods:{open_album:function(s){this.$router.push({path:"/music/spotify/albums/"+s.id})},open_album_dialog:function(s){this.selected_album=s,this.show_album_details_modal=!0},artwork_url:function(s){return s.images&&s.images.length>0?s.images[0].url:""}}},nk={class:"fd-page-with-tabs"},lk=t("p",{class:"title is-4"},"New Releases",-1),rk={class:"image is-64x64 fd-has-shadow fd-has-action"},dk=["onClick"],_k=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),ck=[_k];function uk(s,e,a,r,o,i){const n=h("tabs-music"),c=h("cover-artwork"),p=h("spotify-list-item-album"),g=h("spotify-modal-dialog-album"),b=h("content-with-heading");return l(),_("div",nk,[u(n),u(b,null,{"heading-left":d(()=>[lk]),content:d(()=>[(l(!0),_(T,null,I(i.new_releases,x=>(l(),w(p,{key:x.id,album:x,onClick:q=>i.open_album(x)},Vt({actions:d(()=>[t("a",{onClick:q=>i.open_album_dialog(x)},ck,8,dk)]),_:2},[i.is_visible_artwork?{name:"artwork",fn:d(()=>[t("p",rk,[u(c,{artwork_url:i.artwork_url(x),artist:x.artist,album:x.name,maxwidth:64,maxheight:64},null,8,["artwork_url","artist","album"])])])}:void 0]),1032,["album","onClick"]))),128)),u(g,{show:o.show_album_details_modal,album:o.selected_album,onClose:e[0]||(e[0]=x=>o.show_album_details_modal=!1)},null,8,["show","album"])]),_:1})])}var mk=k(ak,[["render",uk]]);const Ut={load:function(s){if(A.state.spotify_featured_playlists.length>0)return Promise.resolve();const e=new F;e.setAccessToken(A.state.spotify.webapi_token),e.getFeaturedPlaylists({country:A.state.spotify.webapi_country,limit:50})},set:function(s,e){e&&A.commit(os,e.playlists.items)}},hk={name:"SpotifyPageBrowseFeaturedPlaylists",components:{ContentWithHeading:R,TabsMusic:G,SpotifyListItemPlaylist:ps,SpotifyModalDialogPlaylist:Kt},beforeRouteEnter(s,e,a){Ut.load(s).then(r=>{a(o=>Ut.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;Ut.load(s).then(o=>{Ut.set(r,o),a()})},data(){return{show_playlist_details_modal:!1,selected_playlist:{}}},computed:{featured_playlists(){return this.$store.state.spotify_featured_playlists}},methods:{open_playlist_dialog:function(s){this.selected_playlist=s,this.show_playlist_details_modal=!0}}},pk={class:"fd-page-with-tabs"},fk=t("p",{class:"title is-4"},"Featured Playlists",-1),yk=["onClick"],gk=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),bk=[gk];function kk(s,e,a,r,o,i){const n=h("tabs-music"),c=h("spotify-list-item-playlist"),p=h("spotify-modal-dialog-playlist"),g=h("content-with-heading");return l(),_("div",pk,[u(n),u(g,null,{"heading-left":d(()=>[fk]),content:d(()=>[(l(!0),_(T,null,I(i.featured_playlists,b=>(l(),w(c,{key:b.id,playlist:b},{actions:d(()=>[t("a",{onClick:x=>i.open_playlist_dialog(b)},bk,8,yk)]),_:2},1032,["playlist"]))),128)),u(p,{show:o.show_playlist_details_modal,playlist:o.selected_playlist,onClose:e[0]||(e[0]=b=>o.show_playlist_details_modal=!1)},null,8,["show","playlist"])]),_:1})])}var wk=k(hk,[["render",kk]]);const vk={name:"SpotifyModalDialogArtist",props:["show","artist"],emits:["close"],methods:{play:function(){this.$emit("close"),f.player_play_uri(this.artist.uri,!1)},queue_add:function(){this.$emit("close"),f.queue_add(this.artist.uri)},queue_add_next:function(){this.$emit("close"),f.queue_add_next(this.artist.uri)},open_artist:function(){this.$router.push({path:"/music/spotify/artists/"+this.artist.id})}}},$k={key:0,class:"modal is-active"},xk={class:"modal-content fd-modal-card"},Ck={class:"card"},qk={class:"card-content"},Sk={class:"title is-4"},Pk={class:"content is-small"},Ak=t("span",{class:"heading"},"Popularity / Followers",-1),Tk={class:"title is-6"},Rk=t("span",{class:"heading"},"Genres",-1),Ek={class:"title is-6"},Ik={class:"card-footer"},Uk=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),Lk=t("span",{class:"is-size-7"},"Add",-1),Ok=[Uk,Lk],Dk=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-play"})],-1),zk=t("span",{class:"is-size-7"},"Add Next",-1),Nk=[Dk,zk],Vk=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),Bk=t("span",{class:"is-size-7"},"Play",-1),Mk=[Vk,Bk];function Fk(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",$k,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",xk,[t("div",Ck,[t("div",qk,[t("p",Sk,[t("a",{class:"has-text-link",onClick:e[1]||(e[1]=(...n)=>i.open_artist&&i.open_artist(...n))},m(a.artist.name),1)]),t("div",Pk,[t("p",null,[Ak,t("span",Tk,m(a.artist.popularity)+" / "+m(a.artist.followers.total),1)]),t("p",null,[Rk,t("span",Ek,m(a.artist.genres.join(", ")),1)])])]),t("footer",Ik,[t("a",{class:"card-footer-item has-text-dark",onClick:e[2]||(e[2]=(...n)=>i.queue_add&&i.queue_add(...n))},Ok),t("a",{class:"card-footer-item has-text-dark",onClick:e[3]||(e[3]=(...n)=>i.queue_add_next&&i.queue_add_next(...n))},Nk),t("a",{class:"card-footer-item has-text-dark",onClick:e[4]||(e[4]=(...n)=>i.play&&i.play(...n))},Mk)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[5]||(e[5]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var Gs=k(vk,[["render",Fk]]);const Qt=50,Lt={load:function(s){const e=new F;return e.setAccessToken(A.state.spotify.webapi_token),Promise.all([e.getArtist(s.params.artist_id),e.getArtistAlbums(s.params.artist_id,{limit:Qt,offset:0,include_groups:"album,single",market:A.state.spotify.webapi_country})])},set:function(s,e){s.artist=e[0],s.albums=[],s.total=0,s.offset=0,s.append_albums(e[1])}},Gk={name:"SpotifyPageArtist",components:{ContentWithHeading:R,SpotifyListItemAlbum:jt,SpotifyModalDialogAlbum:at,SpotifyModalDialogArtist:Gs,VueEternalLoading:ss.exports.VueEternalLoading,CoverArtwork:K},beforeRouteEnter(s,e,a){Lt.load(s).then(r=>{a(o=>Lt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;Lt.load(s).then(o=>{Lt.set(r,o),a()})},data(){return{artist:{},albums:[],total:0,offset:0,show_details_modal:!1,selected_album:{},show_artist_details_modal:!1}},computed:{is_visible_artwork(){return this.$store.getters.settings_option("webinterface","show_cover_artwork_in_album_lists").value}},methods:{load_next:function({loaded:s}){const e=new F;e.setAccessToken(this.$store.state.spotify.webapi_token),e.getArtistAlbums(this.artist.id,{limit:Qt,offset:this.offset,include_groups:"album,single"}).then(a=>{this.append_albums(a),s(a.items.length,Qt)})},append_albums:function(s){this.albums=this.albums.concat(s.items),this.total=s.total,this.offset+=s.limit},play:function(){this.show_details_modal=!1,f.player_play_uri(this.artist.uri,!0)},open_album:function(s){this.$router.push({path:"/music/spotify/albums/"+s.id})},open_dialog:function(s){this.selected_album=s,this.show_details_modal=!0},artwork_url:function(s){return s.images&&s.images.length>0?s.images[0].url:""}}},jk={class:"title is-4"},Kk={class:"buttons is-centered"},Hk=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),Wk=[Hk],Yk=t("span",{class:"icon"},[t("i",{class:"mdi mdi-shuffle"})],-1),Qk=t("span",null,"Shuffle",-1),Jk=[Yk,Qk],Zk={class:"heading has-text-centered-mobile"},Xk={class:"image is-64x64 fd-has-shadow fd-has-action"},tw=["onClick"],sw=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),ew=[sw],iw=$(" . ");function ow(s,e,a,r,o,i){const n=h("cover-artwork"),c=h("spotify-list-item-album"),p=h("VueEternalLoading"),g=h("spotify-modal-dialog-album"),b=h("spotify-modal-dialog-artist"),x=h("content-with-heading");return l(),w(x,null,{"heading-left":d(()=>[t("p",jk,m(o.artist.name),1)]),"heading-right":d(()=>[t("div",Kk,[t("a",{class:"button is-small is-light is-rounded",onClick:e[0]||(e[0]=q=>o.show_artist_details_modal=!0)},Wk),t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...q)=>i.play&&i.play(...q))},Jk)])]),content:d(()=>[t("p",Zk,m(o.total)+" albums",1),(l(!0),_(T,null,I(o.albums,q=>(l(),w(c,{key:q.id,album:q,onClick:z=>i.open_album(q)},Vt({actions:d(()=>[t("a",{onClick:D(z=>i.open_dialog(q),["prevent","stop"])},ew,8,tw)]),_:2},[i.is_visible_artwork?{name:"artwork",fn:d(()=>[t("p",Xk,[u(n,{artwork_url:i.artwork_url(q),artist:q.artist,album:q.name,maxwidth:64,maxheight:64},null,8,["artwork_url","artist","album"])])])}:void 0]),1032,["album","onClick"]))),128)),o.offset<o.total?(l(),w(p,{key:0,load:i.load_next},{"no-more":d(()=>[iw]),_:1},8,["load"])):y("",!0),u(g,{show:o.show_details_modal,album:o.selected_album,onClose:e[2]||(e[2]=q=>o.show_details_modal=!1)},null,8,["show","album"]),u(b,{show:o.show_artist_details_modal,artist:o.artist,onClose:e[3]||(e[3]=q=>o.show_artist_details_modal=!1)},null,8,["show","artist"])]),_:1})}var aw=k(Gk,[["render",ow]]);const nw={name:"SpotifyListItemTrack",props:["track","position","album","context_uri"],methods:{play:function(){f.player_play_uri(this.context_uri,!1,this.position)}}},lw={class:"media"},rw={key:0,class:"subtitle is-7"},dw=$(" (Track is not playable"),_w={key:0},cw=$(") "),uw={class:"media-right"};function mw(s,e,a,r,o,i){return l(),_("div",lw,[t("div",{class:"media-content fd-has-action is-clipped",onClick:e[0]||(e[0]=(...n)=>i.play&&i.play(...n))},[t("h1",{class:C(["title is-6",{"has-text-grey-light":a.track.is_playable===!1}])},m(a.track.name),3),t("h2",{class:C(["subtitle is-7",{"has-text-grey":a.track.is_playable,"has-text-grey-light":a.track.is_playable===!1}])},[t("b",null,m(a.track.artists[0].name),1)],2),a.track.is_playable===!1?(l(),_("h2",rw,[dw,a.track.restrictions&&a.track.restrictions.reason?(l(),_("span",_w,", restriction reason: "+m(a.track.restrictions.reason),1)):y("",!0),cw])):y("",!0)]),t("div",uw,[O(s.$slots,"actions")])])}var fs=k(nw,[["render",mw]]);const hw={name:"SpotifyModalDialogTrack",props:["show","track","album"],emits:["close"],methods:{play:function(){this.$emit("close"),f.player_play_uri(this.track.uri,!1)},queue_add:function(){this.$emit("close"),f.queue_add(this.track.uri)},queue_add_next:function(){this.$emit("close"),f.queue_add_next(this.track.uri)},open_album:function(){this.$router.push({path:"/music/spotify/albums/"+this.album.id})},open_artist:function(){this.$router.push({path:"/music/spotify/artists/"+this.album.artists[0].id})}}},pw={key:0,class:"modal is-active"},fw={class:"modal-content fd-modal-card"},yw={class:"card"},gw={class:"card-content"},bw={class:"title is-4"},kw={class:"subtitle"},ww={class:"content is-small"},vw=t("span",{class:"heading"},"Album",-1),$w=t("span",{class:"heading"},"Album artist",-1),xw=t("span",{class:"heading"},"Release date",-1),Cw={class:"title is-6"},qw=t("span",{class:"heading"},"Track / Disc",-1),Sw={class:"title is-6"},Pw=t("span",{class:"heading"},"Length",-1),Aw={class:"title is-6"},Tw=t("span",{class:"heading"},"Path",-1),Rw={class:"title is-6"},Ew={class:"card-footer"},Iw=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-plus"})],-1),Uw=t("span",{class:"is-size-7"},"Add",-1),Lw=[Iw,Uw],Ow=t("span",{class:"icon"},[t("i",{class:"mdi mdi-playlist-play"})],-1),Dw=t("span",{class:"is-size-7"},"Add Next",-1),zw=[Ow,Dw],Nw=t("span",{class:"icon"},[t("i",{class:"mdi mdi-play"})],-1),Vw=t("span",{class:"is-size-7"},"Play",-1),Bw=[Nw,Vw];function Mw(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",pw,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",fw,[t("div",yw,[t("div",gw,[t("p",bw,m(a.track.name),1),t("p",kw,m(a.track.artists[0].name),1),t("div",ww,[t("p",null,[vw,t("a",{class:"title is-6 has-text-link",onClick:e[1]||(e[1]=(...n)=>i.open_album&&i.open_album(...n))},m(a.album.name),1)]),t("p",null,[$w,t("a",{class:"title is-6 has-text-link",onClick:e[2]||(e[2]=(...n)=>i.open_artist&&i.open_artist(...n))},m(a.album.artists[0].name),1)]),t("p",null,[xw,t("span",Cw,m(s.$filters.time(a.album.release_date,"L")),1)]),t("p",null,[qw,t("span",Sw,m(a.track.track_number)+" / "+m(a.track.disc_number),1)]),t("p",null,[Pw,t("span",Aw,m(s.$filters.duration(a.track.duration_ms)),1)]),t("p",null,[Tw,t("span",Rw,m(a.track.uri),1)])])]),t("footer",Ew,[t("a",{class:"card-footer-item has-text-dark",onClick:e[3]||(e[3]=(...n)=>i.queue_add&&i.queue_add(...n))},Lw),t("a",{class:"card-footer-item has-text-dark",onClick:e[4]||(e[4]=(...n)=>i.queue_add_next&&i.queue_add_next(...n))},zw),t("a",{class:"card-footer-item has-text-dark",onClick:e[5]||(e[5]=(...n)=>i.play&&i.play(...n))},Bw)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[6]||(e[6]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var ys=k(hw,[["render",Mw]]);const Ot={load:function(s){const e=new F;return e.setAccessToken(A.state.spotify.webapi_token),e.getAlbum(s.params.album_id,{market:A.state.spotify.webapi_country})},set:function(s,e){s.album=e}},Fw={name:"PageAlbum",components:{ContentWithHero:cs,SpotifyListItemTrack:fs,SpotifyModalDialogTrack:ys,SpotifyModalDialogAlbum:at,CoverArtwork:K},beforeRouteEnter(s,e,a){Ot.load(s).then(r=>{a(o=>Ot.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;Ot.load(s).then(o=>{Ot.set(r,o),a()})},data(){return{album:{artists:[{}],tracks:{}},show_track_details_modal:!1,selected_track:{},show_album_details_modal:!1}},computed:{artwork_url:function(){return this.album.images&&this.album.images.length>0?this.album.images[0].url:""}},methods:{open_artist:function(){this.$router.push({path:"/music/spotify/artists/"+this.album.artists[0].id})},play:function(){this.show_details_modal=!1,f.player_play_uri(this.album.uri,!0)},open_track_dialog:function(s){this.selected_track=s,this.show_track_details_modal=!0}}},Gw={class:"title is-5"},jw={class:"subtitle is-6 has-text-link has-text-weight-normal"},Kw={class:"buttons fd-is-centered-mobile fd-has-margin-top"},Hw=t("span",{class:"icon"},[t("i",{class:"mdi mdi-shuffle"})],-1),Ww=t("span",null,"Shuffle",-1),Yw=[Hw,Ww],Qw=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),Jw=[Qw],Zw={class:"image is-square fd-has-shadow fd-has-action"},Xw={class:"heading is-7 has-text-centered-mobile fd-has-margin-top"},tv=["onClick"],sv=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),ev=[sv];function iv(s,e,a,r,o,i){const n=h("cover-artwork"),c=h("spotify-list-item-track"),p=h("spotify-modal-dialog-track"),g=h("spotify-modal-dialog-album"),b=h("content-with-hero");return l(),w(b,null,{"heading-left":d(()=>[t("h1",Gw,m(o.album.name),1),t("h2",jw,[t("a",{class:"has-text-link",onClick:e[0]||(e[0]=(...x)=>i.open_artist&&i.open_artist(...x))},m(o.album.artists[0].name),1)]),t("div",Kw,[t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...x)=>i.play&&i.play(...x))},Yw),t("a",{class:"button is-small is-light is-rounded",onClick:e[2]||(e[2]=x=>o.show_album_details_modal=!0)},Jw)])]),"heading-right":d(()=>[t("p",Zw,[u(n,{artwork_url:i.artwork_url,artist:o.album.artist,album:o.album.name,onClick:e[3]||(e[3]=x=>o.show_album_details_modal=!0)},null,8,["artwork_url","artist","album"])])]),content:d(()=>[t("p",Xw,m(o.album.tracks.total)+" tracks ",1),(l(!0),_(T,null,I(o.album.tracks.items,(x,q)=>(l(),w(c,{key:x.id,track:x,position:q,album:o.album,context_uri:o.album.uri},{actions:d(()=>[t("a",{onClick:z=>i.open_track_dialog(x)},ev,8,tv)]),_:2},1032,["track","position","album","context_uri"]))),128)),u(p,{show:o.show_track_details_modal,track:o.selected_track,album:o.album,onClose:e[4]||(e[4]=x=>o.show_track_details_modal=!1)},null,8,["show","track","album"]),u(g,{show:o.show_album_details_modal,album:o.album,onClose:e[5]||(e[5]=x=>o.show_album_details_modal=!1)},null,8,["show","album"])]),_:1})}var ov=k(Fw,[["render",iv]]);const Jt=50,Dt={load:function(s){const e=new F;return e.setAccessToken(A.state.spotify.webapi_token),Promise.all([e.getPlaylist(s.params.playlist_id),e.getPlaylistTracks(s.params.playlist_id,{limit:Jt,offset:0})])},set:function(s,e){s.playlist=e[0],s.tracks=[],s.total=0,s.offset=0,s.append_tracks(e[1])}},av={name:"SpotifyPagePlaylist",components:{ContentWithHeading:R,SpotifyListItemTrack:fs,SpotifyModalDialogTrack:ys,SpotifyModalDialogPlaylist:Kt,VueEternalLoading:ss.exports.VueEternalLoading},beforeRouteEnter(s,e,a){Dt.load(s).then(r=>{a(o=>Dt.set(o,r))})},beforeRouteUpdate(s,e,a){const r=this;Dt.load(s).then(o=>{Dt.set(r,o),a()})},data(){return{playlist:{tracks:{}},tracks:[],total:0,offset:0,show_track_details_modal:!1,selected_track:{},show_playlist_details_modal:!1}},methods:{load_next:function({loaded:s}){const e=new F;e.setAccessToken(this.$store.state.spotify.webapi_token),e.getPlaylistTracks(this.playlist.id,{limit:Jt,offset:this.offset}).then(a=>{this.append_tracks(a),s(a.items.length,Jt)})},append_tracks:function(s){this.tracks=this.tracks.concat(s.items),this.total=s.total,this.offset+=s.limit},play:function(){this.show_details_modal=!1,f.player_play_uri(this.playlist.uri,!0)},open_track_dialog:function(s){this.selected_track=s,this.show_track_details_modal=!0}}},nv={class:"title is-4"},lv={class:"buttons is-centered"},rv=t("span",{class:"icon"},[t("i",{class:"mdi mdi-dots-horizontal mdi-18px"})],-1),dv=[rv],_v=t("span",{class:"icon"},[t("i",{class:"mdi mdi-shuffle"})],-1),cv=t("span",null,"Shuffle",-1),uv=[_v,cv],mv={class:"heading has-text-centered-mobile"},hv=["onClick"],pv=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),fv=[pv],yv=$(" . ");function gv(s,e,a,r,o,i){const n=h("spotify-list-item-track"),c=h("VueEternalLoading"),p=h("spotify-modal-dialog-track"),g=h("spotify-modal-dialog-playlist"),b=h("content-with-heading");return l(),w(b,null,{"heading-left":d(()=>[t("div",nv,m(o.playlist.name),1)]),"heading-right":d(()=>[t("div",lv,[t("a",{class:"button is-small is-light is-rounded",onClick:e[0]||(e[0]=x=>o.show_playlist_details_modal=!0)},dv),t("a",{class:"button is-small is-dark is-rounded",onClick:e[1]||(e[1]=(...x)=>i.play&&i.play(...x))},uv)])]),content:d(()=>[t("p",mv,m(o.playlist.tracks.total)+" tracks ",1),(l(!0),_(T,null,I(o.tracks,(x,q)=>(l(),w(n,{key:x.track.id,track:x.track,album:x.track.album,position:q,context_uri:o.playlist.uri},{actions:d(()=>[t("a",{onClick:z=>i.open_track_dialog(x.track)},fv,8,hv)]),_:2},1032,["track","album","position","context_uri"]))),128)),o.offset<o.total?(l(),w(c,{key:0,load:i.load_next},{"no-more":d(()=>[yv]),_:1},8,["load"])):y("",!0),u(p,{show:o.show_track_details_modal,track:o.selected_track,album:o.selected_track.album,onClose:e[2]||(e[2]=x=>o.show_track_details_modal=!1)},null,8,["show","track","album"]),u(g,{show:o.show_playlist_details_modal,playlist:o.playlist,onClose:e[3]||(e[3]=x=>o.show_playlist_details_modal=!1)},null,8,["show","playlist"])]),_:1})}var bv=k(av,[["render",gv]]);const kv={name:"SpotifyListItemArtist",props:["artist"],methods:{open_artist:function(){this.$router.push({path:"/music/spotify/artists/"+this.artist.id})}}},wv={class:"media"},vv={class:"title is-6"},$v={class:"media-right"};function xv(s,e,a,r,o,i){return l(),_("div",wv,[t("div",{class:"media-content fd-has-action is-clipped",onClick:e[0]||(e[0]=(...n)=>i.open_artist&&i.open_artist(...n))},[t("h1",vv,m(a.artist.name),1)]),t("div",$v,[O(s.$slots,"actions")])])}var Cv=k(kv,[["render",xv]]);const et=50,qv={name:"SpotifyPageSearch",components:{ContentWithHeading:R,ContentText:Ms,TabsSearch:Fs,SpotifyListItemTrack:fs,SpotifyListItemArtist:Cv,SpotifyListItemAlbum:jt,SpotifyListItemPlaylist:ps,SpotifyModalDialogTrack:ys,SpotifyModalDialogArtist:Gs,SpotifyModalDialogAlbum:at,SpotifyModalDialogPlaylist:Kt,VueEternalLoading:ss.exports.VueEternalLoading,CoverArtwork:K},data(){return{search_query:"",tracks:{items:[],total:0},artists:{items:[],total:0},albums:{items:[],total:0},playlists:{items:[],total:0},query:{},search_param:{},show_track_details_modal:!1,selected_track:{},show_album_details_modal:!1,selected_album:{},show_artist_details_modal:!1,selected_artist:{},show_playlist_details_modal:!1,selected_playlist:{},validSearchTypes:["track","artist","album","playlist"]}},computed:{recent_searches(){return this.$store.state.recent_searches.filter(s=>!s.startsWith("query:"))},show_tracks(){return this.$route.query.type&&this.$route.query.type.includes("track")},show_all_tracks_button(){return this.tracks.total>this.tracks.items.length},show_artists(){return this.$route.query.type&&this.$route.query.type.includes("artist")},show_all_artists_button(){return this.artists.total>this.artists.items.length},show_albums(){return this.$route.query.type&&this.$route.query.type.includes("album")},show_all_albums_button(){return this.albums.total>this.albums.items.length},show_playlists(){return this.$route.query.type&&this.$route.query.type.includes("playlist")},show_all_playlists_button(){return this.playlists.total>this.playlists.items.length},is_visible_artwork(){return this.$store.getters.settings_option("webinterface","show_cover_artwork_in_album_lists").value}},watch:{$route(s,e){this.query=s.query,this.search()}},mounted:function(){this.query=this.$route.query,this.search()},methods:{reset:function(){this.tracks={items:[],total:0},this.artists={items:[],total:0},this.albums={items:[],total:0},this.playlists={items:[],total:0}},search:function(){if(this.reset(),!this.query.query||this.query.query===""||this.query.query.startsWith("query:")){this.search_query="",this.$refs.search_field.focus();return}this.search_query=this.query.query,this.search_param.limit=this.query.limit?this.query.limit:et,this.search_param.offset=this.query.offset?this.query.offset:0,this.$store.commit(as,this.query.query),this.search_all()},spotify_search:function(){return f.spotify().then(({data:s})=>{this.search_param.market=s.webapi_country;const e=new F;e.setAccessToken(s.webapi_token);const a=this.query.type.split(",").filter(r=>this.validSearchTypes.includes(r));return e.search(this.query.query,a,this.search_param)})},search_all:function(){this.spotify_search().then(s=>{this.tracks=s.tracks?s.tracks:{items:[],total:0},this.artists=s.artists?s.artists:{items:[],total:0},this.albums=s.albums?s.albums:{items:[],total:0},this.playlists=s.playlists?s.playlists:{items:[],total:0}})},search_tracks_next:function({loaded:s}){this.spotify_search().then(e=>{this.tracks.items=this.tracks.items.concat(e.tracks.items),this.tracks.total=e.tracks.total,this.search_param.offset+=e.tracks.limit,s(e.tracks.items.length,et)})},search_artists_next:function({loaded:s}){this.spotify_search().then(e=>{this.artists.items=this.artists.items.concat(e.artists.items),this.artists.total=e.artists.total,this.search_param.offset+=e.artists.limit,s(e.artists.items.length,et)})},search_albums_next:function({loaded:s}){this.spotify_search().then(e=>{this.albums.items=this.albums.items.concat(e.albums.items),this.albums.total=e.albums.total,this.search_param.offset+=e.albums.limit,s(e.albums.items.length,et)})},search_playlists_next:function({loaded:s}){this.spotify_search().then(e=>{this.playlists.items=this.playlists.items.concat(e.playlists.items),this.playlists.total=e.playlists.total,this.search_param.offset+=e.playlists.limit,s(e.playlists.items.length,et)})},new_search:function(){!this.search_query||(this.$router.push({path:"/search/spotify",query:{type:"track,artist,album,playlist,audiobook,podcast",query:this.search_query,limit:3,offset:0}}),this.$refs.search_field.blur())},open_search_tracks:function(){this.$router.push({path:"/search/spotify",query:{type:"track",query:this.$route.query.query}})},open_search_artists:function(){this.$router.push({path:"/search/spotify",query:{type:"artist",query:this.$route.query.query}})},open_search_albums:function(){this.$router.push({path:"/search/spotify",query:{type:"album",query:this.$route.query.query}})},open_search_playlists:function(){this.$router.push({path:"/search/spotify",query:{type:"playlist",query:this.$route.query.query}})},open_recent_search:function(s){this.search_query=s,this.new_search()},open_track_dialog:function(s){this.selected_track=s,this.show_track_details_modal=!0},open_album_dialog:function(s){this.selected_album=s,this.show_album_details_modal=!0},open_artist_dialog:function(s){this.selected_artist=s,this.show_artist_details_modal=!0},open_playlist_dialog:function(s){this.selected_playlist=s,this.show_playlist_details_modal=!0},open_album:function(s){this.$router.push({path:"/music/spotify/albums/"+s.id})},artwork_url:function(s){return s.images&&s.images.length>0?s.images[0].url:""}}},Sv={class:"section fd-remove-padding-bottom"},Pv={class:"container"},Av={class:"columns is-centered"},Tv={class:"column is-four-fifths"},Rv={class:"field"},Ev={class:"control is-expanded has-icons-left"},Iv=t("span",{class:"icon is-left"},[t("i",{class:"mdi mdi-magnify"})],-1),Uv={class:"tags",style:{"margin-top":"16px"}},Lv=["onClick"],Ov=t("p",{class:"title is-4"},"Tracks",-1),Dv=["onClick"],zv=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),Nv=[zv],Vv=$(" . "),Bv={key:0,class:"level"},Mv={class:"level-item"},Fv=t("p",null,[t("i",null,"No tracks found")],-1),Gv=t("p",{class:"title is-4"},"Artists",-1),jv=["onClick"],Kv=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),Hv=[Kv],Wv=$(" . "),Yv={key:0,class:"level"},Qv={class:"level-item"},Jv=t("p",null,[t("i",null,"No artists found")],-1),Zv=t("p",{class:"title is-4"},"Albums",-1),Xv={class:"image is-64x64 fd-has-shadow fd-has-action"},t$=["onClick"],s$=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),e$=[s$],i$=$(" . "),o$={key:0,class:"level"},a$={class:"level-item"},n$=t("p",null,[t("i",null,"No albums found")],-1),l$=t("p",{class:"title is-4"},"Playlists",-1),r$=["onClick"],d$=t("span",{class:"icon has-text-dark"},[t("i",{class:"mdi mdi-dots-vertical mdi-18px"})],-1),_$=[d$],c$=$(" . "),u$={key:0,class:"level"},m$={class:"level-item"},h$=t("p",null,[t("i",null,"No playlists found")],-1);function p$(s,e,a,r,o,i){const n=h("tabs-search"),c=h("spotify-list-item-track"),p=h("VueEternalLoading"),g=h("spotify-modal-dialog-track"),b=h("content-with-heading"),x=h("content-text"),q=h("spotify-list-item-artist"),z=h("spotify-modal-dialog-artist"),S=h("cover-artwork"),W=h("spotify-list-item-album"),nt=h("spotify-modal-dialog-album"),lt=h("spotify-list-item-playlist"),L=h("spotify-modal-dialog-playlist");return l(),_("div",null,[t("section",Sv,[t("div",Pv,[t("div",Av,[t("div",Tv,[t("form",{onSubmit:e[1]||(e[1]=D((...P)=>i.new_search&&i.new_search(...P),["prevent"]))},[t("div",Rv,[t("p",Ev,[U(t("input",{ref:"search_field","onUpdate:modelValue":e[0]||(e[0]=P=>o.search_query=P),class:"input is-rounded is-shadowless",type:"text",placeholder:"Search",autocomplete:"off"},null,512),[[M,o.search_query]]),Iv])])],32),t("div",Uv,[(l(!0),_(T,null,I(i.recent_searches,P=>(l(),_("a",{key:P,class:"tag",onClick:st=>i.open_recent_search(P)},m(P),9,Lv))),128))])])])])]),u(n,{query:o.search_query},null,8,["query"]),i.show_tracks&&o.tracks.total?(l(),w(b,{key:0},{"heading-left":d(()=>[Ov]),content:d(()=>[(l(!0),_(T,null,I(o.tracks.items,P=>(l(),w(c,{key:P.id,track:P,album:P.album,position:0,context_uri:P.uri},{actions:d(()=>[t("a",{onClick:st=>i.open_track_dialog(P)},Nv,8,Dv)]),_:2},1032,["track","album","context_uri"]))),128)),o.query.type==="track"?(l(),w(p,{key:0,load:i.search_tracks_next},{"no-more":d(()=>[Vv]),_:1},8,["load"])):y("",!0),u(g,{show:o.show_track_details_modal,track:o.selected_track,album:o.selected_track.album,onClose:e[2]||(e[2]=P=>o.show_track_details_modal=!1)},null,8,["show","track","album"])]),footer:d(()=>[i.show_all_tracks_button?(l(),_("nav",Bv,[t("p",Mv,[t("a",{class:"button is-light is-small is-rounded",onClick:e[3]||(e[3]=(...P)=>i.open_search_tracks&&i.open_search_tracks(...P))},"Show all "+m(o.tracks.total.toLocaleString())+" tracks",1)])])):y("",!0)]),_:1})):y("",!0),i.show_tracks&&!o.tracks.total?(l(),w(x,{key:1,class:"mt-6"},{content:d(()=>[Fv]),_:1})):y("",!0),i.show_artists&&o.artists.total?(l(),w(b,{key:2},{"heading-left":d(()=>[Gv]),content:d(()=>[(l(!0),_(T,null,I(o.artists.items,P=>(l(),w(q,{key:P.id,artist:P},{actions:d(()=>[t("a",{onClick:st=>i.open_artist_dialog(P)},Hv,8,jv)]),_:2},1032,["artist"]))),128)),o.query.type==="artist"?(l(),w(p,{key:0,load:i.search_artists_next},{"no-more":d(()=>[Wv]),_:1},8,["load"])):y("",!0),u(z,{show:o.show_artist_details_modal,artist:o.selected_artist,onClose:e[4]||(e[4]=P=>o.show_artist_details_modal=!1)},null,8,["show","artist"])]),footer:d(()=>[i.show_all_artists_button?(l(),_("nav",Yv,[t("p",Qv,[t("a",{class:"button is-light is-small is-rounded",onClick:e[5]||(e[5]=(...P)=>i.open_search_artists&&i.open_search_artists(...P))},"Show all "+m(o.artists.total.toLocaleString())+" artists",1)])])):y("",!0)]),_:1})):y("",!0),i.show_artists&&!o.artists.total?(l(),w(x,{key:3},{content:d(()=>[Jv]),_:1})):y("",!0),i.show_albums&&o.albums.total?(l(),w(b,{key:4},{"heading-left":d(()=>[Zv]),content:d(()=>[(l(!0),_(T,null,I(o.albums.items,P=>(l(),w(W,{key:P.id,album:P,onClick:st=>i.open_album(P)},Vt({actions:d(()=>[t("a",{onClick:st=>i.open_album_dialog(P)},e$,8,t$)]),_:2},[i.is_visible_artwork?{name:"artwork",fn:d(()=>[t("p",Xv,[u(S,{artwork_url:i.artwork_url(P),artist:P.artist,album:P.name,maxwidth:64,maxheight:64},null,8,["artwork_url","artist","album"])])])}:void 0]),1032,["album","onClick"]))),128)),o.query.type==="album"?(l(),w(p,{key:0,load:i.search_albums_next},{"no-more":d(()=>[i$]),_:1},8,["load"])):y("",!0),u(nt,{show:o.show_album_details_modal,album:o.selected_album,onClose:e[6]||(e[6]=P=>o.show_album_details_modal=!1)},null,8,["show","album"])]),footer:d(()=>[i.show_all_albums_button?(l(),_("nav",o$,[t("p",a$,[t("a",{class:"button is-light is-small is-rounded",onClick:e[7]||(e[7]=(...P)=>i.open_search_albums&&i.open_search_albums(...P))},"Show all "+m(o.albums.total.toLocaleString())+" albums",1)])])):y("",!0)]),_:1})):y("",!0),i.show_albums&&!o.albums.total?(l(),w(x,{key:5},{content:d(()=>[n$]),_:1})):y("",!0),i.show_playlists&&o.playlists.total?(l(),w(b,{key:6},{"heading-left":d(()=>[l$]),content:d(()=>[(l(!0),_(T,null,I(o.playlists.items,P=>(l(),w(lt,{key:P.id,playlist:P},{actions:d(()=>[t("a",{onClick:st=>i.open_playlist_dialog(P)},_$,8,r$)]),_:2},1032,["playlist"]))),128)),o.query.type==="playlist"?(l(),w(p,{key:0,load:i.search_playlists_next},{"no-more":d(()=>[c$]),_:1},8,["load"])):y("",!0),u(L,{show:o.show_playlist_details_modal,playlist:o.selected_playlist,onClose:e[8]||(e[8]=P=>o.show_playlist_details_modal=!1)},null,8,["show","playlist"])]),footer:d(()=>[i.show_all_playlists_button?(l(),_("nav",u$,[t("p",m$,[t("a",{class:"button is-light is-small is-rounded",onClick:e[9]||(e[9]=(...P)=>i.open_search_playlists&&i.open_search_playlists(...P))},"Show all "+m(o.playlists.total.toLocaleString())+" playlists",1)])])):y("",!0)]),_:1})):y("",!0),i.show_playlists&&!o.playlists.total?(l(),w(x,{key:7},{content:d(()=>[h$]),_:1})):y("",!0)])}var f$=k(qv,[["render",p$]]);const y$={name:"TabsSettings",computed:{}},g$={class:"section fd-tabs-section"},b$={class:"container"},k$={class:"columns is-centered"},w$={class:"column is-four-fifths"},v$={class:"tabs is-centered is-small"},$$=["onClick","onKeypress"],x$=t("span",{class:""},"Webinterface",-1),C$=[x$],q$=["onClick","onKeypress"],S$=t("span",{class:""},"Remotes & Outputs",-1),P$=[S$],A$=["onClick","onKeypress"],T$=t("span",{class:""},"Artwork",-1),R$=[T$],E$=["onClick","onKeypress"],I$=t("span",{class:""},"Online Services",-1),U$=[I$];function L$(s,e,a,r,o,i){const n=h("router-link");return l(),_("section",g$,[t("div",b$,[t("div",k$,[t("div",w$,[t("div",v$,[t("ul",null,[u(n,{to:"/settings/webinterface",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},C$,40,$$)],2)]),_:1}),u(n,{to:"/settings/remotes-outputs",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},P$,40,q$)],2)]),_:1}),u(n,{to:"/settings/artwork",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},R$,40,A$)],2)]),_:1}),u(n,{to:"/settings/online-services",custom:""},{default:d(({navigate:c,isActive:p})=>[t("li",{class:C({"is-active":p})},[t("a",{onClick:c,onKeypress:B(c,["enter"])},U$,40,E$)],2)]),_:1})])])])])])])}var Ht=k(y$,[["render",L$]]);const O$={name:"SettingsCheckbox",props:["category_name","option_name"],data(){return{timerDelay:2e3,timerId:-1,statusUpdate:""}},computed:{category(){return this.$store.state.settings.categories.find(s=>s.name===this.category_name)},option(){return this.category?this.category.options.find(s=>s.name===this.option_name):{}},value(){return this.option.value},info(){return this.statusUpdate==="success"?"(setting saved)":this.statusUpdate==="error"?"(error saving setting)":""}},methods:{set_update_timer(){this.timerId>0&&(window.clearTimeout(this.timerId),this.timerId=-1),this.statusUpdate="",this.$refs.settings_checkbox.checked!==this.value&&(this.timerId=window.setTimeout(this.update_setting,this.timerDelay))},update_setting(){this.timerId=-1;const s=this.$refs.settings_checkbox.checked;if(console.log(this.$refs.settings_checkbox),s===this.value){this.statusUpdate="";return}const e={category:this.category.name,name:this.option_name,value:s};f.settings_update(this.category.name,e).then(()=>{this.$store.commit(Bt,e),this.statusUpdate="success"}).catch(()=>{this.statusUpdate="error",this.$refs.settings_checkbox.checked=this.value}).finally(()=>{this.timerId=window.setTimeout(this.clear_status,this.timerDelay)})},clear_status:function(){this.statusUpdate=""}}},D$={class:"field"},z$={class:"checkbox"},N$=["checked"],V$={key:0,class:"help"};function B$(s,e,a,r,o,i){return l(),_("div",D$,[t("label",z$,[t("input",{ref:"settings_checkbox",type:"checkbox",checked:i.value,onChange:e[0]||(e[0]=(...n)=>i.set_update_timer&&i.set_update_timer(...n))},null,40,N$),O(s.$slots,"label"),t("i",{class:C(["is-size-7",{"has-text-info":o.statusUpdate==="success","has-text-danger":o.statusUpdate==="error"}])},m(i.info),3)]),s.$slots.info?(l(),_("p",V$,[O(s.$slots,"info")])):y("",!0)])}var js=k(O$,[["render",B$]]);const M$={name:"SettingsTextfield",props:["category_name","option_name","placeholder","disabled"],data(){return{timerDelay:2e3,timerId:-1,statusUpdate:""}},computed:{category(){return this.$store.state.settings.categories.find(s=>s.name===this.category_name)},option(){return this.category?this.category.options.find(s=>s.name===this.option_name):{}},value(){return this.option.value},info(){return this.statusUpdate==="success"?"(setting saved)":this.statusUpdate==="error"?"(error saving setting)":""}},methods:{set_update_timer(){this.timerId>0&&(window.clearTimeout(this.timerId),this.timerId=-1),this.statusUpdate="",this.$refs.settings_text.value!==this.value&&(this.timerId=window.setTimeout(this.update_setting,this.timerDelay))},update_setting(){this.timerId=-1;const s=this.$refs.settings_text.value;if(s===this.value){this.statusUpdate="";return}const e={category:this.category.name,name:this.option_name,value:s};f.settings_update(this.category.name,e).then(()=>{this.$store.commit(Bt,e),this.statusUpdate="success"}).catch(()=>{this.statusUpdate="error",this.$refs.settings_text.value=this.value}).finally(()=>{this.timerId=window.setTimeout(this.clear_status,this.timerDelay)})},clear_status:function(){this.statusUpdate=""}}},F$=["disabled"],G$={class:"field"},j$={class:"label has-text-weight-normal"},K$={class:"control"},H$=["placeholder","value"],W$={key:0,class:"help"};function Y$(s,e,a,r,o,i){return l(),_("fieldset",{disabled:a.disabled},[t("div",G$,[t("label",j$,[O(s.$slots,"label"),t("i",{class:C(["is-size-7",{"has-text-info":o.statusUpdate==="success","has-text-danger":o.statusUpdate==="error"}])},m(i.info),3)]),t("div",K$,[t("input",{ref:"settings_text",class:"input",type:"text",placeholder:a.placeholder,value:i.value,onInput:e[0]||(e[0]=(...n)=>i.set_update_timer&&i.set_update_timer(...n))},null,40,H$)]),s.$slots.info?(l(),_("p",W$,[O(s.$slots,"info")])):y("",!0)])],8,F$)}var Q$=k(M$,[["render",Y$]]);const J$={name:"SettingsIntfield",props:["category_name","option_name","placeholder","disabled"],data(){return{timerDelay:2e3,timerId:-1,statusUpdate:""}},computed:{category(){return this.$store.state.settings.categories.find(s=>s.name===this.category_name)},option(){return this.category?this.category.options.find(s=>s.name===this.option_name):{}},value(){return this.option.value},info(){return this.statusUpdate==="success"?"(setting saved)":this.statusUpdate==="error"?"(error saving setting)":""}},methods:{set_update_timer(){this.timerId>0&&(window.clearTimeout(this.timerId),this.timerId=-1),this.statusUpdate="",this.$refs.settings_number.value!==this.value&&(this.timerId=window.setTimeout(this.update_setting,this.timerDelay))},update_setting(){this.timerId=-1;const s=this.$refs.settings_number.value;if(s===this.value){this.statusUpdate="";return}const e={category:this.category.name,name:this.option_name,value:parseInt(s,10)};f.settings_update(this.category.name,e).then(()=>{this.$store.commit(Bt,e),this.statusUpdate="success"}).catch(()=>{this.statusUpdate="error",this.$refs.settings_number.value=this.value}).finally(()=>{this.timerId=window.setTimeout(this.clear_status,this.timerDelay)})},clear_status:function(){this.statusUpdate=""}}},Z$=["disabled"],X$={class:"field"},t0={class:"label has-text-weight-normal"},s0={class:"control"},e0=["placeholder","value"],i0={key:0,class:"help"};function o0(s,e,a,r,o,i){return l(),_("fieldset",{disabled:a.disabled},[t("div",X$,[t("label",t0,[O(s.$slots,"label"),t("i",{class:C(["is-size-7",{"has-text-info":o.statusUpdate==="success","has-text-danger":o.statusUpdate==="error"}])},m(i.info),3)]),t("div",s0,[t("input",{ref:"settings_number",class:"input",type:"number",min:"0",style:{width:"10em"},placeholder:a.placeholder,value:i.value,onInput:e[0]||(e[0]=(...n)=>i.set_update_timer&&i.set_update_timer(...n))},null,40,e0)]),s.$slots.info?(l(),_("p",i0,[O(s.$slots,"info")])):y("",!0)])],8,Z$)}var a0=k(J$,[["render",o0]]);const n0={name:"SettingsPageWebinterface",components:{ContentWithHeading:R,TabsSettings:Ht,SettingsCheckbox:js,SettingsTextfield:Q$,SettingsIntfield:a0},computed:{settings_option_show_composer_now_playing(){return this.$store.getters.settings_option_show_composer_now_playing}}},l0={class:"fd-page-with-tabs"},r0=t("div",{class:"title is-4"},"Navbar items",-1),d0=t("p",{class:"content"},"Select the top navigation bar menu items",-1),_0=t("div",{class:"notification is-size-7"}," If you select more items than can be shown on your screen then the burger menu will disappear. ",-1),c0=$(" Playlists "),u0=$(" Music "),m0=$(" Podcasts "),h0=$(" Audiobooks "),p0=$(" Radio "),f0=$(" Files "),y0=$(" Search "),g0=t("div",{class:"title is-4"},"Album lists",-1),b0=$(" Show cover artwork in album list "),k0=t("div",{class:"title is-4"},"Now playing page",-1),w0=$(" Show composer "),v0=$(' If enabled the composer of the current playing track is shown on the "now playing page" '),$0=$(" Show composer only for listed genres "),x0=t("p",{class:"help"},' Comma separated list of genres the composer should be displayed on the "now playing page". ',-1),C0=t("p",{class:"help"},"Leave empty to always show the composer.",-1),q0=t("p",{class:"help"},[$(" The genre tag of the current track is matched by checking, if one of the defined genres are included. For example setting to "),t("code",null,"classical, soundtrack"),$(' will show the composer for tracks with a genre tag of "Contemporary Classical".'),t("br")],-1),S0=t("div",{class:"title is-4"},"Recently added page",-1),P0=$(' Limit the number of albums shown on the "Recently Added" page ');function A0(s,e,a,r,o,i){const n=h("tabs-settings"),c=h("settings-checkbox"),p=h("content-with-heading"),g=h("settings-textfield"),b=h("settings-intfield");return l(),_("div",l0,[u(n),u(p,null,{"heading-left":d(()=>[r0]),content:d(()=>[d0,_0,u(c,{category_name:"webinterface",option_name:"show_menu_item_playlists"},{label:d(()=>[c0]),_:1}),u(c,{category_name:"webinterface",option_name:"show_menu_item_music"},{label:d(()=>[u0]),_:1}),u(c,{category_name:"webinterface",option_name:"show_menu_item_podcasts"},{label:d(()=>[m0]),_:1}),u(c,{category_name:"webinterface",option_name:"show_menu_item_audiobooks"},{label:d(()=>[h0]),_:1}),u(c,{category_name:"webinterface",option_name:"show_menu_item_radio"},{label:d(()=>[p0]),_:1}),u(c,{category_name:"webinterface",option_name:"show_menu_item_files"},{label:d(()=>[f0]),_:1}),u(c,{category_name:"webinterface",option_name:"show_menu_item_search"},{label:d(()=>[y0]),_:1})]),_:1}),u(p,null,{"heading-left":d(()=>[g0]),content:d(()=>[u(c,{category_name:"webinterface",option_name:"show_cover_artwork_in_album_lists"},{label:d(()=>[b0]),_:1})]),_:1}),u(p,null,{"heading-left":d(()=>[k0]),content:d(()=>[u(c,{category_name:"webinterface",option_name:"show_composer_now_playing"},{label:d(()=>[w0]),info:d(()=>[v0]),_:1}),u(g,{category_name:"webinterface",option_name:"show_composer_for_genre",disabled:!i.settings_option_show_composer_now_playing,placeholder:"Genres"},{label:d(()=>[$0]),info:d(()=>[x0,C0,q0]),_:1},8,["disabled"])]),_:1}),u(p,null,{"heading-left":d(()=>[S0]),content:d(()=>[u(b,{category_name:"webinterface",option_name:"recently_added_limit"},{label:d(()=>[P0]),_:1})]),_:1})])}var T0=k(n0,[["render",A0]]);const R0={name:"SettingsPageArtwork",components:{ContentWithHeading:R,TabsSettings:Ht,SettingsCheckbox:js},computed:{spotify(){return this.$store.state.spotify}}},E0={class:"fd-page-with-tabs"},I0=t("div",{class:"title is-4"},"Artwork",-1),U0=t("div",{class:"content"},[t("p",null," OwnTone supports PNG and JPEG artwork which is either placed as separate image files in the library, embedded in the media files or made available online by radio stations. "),t("p",null," In addition to that, you can enable fetching artwork from the following artwork providers: ")],-1),L0=$(" Spotify "),O0=$(" Discogs ("),D0=t("a",{href:"https://www.discogs.com/"},"https://www.discogs.com/",-1),z0=$(") "),N0=$(" Cover Art Archive ("),V0=t("a",{href:"https://coverartarchive.org/"},"https://coverartarchive.org/",-1),B0=$(") ");function M0(s,e,a,r,o,i){const n=h("tabs-settings"),c=h("settings-checkbox"),p=h("content-with-heading");return l(),_("div",E0,[u(n),u(p,null,{"heading-left":d(()=>[I0]),content:d(()=>[U0,i.spotify.libspotify_logged_in?(l(),w(c,{key:0,category_name:"artwork",option_name:"use_artwork_source_spotify"},{label:d(()=>[L0]),_:1})):y("",!0),u(c,{category_name:"artwork",option_name:"use_artwork_source_discogs"},{label:d(()=>[O0,D0,z0]),_:1}),u(c,{category_name:"artwork",option_name:"use_artwork_source_coverartarchive"},{label:d(()=>[N0,V0,B0]),_:1})]),_:1})])}var F0=k(R0,[["render",M0]]);const G0={name:"SettingsPageOnlineServices",components:{ContentWithHeading:R,TabsSettings:Ht},filters:{join(s){return s.join(", ")}},data(){return{libspotify:{user:"",password:"",errors:{user:"",password:"",error:""}},lastfm_login:{user:"",password:"",errors:{user:"",password:"",error:""}}}},computed:{lastfm(){return this.$store.state.lastfm},spotify(){return this.$store.state.spotify},spotify_required_scope(){return this.spotify.webapi_required_scope?this.spotify.webapi_required_scope.split(" "):[]},spotify_missing_scope(){return this.spotify.webapi_token_valid&&this.spotify.webapi_granted_scope&&this.spotify.webapi_required_scope?this.spotify.webapi_required_scope.split(" ").filter(s=>this.spotify.webapi_granted_scope.indexOf(s)<0):[]},use_libspotify(){return this.$store.state.config.use_libspotify}},methods:{login_libspotify(){f.spotify_login(this.libspotify).then(s=>{this.libspotify.user="",this.libspotify.password="",this.libspotify.errors.user="",this.libspotify.errors.password="",this.libspotify.errors.error="",s.data.success||(this.libspotify.errors.user=s.data.errors.user,this.libspotify.errors.password=s.data.errors.password,this.libspotify.errors.error=s.data.errors.error)})},logout_spotify(){f.spotify_logout()},login_lastfm(){f.lastfm_login(this.lastfm_login).then(s=>{this.lastfm_login.user="",this.lastfm_login.password="",this.lastfm_login.errors.user="",this.lastfm_login.errors.password="",this.lastfm_login.errors.error="",s.data.success||(this.lastfm_login.errors.user=s.data.errors.user,this.lastfm_login.errors.password=s.data.errors.password,this.lastfm_login.errors.error=s.data.errors.error)})},logoutLastfm(){f.lastfm_logout()}}},j0={class:"fd-page-with-tabs"},K0=t("div",{class:"title is-4"},"Spotify",-1),H0={key:0,class:"notification is-size-7"},W0=t("p",null," OwnTone was either built without support for Spotify or libspotify is not installed. ",-1),Y0=[W0],Q0={key:1},J0={class:"notification is-size-7"},Z0=t("b",null,"You must have a Spotify premium account",-1),X0=$(". "),tx={key:0},sx={key:0},ex=t("p",{class:"content"},[t("b",null,"libspotify"),$(" - Login with your Spotify username and password ")],-1),ix={key:0,class:"fd-has-margin-bottom"},ox=$(" Logged in as "),ax={class:"field is-grouped"},nx={class:"control is-expanded"},lx={class:"help is-danger"},rx={class:"control is-expanded"},dx={class:"help is-danger"},_x=t("div",{class:"control"},[t("button",{class:"button is-info"},"Login")],-1),cx={class:"help is-danger"},ux=t("p",{class:"help"}," libspotify enables OwnTone to play Spotify tracks. ",-1),mx=t("p",{class:"help"}," OwnTone will not store your password, but will still be able to log you in automatically afterwards, because libspotify saves a login token. ",-1),hx={class:"fd-has-margin-top"},px=t("p",{class:"content"},[t("b",null,"Spotify Web API"),$(" - Grant access to the Spotify Web API ")],-1),fx={key:0},yx=$(" Access granted for "),gx={key:1,class:"help is-danger"},bx=$(" Please reauthorize Web API access to grant OwnTone the following additional access rights: "),kx={class:"field fd-has-margin-top"},wx={class:"control"},vx=["href"],$x={class:"help"},xx=$(" Access to the Spotify Web API enables scanning of your Spotify library. Required scopes are "),Cx=$(". "),qx={key:2,class:"field fd-has-margin-top"},Sx={class:"control"},Px=t("div",{class:"title is-4"},"Last.fm",-1),Ax={key:0,class:"notification is-size-7"},Tx=t("p",null,"OwnTone was built without support for Last.fm.",-1),Rx=[Tx],Ex={key:1},Ix=t("p",{class:"content"},[t("b",null,"Last.fm"),$(" - Login with your Last.fm username and password to enable scrobbling ")],-1),Ux={key:0},Lx={key:1},Ox={class:"field is-grouped"},Dx={class:"control is-expanded"},zx={class:"help is-danger"},Nx={class:"control is-expanded"},Vx={class:"help is-danger"},Bx=t("div",{class:"control"},[t("button",{class:"button is-info",type:"submit"},"Login")],-1),Mx={class:"help is-danger"},Fx=t("p",{class:"help"}," OwnTone will not store your Last.fm username/password, only the session key. The session key does not expire. ",-1);function Gx(s,e,a,r,o,i){const n=h("tabs-settings"),c=h("content-with-heading");return l(),_("div",j0,[u(n),u(c,null,{"heading-left":d(()=>[K0]),content:d(()=>[i.spotify.spotify_installed?y("",!0):(l(),_("div",H0,Y0)),i.spotify.spotify_installed?(l(),_("div",Q0,[t("div",J0,[Z0,X0,s.use_libspotity?(l(),_("span",tx,"If you normally log into Spotify with your Facebook account you must first go to Spotify's web site where you can get the Spotify username and password that matches your account.")):y("",!0)]),s.use_libspotity?(l(),_("div",sx,[ex,i.spotify.libspotify_logged_in?(l(),_("p",ix,[ox,t("b",null,[t("code",null,m(i.spotify.libspotify_user),1)])])):y("",!0),i.spotify.spotify_installed&&!i.spotify.libspotify_logged_in?(l(),_("form",{key:1,onSubmit:e[2]||(e[2]=D((...p)=>i.login_libspotify&&i.login_libspotify(...p),["prevent"]))},[t("div",ax,[t("div",nx,[U(t("input",{"onUpdate:modelValue":e[0]||(e[0]=p=>o.libspotify.user=p),class:"input",type:"text",placeholder:"Username"},null,512),[[M,o.libspotify.user]]),t("p",lx,m(o.libspotify.errors.user),1)]),t("div",rx,[U(t("input",{"onUpdate:modelValue":e[1]||(e[1]=p=>o.libspotify.password=p),class:"input",type:"password",placeholder:"Password"},null,512),[[M,o.libspotify.password]]),t("p",dx,m(o.libspotify.errors.password),1)]),_x])],32)):y("",!0),t("p",cx,m(o.libspotify.errors.error),1),ux,mx])):y("",!0),t("div",hx,[px,i.spotify.webapi_token_valid?(l(),_("p",fx,[yx,t("b",null,[t("code",null,m(i.spotify.webapi_user),1)])])):y("",!0),i.spotify_missing_scope.length>0?(l(),_("p",gx,[bx,t("b",null,[t("code",null,m(i.spotify_missing_scope.join()),1)])])):y("",!0),t("div",kx,[t("div",wx,[t("a",{class:C(["button",{"is-info":!i.spotify.webapi_token_valid||i.spotify_missing_scope.length>0}]),href:i.spotify.oauth_uri},"Authorize Web API access",10,vx)])]),t("p",$x,[xx,t("code",null,m(i.spotify_required_scope.join()),1),Cx]),i.spotify.webapi_token_valid?(l(),_("div",qx,[t("div",Sx,[t("a",{class:"button is-danger",onClick:e[3]||(e[3]=(...p)=>i.logout_spotify&&i.logout_spotify(...p))},"Logout")])])):y("",!0)])])):y("",!0)]),_:1}),u(c,null,{"heading-left":d(()=>[Px]),content:d(()=>[i.lastfm.enabled?y("",!0):(l(),_("div",Ax,Rx)),i.lastfm.enabled?(l(),_("div",Ex,[Ix,i.lastfm.scrobbling_enabled?(l(),_("div",Ux,[t("a",{class:"button",onClick:e[4]||(e[4]=(...p)=>i.logoutLastfm&&i.logoutLastfm(...p))},"Stop scrobbling")])):y("",!0),i.lastfm.scrobbling_enabled?y("",!0):(l(),_("div",Lx,[t("form",{onSubmit:e[7]||(e[7]=D((...p)=>i.login_lastfm&&i.login_lastfm(...p),["prevent"]))},[t("div",Ox,[t("div",Dx,[U(t("input",{"onUpdate:modelValue":e[5]||(e[5]=p=>o.lastfm_login.user=p),class:"input",type:"text",placeholder:"Username"},null,512),[[M,o.lastfm_login.user]]),t("p",zx,m(o.lastfm_login.errors.user),1)]),t("div",Nx,[U(t("input",{"onUpdate:modelValue":e[6]||(e[6]=p=>o.lastfm_login.password=p),class:"input",type:"password",placeholder:"Password"},null,512),[[M,o.lastfm_login.password]]),t("p",Vx,m(o.lastfm_login.errors.password),1)]),Bx]),t("p",Mx,m(o.lastfm_login.errors.error),1),Fx],32)]))])):y("",!0)]),_:1})])}var jx=k(G0,[["render",Gx]]);const Kx={name:"SettingsPageRemotesOutputs",components:{ContentWithHeading:R,TabsSettings:Ht},filters:{},data(){return{pairing_req:{pin:""},verification_req:{pin:""}}},computed:{pairing(){return this.$store.state.pairing},outputs(){return this.$store.state.outputs}},methods:{kickoff_pairing(){f.pairing_kickoff(this.pairing_req)},output_toggle(s){f.output_toggle(s)},kickoff_verification(s){f.output_update(s,this.verification_req)}}},Hx={class:"fd-page-with-tabs"},Wx=t("div",{class:"title is-4"},"Remote Pairing",-1),Yx={key:0,class:"notification"},Qx={class:"label has-text-weight-normal"},Jx=$(" Remote pairing request from "),Zx={class:"field is-grouped"},Xx={class:"control"},t2=t("div",{class:"control"},[t("button",{class:"button is-info",type:"submit"},"Send")],-1),s2={key:1,class:"content"},e2=t("p",null,"No active pairing request.",-1),i2=[e2],o2=t("div",{class:"title is-4"},"Speaker pairing and device verification",-1),a2=t("p",{class:"content"}," If your speaker requires pairing then activate it below and enter the PIN that it displays. ",-1),n2={class:"field"},l2={class:"control"},r2={class:"checkbox"},d2=["onUpdate:modelValue","onChange"],_2=["onSubmit"],c2={class:"field is-grouped"},u2={class:"control"},m2=t("div",{class:"control"},[t("button",{class:"button is-info",type:"submit"},"Verify")],-1);function h2(s,e,a,r,o,i){const n=h("tabs-settings"),c=h("content-with-heading");return l(),_("div",Hx,[u(n),u(c,null,{"heading-left":d(()=>[Wx]),content:d(()=>[i.pairing.active?(l(),_("div",Yx,[t("form",{onSubmit:e[1]||(e[1]=D((...p)=>i.kickoff_pairing&&i.kickoff_pairing(...p),["prevent"]))},[t("label",Qx,[Jx,t("b",null,m(i.pairing.remote),1)]),t("div",Zx,[t("div",Xx,[U(t("input",{"onUpdate:modelValue":e[0]||(e[0]=p=>o.pairing_req.pin=p),class:"input",type:"text",placeholder:"Enter pairing code"},null,512),[[M,o.pairing_req.pin]])]),t2])],32)])):y("",!0),i.pairing.active?y("",!0):(l(),_("div",s2,i2))]),_:1}),u(c,null,{"heading-left":d(()=>[o2]),content:d(()=>[a2,(l(!0),_(T,null,I(i.outputs,p=>(l(),_("div",{key:p.id},[t("div",n2,[t("div",l2,[t("label",r2,[U(t("input",{"onUpdate:modelValue":g=>p.selected=g,type:"checkbox",onChange:g=>i.output_toggle(p.id)},null,40,d2),[[J,p.selected]]),$(" "+m(p.name),1)])])]),p.needs_auth_key?(l(),_("form",{key:0,class:"fd-has-margin-bottom",onSubmit:D(g=>i.kickoff_verification(p.id),["prevent"])},[t("div",c2,[t("div",u2,[U(t("input",{"onUpdate:modelValue":e[2]||(e[2]=g=>o.verification_req.pin=g),class:"input",type:"text",placeholder:"Enter verification code"},null,512),[[M,o.verification_req.pin]])]),m2])],40,_2)):y("",!0)]))),128))]),_:1})])}var p2=k(Kx,[["render",h2]]);const Ks=Zs({history:Xs(),routes:[{path:"/",name:"PageQueue",component:Yo},{path:"/about",name:"About",component:Ab},{path:"/now-playing",name:"Now playing",component:ga},{path:"/music",redirect:"/music/browse"},{path:"/music/browse",name:"Browse",component:Hr,meta:{show_progress:!0,has_tabs:!0}},{path:"/music/browse/recently_added",name:"Browse Recently Added",component:Xr,meta:{show_progress:!0,has_tabs:!0}},{path:"/music/browse/recently_played",name:"Browse Recently Played",component:ad,meta:{show_progress:!0,has_tabs:!0}},{path:"/music/artists",name:"Artists",component:b_,meta:{show_progress:!0,has_tabs:!0,has_index:!0}},{path:"/music/artists/:artist_id",name:"Artist",component:I_,meta:{show_progress:!0,has_index:!0}},{path:"/music/artists/:artist_id/tracks",name:"Tracks",component:Bu,meta:{show_progress:!0,has_index:!0}},{path:"/music/albums",name:"Albums",component:Z_,meta:{show_progress:!0,has_tabs:!0,has_index:!0}},{path:"/music/albums/:album_id",name:"Album",component:qc,meta:{show_progress:!0}},{path:"/music/genres",name:"Genres",component:ru,meta:{show_progress:!0,has_tabs:!0,has_index:!0}},{path:"/music/genres/:genre",name:"Genre",component:bu,meta:{show_progress:!0,has_index:!0}},{path:"/music/genres/:genre/tracks",name:"GenreTracks",component:Tu,meta:{show_progress:!0,has_index:!0}},{path:"/music/composers",name:"Composers",component:$m,meta:{show_progress:!0,has_tabs:!0,has_index:!0}},{path:"/music/composers/:composer/albums",name:"ComposerAlbums",component:Um,meta:{show_progress:!0,has_tabs:!0,has_index:!0}},{path:"/music/composers/:composer/tracks",name:"ComposerTracks",component:jm,meta:{show_progress:!0,has_tabs:!0,has_index:!0}},{path:"/podcasts",name:"Podcasts",component:Rh,meta:{show_progress:!0}},{path:"/podcasts/:album_id",name:"Podcast",component:Kh,meta:{show_progress:!0}},{path:"/audiobooks",redirect:"/audiobooks/artists"},{path:"/audiobooks/artists",name:"AudiobooksArtists",component:bp,meta:{show_progress:!0,has_tabs:!0,has_index:!0}},{path:"/audiobooks/artists/:artist_id",name:"AudiobooksArtist",component:Tp,meta:{show_progress:!0}},{path:"/audiobooks/albums",name:"AudiobooksAlbums",component:mp,meta:{show_progress:!0,has_tabs:!0,has_index:!0}},{path:"/audiobooks/:album_id",name:"Audiobook",component:Fp,meta:{show_progress:!0}},{path:"/radio",name:"Radio",component:Iy,meta:{show_progress:!0}},{path:"/files",name:"Files",component:Py,meta:{show_progress:!0}},{path:"/playlists",redirect:"/playlists/0"},{path:"/playlists/:playlist_id",name:"Playlists",component:Pf,meta:{show_progress:!0}},{path:"/playlists/:playlist_id/tracks",name:"Playlist",component:Nf,meta:{show_progress:!0}},{path:"/search",redirect:"/search/library"},{path:"/search/library",name:"Search Library",component:Ng},{path:"/music/spotify",name:"Spotify",component:ok,meta:{show_progress:!0,has_tabs:!0}},{path:"/music/spotify/new-releases",name:"Spotify Browse New Releases",component:mk,meta:{show_progress:!0,has_tabs:!0}},{path:"/music/spotify/featured-playlists",name:"Spotify Browse Featured Playlists",component:wk,meta:{show_progress:!0,has_tabs:!0}},{path:"/music/spotify/artists/:artist_id",name:"Spotify Artist",component:aw,meta:{show_progress:!0}},{path:"/music/spotify/albums/:album_id",name:"Spotify Album",component:ov,meta:{show_progress:!0}},{path:"/music/spotify/playlists/:playlist_id",name:"Spotify Playlist",component:bv,meta:{show_progress:!0}},{path:"/search/spotify",name:"Spotify Search",component:f$},{path:"/settings/webinterface",name:"Settings Webinterface",component:T0},{path:"/settings/artwork",name:"Settings Artwork",component:F0},{path:"/settings/online-services",name:"Settings Online Services",component:jx},{path:"/settings/remotes-outputs",name:"Settings Remotes Outputs",component:p2}],scrollBehavior(s,e,a){return a?new Promise((o,i)=>{setTimeout(()=>{o(a)},0)}):s.path===e.path&&s.hash?{el:s.hash,top:120}:s.hash?new Promise((o,i)=>{setTimeout(()=>{o({el:s.hash,top:120})},0)}):s.meta.has_index?new Promise((o,i)=>{setTimeout(()=>{s.meta.has_tabs?o({el:"#top",top:140}):o({el:"#top",top:110})},0)}):{left:0,top:0}}});Ks.beforeEach((s,e,a)=>{if(A.state.show_burger_menu){A.commit(Z,!1),a(!1);return}if(A.state.show_player_menu){A.commit(X,!1),a(!1);return}a(!0)});te(Y);const f2={duration:function(s,e){return e?Y.duration(s).format(e):Y.duration(s).format("hh:*mm:ss")},time:function(s,e){return e?Y(s).format(e):Y(s).format()},timeFromNow:function(s,e){return Y(s).fromNow(e)},number:function(s){return s.toLocaleString()},channels:function(s){return s===1?"mono":s===2?"stereo":s?s+" channels":""}},y2={name:"NavbarItemLink",props:{to:String,exact:Boolean},computed:{is_active(){return this.exact?this.$route.path===this.to:this.$route.path.startsWith(this.to)},show_player_menu:{get(){return this.$store.state.show_player_menu},set(s){this.$store.commit(X,s)}},show_burger_menu:{get(){return this.$store.state.show_burger_menu},set(s){this.$store.commit(Z,s)}}},methods:{open_link:function(){this.show_burger_menu&&this.$store.commit(Z,!1),this.show_player_menu&&this.$store.commit(X,!1),this.$router.push({path:this.to})},full_path:function(){return this.$router.resolve(this.to).href}}},g2=["href"];function b2(s,e,a,r,o,i){return l(),_("a",{class:C(["navbar-item",{"is-active":i.is_active}]),href:i.full_path(),onClick:e[0]||(e[0]=D(n=>i.open_link(),["stop","prevent"]))},[O(s.$slots,"default")],10,g2)}var Hs=k(y2,[["render",b2]]);const k2={name:"NavbarTop",components:{NavbarItemLink:Hs},data(){return{show_settings_menu:!1}},computed:{is_visible_playlists(){return this.$store.getters.settings_option("webinterface","show_menu_item_playlists").value},is_visible_music(){return this.$store.getters.settings_option("webinterface","show_menu_item_music").value},is_visible_podcasts(){return this.$store.getters.settings_option("webinterface","show_menu_item_podcasts").value},is_visible_audiobooks(){return this.$store.getters.settings_option("webinterface","show_menu_item_audiobooks").value},is_visible_radio(){return this.$store.getters.settings_option("webinterface","show_menu_item_radio").value},is_visible_files(){return this.$store.getters.settings_option("webinterface","show_menu_item_files").value},is_visible_search(){return this.$store.getters.settings_option("webinterface","show_menu_item_search").value},player(){return this.$store.state.player},config(){return this.$store.state.config},library(){return this.$store.state.library},audiobooks(){return this.$store.state.audiobooks_count},podcasts(){return this.$store.state.podcasts_count},spotify_enabled(){return this.$store.state.spotify.webapi_token_valid},show_burger_menu:{get(){return this.$store.state.show_burger_menu},set(s){this.$store.commit(Z,s)}},show_player_menu(){return this.$store.state.show_player_menu},show_update_dialog:{get(){return this.$store.state.show_update_dialog},set(s){this.$store.commit(ot,s)}},zindex(){return this.show_player_menu?"z-index: 20":""}},watch:{$route(s,e){this.show_settings_menu=!1}},methods:{on_click_outside_settings(){this.show_settings_menu=!this.show_settings_menu},open_update_dialog(){this.show_update_dialog=!0,this.show_settings_menu=!1,this.show_burger_menu=!1}}},w2={class:"navbar-brand"},v2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-library-music"})],-1),$2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-music"})],-1),x2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-microphone"})],-1),C2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-book-open-variant"})],-1),q2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-radio"})],-1),S2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-folder-open"})],-1),P2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-magnify"})],-1),A2=t("span",null,null,-1),T2=t("span",null,null,-1),R2=t("span",null,null,-1),E2=[A2,T2,R2],I2=t("div",{class:"navbar-start"},null,-1),U2={class:"navbar-end"},L2=t("a",{class:"navbar-link is-arrowless"},[t("span",{class:"icon is-hidden-touch"},[t("i",{class:"mdi mdi-24px mdi-menu"})]),t("span",{class:"is-hidden-desktop has-text-weight-bold"},"OwnTone")],-1),O2={class:"navbar-dropdown is-right"},D2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-library-music"})],-1),z2=t("b",null,"Playlists",-1),N2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-music"})],-1),V2=t("b",null,"Music",-1),B2=t("span",{class:"fd-navbar-item-level2"},"Artists",-1),M2=t("span",{class:"fd-navbar-item-level2"},"Albums",-1),F2=t("span",{class:"fd-navbar-item-level2"},"Genres",-1),G2=t("span",{class:"fd-navbar-item-level2"},"Spotify",-1),j2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-microphone"})],-1),K2=t("b",null,"Podcasts",-1),H2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-book-open-variant"})],-1),W2=t("b",null,"Audiobooks",-1),Y2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-radio"})],-1),Q2=t("b",null,"Radio",-1),J2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-folder-open"})],-1),Z2=t("b",null,"Files",-1),X2=t("span",{class:"icon"},[t("i",{class:"mdi mdi-magnify"})],-1),tC=t("b",null,"Search",-1),sC=t("hr",{class:"fd-navbar-divider"},null,-1),eC=$(" Settings "),iC=$(" About "),oC=t("div",{class:"navbar-item is-hidden-desktop",style:{"margin-bottom":"2.5rem"}},null,-1);function aC(s,e,a,r,o,i){const n=h("navbar-item-link");return l(),_("nav",{class:"fd-top-navbar navbar is-light is-fixed-top",style:ts(i.zindex),role:"navigation","aria-label":"main navigation"},[t("div",w2,[i.is_visible_playlists?(l(),w(n,{key:0,to:"/playlists"},{default:d(()=>[v2]),_:1})):y("",!0),i.is_visible_music?(l(),w(n,{key:1,to:"/music"},{default:d(()=>[$2]),_:1})):y("",!0),i.is_visible_podcasts?(l(),w(n,{key:2,to:"/podcasts"},{default:d(()=>[x2]),_:1})):y("",!0),i.is_visible_audiobooks?(l(),w(n,{key:3,to:"/audiobooks"},{default:d(()=>[C2]),_:1})):y("",!0),i.is_visible_radio?(l(),w(n,{key:4,to:"/radio"},{default:d(()=>[q2]),_:1})):y("",!0),i.is_visible_files?(l(),w(n,{key:5,to:"/files"},{default:d(()=>[S2]),_:1})):y("",!0),i.is_visible_search?(l(),w(n,{key:6,to:"/search"},{default:d(()=>[P2]),_:1})):y("",!0),t("div",{class:C(["navbar-burger",{"is-active":i.show_burger_menu}]),onClick:e[0]||(e[0]=c=>i.show_burger_menu=!i.show_burger_menu)},E2,2)]),t("div",{class:C(["navbar-menu",{"is-active":i.show_burger_menu}])},[I2,t("div",U2,[t("div",{class:C(["navbar-item has-dropdown is-hoverable",{"is-active":o.show_settings_menu}]),onClick:e[2]||(e[2]=(...c)=>i.on_click_outside_settings&&i.on_click_outside_settings(...c))},[L2,t("div",O2,[u(n,{to:"/playlists"},{default:d(()=>[D2,z2]),_:1}),u(n,{to:"/music",exact:""},{default:d(()=>[N2,V2]),_:1}),u(n,{to:"/music/artists"},{default:d(()=>[B2]),_:1}),u(n,{to:"/music/albums"},{default:d(()=>[M2]),_:1}),u(n,{to:"/music/genres"},{default:d(()=>[F2]),_:1}),i.spotify_enabled?(l(),w(n,{key:0,to:"/music/spotify"},{default:d(()=>[G2]),_:1})):y("",!0),u(n,{to:"/podcasts"},{default:d(()=>[j2,K2]),_:1}),u(n,{to:"/audiobooks"},{default:d(()=>[H2,W2]),_:1}),u(n,{to:"/radio"},{default:d(()=>[Y2,Q2]),_:1}),u(n,{to:"/files"},{default:d(()=>[J2,Z2]),_:1}),u(n,{to:"/search"},{default:d(()=>[X2,tC]),_:1}),sC,u(n,{to:"/settings/webinterface"},{default:d(()=>[eC]),_:1}),t("a",{class:"navbar-item",onClick:e[1]||(e[1]=D(c=>i.open_update_dialog(),["stop","prevent"]))}," Update Library "),u(n,{to:"/about"},{default:d(()=>[iC]),_:1}),oC])],2)])],2),U(t("div",{class:"is-overlay",style:{"z-index":"10",width:"100vw",height:"100vh"},onClick:e[3]||(e[3]=c=>o.show_settings_menu=!1)},null,512),[[zt,o.show_settings_menu]])],4)}var nC=k(k2,[["render",aC]]),it={_audio:new Audio,_context:null,_source:null,_gain:null,setupAudio(){const s=window.AudioContext||window.webkitAudioContext;return this._context=new s,this._source=this._context.createMediaElementSource(this._audio),this._gain=this._context.createGain(),this._source.connect(this._gain),this._gain.connect(this._context.destination),this._audio.addEventListener("canplaythrough",e=>{this._audio.play()}),this._audio.addEventListener("canplay",e=>{this._audio.play()}),this._audio},setVolume(s){!this._gain||(s=parseFloat(s)||0,s=s<0?0:s,s=s>1?1:s,this._gain.gain.value=s)},playSource(s){this.stopAudio(),this._context.resume().then(()=>{this._audio.src=String(s||"")+"?x="+Date.now(),this._audio.crossOrigin="anonymous",this._audio.load()})},stopAudio(){try{this._audio.pause()}catch{}try{this._audio.stop()}catch{}try{this._audio.close()}catch{}}};const lC={name:"NavbarItemOutput",components:{Slider:Xt},props:["output"],computed:{type_class(){return this.output.type.startsWith("AirPlay")?"mdi-airplay":this.output.type==="Chromecast"?"mdi-cast":this.output.type==="fifo"?"mdi-pipe":"mdi-server"},volume(){return this.output.selected?this.output.volume:0}},methods:{play_next:function(){f.player_next()},set_volume:function(s){f.player_output_volume(this.output.id,s)},set_enabled:function(){const s={selected:!this.output.selected};f.output_update(this.output.id,s)}}},rC={class:"navbar-item"},dC={class:"level is-mobile"},_C={class:"level-left fd-expanded"},cC={class:"level-item",style:{"flex-grow":"0"}},uC={class:"button is-white is-small"},mC=["title"],hC={class:"level-item fd-expanded"},pC={class:"fd-expanded"};function fC(s,e,a,r,o,i){const n=h("Slider");return l(),_("div",rC,[t("div",dC,[t("div",_C,[t("div",cC,[t("a",uC,[t("span",{class:C(["icon fd-has-action",{"has-text-grey-light":!a.output.selected}]),onClick:e[0]||(e[0]=(...c)=>i.set_enabled&&i.set_enabled(...c))},[t("i",{class:C(["mdi mdi-18px",i.type_class]),title:a.output.type},null,10,mC)],2)])]),t("div",hC,[t("div",pC,[t("p",{class:C(["heading",{"has-text-grey-light":!a.output.selected}])},m(a.output.name),3),u(n,{modelValue:i.volume,"onUpdate:modelValue":e[1]||(e[1]=c=>i.volume=c),min:0,max:100,step:1,tooltips:!1,disabled:!a.output.selected,classes:{target:"slider"},onChange:i.set_volume},null,8,["modelValue","disabled","onChange"])])])])])])}var yC=k(lC,[["render",fC]]);const gC={name:"PlayerButtonPlayPause",props:{icon_style:String,show_disabled_message:Boolean},computed:{is_playing(){return this.$store.state.player.state==="play"},is_pause_allowed(){return this.$store.getters.now_playing&&this.$store.getters.now_playing.data_kind!=="pipe"},disabled(){return!this.$store.state.queue||this.$store.state.queue.count<=0}},methods:{toggle_play_pause:function(){if(this.disabled){this.show_disabled_message&&this.$store.dispatch("add_notification",{text:"Queue is empty",type:"info",topic:"connection",timeout:2e3});return}this.is_playing&&this.is_pause_allowed?f.player_pause():this.is_playing&&!this.is_pause_allowed?f.player_stop():f.player_play()}}},bC=["disabled"],kC={class:"icon"};function wC(s,e,a,r,o,i){return l(),_("a",{disabled:i.disabled,onClick:e[0]||(e[0]=(...n)=>i.toggle_play_pause&&i.toggle_play_pause(...n))},[t("span",kC,[t("i",{class:C(["mdi",[a.icon_style,{"mdi-play":!i.is_playing,"mdi-pause":i.is_playing&&i.is_pause_allowed,"mdi-stop":i.is_playing&&!i.is_pause_allowed}]])},null,2)])],8,bC)}var vC=k(gC,[["render",wC]]);const $C={name:"PlayerButtonNext",props:{icon_style:String},computed:{disabled(){return!this.$store.state.queue||this.$store.state.queue.count<=0}},methods:{play_next:function(){this.disabled||f.player_next()}}},xC=["disabled"],CC={class:"icon"};function qC(s,e,a,r,o,i){return l(),_("a",{disabled:i.disabled,onClick:e[0]||(e[0]=(...n)=>i.play_next&&i.play_next(...n))},[t("span",CC,[t("i",{class:C(["mdi mdi-skip-forward",a.icon_style])},null,2)])],8,xC)}var SC=k($C,[["render",qC]]);const PC={name:"PlayerButtonPrevious",props:{icon_style:String},computed:{disabled(){return!this.$store.state.queue||this.$store.state.queue.count<=0}},methods:{play_previous:function(){this.disabled||f.player_previous()}}},AC=["disabled"],TC={class:"icon"};function RC(s,e,a,r,o,i){return l(),_("a",{disabled:i.disabled,onClick:e[0]||(e[0]=(...n)=>i.play_previous&&i.play_previous(...n))},[t("span",TC,[t("i",{class:C(["mdi mdi-skip-backward",a.icon_style])},null,2)])],8,AC)}var EC=k(PC,[["render",RC]]);const IC={name:"PlayerButtonShuffle",props:{icon_style:String},computed:{is_shuffle(){return this.$store.state.player.shuffle}},methods:{toggle_shuffle_mode:function(){f.player_shuffle(!this.is_shuffle)}}},UC={class:"icon"};function LC(s,e,a,r,o,i){return l(),_("a",{class:C({"is-warning":i.is_shuffle}),onClick:e[0]||(e[0]=(...n)=>i.toggle_shuffle_mode&&i.toggle_shuffle_mode(...n))},[t("span",UC,[t("i",{class:C(["mdi",[a.icon_style,{"mdi-shuffle":i.is_shuffle,"mdi-shuffle-disabled":!i.is_shuffle}]])},null,2)])],2)}var OC=k(IC,[["render",LC]]);const DC={name:"PlayerButtonConsume",props:{icon_style:String},computed:{is_consume(){return this.$store.state.player.consume}},methods:{toggle_consume_mode:function(){f.player_consume(!this.is_consume)}}},zC={class:"icon"};function NC(s,e,a,r,o,i){return l(),_("a",{class:C({"is-warning":i.is_consume}),onClick:e[0]||(e[0]=(...n)=>i.toggle_consume_mode&&i.toggle_consume_mode(...n))},[t("span",zC,[t("i",{class:C(["mdi mdi-fire",a.icon_style])},null,2)])],2)}var VC=k(DC,[["render",NC]]);const BC={name:"PlayerButtonRepeat",props:{icon_style:String},computed:{is_repeat_all(){return this.$store.state.player.repeat==="all"},is_repeat_single(){return this.$store.state.player.repeat==="single"},is_repeat_off(){return!this.is_repeat_all&&!this.is_repeat_single}},methods:{toggle_repeat_mode:function(){this.is_repeat_all?f.player_repeat("single"):this.is_repeat_single?f.player_repeat("off"):f.player_repeat("all")}}},MC={class:"icon"};function FC(s,e,a,r,o,i){return l(),_("a",{class:C({"is-warning":!i.is_repeat_off}),onClick:e[0]||(e[0]=(...n)=>i.toggle_repeat_mode&&i.toggle_repeat_mode(...n))},[t("span",MC,[t("i",{class:C(["mdi",[a.icon_style,{"mdi-repeat":i.is_repeat_all,"mdi-repeat-once":i.is_repeat_single,"mdi-repeat-off":i.is_repeat_off}]])},null,2)])],2)}var GC=k(BC,[["render",FC]]);const jC={name:"PlayerButtonSeekBack",props:["seek_ms","icon_style"],computed:{now_playing(){return this.$store.getters.now_playing},is_stopped(){return this.$store.state.player.state==="stop"},disabled(){return!this.$store.state.queue||this.$store.state.queue.count<=0||this.is_stopped||this.now_playing.data_kind==="pipe"},visible(){return["podcast","audiobook"].includes(this.now_playing.media_kind)}},methods:{seek:function(){this.disabled||f.player_seek(this.seek_ms*-1)}}},KC=["disabled"],HC={class:"icon"};function WC(s,e,a,r,o,i){return i.visible?(l(),_("a",{key:0,disabled:i.disabled,onClick:e[0]||(e[0]=(...n)=>i.seek&&i.seek(...n))},[t("span",HC,[t("i",{class:C(["mdi mdi-rewind",a.icon_style])},null,2)])],8,KC)):y("",!0)}var YC=k(jC,[["render",WC]]);const QC={name:"PlayerButtonSeekForward",props:["seek_ms","icon_style"],computed:{now_playing(){return this.$store.getters.now_playing},is_stopped(){return this.$store.state.player.state==="stop"},disabled(){return!this.$store.state.queue||this.$store.state.queue.count<=0||this.is_stopped||this.now_playing.data_kind==="pipe"},visible(){return["podcast","audiobook"].includes(this.now_playing.media_kind)}},methods:{seek:function(){this.disabled||f.player_seek(this.seek_ms)}}},JC=["disabled"],ZC={class:"icon"};function XC(s,e,a,r,o,i){return i.visible?(l(),_("a",{key:0,disabled:i.disabled,onClick:e[0]||(e[0]=(...n)=>i.seek&&i.seek(...n))},[t("span",ZC,[t("i",{class:C(["mdi mdi-fast-forward",a.icon_style])},null,2)])],8,JC)):y("",!0)}var t4=k(QC,[["render",XC]]);const s4={name:"NavbarBottom",components:{NavbarItemLink:Hs,NavbarItemOutput:yC,Slider:Xt,PlayerButtonPlayPause:vC,PlayerButtonNext:SC,PlayerButtonPrevious:EC,PlayerButtonShuffle:OC,PlayerButtonConsume:VC,PlayerButtonRepeat:GC,PlayerButtonSeekForward:t4,PlayerButtonSeekBack:YC},data(){return{old_volume:0,playing:!1,loading:!1,stream_volume:10,show_outputs_menu:!1,show_desktop_outputs_menu:!1}},computed:{show_player_menu:{get(){return this.$store.state.show_player_menu},set(s){this.$store.commit(X,s)}},show_burger_menu(){return this.$store.state.show_burger_menu},zindex(){return this.show_burger_menu?"z-index: 20":""},state(){return this.$store.state.player},now_playing(){return this.$store.getters.now_playing},is_now_playing_page(){return this.$route.path==="/now-playing"},outputs(){return this.$store.state.outputs},player(){return this.$store.state.player},config(){return this.$store.state.config}},watch:{"$store.state.player.volume"(){this.player.volume>0&&(this.old_volume=this.player.volume)}},mounted(){this.setupAudio()},unmounted(){this.closeAudio()},methods:{on_click_outside_outputs(){this.show_outputs_menu=!1},set_volume:function(s){f.player_volume(s)},toggle_mute_volume:function(){this.player.volume>0?this.set_volume(0):this.set_volume(this.old_volume)},setupAudio:function(){const s=it.setupAudio();s.addEventListener("waiting",e=>{this.playing=!1,this.loading=!0}),s.addEventListener("playing",e=>{this.playing=!0,this.loading=!1}),s.addEventListener("ended",e=>{this.playing=!1,this.loading=!1}),s.addEventListener("error",e=>{this.closeAudio(),this.$store.dispatch("add_notification",{text:"HTTP stream error: failed to load stream or stopped loading due to network problem",type:"danger"}),this.playing=!1,this.loading=!1})},closeAudio:function(){it.stopAudio(),this.playing=!1},playChannel:function(){if(this.playing)return;const s="/stream.mp3";this.loading=!0,it.playSource(s),it.setVolume(this.stream_volume/100)},togglePlay:function(){if(!this.loading)return this.playing?this.closeAudio():this.playChannel()},set_stream_volume:function(s){this.stream_volume=s,it.setVolume(this.stream_volume/100)}}},e4={class:"navbar-brand fd-expanded"},i4=t("span",{class:"icon"},[t("i",{class:"mdi mdi-24px mdi-playlist-play"})],-1),o4={class:"is-clipped"},a4={class:"is-size-7 fd-is-text-clipped"},n4=t("br",null,null,-1),l4={key:0},r4={class:"icon"},d4={class:"icon"},_4={class:"navbar-dropdown is-right is-boxed",style:{"margin-right":"6px","margin-bottom":"6px","border-radius":"6px"}},c4={class:"navbar-item"},u4={class:"level is-mobile"},m4={class:"level-left fd-expanded"},h4={class:"level-item",style:{"flex-grow":"0"}},p4={class:"icon"},f4={class:"level-item fd-expanded"},y4={class:"fd-expanded"},g4=t("p",{class:"heading"},"Volume",-1),b4=t("hr",{class:"fd-navbar-divider"},null,-1),k4=t("hr",{class:"fd-navbar-divider"},null,-1),w4={class:"navbar-item"},v4={class:"level is-mobile"},$4={class:"level-left fd-expanded"},x4={class:"level-item",style:{"flex-grow":"0"}},C4=t("i",{class:"mdi mdi-18px mdi-radio-tower"},null,-1),q4=[C4],S4={class:"level-item fd-expanded"},P4={class:"fd-expanded"},A4=$(" HTTP stream "),T4=t("a",{href:"stream.mp3"},[t("span",{class:"is-lowercase"},"(stream.mp3)")],-1),R4=[A4,T4],E4=t("hr",{class:"fd-navbar-divider"},null,-1),I4={class:"navbar-item"},U4={class:"level is-mobile fd-expanded"},L4={class:"level-item"},O4={class:"buttons has-addons"},D4=t("div",{class:"navbar-start"},null,-1),z4={class:"navbar-end"},N4={class:"navbar-item"},V4={class:"buttons is-centered"},B4=t("hr",{class:"fd-navbar-divider"},null,-1),M4={class:"navbar-item"},F4={class:"level is-mobile"},G4={class:"level-left fd-expanded"},j4={class:"level-item",style:{"flex-grow":"0"}},K4={class:"icon"},H4={class:"level-item fd-expanded"},W4={class:"fd-expanded"},Y4=t("p",{class:"heading"},"Volume",-1),Q4=t("hr",{class:"fd-navbar-divider"},null,-1),J4={class:"navbar-item fd-has-margin-bottom"},Z4={class:"level is-mobile"},X4={class:"level-left fd-expanded"},t3={class:"level-item",style:{"flex-grow":"0"}},s3=t("i",{class:"mdi mdi-18px mdi-radio-tower"},null,-1),e3=[s3],i3={class:"level-item fd-expanded"},o3={class:"fd-expanded"},a3=$(" HTTP stream "),n3=t("a",{href:"stream.mp3"},[t("span",{class:"is-lowercase"},"(stream.mp3)")],-1),l3=[a3,n3];function r3(s,e,a,r,o,i){const n=h("navbar-item-link"),c=h("router-link"),p=h("player-button-previous"),g=h("player-button-seek-back"),b=h("player-button-play-pause"),x=h("player-button-seek-forward"),q=h("player-button-next"),z=h("Slider"),S=h("navbar-item-output"),W=h("player-button-repeat"),nt=h("player-button-shuffle"),lt=h("player-button-consume");return l(),_("nav",{class:C(["fd-bottom-navbar navbar is-white is-fixed-bottom",{"is-transparent":i.is_now_playing_page,"is-dark":!i.is_now_playing_page}]),style:ts(i.zindex),role:"navigation","aria-label":"player controls"},[t("div",e4,[u(n,{to:"/",exact:""},{default:d(()=>[i4]),_:1}),i.is_now_playing_page?y("",!0):(l(),w(c,{key:0,to:"/now-playing",class:"navbar-item is-expanded is-clipped","active-class":"is-active",exact:""},{default:d(()=>[t("div",o4,[t("p",a4,[t("strong",null,m(i.now_playing.title),1),n4,$(" "+m(i.now_playing.artist),1),i.now_playing.data_kind==="url"?(l(),_("span",l4," - "+m(i.now_playing.album),1)):y("",!0)])])]),_:1})),i.is_now_playing_page?(l(),w(p,{key:1,class:"navbar-item fd-margin-left-auto",icon_style:"mdi-24px"})):y("",!0),i.is_now_playing_page?(l(),w(g,{key:2,seek_ms:"10000",class:"navbar-item",icon_style:"mdi-24px"})):y("",!0),u(b,{class:"navbar-item",icon_style:"mdi-36px",show_disabled_message:""}),i.is_now_playing_page?(l(),w(x,{key:3,seek_ms:"30000",class:"navbar-item",icon_style:"mdi-24px"})):y("",!0),i.is_now_playing_page?(l(),w(q,{key:4,class:"navbar-item",icon_style:"mdi-24px"})):y("",!0),t("a",{class:"navbar-item fd-margin-left-auto is-hidden-desktop",onClick:e[0]||(e[0]=L=>i.show_player_menu=!i.show_player_menu)},[t("span",r4,[t("i",{class:C(["mdi mdi-18px",{"mdi-chevron-up":!i.show_player_menu,"mdi-chevron-down":i.show_player_menu}])},null,2)])]),t("div",{class:C(["navbar-item has-dropdown has-dropdown-up fd-margin-left-auto is-hidden-touch",{"is-active":i.show_player_menu}])},[t("a",{class:"navbar-link is-arrowless",onClick:e[1]||(e[1]=L=>i.show_player_menu=!i.show_player_menu)},[t("span",d4,[t("i",{class:C(["mdi mdi-18px",{"mdi-chevron-up":!i.show_player_menu,"mdi-chevron-down":i.show_player_menu}])},null,2)])]),t("div",_4,[t("div",c4,[t("div",u4,[t("div",m4,[t("div",h4,[t("a",{class:"button is-white is-small",onClick:e[2]||(e[2]=(...L)=>i.toggle_mute_volume&&i.toggle_mute_volume(...L))},[t("span",p4,[t("i",{class:C(["mdi mdi-18px",{"mdi-volume-off":i.player.volume<=0,"mdi-volume-high":i.player.volume>0}])},null,2)])])]),t("div",f4,[t("div",y4,[g4,u(z,{modelValue:i.player.volume,"onUpdate:modelValue":e[3]||(e[3]=L=>i.player.volume=L),min:0,max:100,step:1,tooltips:!1,classes:{target:"slider"},onChange:i.set_volume},null,8,["modelValue","onChange"])])])])])]),b4,(l(!0),_(T,null,I(i.outputs,L=>(l(),w(S,{key:L.id,output:L},null,8,["output"]))),128)),k4,t("div",w4,[t("div",v4,[t("div",$4,[t("div",x4,[t("a",{class:C(["button is-white is-small",{"is-loading":o.loading}])},[t("span",{class:C(["icon fd-has-action",{"has-text-grey-light":!o.playing&&!o.loading,"is-loading":o.loading}]),onClick:e[4]||(e[4]=(...L)=>i.togglePlay&&i.togglePlay(...L))},q4,2)],2)]),t("div",S4,[t("div",P4,[t("p",{class:C(["heading",{"has-text-grey-light":!o.playing}])},R4,2),u(z,{modelValue:o.stream_volume,"onUpdate:modelValue":e[5]||(e[5]=L=>o.stream_volume=L),min:0,max:100,step:1,tooltips:!1,disabled:!o.playing,classes:{target:"slider"},onChange:i.set_stream_volume},null,8,["modelValue","disabled","onChange"])])])])])]),E4,t("div",I4,[t("div",U4,[t("div",L4,[t("div",O4,[u(W,{class:"button"}),u(nt,{class:"button"}),u(lt,{class:"button"})])])])])])],2)]),t("div",{class:C(["navbar-menu is-hidden-desktop",{"is-active":i.show_player_menu}])},[D4,t("div",z4,[t("div",N4,[t("div",V4,[u(W,{class:"button",icon_style:"mdi-18px"}),u(nt,{class:"button",icon_style:"mdi-18px"}),u(lt,{class:"button",icon_style:"mdi-18px"})])]),B4,t("div",M4,[t("div",F4,[t("div",G4,[t("div",j4,[t("a",{class:"button is-white is-small",onClick:e[6]||(e[6]=(...L)=>i.toggle_mute_volume&&i.toggle_mute_volume(...L))},[t("span",K4,[t("i",{class:C(["mdi mdi-18px",{"mdi-volume-off":i.player.volume<=0,"mdi-volume-high":i.player.volume>0}])},null,2)])])]),t("div",H4,[t("div",W4,[Y4,u(z,{modelValue:i.player.volume,"onUpdate:modelValue":e[7]||(e[7]=L=>i.player.volume=L),min:0,max:100,step:1,tooltips:!1,classes:{target:"slider"},onChange:i.set_volume},null,8,["modelValue","onChange"])])])])])]),(l(!0),_(T,null,I(i.outputs,L=>(l(),w(S,{key:L.id,output:L},null,8,["output"]))),128)),Q4,t("div",J4,[t("div",Z4,[t("div",X4,[t("div",t3,[t("a",{class:C(["button is-white is-small",{"is-loading":o.loading}])},[t("span",{class:C(["icon fd-has-action",{"has-text-grey-light":!o.playing&&!o.loading,"is-loading":o.loading}]),onClick:e[8]||(e[8]=(...L)=>i.togglePlay&&i.togglePlay(...L))},e3,2)],2)]),t("div",i3,[t("div",o3,[t("p",{class:C(["heading",{"has-text-grey-light":!o.playing}])},l3,2),u(z,{modelValue:o.stream_volume,"onUpdate:modelValue":e[9]||(e[9]=L=>o.stream_volume=L),min:0,max:100,step:1,tooltips:!1,disabled:!o.playing,classes:{target:"slider"},onChange:i.set_stream_volume},null,8,["modelValue","disabled","onChange"])])])])])])])],2)],6)}var d3=k(s4,[["render",r3]]);const _3={name:"NotificationList",components:{},data(){return{showNav:!1}},computed:{notifications(){return this.$store.state.notifications.list}},methods:{remove:function(s){this.$store.commit(Wt,s)}}},c3={key:0,class:"fd-notifications"},u3={class:"columns is-centered"},m3={class:"column is-half"},h3=["onClick"];function p3(s,e,a,r,o,i){return i.notifications.length>0?(l(),_("section",c3,[t("div",u3,[t("div",m3,[(l(!0),_(T,null,I(i.notifications,n=>(l(),_("div",{key:n.id,class:C(["notification has-shadow",["notification",n.type?`is-${n.type}`:""]])},[t("button",{class:"delete",onClick:c=>i.remove(n)},null,8,h3),$(" "+m(n.text),1)],2))),128))])])])):y("",!0)}var f3=k(_3,[["render",p3]]);const y3={name:"ModalDialogRemotePairing",props:["show"],emits:["close"],data(){return{pairing_req:{pin:""}}},computed:{pairing(){return this.$store.state.pairing}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.pin_field.focus()},10))}},methods:{kickoff_pairing(){f.pairing_kickoff(this.pairing_req).then(()=>{this.pairing_req.pin=""})}}},g3={key:0,class:"modal is-active"},b3={class:"modal-content fd-modal-card"},k3={class:"card"},w3={class:"card-content"},v3=t("p",{class:"title is-4"},"Remote pairing request",-1),$3={class:"label"},x3={class:"field"},C3={class:"control"},q3={class:"card-footer"},S3=t("span",{class:"icon"},[t("i",{class:"mdi mdi-cancel"})],-1),P3=t("span",{class:"is-size-7"},"Cancel",-1),A3=[S3,P3],T3=t("span",{class:"icon"},[t("i",{class:"mdi mdi-cellphone-iphone"})],-1),R3=t("span",{class:"is-size-7"},"Pair Remote",-1),E3=[T3,R3];function I3(s,e,a,r,o,i){return l(),_("div",null,[u(N,{name:"fade"},{default:d(()=>[a.show?(l(),_("div",g3,[t("div",{class:"modal-background",onClick:e[0]||(e[0]=n=>s.$emit("close"))}),t("div",b3,[t("div",k3,[t("div",w3,[v3,t("form",{onSubmit:e[2]||(e[2]=D((...n)=>i.kickoff_pairing&&i.kickoff_pairing(...n),["prevent"]))},[t("label",$3,m(i.pairing.remote),1),t("div",x3,[t("div",C3,[U(t("input",{ref:"pin_field","onUpdate:modelValue":e[1]||(e[1]=n=>o.pairing_req.pin=n),class:"input",type:"text",placeholder:"Enter pairing code"},null,512),[[M,o.pairing_req.pin]])])])],32)]),t("footer",q3,[t("a",{class:"card-footer-item has-text-danger",onClick:e[3]||(e[3]=n=>s.$emit("close"))},A3),t("a",{class:"card-footer-item has-background-info has-text-white has-text-weight-bold",onClick:e[4]||(e[4]=(...n)=>i.kickoff_pairing&&i.kickoff_pairing(...n))},E3)])])]),t("button",{class:"modal-close is-large","aria-label":"close",onClick:e[5]||(e[5]=n=>s.$emit("close"))})])):y("",!0)]),_:1})])}var U3=k(y3,[["render",I3]]);const L3={name:"ModalDialogUpdate",components:{ModalDialog:rs},props:["show"],emits:["close"],data(){return{rescan_metadata:!1}},computed:{library(){return this.$store.state.library},rss(){return this.$store.state.rss_count},spotify_enabled(){return this.$store.state.spotify.webapi_token_valid},update_dialog_scan_kind:{get(){return this.$store.state.update_dialog_scan_kind},set(s){this.$store.commit(ls,s)}}},methods:{update_library(){this.rescan_metadata?f.library_rescan(this.update_dialog_scan_kind):f.library_update(this.update_dialog_scan_kind)},close(){this.update_dialog_scan_kind="",this.$emit("close")}}},O3={key:0},D3=t("p",{class:"mb-3"},"Scan for new, deleted and modified files",-1),z3={key:0,class:"field"},N3={class:"control"},V3={class:"select is-small"},B3=t("option",{value:""},"Update everything",-1),M3=t("option",{value:"files"},"Only update local library",-1),F3={key:0,value:"spotify"},G3={key:1,value:"rss"},j3={class:"field"},K3={class:"checkbox is-size-7 is-small"},H3=$(" Rescan metadata for unmodified files "),W3={key:1},Y3=t("p",{class:"mb-3"},"Library update in progress ...",-1),Q3=[Y3];function J3(s,e,a,r,o,i){const n=h("modal-dialog");return l(),w(n,{show:a.show,title:"Update library",ok_action:i.library.updating?"":"Rescan",close_action:"Close",onOk:i.update_library,onClose:e[2]||(e[2]=c=>i.close())},{"modal-content":d(()=>[i.library.updating?(l(),_("div",W3,Q3)):(l(),_("div",O3,[D3,i.spotify_enabled||i.rss.tracks>0?(l(),_("div",z3,[t("div",N3,[t("div",V3,[U(t("select",{"onUpdate:modelValue":e[0]||(e[0]=c=>i.update_dialog_scan_kind=c)},[B3,M3,i.spotify_enabled?(l(),_("option",F3," Only update Spotify ")):y("",!0),i.rss.tracks>0?(l(),_("option",G3," Only update RSS feeds ")):y("",!0)],512),[[se,i.update_dialog_scan_kind]])])])])):y("",!0),t("div",j3,[t("label",K3,[U(t("input",{"onUpdate:modelValue":e[1]||(e[1]=c=>o.rescan_metadata=c),type:"checkbox"},null,512),[[J,o.rescan_metadata]]),H3])])]))]),_:1},8,["show","ok_action","onOk"])}var Z3=k(L3,[["render",J3]]);const X3={name:"App",components:{NavbarTop:nC,NavbarBottom:d3,NotificationList:f3,ModalDialogRemotePairing:U3,ModalDialogUpdate:Z3},data(){return{token_timer_id:0,reconnect_attempts:0,pairing_active:!1}},computed:{show_burger_menu:{get(){return this.$store.state.show_burger_menu},set(s){this.$store.commit(Z,s)}},show_player_menu:{get(){return this.$store.state.show_player_menu},set(s){this.$store.commit(X,s)}},show_update_dialog:{get(){return this.$store.state.show_update_dialog},set(s){this.$store.commit(ot,s)}}},watch:{show_burger_menu(){this.update_is_clipped()},show_player_menu(){this.update_is_clipped()}},created:function(){Y.locale(navigator.language),this.connect(),this.$Progress.start(),this.$router.beforeEach((s,e,a)=>{if(s.meta.show_progress){if(s.meta.progress!==void 0){const r=s.meta.progress;this.$Progress.parseMeta(r)}this.$Progress.start()}a()}),this.$router.afterEach((s,e)=>{s.meta.show_progress&&this.$Progress.finish()})},methods:{connect:function(){f.config().then(({data:s})=>{this.$store.commit(ks,s),this.$store.commit(Mt,s.hide_singles),document.title=s.library_name,this.open_ws(),this.$Progress.finish()}).catch(()=>{this.$store.dispatch("add_notification",{text:"Failed to connect to OwnTone server",type:"danger",topic:"connection"})})},open_ws:function(){if(this.$store.state.config.websocket_port<=0){this.$store.dispatch("add_notification",{text:"Missing websocket port",type:"danger"});return}const s=this;let e="ws://";window.location.protocol==="https:"&&(e="wss://");let a=e+window.location.hostname+":"+s.$store.state.config.websocket_port;const r=new ee(a,"notify",{reconnectInterval:1e3,maxReconnectInterval:2e3});r.onopen=function(){s.reconnect_attempts=0,r.send(JSON.stringify({notify:["update","database","player","options","outputs","volume","queue","spotify","lastfm","pairing"]})),s.update_outputs(),s.update_player_status(),s.update_library_stats(),s.update_settings(),s.update_queue(),s.update_spotify(),s.update_lastfm(),s.update_pairing()},r.onclose=function(){};var o=!1;function i(){o||(s.update_outputs(),s.update_player_status(),s.update_library_stats(),s.update_settings(),s.update_queue(),s.update_spotify(),s.update_lastfm(),s.update_pairing(),o=!0,setTimeout(function(){o=!1},500))}window.addEventListener("focus",i),document.addEventListener("visibilitychange",function(){document.visibilityState==="visible"&&i()}),r.onmessage=function(n){const c=JSON.parse(n.data);(c.notify.includes("update")||c.notify.includes("database"))&&s.update_library_stats(),(c.notify.includes("player")||c.notify.includes("options")||c.notify.includes("volume"))&&s.update_player_status(),(c.notify.includes("outputs")||c.notify.includes("volume"))&&s.update_outputs(),c.notify.includes("queue")&&s.update_queue(),c.notify.includes("spotify")&&s.update_spotify(),c.notify.includes("lastfm")&&s.update_lastfm(),c.notify.includes("pairing")&&s.update_pairing()}},update_library_stats:function(){f.library_stats().then(({data:s})=>{this.$store.commit(vs,s)}),f.library_count("media_kind is audiobook").then(({data:s})=>{this.$store.commit($s,s)}),f.library_count("media_kind is podcast").then(({data:s})=>{this.$store.commit(xs,s)}),f.library_count("scan_kind is rss").then(({data:s})=>{this.$store.commit(Cs,s)})},update_outputs:function(){f.outputs().then(({data:s})=>{this.$store.commit(qs,s.outputs)})},update_player_status:function(){f.player_status().then(({data:s})=>{this.$store.commit(es,s)})},update_queue:function(){f.queue().then(({data:s})=>{this.$store.commit(Ss,s)})},update_settings:function(){f.settings().then(({data:s})=>{this.$store.commit(ws,s)})},update_lastfm:function(){f.lastfm().then(({data:s})=>{this.$store.commit(Ps,s)})},update_spotify:function(){f.spotify().then(({data:s})=>{this.$store.commit(As,s),this.token_timer_id>0&&(window.clearTimeout(this.token_timer_id),this.token_timer_id=0),s.webapi_token_expires_in>0&&s.webapi_token&&(this.token_timer_id=window.setTimeout(this.update_spotify,1e3*s.webapi_token_expires_in))})},update_pairing:function(){f.pairing().then(({data:s})=>{this.$store.commit(Ts,s),this.pairing_active=s.active})},update_is_clipped:function(){this.show_burger_menu||this.show_player_menu?document.querySelector("html").classList.add("is-clipped"):document.querySelector("html").classList.remove("is-clipped")}},template:"<App/>"},t8={id:"app"};function s8(s,e,a,r,o,i){const n=h("navbar-top"),c=h("vue-progress-bar"),p=h("router-view"),g=h("modal-dialog-remote-pairing"),b=h("modal-dialog-update"),x=h("notification-list"),q=h("navbar-bottom");return l(),_("div",t8,[u(n),u(c,{class:"fd-progress-bar"}),u(p,null,{default:d(({Component:z})=>[(l(),w(ie(z),{class:"fd-page"}))]),_:1}),u(g,{show:o.pairing_active,onClose:e[0]||(e[0]=z=>o.pairing_active=!1)},null,8,["show"]),u(b,{show:i.show_update_dialog,onClose:e[1]||(e[1]=z=>i.show_update_dialog=!1)},null,8,["show"]),U(u(x,null,null,512),[[zt,!i.show_burger_menu]]),u(q),U(t("div",{class:"fd-overlay-fullscreen",onClick:e[2]||(e[2]=z=>i.show_burger_menu=i.show_player_menu=!1)},null,512),[[zt,i.show_burger_menu||i.show_player_menu]])])}var e8=k(X3,[["render",s8]]);const Ws=oe(e8).use(A).use(Ks).use(ae,{color:"hsl(204, 86%, 53%)",failedColor:"red",height:"1px"}).use(ne).use(le,{log:!1}).use(re);Ws.config.globalProperties.$filters=f2;Ws.mount("#app");
|