From add0eff64ac0b89aca41e4288a82b34cce96bec6 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Sun, 13 Oct 2019 14:49:53 +1300 Subject: [PATCH] Buildout --- VERSION.md | 2 +- mopidy_iris/__init__.py | 2 +- mopidy_iris/static/app.min.css | 182 +++++++++++++++++---------------- mopidy_iris/static/app.min.js | 8 +- mopidy_iris/static/index.html | 4 +- package.json | 2 +- 6 files changed, 104 insertions(+), 96 deletions(-) diff --git a/VERSION.md b/VERSION.md index 050c055b..2624404f 100755 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -3.41.1 \ No newline at end of file +3.41.2 \ No newline at end of file diff --git a/mopidy_iris/__init__.py b/mopidy_iris/__init__.py index a0725a20..3e493946 100755 --- a/mopidy_iris/__init__.py +++ b/mopidy_iris/__init__.py @@ -12,7 +12,7 @@ from handlers import WebsocketHandler, HttpHandler from core import IrisCore logger = logging.getLogger(__name__) -__version__ = '3.41.1' +__version__ = '3.41.2' ## # Core extension class diff --git a/mopidy_iris/static/app.min.css b/mopidy_iris/static/app.min.css index f73235df..f4bb4b28 100644 --- a/mopidy_iris/static/app.min.css +++ b/mopidy_iris/static/app.min.css @@ -5537,16 +5537,18 @@ main header { vertical-align: bottom; margin-bottom: 8px; font-size: 0.9em; } - main header .options { + main header .header__options { position: absolute; top: 2.6rem; right: 40px; } - main header .options .context-menu-trigger { + main header .header__options__wrapper { + display: flex; } + main header .header__options .context-menu-trigger { display: none; font-size: 18px; padding: 16px 14px; } - main header .options .button, - main header .options button { + main header .header__options .button, + main header .header__options button { font-size: 13px; font-weight: 800; font-family: "Overpass"; @@ -5557,21 +5559,21 @@ main header { min-width: 0; color: #cecac4; vertical-align: unset; } - main header .options .button:hover, - main header .options button:hover { + main header .header__options .button:hover, + main header .header__options button:hover { color: #32b5f2; box-shadow: none; } - main header .options .button:hover:before, - main header .options button:hover:before { + main header .header__options .button:hover:before, + main header .header__options button:hover:before { display: none; } - .light-theme main header .options .button, .light-theme - main header .options button { + .light-theme main header .header__options .button, .light-theme + main header .header__options button { color: #121212; } - .light-theme main header .options .button:hover, .light-theme - main header .options button:hover { + .light-theme main header .header__options .button:hover, .light-theme + main header .header__options button:hover { color: #32b5f2; } - .light-theme main header .options .button:active, .light-theme - main header .options button:active { + .light-theme main header .header__options .button:active, .light-theme + main header .header__options button:active { background: transparent; } main header.overlay { position: absolute; @@ -5590,12 +5592,12 @@ main header { margin-bottom: 2px; padding-right: 6px; margin-left: 10px; } - main header .options { + main header .header__options { top: 0; right: 0; } - main header .options .context-menu-trigger { + main header .header__options .context-menu-trigger { display: block; } - main header .options .items { + main header .header__options__wrapper { display: none; } } .notifications { @@ -5798,35 +5800,37 @@ main header { font-family: "Overpass"; position: relative; display: inline-block; } - .dropdown-field .label { + .dropdown-field__label { display: flex; } - .dropdown-field .label .icon { + .dropdown-field__label__name { + display: none; } + .dropdown-field__label .icon { padding-right: 8px; } - .dropdown-field .label:not(.button) { + .dropdown-field__label:not(.button) { -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; padding: 14px 10px; cursor: pointer; } - .notouch .dropdown-field .label:not(.button):hover { + .notouch .dropdown-field__label:not(.button):hover { color: #32b5f2; } - .dropdown-field.expanded .label:not(.button) { + .dropdown-field--expanded .label:not(.button) { color: #32b5f2; } - .dropdown-field.expanded .options { + .dropdown-field--expanded .dropdown-field__options { display: block; } - .dropdown-field.no-status-icon .options .option { + .dropdown-field--no-status-icon .dropdown-field__options__item { padding-left: 12px; } - .dropdown-field.no-label .label > .text { + .dropdown-field--no-label .label > .text { display: none; } - .dropdown-field .options { + .dropdown-field__options { position: absolute; top: 46px; right: 10px; z-index: 97; display: none; box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.2); } - .dropdown-field .options:before { + .dropdown-field__options:before { content: ''; display: block; width: 6px; @@ -5838,70 +5842,74 @@ main header { position: absolute; top: -3px; right: 9px; } - .light-theme .dropdown-field .options:before { + .light-theme .dropdown-field__options:before { background: #f4f2f0; } - .dropdown-field .options > .liner { + .dropdown-field__options__liner { color: #000000; background: #FFFFFF; min-width: 120px; max-height: 70vh; overflow-y: auto; border-radius: 3px; } - .light-theme .dropdown-field .options > .liner { + .light-theme .dropdown-field__options__liner { background: #f4f2f0; } - .dropdown-field .options > .liner .option { + .dropdown-field__options__item { + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + position: relative; + padding: 9px 12px 8px 24px; + cursor: pointer; + color: #000000; } + .dropdown-field__options__item:before { -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; - position: relative; - padding: 9px 12px 8px 24px; - cursor: pointer; + content: ''; + display: block; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + opacity: 0; + z-index: 9; + background: -webkit-linear-gradient(to bottom right, white, rgba(0, 0, 0, 0.5)); + background: -moz-linear-gradient(to bottom right, white, rgba(0, 0, 0, 0.5)); + background: -o-linear-gradient(to bottom right, white, rgba(0, 0, 0, 0.5)); + background: linear-gradient(to bottom right, white, rgba(0, 0, 0, 0.5)); } + .dropdown-field__options__item .icon { + position: absolute; + top: 8px; + left: 6px; + font-size: 16px; } + .notouch .dropdown-field__options__item:hover { color: #000000; } - .dropdown-field .options > .liner .option:before { - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; - content: ''; - display: block; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - opacity: 0; - z-index: 9; - background: -webkit-linear-gradient(to bottom right, white, rgba(0, 0, 0, 0.5)); - background: -moz-linear-gradient(to bottom right, white, rgba(0, 0, 0, 0.5)); - background: -o-linear-gradient(to bottom right, white, rgba(0, 0, 0, 0.5)); - background: linear-gradient(to bottom right, white, rgba(0, 0, 0, 0.5)); } - .dropdown-field .options > .liner .option .icon { - position: absolute; - top: 8px; - left: 6px; - font-size: 16px; } - .notouch .dropdown-field .options > .liner .option:hover { - color: #000000; } - .notouch .dropdown-field .options > .liner .option:hover:before { - opacity: 0.15; } + .notouch .dropdown-field__options__item:hover:before { + opacity: 0.15; } #context-menu .dropdown-field { padding: 16px 0; display: block; } #context-menu .dropdown-field:active, #context-menu .dropdown-field:focus { background: none !important; } - #context-menu .dropdown-field .label { + #context-menu .dropdown-field__label { padding: 0 0 3px 0; opacity: 0.5; font-size: 1rem; display: block; cursor: default; } - #context-menu .dropdown-field .label, #context-menu .dropdown-field .label:hover { + #context-menu .dropdown-field__label__value { + display: none; } + #context-menu .dropdown-field__label__name { + display: inline-block; } + #context-menu .dropdown-field__label, #context-menu .dropdown-field__label:hover { color: #FFFFFF; } - .light-theme #context-menu .dropdown-field .label, .light-theme #context-menu .dropdown-field .label:hover { + .light-theme #context-menu .dropdown-field__label, .light-theme #context-menu .dropdown-field__label:hover { color: #181818 !important; } - #context-menu .dropdown-field .options { + #context-menu .dropdown-field__options { display: block; position: static; background: transparent; @@ -5910,31 +5918,31 @@ main header { box-shadow: none; font-weight: 700; font-size: 1.2rem; } - #context-menu .dropdown-field .options:before { + #context-menu .dropdown-field__options:before { display: none !important; } - #context-menu .dropdown-field .options > .liner { + #context-menu .dropdown-field__options__liner { background: transparent; color: #FFFFFF !important; margin: -3px -5px; } - .light-theme #context-menu .dropdown-field .options > .liner { + .light-theme #context-menu .dropdown-field__options__liner { color: #181818 !important; } - #context-menu .dropdown-field .options > .liner:before { + #context-menu .dropdown-field__options__liner:before { display: none !important; } - #context-menu .dropdown-field .options > .liner .option { + #context-menu .dropdown-field__options__item { + display: block; + padding: 3px 5px; + border-radius: 0; + color: #FFFFFF !important; } + .light-theme #context-menu .dropdown-field__options__item { + color: #181818 !important; } + #context-menu .dropdown-field__options__item:before { + display: none !important; } + #context-menu .dropdown-field__options__item .icon { display: inline-block; - padding: 3px 5px; - border-radius: 0; - color: #FFFFFF !important; } - .light-theme #context-menu .dropdown-field .options > .liner .option { - color: #181818 !important; } - #context-menu .dropdown-field .options > .liner .option:before { - display: none !important; } - #context-menu .dropdown-field .options > .liner .option .icon { - display: inline-block; - position: static; - padding-right: 2px; - padding-bottom: 3px; - font-size: 0.9em; } + position: static; + padding-right: 2px; + padding-bottom: 3px; + font-size: 0.9em; } .autocomplete-field { position: relative; } @@ -5991,7 +5999,7 @@ main header { .filter-field .icon { position: absolute; - top: 10px; + top: 12px; left: 15px; pointer-events: none; } @@ -6949,12 +6957,12 @@ main .track-view { align-items: center; } .queue-view .current-track__added-from__text { border: 0 !important; - display: flex; - padding-left: 15px; } + display: flex; } .queue-view .current-track__added-from__text .links-sentence { padding-left: 0.15em; } .queue-view .current-track__added-from__thumbnail { - border: 0 !important; } + border: 0 !important; + margin-right: 15px; } .queue-view .current-track__added-from__thumbnail .thumbnail { width: 30px; } .queue-view .current-track__queue-details { diff --git a/mopidy_iris/static/app.min.js b/mopidy_iris/static/app.min.js index d10c80a8..3421c24a 100644 --- a/mopidy_iris/static/app.min.js +++ b/mopidy_iris/static/app.min.js @@ -1,4 +1,4 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=82)}([function(e,t,n){"use strict";e.exports=n(83)},function(e,t,n){e.exports=n(88)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};if(o){var n=o.getItem(e);return n?JSON.parse(n):t}return console.warn("localStorage not available. Using default value for '"+e+"'."),t},s=t.setStorage=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(o){var r=o.getItem(e);if(!r||n)var i=t;else i=a({},JSON.parse(r),t);o.setItem(e,JSON.stringify(i))}else console.warn("localStorage not available. '"+e+"'' will not perist when you close your browser.")},l=(t.cache={get:function(e){var t=i("cache",{});if(void 0!==t['"'+e+'"'])return t['"'+e+'"']},set:function(e,t){var n=i("cache",{});return n['"'+e+'"']=t,s("cache",n),!0},clear:function(){s("cache",{},!0)}},t.toJSON=function(e){try{return JSON.parse(e)}catch(t){if(e.constructor==={}.constructor)return e;console.error("Could not convert non-JSON",string)}return{}},t.setFavicon=function(e){var t=document.getElementsByClassName("favicon"),n=!0,r=!1,a=void 0;try{for(var o,i=t[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value,l=document.createElement("link");l.className=s.className,l.rel=s.rel,l.href="/iris/assets/"+e,s.type&&(l.type=s.type),document.head.removeChild(s),document.head.appendChild(l)}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}},t.isCached=function(e){var t=new Image;return t.src=e,t.complete},t.digestMopidyImages=function(e,t){for(var n=[],a=0;a0&&void 0!==arguments[0]?arguments[0]:"numeric";if("numeric"==e){var t=(new Date).valueOf().toString(),n=Math.floor(100*Math.random()).toString();return parseInt(t+n)}var r="xxxxxxxxxx";return r.replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},t.getCurrentPusherConnection=function(e,t){var n=newProps.pusher.connections.find(function(e){return e.connectionid==newProps.pusher.connectionid});return n||!1},t.getTrackIcon=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return!1;if(!e)return!1;if(void 0===e.uri)return!1;if(void 0===t.tracks[e.uri])return!1;var n=t.tracks[e.uri];return!!n.images&&l(n.images).small},t.formatImages=function(e){var t={formatted:!0,small:null,medium:null,large:null,huge:null};if(!e)return t;if(Array.isArray(e)){if(e.length<=0)return t;for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;t.push(d(s))}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t},t.formatAlbums=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;t.push(u(s))}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t},t.formatArtists=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;t.push(c(s))}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t},t.formatPlaylists=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;t.push(d(s))}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t},t.formatUsers=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;t.push(p(s))}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t},t.formatAlbum=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["uri","provider","name","type","added_at","release_date","listeners","play_count","wiki","wiki_publish_date","popularity","images","artists_uris","tracks_uris","artists"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t.images&&!t.images.formatted&&(t.images=l(t.images)),e.date&&!t.date&&(t.release_date=e.date),e.album_type&&(t.type=e.album_type),void 0===t.provider&&void 0!==t.uri&&(t.provider=f(t.uri)),t}),c=t.formatArtist=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["uri","provider","mbid","name","type","popularity","followers","listeners","added_at","biography","biography_link","biography_publish_date","related_artists_uris","albums_uris","albums_total","albums_more","tracks_uris","tracks_total","tracks_more"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return e.images&&e.images.length>0&&(t.images=[l(e.images)]),e.followers&&void 0!==e.followers.total&&(t.followers=e.followers.total),e.bio&&(e.bio.content&&!t.biography&&(t.biography=e.bio.content),e.bio.links&&e.bio.links.link&&e.bio.links.link.href&&!t.biography_link&&(t.biography_link=e.bio.links.link.href),e.bio.published&&!t.biography_publish_date&&(t.biography_publish_date=e.bio.published)),void 0===t.provider&&void 0!==t.uri&&(t.provider=f(t.uri)),t},p=(t.formatPlaylist=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["uri","snapshot_id","provider","type","collaborative","public","name","description","images","popularity","followers","added_at","last_modified_date","can_edit","owner","user_uri","tracks_uris","tracks_total","tracks_more"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t.images&&!t.images.formatted&&(t.images=l(t.images)),e.followers&&void 0!==e.followers.total&&(t.followers=e.followers.total),e.tracks&&void 0!==e.tracks.total&&(t.tracks_total=e.tracks.total),e.owner&&(t.owner={id:e.owner.id,uri:e.owner.uri,name:e.owner.display_name?e.owner.display_name:null},t.user_uri=e.owner.uri),t.uri=_(t.uri),void 0===t.provider&&void 0!==t.uri&&(t.provider=f(t.uri)),t},t.formatUser=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["id","uri","provider","name","images","followers","playlists_uris","playlists_total","playlists_more"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return!t.images&&e.image?t.images=l(e.image):!t.images&&e.avatar?t.images=l(e.avatar):t.images&&!t.images.formatted&&(t.images=l(t.images)),e.followers&&void 0!==e.followers.total&&(t.followers=e.followers.total),e.realname&&(t.name=e.realname),e.display_name&&!t.name&&(t.name=e.display_name),e.id&&!t.name&&(t.name=e.id),void 0===t.provider&&void 0!==t.uri&&(t.provider=f(t.uri)),t}),d=t.formatTrack=function(e){var t={};e&&e.track&&m(e.track)&&(e.added_by&&(e.track.added_by=e.added_by),e.added_at&&(e.track.added_at=e.added_at),e.tlid&&(e.track.tlid=e.tlid),e=e.track);var n=!0,r=!1,a=void 0;try{for(var o,i=["uri","tlid","provider","name","images","release_date","disc_number","track_number","duration","followers","popularity","userloved","is_explicit","is_local","lyrics","lyrics_path","lyrics_results","artists","album"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return e.followers&&e.followers.total&&(t.followers=e.followers.total),void 0===t.duration&&void 0!==e.duration_ms?t.duration=e.duration_ms:void 0===t.duration&&void 0!==e.length&&(t.duration=e.length),void 0===t.track_number&&void 0!==e.track_no&&(t.track_number=e.track_no),void 0===t.disc_number&&void 0!==e.disc_no&&(t.disc_number=e.disc_no),void 0===t.release_date&&void 0!==e.date&&(t.release_date=e.date),void 0===t.explicit&&void 0!==e.explicit&&(t.is_explicit=e.explicit),e.album&&e.album.images&&(void 0!==t.images&&t.images.formatted||(t.images=l(e.album.images))),void 0===t.provider&&void 0!==t.uri&&(t.provider=f(t.uri)),t},f=(t.formatClient=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["id","connected","name","host_name","volume","mute","latency","power_on_command","power_off_command"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return e.config&&(void 0===t.latency&&void 0!==e.config.latency&&(t.latency=e.config.latency),!t.name&&e.config.name&&(t.name=e.config.name),e.config.volume&&(e.config.volume.percent&&(t.volume=e.config.volume.percent),e.config.volume.muted&&(t.mute=e.config.volume.muted))),void 0===t.name&&e.host&&e.host.name&&(t.name=e.host.name),t},t.formatGroup=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["id","name","mute","stream_id","clients_ids"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return void 0!==t.name&&""!==t.name||(t.name="Group "+e.id.substring(0,3)),void 0===t.mute&&void 0!==e.mute&&(t.mute=e.mute),t},t.collate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==(e=a({},e)).artists_uris&&(e.artists=[]),void 0!==e.albums_uris&&(e.albums=[]),void 0!==e.tracks_uris&&(e.tracks=[]),void 0!==e.users_uris&&(e.users=[]),void 0!==e.playlists_uris&&(e.playlists=[]),void 0!==e.related_artists_uris&&(e.related_artists=[]),void 0!==e.clients_ids&&(e.clients=[]),t.artists){if(e.artists_uris){var n=!0,r=!1,o=void 0;try{for(var i,s=e.artists_uris[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var l=i.value;t.artists[l]&&e.artists.push(t.artists[l])}}catch(e){r=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}}if(e.related_artists_uris){var u=!0,c=!1,p=void 0;try{for(var d,f=e.related_artists_uris[Symbol.iterator]();!(u=(d=f.next()).done);u=!0){l=d.value;t.artists[l]&&e.related_artists.push(t.artists[l])}}catch(e){c=!0,p=e}finally{try{!u&&f.return&&f.return()}finally{if(c)throw p}}}e.artist_uri&&t.artists[e.artist_uri]&&(e.artist=t.artists[e.artist_uri])}if(t.albums){if(e.albums_uris){var h=!0,m=!1,y=void 0;try{for(var _,v=e.albums_uris[Symbol.iterator]();!(h=(_=v.next()).done);h=!0){l=_.value;t.albums[l]&&e.albums.push(t.albums[l])}}catch(e){m=!0,y=e}finally{try{!h&&v.return&&v.return()}finally{if(m)throw y}}}e.album_uri&&t.albums[e.album_uri]&&(e.album=t.albums[e.album_uri])}if(t.tracks){if(e.tracks_uris){var b=!0,g=!1,E=void 0;try{for(var k,w=e.tracks_uris[Symbol.iterator]();!(b=(k=w.next()).done);b=!0){l=k.value;t.tracks[l]&&e.tracks.push(t.tracks[l])}}catch(e){g=!0,E=e}finally{try{!b&&w.return&&w.return()}finally{if(g)throw E}}}e.track_uri&&t.tracks[e.track_uri]&&(e.track=t.tracks[e.track_uri])}if(t.users){if(e.users_uris){var S=!0,O=!1,T=void 0;try{for(var A,C=e.users_uris[Symbol.iterator]();!(S=(A=C.next()).done);S=!0){l=A.value;t.users[l]&&e.users.push(t.users[l])}}catch(e){O=!0,T=e}finally{try{!S&&C.return&&C.return()}finally{if(O)throw T}}}e.user_uri&&t.users[e.user_uri]&&(e.user=t.users[e.user_uri])}if(t.playlists){if(e.playlists_uris){var P=!0,x=!1,R=void 0;try{for(var N,M=e.playlists_uris[Symbol.iterator]();!(P=(N=M.next()).done);P=!0){l=N.value;t.playlists[l]&&e.playlists.push(t.playlists[l])}}catch(e){x=!0,R=e}finally{try{!P&&M.return&&M.return()}finally{if(x)throw R}}}e.playlist_uri&&t.playlists[e.playlist_uri]&&(e.playlist=t.playlists[e.playlist_uri])}if(t.clients&&e.clients_ids){var L=!0,D=!1,I=void 0;try{for(var j,U=e.clients_ids[Symbol.iterator]();!(L=(j=U.next()).done);L=!0){var Y=j.value;t.clients[Y]&&e.clients.push(t.clients[Y])}}catch(e){D=!0,I=e}finally{try{!L&&U.return&&U.return()}finally{if(D)throw I}}}return e},t.uriSource=function(e){return!!e&&e.split(":")[0]}),h=t.uriType=function(e){if(!e)return null;var t=e.split(":");if("m3u"===t[0])return"playlist";if("iris"===t[0])switch(t[1]){case"search":case"discover":case"browse":case"radio":return t[1];default:return null}switch(t[1]){case"track":case"artist":case"album":case"playlist":case"genre":return t[1];case"user":return t.length>3&&"playlist"==t[3]?"playlist":t[1];default:return null}},m=(t.sourceIcon=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e&&(t=f(e)),t){case"local":case"m3u":return"folder";case"gmusic":return"google";case"podcast":case"podcast+file":case"podcast+http":case"podcast+https":case"podcast+itunes":return"podcast";case"tunein":case"somafm":case"dirble":return"microphone";default:return t}},t.getFromUri=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t.split(":");n[0];switch(e){case"mbid":var r=n.indexOf("mbid");if(r>-1)return n[r+1];break;case"artistid":if("artist"==n[1])return n[2];break;case"albumid":if("album"==n[1])return n[2];break;case"playlistid":if("playlist"==n[1])return n[2];if("user"==n[1]&&"playlist"==n[3])return n[4];break;case"playlistowner":if("user"==n[1]&&"playlist"==n[3])return n[2];break;case"trackid":if("track"==n[1])return n[2];break;case"userid":if("user"==n[1])return n[2];break;case"genreid":if("genre"==n[1])return n[2];break;case"seeds":if("discover"==n[1])return n[2];if("radio"===n[1]){var a=n[2].split(",");return a.map(function(e){return e.replace(/_/gi,":")})}break;case"searchtype":if("search"==n[0])return n[1];break;case"searchterm":if("search"==n[0])return n[2];break;default:return null}},t.buildLink=function(e){var t="/"+h(e)+"/";return t+=e=encodeURIComponent(e)},t.arrayOf=function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var l=i.value;void 0!==l[e]&&null!=l[e]&&n.push(l[e])}}catch(e){a=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw o}}return n},t.mergeDuplicates=function(e,t){var n=[],r={};for(var o in e){var i=e[o];i[t]in r&&(i=a({},r[i[t]],i)),r[i[t]]=i}for(o in r)n.push(r[o]);return n},t.removeDuplicates=function(e){var t=[];for(var n in e)t.indexOf(e[n])<=-1&&t.push(e[n]);return t},t.applyFilter=function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=[],o=0;o2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!e||e.length<=0)return[];function a(e){var n=t.split("."),r=!0,a=!1,o=void 0;try{for(var i,s=n[Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var l=i.value;if("first"==l){if(Array.isArray(e)&&e.length>0){e=e[0];continue}return null}if("length"==l)return Array.isArray(e)?e.length:0;if(void 0===e[l])return null;e=e[l]}}catch(e){a=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw o}}return e}function o(e,n){var o=a(e),i=a(n);if("uri"==t&&(o=f(o),i=f(i)),!r)return"boolean"==typeof o&&"boolean"==typeof i?o&&!i?-1:!o&&i?1:0:"number"==typeof o&&"number"==typeof i?null==o&&null==i?0:null==o?-1:null==i?1:parseInt(o)>parseInt(i)?1:parseInt(o)i.toLowerCase()?1:o.toLowerCase()l?-1:void 0}var i=Object.assign([],e.sort(o));return n&&i.reverse(),i},t.shuffle=function(e){var t=void 0,n=void 0,r=void 0;for(r=e.length-1;r>0;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},t.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},t.isObject=function(e){return e instanceof Object&&e.constructor===Object}),y=(t.isLoading=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(var n in e)if(e.hasOwnProperty(n))for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:["jaedb.github.io"],t=window.location.hostname;return e.includes(t)},t.getIndexedRecords=function(e,t){var n=[];t instanceof Array||(t=[t]);for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.getElementById("main");if(t||n.classList.remove("smooth-scroll"),e&&Number.isInteger(e))"function"==typeof n.scrollTo&&(n.scrollTop=e);else if(e){var r=null;"#"==e.charAt(0)?r=document.getElementById(e.substring(1)):"."==e.charAt(0)?(r=document.getElementsByClassName(e.substring(1))).length>0&&(r=r[0]):console.error("Invalid target type '"+e+"'. Must start with '#' or '.'."),r&&"function"==typeof r.scrollIntoView&&r.scrollIntoView()}else n.scrollTop=0;t||n.classList.add("smooth-scroll")},t.upgradeSpotifyPlaylistUris=function(e){var t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;s.includes("spotify:user:")&&(s=s.replace(/spotify:user:([^:]*?):/i,"spotify:")),t.push(s)}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t}),_=t.upgradeSpotifyPlaylistUri=function(e){return y([e])[0]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"SET_WINDOW_TITLE",title:e,play_state:t}},t.setCurrentTrackTransition=function(e){return{type:"SET_CURRENT_TRACK_TRANSITION",current_track_transition:e}},t.setSelectedTracks=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof e&&(e=[e]);return{type:"SET_SELECTED_TRACKS",keys:e}},t.showContextMenu=function(e){e.e.changedTouches?(e.position_x=e.e.changedTouches[0].clientX,e.position_y=e.e.changedTouches[0].clientY):e.e.touches?(e.position_x=e.e.touches[0].clientX,e.position_y=e.e.touches[0].clientY):(e.position_x=e.e.clientX,e.position_y=e.e.clientY);return{type:"SHOW_CONTEXT_MENU",data:e}},t.setSlimMode=function(e){return{type:"SET_SLIM_MODE",slim_mode:e}},t.setWindowFocus=function(e){return{type:"SET_WINDOW_FOCUS",window_focus:e}},t.hideContextMenu=function(){return{type:"HIDE_CONTEXT_MENU"}},t.removeContextMenu=function(){return{type:"REMOVE_CONTEXT_MENU"}},t.showTouchContextMenu=function(e){return{type:"SHOW_TOUCH_CONTEXT_MENU",data:e}},t.hideTouchContextMenu=function(){return{type:"HIDE_TOUCH_CONTEXT_MENU"}},t.removeTouchContextMenu=function(){return{type:"REMOVE_TOUCH_CONTEXT_MENU"}},t.lazyLoading=function(e){return{type:"LAZY_LOADING",start:e}},t.toggleSidebar=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"toggle",t={type:"TOGGLE_SIDEBAR"};"toggle"!=e&&(t.new_state=e);return t},t.dragStart=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return{type:"DRAG_START",context:t,from_uri:n,victims:r,victims_indexes:a,start_x:e.clientX,start_y:e.clientY}},t.dragActive=function(){return{type:"DRAG_ACTIVE"}},t.dragEnd=function(){return{type:"DRAG_END"}},t.set=function(e){return{type:"UI_SET",data:e}},t.installPrompt=function(e){return{type:"INSTALL_PROMPT",event:e}},t.createBrowserNotification=function(e){return{type:"BROWSER_NOTIFICATION",data:e}},t.createNotification=function(e){e.message&&(e.content=e.message);"shortcut"==e.type&&(e.duration=.4);return{type:"CREATE_NOTIFICATION",notification:r({key:a.generateGuid(),duration:5,type:"default",title:null,content:null,description:null,sticky:!1,closing:!1,render_content:!1},e)}},t.closeNotification=function(e){return{type:"CLOSE_NOTIFICATION",key:e}},t.removeNotification=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"REMOVE_NOTIFICATION",key:e,manual:t}},t.startLoading=function(e,t){return{type:"START_LOADING",source:t,key:e}},t.stopLoading=function(e){return{type:"STOP_LOADING",key:e}},t.startProcess=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:"START_PROCESS",key:e,message:t,data:n}},t.resumeProcess=function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"RESUME_PROCESS",key:e}},t.updateProcess=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:"UPDATE_PROCESS",key:e,message:t,data:n}},t.runProcess=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:e,data:t}},t.cancelProcess=function(e){return{type:"CANCEL_PROCESS",key:e}},t.processCancelled=function(e){return{type:"PROCESS_CANCELLED",key:e}},t.processFinishing=function(e){return{type:"PROCESS_FINISHING",key:e}},t.processFinished=function(e){return{type:"PROCESS_FINISHED",key:e}};var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(2))},function(e,t,n){"use strict";n.r(t),n.d(t,"__DO_NOT_USE__ActionTypes",function(){return o}),n.d(t,"applyMiddleware",function(){return y}),n.d(t,"bindActionCreators",function(){return p}),n.d(t,"combineReducers",function(){return u}),n.d(t,"compose",function(){return m}),n.d(t,"createStore",function(){return s});var r=n(68),a=function(){return Math.random().toString(36).substring(7).split("").join(".")},o={INIT:"@@redux/INIT"+a(),REPLACE:"@@redux/REPLACE"+a(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+a()}};function i(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function s(e,t,n){var a;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(s)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var l=e,u=t,c=[],p=c,d=!1;function f(){p===c&&(p=c.slice())}function h(){if(d)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return u}function m(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(d)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var t=!0;return f(),p.push(e),function(){if(t){if(d)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");t=!1,f();var n=p.indexOf(e);p.splice(n,1)}}}function y(e){if(!i(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,u=l(u,e)}finally{d=!1}for(var t=c=p,n=0;n=0||(a[n]=e[n]);return a}var f=n(67),h=n.n(f),m=n(11),y=n.n(m),_=n(66);function v(e,t){void 0===t&&(t={});var n=t,i=n.getDisplayName,s=void 0===i?function(e){return"ConnectAdvanced("+e+")"}:i,u=n.methodName,c=void 0===u?"connectAdvanced":u,f=n.renderCountProp,m=void 0===f?void 0:f,v=n.shouldHandleStateChanges,b=void 0===v||v,g=n.storeKey,E=void 0===g?"store":g,k=n.withRef,w=void 0!==k&&k,S=n.forwardRef,O=void 0!==S&&S,T=n.context,A=void 0===T?l:T,C=d(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]);y()(void 0===m,"renderCountProp is removed. render counting is built into the latest React dev tools profiling extension"),y()(!w,"withRef is removed. To access the wrapped instance, use a ref on the connected component");var P="To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React Redux's Provider and specific components like: . You may also pass a {context : MyContext} option to connect";y()("store"===E,"storeKey has been removed and does not do anything. "+P);var x=A;return function(t){var n=t.displayName||t.name||"Component",i=s(n),l=Object(p.a)({},C,{getDisplayName:s,methodName:c,renderCountProp:m,shouldHandleStateChanges:b,storeKey:E,displayName:i,wrappedComponentName:n,WrappedComponent:t}),u=C.pure,d=a.Component;u&&(d=a.PureComponent);var f=function(n){function a(t){var r,a,i,s,l,c,d,f,h,m,_;return r=n.call(this,t)||this,y()(O?!t.wrapperProps[E]:!t[E],"Passing redux store in props has been removed and does not do anything. "+P),r.selectDerivedProps=function(t,n,r,o){if(u&&a===n&&i===t)return s;r===l&&c===o||(l=r,c=o,d=e(r.dispatch,o)),a=n,i=t;var p=d(t,n);return s=p},r.selectChildElement=function(e,t,n){return t===f&&n===h&&_===e||(f=t,h=n,_=e,m=o.a.createElement(e,Object(p.a)({},t,{ref:n}))),m},r.indirectRenderWrappedComponent=r.indirectRenderWrappedComponent.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r)),r}r(a,n);var s=a.prototype;return s.indirectRenderWrappedComponent=function(e){return this.renderWrappedComponent(e)},s.renderWrappedComponent=function(e){y()(e,'Could not find "store" in the context of "'+i+'". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to '+i+" in connect options.");var n,r=e.storeState,a=e.store,o=this.props;O&&(o=this.props.wrapperProps,n=this.props.forwardedRef);var s=this.selectDerivedProps(r,o,a,l);return this.selectChildElement(t,s,n)},s.render=function(){var e=this.props.context&&this.props.context.Consumer&&Object(_.isContextConsumer)(o.a.createElement(this.props.context.Consumer,null))?this.props.context:x;return o.a.createElement(e.Consumer,null,this.indirectRenderWrappedComponent)},a}(d);if(f.WrappedComponent=t,f.displayName=i,O){var v=o.a.forwardRef(function(e,t){return o.a.createElement(f,{wrapperProps:e,forwardedRef:t})});return v.displayName=i,v.WrappedComponent=t,h()(v,t)}return h()(f,t)}}var b=Object.prototype.hasOwnProperty;function g(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function E(e,t){if(g(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var a=0;a=0;r--){var a=t[r](e);if(a)return a}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function L(e,t){return e===t}var D,I,j,U,Y,F,H,z,B,q,G,W,V=(j=(I=void 0===D?{}:D).connectHOC,U=void 0===j?v:j,Y=I.mapStateToPropsFactories,F=void 0===Y?A:Y,H=I.mapDispatchToPropsFactories,z=void 0===H?T:H,B=I.mergePropsFactories,q=void 0===B?P:B,G=I.selectorFactory,W=void 0===G?N:G,function(e,t,n,r){void 0===r&&(r={});var a=r,o=a.pure,i=void 0===o||o,s=a.areStatesEqual,l=void 0===s?L:s,u=a.areOwnPropsEqual,c=void 0===u?E:u,f=a.areStatePropsEqual,h=void 0===f?E:f,m=a.areMergedPropsEqual,y=void 0===m?E:m,_=d(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),v=M(e,F,"mapStateToProps"),b=M(t,z,"mapDispatchToProps"),g=M(n,q,"mergeProps");return U(W,Object(p.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:v,initMapDispatchToProps:b,initMergeProps:g,pure:i,areStatesEqual:l,areOwnPropsEqual:c,areStatePropsEqual:h,areMergedPropsEqual:y},_))});n.d(t,"Provider",function(){return c}),n.d(t,"connectAdvanced",function(){return v}),n.d(t,"ReactReduxContext",function(){return l}),n.d(t,"connect",function(){return V})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=i(r),o=i(n(136));function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,r.memo)(function(e){if(!e.name||""===e.name)return null;var t="icon icon--"+(e.type?e.type:"material");switch(e.className&&(t+=" "+e.className),e.type){case"svg":return a.default.createElement("img",{className:t,src:"/iris/assets/icons/"+e.name+".svg",onClick:function(t){return e.onClick?e.onClick(t):null}});case"gif":return a.default.createElement("img",{className:t,src:"/iris/assets/icons/"+e.name+".gif",onClick:function(t){return e.onClick?e.onClick(t):null}});case"fontawesome":return a.default.createElement(o.default,{className:t,type:"fontawesome",name:e.name,onClick:function(t){return e.onClick?e.onClick(t):null}});case"css":switch(e.name){case"playing":return a.default.createElement("i",{className:t+" icon--playing"},a.default.createElement("span",null),a.default.createElement("span",null),a.default.createElement("span",null))}default:return a.default.createElement("i",{className:t,onClick:function(t){return e.onClick?e.onClick(t):null}},e.name)}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.set=function(e){return{type:"MOPIDY_SET",data:e}},t.request=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:"MOPIDY_REQUEST",method:e,params:t,response_callback:n,error_callback:r}},t.connect=function(){return{type:"MOPIDY_CONNECT"}},t.connecting=function(){return{type:"MOPIDY_CONNECTING"}},t.disconnect=function(){return{type:"MOPIDY_DISCONNECT"}},t.debug=function(e,t){return{type:"MOPIDY_DEBUG",call:e,value:t}},t.restartStarted=function(){return{type:"MOPIDY_RESTART_STARTED"}},t.restartFinished=function(){return{type:"MOPIDY_RESTART_FINISHED"}},t.upgradeStarted=function(){return{type:"MOPIDY_UPGRADE_STARTED"}},t.upgradeFinished=function(){return{type:"MOPIDY_UPGRADE_FINISHED"}},t.localScanStarted=function(){return{type:"MOPIDY_LOCAL_SCAN_STARTED"}},t.localScanFinished=function(){return{type:"MOPIDY_LOCAL_SCAN_FINISHED"}},t.getPlayState=function(){return{type:"MOPIDY_GET_PLAY_STATE"}},t.play=function(){return{type:"MOPIDY_PLAY"}},t.pause=function(){return{type:"MOPIDY_PAUSE"}},t.stop=function(){return{type:"MOPIDY_STOP"}},t.next=function(){return{type:"MOPIDY_NEXT"}},t.previous=function(){return{type:"MOPIDY_PREVIOUS"}},t.getMute=function(){return{type:"MOPIDY_GET_MUTE"}},t.setMute=function(e){return{type:"MOPIDY_SET_MUTE",mute:e}},t.getVolume=function(){return{type:"MOPIDY_GET_VOLUME"}},t.setVolume=function(e){return{type:"MOPIDY_SET_VOLUME",volume:e}},t.getConsume=function(){return{type:"MOPIDY_GET_CONSUME"}},t.setConsume=function(e){return{type:"MOPIDY_SET_CONSUME",consume:e}},t.getRepeat=function(){return{type:"MOPIDY_GET_REPEAT"}},t.setRepeat=function(e){return{type:"MOPIDY_SET_REPEAT",repeat:e}},t.getRandom=function(){return{type:"MOPIDY_GET_RANDOM"}},t.setRandom=function(e){return{type:"MOPIDY_SET_RANDOM",random:e}},t.getTimePosition=function(){return{type:"MOPIDY_GET_TIME_POSITION"}},t.setTimePosition=function(e){return{type:"MOPIDY_SET_TIME_POSITION",time_position:parseInt(e)}},t.timePosition=function(e){return{type:"MOPIDY_TIME_POSITION",time_position:parseInt(e)}},t.getUriSchemes=function(){return{type:"MOPIDY_GET_URI_SCHEMES"}},t.getCurrentTrack=function(){return{type:"MOPIDY_GET_CURRENT_TRACK"}},t.currentTrackLoaded=function(e){return{type:"MOPIDY_CURRENT_TRACK_LOADED",tl_track:e}},t.getNextTrack=function(){return{type:"MOPIDY_GET_NEXT_TRACK"}},t.clearCurrentTrack=function(){return{type:"CLEAR_CURRENT_TRACK"}},t.getQueue=function(){return{type:"MOPIDY_GET_QUEUE"}},t.changeTrack=function(e){return{type:"MOPIDY_CHANGE_TRACK",tlid:e}},t.playURIs=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"MOPIDY_PLAY_URIS",uris:e,from_uri:t}},t.playAlbum=function(e){return{type:"MOPIDY_PLAY_ALBUM",uri:e}},t.playPlaylist=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"MOPIDY_PLAY_PLAYLIST",uri:e,shuffle:t}},t.enqueueURIs=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return{type:"MOPIDY_ENQUEUE_URIS",uris:e,from_uri:t,at_position:r,play_next:n,offset:a}},t.enqueueAlbum=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:"MOPIDY_ENQUEUE_ALBUM",uri:e,next:t,at_position:n}},t.enqueuePlaylist=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:"MOPIDY_ENQUEUE_PLAYLIST",uri:e,play_next:t,at_position:n}},t.enqueueURIsBatchDone=function(){return{type:"MOPIDY_ENQUEUE_URIS_BATCH_DONE"}},t.removeTracks=function(e){return{type:"MOPIDY_REMOVE_TRACKS",tlids:e}},t.reorderTracklist=function(e,t){var n=r.createRange(e);t>n.start&&(t-=n.length);return{type:"MOPIDY_REORDER_TRACKLIST",range_start:n.start,range_length:n.length,insert_before:t}},t.clearTracklist=function(){return{type:"MOPIDY_CLEAR_TRACKLIST"}},t.getImages=function(e,t){return{type:"MOPIDY_GET_IMAGES",context:e,uris:t}},t.createPlaylist=function(e,t){return{type:"MOPIDY_CREATE_PLAYLIST",name:e,scheme:t}},t.deletePlaylist=function(e){return{type:"MOPIDY_DELETE_PLAYLIST",uri:e}},t.getLibraryPlaylists=function(){return{type:"MOPIDY_GET_LIBRARY_PLAYLISTS"}},t.getPlaylist=function(e){return{type:"MOPIDY_GET_PLAYLIST",data:{uri:e}}},t.getPlaylists=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"MOPIDY_GET_PLAYLISTS",uris:e,processor:t}},t.getDirectory=function(e){return{type:"MOPIDY_GET_DIRECTORY",data:{uri:e}}},t.getTrack=function(e){return{type:"MOPIDY_GET_TRACK",data:{uri:e}}},t.getLibraryArtists=function(){return{type:"MOPIDY_GET_LIBRARY_ARTISTS",uri:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null}},t.clearLibraryArtists=function(){return{type:"MOPIDY_CLEAR_LIBRARY_ARTISTS"}},t.getArtist=function(e){return{type:"MOPIDY_GET_ARTIST",data:{uri:e}}},t.getArtists=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"MOPIDY_GET_ARTISTS",uris:e,processor:t}},t.getAlbum=function(e){return{type:"MOPIDY_GET_ALBUM",data:{uri:e}}},t.getAlbums=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"MOPIDY_GET_ALBUMS",uris:e,processor:t}},t.getLibraryAlbums=function(){return{type:"MOPIDY_GET_LIBRARY_ALBUMS",uri:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null}},t.clearLibraryAlbums=function(){return{type:"MOPIDY_CLEAR_LIBRARY_ALBUMS"}},t.runProcessor=function(e){return{type:e}},t.cancelProcessor=function(e){return{type:e+"_CANCEL"}},t.clearSearchResults=function(){return{type:"MOPIDY_CLEAR_SEARCH_RESULTS"}},t.getSearchResults=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return{type:"MOPIDY_GET_SEARCH_RESULTS",context:e,query:t,limit:n}},t.getQueueHistory=function(){return{type:"MOPIDY_GET_QUEUE_HISTORY"}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(2))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]&&arguments[2];return function(r,a){c(r,a,e).then(function(e){r({type:t,key:n,data:e})},function(e){r(o.handleException("Could not load URL",e))})}},t.getMore=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(r,a){c(r,a,e).then(function(e){t?r(o.loadedMore(t.parent_type,t.parent_key,t.records_type,e)):n?(n.data=e,r(n)):r(o.handleException("No callback handler for loading more items"))},function(e){r(o.handleException("Could not load more "+callback_action.parent_type+" "+callback_action.records_type+"s",e))})}},t.clearSearchResults=function(){return{type:"SPOTIFY_CLEAR_SEARCH_RESULTS"}},t.getSearchResults=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return function(s,l){s(i.startProcess("SPOTIFY_GET_SEARCH_RESULTS_PROCESSOR","Searching Spotify")),"all"==(e=e.replace(/s+$/,""))&&(e="album,artist,playlist,track");var p="search?q="+t;p+="&type="+e,p+="&country="+l().spotify.country,p+="&limit="+n,c(s,l,p+="&offset="+a).then(function(e){if(void 0!==e.tracks&&s({type:"SPOTIFY_SEARCH_RESULTS_LOADED",context:"tracks",query:t,results:u.formatTracks(e.tracks.items),more:e.tracks.next}),void 0!==e.artists&&(s({type:"ARTISTS_LOADED",artists:e.artists.items}),s({type:"SPOTIFY_SEARCH_RESULTS_LOADED",context:"artists",query:t,results:u.arrayOf("uri",e.artists.items),more:e.artists.next})),void 0!==e.albums&&(s({type:"ALBUMS_LOADED",albums:e.albums.items}),s({type:"SPOTIFY_SEARCH_RESULTS_LOADED",context:"albums",query:t,results:u.arrayOf("uri",e.albums.items),more:e.albums.next})),void 0!==e.playlists){var n=[],a=!0,o=!1,c=void 0;try{for(var p,d=e.playlists.items[Symbol.iterator]();!(a=(p=d.next()).done);a=!0){var f=p.value;n.push(r({},u.formatPlaylist(f),{can_edit:l().spotify.me&&f.owner.id==l().spotify.me.id,tracks_total:f.tracks.total}))}}catch(e){o=!0,c=e}finally{try{!a&&d.return&&d.return()}finally{if(o)throw c}}s({type:"PLAYLISTS_LOADED",playlists:n}),s({type:"SPOTIFY_SEARCH_RESULTS_LOADED",context:"playlists",query:t,results:u.arrayOf("uri",n),more:e.playlists.next})}s(i.processFinishing("SPOTIFY_GET_SEARCH_RESULTS_PROCESSOR"))},function(e){s(o.handleException("Could not load search results",e))})}},t.getAutocompleteResults=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["album","artist","playlist","track"];return function(r,a){r({type:"SPOTIFY_AUTOCOMPLETE_LOADING",field_id:e});var i=n.includes("genre");if(i){var s=n.indexOf("genre");n.splice(s,1)}var l="search?q="+t;l+="&type="+n.join(","),l+="&country="+a().spotify.country,c(r,a,l).then(function(n){var s=[];if(i){var l=a().spotify.genres;if(l)for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:null}},t.following=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET";return function(n,r){var a=u.uriType(e),i=void 0,s=void 0,l=null;switch("PUT"==t?l=!0:"DELETE"==t&&(l=!1),a){case"track":i="GET"==t?"me/tracks/contains/?ids="+u.getFromUri("trackid",e):"me/tracks/?ids="+u.getFromUri("trackid",e);break;case"album":i="GET"==t?"me/albums/contains/?ids="+u.getFromUri("albumid",e):"me/albums/?ids="+u.getFromUri("albumid",e);break;case"artist":"GET"==t?i="me/following/contains?type=artist&ids="+u.getFromUri("artistid",e):(i="me/following?type=artist&ids="+u.getFromUri("artistid",e),s={});break;case"user":"GET"==t?i="me/following/contains?type=user&ids="+u.getFromUri("userid",e):(i="me/following?type=user&ids="+u.getFromUri("userid",e),s={});break;case"playlist":i="GET"==t?"playlists/"+u.getFromUri("playlistid",e)+"/followers/contains?ids="+r().spotify.me.id:"playlists/"+u.getFromUri("playlistid",e)+"/followers"}c(n,r,i,t,s).then(function(t){l=t?t[0]:l,n({type:"SPOTIFY_LIBRARY_"+a.toUpperCase()+"_CHECK",key:e,in_library:l})},function(e){n(o.handleException("Could not follow/unfollow",e))})}},t.resolveRadioSeeds=function(e){return function(t,n){if(e.seed_artists.length>0){for(var r="",a=0;a0&&(r+=","),r+=u.getFromUri("artistid",e.seed_artists[a]);c(t,n,"artists?ids="+r).then(function(e){e&&e.artists?t({type:"ARTISTS_LOADED",artists:e.artists}):console.error("No Spotify artists returned",r)},function(e){t(o.handleException("Could not resolve radio artist seeds",e))})}if(e.seed_tracks.length>0){var i="";for(a=0;a0&&(i+=","),i+=u.getFromUri("trackid",e.seed_tracks[a]);c(t,n,"tracks?ids="+i).then(function(e){t({type:"TRACKS_LOADED",tracks:e.tracks})},function(e){t(o.handleException("Could not load radio track seeds",e))})}}},t.getFavorites=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long_term";return function(a,i){a({type:"SPOTIFY_FAVORITES_LOADED",artists:[],tracks:[]}),e.when(c(a,i,"me/top/artists?limit="+t+"&time_range="+n),c(a,i,"me/top/tracks?limit="+t+"&time_range="+n)).then(function(e,t){a({type:"SPOTIFY_FAVORITES_LOADED",artists:e.items,tracks:t.items})},function(e,t){a(o.handleException("Could not load favorites",r({},e,t)))})}},t.getRecommendations=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(r,a){r({type:"CLEAR_SPOTIFY_RECOMMENDATIONS"});for(var i=[],s=[],l=[],p=0;p0){var r={uri:e.uri,images:n.artists.items[0].images};t(o.artistLoaded(r))}},function(e){t(o.handleException("Could not load artists",e))})}},t.playArtistTopTracks=function(e){return function(t,n){var r=n().core.artists;if(void 0!==r[e]&&void 0!==r[e].tracks){var a=u.arrayOf("uri",r[e].tracks);t(s.playURIs(a,e))}else c(t,n,"artists/"+u.getFromUri("artistid",e)+"/top-tracks?country="+n().spotify.country).then(function(n){var r=u.arrayOf("uri",n.tracks);t(s.playURIs(r,e))},function(e){t(o.handleException("Could not play artist's top tracks",e))})}},t.getUser=function(e){return function(t,n){c(t,n,"users/"+u.getFromUri("userid",e)).then(function(e){t(o.userLoaded(u.formatUser(e)))},function(e){t(o.handleException("Could not load user",e))})}},t.getUserPlaylists=function(e){return function(t,n){c(t,n,"users/"+u.getFromUri("userid",e)+"/playlists?limit=40").then(function(a){var i=[],s=!0,l=!1,c=void 0;try{for(var p,d=a.items[Symbol.iterator]();!(s=(p=d.next()).done);s=!0){var f=p.value,h=!1;n().spotify.me&&f.owner.id==n().spotify.me.id&&(h=!0);var m=r({},u.formatPlaylist(f),{can_edit:h,tracks_total:f.tracks.total});i.push(m)}}catch(e){l=!0,c=e}finally{try{!s&&d.return&&d.return()}finally{if(l)throw c}}t(o.userPlaylistsLoaded(e,i,a.next,a.total))},function(e){t(o.handleException("Could not load user's playlists",e))})}},t.getAlbum=function(e){return function(t,n){c(t,n,"albums/"+u.getFromUri("albumid",e)).then(function(e){t(o.artistsLoaded(e.artists));for(var a=Object.assign([],e.tracks.items),i=r({},u.formatAlbum(e),{artists_uris:u.arrayOf("uri",e.artists),tracks_uris:u.arrayOf("uri",a),tracks_more:e.tracks.next,tracks_total:e.tracks.total}),s=0;s1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;return function(s,l){s(i.startProcess("SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR","Loading playlist tracks",{uri:e,next:"playlists/"+u.getFromUri("playlistid",e)+"/tracks?market="+l().spotify.country,shuffle:t,play_next:r,at_position:a,offset:o,callback_action:n}))}},t.getAllPlaylistTracksProcessor=function(e){return function(t,n){c(t,n,e.next).then(function(o){if(void 0!==n().ui.processes.SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR&&"cancelling"==n().ui.processes.SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR.status)return t(i.processCancelled("SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR")),!1;var l=[],c=[],p=!0,d=!1,f=void 0;try{for(var h,m=o.items[Symbol.iterator]();!(p=(h=m.next()).done);p=!0){var y=h.value;y.track&&c.push(y.track.uri)}}catch(e){d=!0,f=e}finally{try{!p&&m.return&&m.return()}finally{if(d)throw f}}l=e.uris?[].concat(a(e.uris),c):c,o.next?(t(i.updateProcess("SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR","Loading "+(o.total-l.length)+" playlist tracks",r({},e,{next:o.next,total:o.total,remaining:o.total-l.length}))),t(i.runProcess("SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR",r({},e,{next:o.next,uris:l})))):(e.shuffle&&(l=u.shuffle(l)),t(i.processFinished("SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR")),"enqueue"==e.callback_action?t(s.enqueueURIs(l,e.uri,e.play_next,e.at_position,e.offset)):t(s.playURIs(l,e.uri)))},function(e){t(o.handleException("Could not load tracks to play playlist",e))})}},t.toggleFollowingPlaylist=function(e,t){if("PUT"==t)var n=1;if("DELETE"==t)n=0;return function(r,a){c(r,a,"playlists/"+u.getFromUri("playlistid",e)+"/followers",t).then(function(t){r({type:"SPOTIFY_PLAYLIST_FOLLOWING_LOADED",key:e,is_following:n})},function(e){r(o.handleException("Could not add/remove library playlist",e))})}},t.addTracksToPlaylist=function(e,t){return function(n,r){c(n,r,"playlists/"+u.getFromUri("playlistid",e)+"/tracks","POST",{uris:t}).then(function(r){n({type:"PLAYLIST_TRACKS_ADDED",key:e,tracks_uris:t,snapshot_id:r.snapshot_id})},function(e){n(o.handleException("Could not add tracks to playlist",e))})}},t.deleteTracksFromPlaylist=function(e,t,n){return function(r,a){c(r,a,"playlists/"+u.getFromUri("playlistid",e)+"/tracks","DELETE",{snapshot_id:t,positions:n}).then(function(t){r({type:"PLAYLIST_TRACKS_REMOVED",key:e,tracks_indexes:n,snapshot_id:t.snapshot_id})},function(e){r(o.handleException("Could not remove tracks from playlist",e))})}},t.reorderPlaylistTracks=function(e,t,n,r,a){return function(i,s){c(i,s,"playlists/"+u.getFromUri("playlistid",e)+"/tracks","PUT",{uri:e,range_start:t,range_length:n,insert_before:r,snapshot_id:a}).then(function(a){i({type:"PLAYLIST_TRACKS_REORDERED",key:e,range_start:t,range_length:n,insert_before:r,snapshot_id:a.snapshot_id})},function(e){i(o.handleException("Could not reorder playlist tracks",e))})}},t.flushLibrary=function(){return{type:"SPOTIFY_FLUSH_LIBRARY"}},t.getLibraryPlaylists=function(){return function(e,t){var n=t().ui.processes.SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR;n?"cancelled"==n.status?e(i.resumeProcess("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR")):"finished"!=n.status||t().spotify.library_playlists_loaded_all||e(i.startProcess("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR","Loading Spotify playlists",{next:"me/playlists?limit=50"})):e(i.startProcess("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR","Loading Spotify playlists",{next:"me/playlists?limit=50"}))}},t.getLibraryPlaylistsProcessor=function(e){return function(t,n){c(t,n,e.next).then(function(e){if((t({type:"SPOTIFY_LIBRARY_PLAYLISTS_LOADED",playlists:e.items}),void 0!==n().ui.processes.SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR)&&"cancelling"==n().ui.processes.SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR.status)return t(i.processCancelled("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR")),!1;if(e.next){var r=e.total-n().spotify.library_playlists.length;t(i.updateProcess("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR","Loading "+r+" Spotify playlists",{next:e.next,total:e.total,remaining:r})),t(i.runProcess("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR",{next:e.next}))}else t(i.processFinishing("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR")),t({type:"SPOTIFY_LIBRARY_PLAYLISTS_LOADED_ALL"})},function(e){t(o.handleException("Could not load library playlists",e))})}},t.getLibraryArtists=function(){return function(e,t){var n=t().ui.processes.SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR;n?"cancelled"==n.status?e(i.resumeProcess("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR")):"finished"!=n.status||t().spotify.library_artists_loaded_all||e(i.startProcess("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR","Loading Spotify artists",{next:"me/following?type=artist&limit=50"})):e(i.startProcess("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR","Loading Spotify artists",{next:"me/following?type=artist&limit=50"}))}},t.getLibraryArtistsProcessor=function(e){return function(t,n){c(t,n,e.next).then(function(e){if((t({type:"SPOTIFY_LIBRARY_ARTISTS_LOADED",artists:e.artists.items}),void 0!==n().ui.processes.SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR)&&"cancelling"==n().ui.processes.SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR.status)return t(i.processCancelled("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR")),!1;if(e.artists.next){var r=e.artists.total-n().spotify.library_artists.length;t(i.updateProcess("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR","Loading "+r+" Spotify artists",{next:e.artists.next,total:e.artists.total,remaining:r})),t(i.runProcess("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR",{next:e.artists.next}))}else t(i.processFinishing("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR"))},function(e){t(o.handleException("Could not load library artists",e))})}},t.getLibraryAlbums=function(){return function(e,t){var n=t().ui.processes.SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR;n?"cancelled"==n.status?e(i.updateProcess("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR","Loading Spotify albums",{next:"me/albums?limit=50"})):"finished"!=n.status||t().spotify.library_albums_loaded_all||e(i.startProcess("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR","Loading Spotify albums",{next:"me/albums?limit=50"})):e(i.startProcess("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR","Loading Spotify albums",{next:"me/albums?limit=50"}))}},t.getLibraryAlbumsProcessor=function(e){return function(t,n){c(t,n,e.next).then(function(e){if((t({type:"SPOTIFY_LIBRARY_ALBUMS_LOADED",albums:e.items}),void 0!==n().ui.processes.SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR)&&"cancelling"==n().ui.processes.SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR.status)return t(i.processCancelled("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR")),!1;if(e.next){var r=e.total-n().spotify.library_albums.length;t(i.updateProcess("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR","Loading "+r+" Spotify albums",{next:e.next,total:e.total,remaining:r})),t(i.runProcess("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR",{next:e.next}))}else t(i.processFinishing("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR"))},function(e){t(o.handleException("Could not load library albums",e))})}};n(19);function a(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t3&&void 0!==arguments[3]?arguments[3]:"GET",a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],u.generateGuid());return e(i.startLoading(s,"spotify_"+n)),new Promise(function(l,u){p(e,t).then(function(o){var c="https://api.spotify.com/v1/"+n;n.startsWith("https://api.spotify.com/")&&(c=n);var p={method:r,timeout:3e4,headers:{Authorization:"Bearer "+o,Accept:"application/json"}};a&&(p.body="string"==typeof a?a:JSON.stringify(a)),fetch(c,p).then(function(t){return e(i.stopLoading(s)),429===t.status&&console.error("You hit the Spotify API rate limiter"),t.text().then(function(e){return e?JSON.parse(e):{}})}).then(function(n){n&&n.error&&"The access token expired"===n.error.message&&e(d(e,t)),l(n)}).catch(function(e){u(e)})},function(t){e(o.handleException(t.error)),u(t)})})};function p(e,t){return new Promise(function(n,r){t().spotify.token_expiry&&(new Date).getTime()1&&void 0!==arguments[1]&&arguments[1];return function(r,a){var i={},s=[c(r,a,"artists/"+u.getFromUri("artistid",t),"GET",!1,!0).then(function(e){Object.assign(i,e)},function(e){r(o.handleException("Could not load artist",e))})];n&&(s.push(c(r,a,"artists/"+u.getFromUri("artistid",t)+"/top-tracks?country="+a().spotify.country).then(function(e){Object.assign(i,e)},function(e){r(o.handleException("Could not load artist's top tracks",e))})),s.push(c(r,a,"artists/"+u.getFromUri("artistid",t)+"/related-artists").then(function(e){r(o.artistsLoaded(e.artists)),Object.assign(i,{related_artists_uris:u.arrayOf("uri",e.artists)})},function(e){r(o.handleException("Could not load artist's related artists",e))}))),e.when.apply(e,s).then(function(){i.musicbrainz_id?r(l.getArtist(i.uri,!1,i.musicbrainz_id)):r(l.getArtist(i.uri,i.name.replace("&","and"))),r(o.artistLoaded(i)),n&&c(r,a,"artists/"+u.getFromUri("artistid",t)+"/albums?market="+a().spotify.country).then(function(e){r({type:"SPOTIFY_ARTIST_ALBUMS_LOADED",artist_uri:t,data:e})},function(e){r(o.handleException("Could not load artist's albums",e))})})}}}).call(this,n(21))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.getBroadcasts=function(){return function(t,n){var r={method:"GET",timeout:15e3};n().ui.test_mode?r.url="https://gist.githubusercontent.com/jaedb/cb3a5ee6909632abb2e0fe66d4c8c311/raw":r.url="https://gist.githubusercontent.com/jaedb/b677dccf80daf3ccb2ef12e96e495677/raw",e.ajax(r).then(function(e){t({type:"BROADCASTS_LOADED",broadcasts:JSON.parse(e)})},function(e,n,a){t(i("Could not fetch broadcasts from GitHub",{config:r,xhr:e,status:n,error:a},null,!1))})}},t.startSearch=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"SEARCH_STARTED",search_type:e,query:t,only_mopidy:n}},t.handleException=i,t.debugResponse=function(e){return{type:"DEBUG",response:e}},t.set=function(e){return{type:"CORE_SET",data:e}},t.clearCurrentTrack=function(){return{type:"CLEAR_CURRENT_TRACK"}},t.cachebustHttpStream=function(){return{type:"CACHEBUST_HTTP_STREAM"}},t.loadTrack=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_TRACK",uri:e,force_reload:t}},t.loadAlbum=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_ALBUM",uri:e,force_reload:t}},t.loadArtist=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_ARTIST",uri:e,force_reload:t}},t.loadPlaylist=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_PLAYLIST",uri:e,force_reload:t}},t.loadUser=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_USER",uri:e,force_reload:t}},t.loadUserPlaylists=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_USER_PLAYLISTS",uri:e,force_reload:t}},t.trackLoaded=function(e){return s([e])},t.tracksLoaded=s,t.artistLoaded=function(e){return l([e])},t.artistsLoaded=l,t.albumLoaded=function(e){return u([e])},t.albumsLoaded=u,t.playlistLoaded=function(e){return c([e])},t.playlistsLoaded=c,t.userLoaded=function(e){return p([e])},t.usersLoaded=p,t.userPlaylistsLoaded=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:"USER_PLAYLISTS_LOADED",uri:e,playlists:t,more:n,total:r}},t.loadedMore=function(e,t,n,r){return{type:"LOADED_MORE",parent_type:e,parent_key:t,records_type:n,records_data:r}},t.removeFromIndex=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:"REMOVE_FROM_INDEX",index_name:e,key:t,new_key:n}},t.reorderPlaylistTracks=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=r.createRange(t);switch(r.uriSource(e)){case"spotify":return{type:"SPOTIFY_REORDER_PLAYLIST_TRACKS",key:e,range_start:o.start,range_length:o.length,insert_before:n,snapshot_id:a};case"m3u":return{type:"MOPIDY_REORDER_PLAYLIST_TRACKS",key:e,range_start:o.start,range_length:o.length,insert_before:n}}},t.savePlaylist=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;switch(r.uriSource(e)){case"spotify":return{type:"SPOTIFY_SAVE_PLAYLIST",key:e,name:t,description:""==n?null:n,image:i,is_public:a,is_collaborative:o};case"m3u":return{type:"MOPIDY_SAVE_PLAYLIST",key:e,name:t}}return!1},t.createPlaylist=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];switch(e){case"spotify":return""==n&&(n=null),a.createPlaylist(t,n,r,i);default:return o.createPlaylist(t,e)}return!1},t.deletePlaylist=function(e){switch(r.uriSource(e)){case"spotify":return a.following(e,"DELETE");default:return o.deletePlaylist(e)}return!1},t.removeTracksFromPlaylist=function(e,t){switch(r.uriSource(e)){case"spotify":return{type:"SPOTIFY_REMOVE_PLAYLIST_TRACKS",key:e,tracks_indexes:t};case"m3u":return{type:"MOPIDY_REMOVE_PLAYLIST_TRACKS",key:e,tracks_indexes:t}}},t.addTracksToPlaylist=function(e,t){switch(r.uriSource(e)){case"spotify":return{type:"SPOTIFY_ADD_PLAYLIST_TRACKS",key:e,tracks_uris:t};case"m3u":return{type:"MOPIDY_ADD_PLAYLIST_TRACKS",key:e,tracks_uris:t}}},t.getLibraryPlaylists=function(){return{type:"GET_LIBRARY_PLAYLISTS"}},t.getLibraryAlbums=function(){return{type:"GET_LIBRARY_ALBUMS"}},t.getLibraryArtists=function(){return{type:"GET_LIBRARY_ARTISTS"}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(2));var a=n(8),o=n(7);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return!e&&t.message?e=t.message:!e&&t.error.message&&(e=t.error.message),!n&&t.description?n=t.description:!n&&t.error&&t.error.description&&(n=t.error.description),{type:"HANDLE_EXCEPTION",message:e,description:n,data:t,show_notification:r}}function s(e){return{type:"TRACKS_LOADED",tracks:e}}function l(e){return{type:"ARTISTS_LOADED",artists:e}}function u(e){return{type:"ALBUMS_LOADED",albums:e}}function c(e){return{type:"PLAYLISTS_LOADED",playlists:e}}function p(e){return{type:"USERS_LOADED",users:e}}}).call(this,n(21))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];return{type:"PUSHER_SET_USERNAME",username:e.replace(/[\W_]+/g,""),force:t}},t.connect=function(){return{type:"PUSHER_CONNECT"}},t.disconnect=function(){return{type:"PUSHER_DISCONNECT"}},t.upgrade=function(){return{type:"PUSHER_UPGRADE"}},t.reload=function(){return{type:"PUSHER_RELOAD"}},t.restart=function(){return{type:"PUSHER_RESTART"}},t.localScan=function(){return{type:"PUSHER_LOCAL_SCAN"}},t.getConnections=function(){return{type:"PUSHER_GET_CONNECTIONS"}},t.connectionAdded=function(e){return{type:"PUSHER_CONNECTION_ADDED",connection:e}},t.updateConnection=function(e){return{type:"PUSHER_UPDATE_CONNECTION",connection:e}},t.connectionChanged=function(e){return{type:"PUSHER_CONNECTION_CHANGED",connection:e}},t.connectionRemoved=function(e){return{type:"PUSHER_CONNECTION_REMOVED",connection:e}},t.request=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:"PUSHER_REQUEST",method:e,params:t,response_callback:n,error_callback:r}},t.getConfig=function(){return{type:"PUSHER_GET_CONFIG"}},t.getVersion=function(){return{type:"PUSHER_GET_VERSION"}},t.deliverBroadcast=function(e,t){return{type:"PUSHER_DELIVER_BROADCAST",data:{method:e,params:t}}},t.deliverMessage=function(e,t,n){return{type:"PUSHER_DELIVER_MESSAGE",data:{recipient:e,method:t,params:n}}},t.getRadio=function(){return{type:"PUSHER_GET_RADIO"}},t.startRadio=function(e){return{type:"PUSHER_START_RADIO",uris:e}},t.updateRadio=function(e){return{type:"PUSHER_UPDATE_RADIO",uris:e}},t.stopRadio=function(){return{type:"PUSHER_STOP_RADIO"}},t.radioStarted=function(e){return{type:"PUSHER_RADIO_STARTED",radio:e}},t.radioChanged=function(e){return{type:"PUSHER_RADIO_CHANGED",radio:e}},t.radioStopped=function(){return{type:"PUSHER_RADIO_STOPPED"}},t.debug=function(){return{type:"PUSHER_DEBUG",message:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null}},t.getQueueMetadata=function(){return{type:"PUSHER_GET_QUEUE_METADATA"}},t.queueMetadataChanged=function(e){return{type:"PUSHER_QUEUE_METADATA_CHANGED",queue_metadata:e}},t.addQueueMetadata=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"PUSHER_ADD_QUEUE_METADATA",tlids:e,from_uri:t}},t.getCommands=function(){return{type:"PUSHER_GET_COMMANDS"}},t.setCommand=function(e){return{type:"PUSHER_SET_COMMAND",command:e}},t.setCommands=function(e){return{type:"PUSHER_SET_COMMANDS",commands:e}},t.removeCommand=function(e){return{type:"PUSHER_REMOVE_COMMAND",id:e}},t.runCommand=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"PUSHER_RUN_COMMAND",id:e,notify:t}},t.commandsUpdated=function(e){return{type:"PUSHER_COMMANDS_UPDATED",commands:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]&&arguments[2];return function(r,o){if(n)var i="method=artist.getInfo&mbid="+n;else{t=t.replace("&","and");i="method=artist.getInfo&artist="+(t=encodeURIComponent(t))}s(r,o,i).then(function(t){if(t.artist){var n={uri:e,mbid:t.artist.mbid,biography:t.artist.bio.content,biography_publish_date:t.artist.bio.published,biography_link:t.artist.bio.links.link.href,listeners:parseInt(t.artist.stats.listeners)};r(a.artistLoaded(n))}},function(e){})}},t.getAlbum=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(o,i){if(r)var l="method=album.getInfo&mbid="+r;else{t=encodeURIComponent(t);l="method=album.getInfo&album="+(n=encodeURIComponent(n))+"&artist="+t}s(o,i,l).then(function(t){if(t.album){var n=i().core.albums[e],r={uri:e,images:t.album.image,listeners:parseInt(t.album.listeners),play_count:parseInt(t.album.playcount),mbid:t.album.mbid,wiki:t.album.wiki?t.album.wiki.content:null,wiki_publish_date:t.album.wiki?t.album.wiki.published:null};n&&n.images&&delete r.images,o(a.albumLoaded(r))}},function(e){})}},t.getImages=function(e,t){return function(n,o){var l=o().core[e][t];if(l)switch(e){case"tracks":if(l.mbid)var u="method=album.getInfo&mbid="+l.mbid;else if(l.artists&&l.artists.length>0&&l.album){var c=encodeURIComponent(l.artists[0].name);u="method=album.getInfo&album="+encodeURIComponent(l.album.name)+"&artist="+c}u&&s(n,o,u).then(function(e){if(e.album){var r=i.formatImages(e.album.image);n(a.trackLoaded({uri:t,images:r}))}});break;case"albums":if(l.mbid)u="method=album.getInfo&mbid="+l.mbid;else if(l.artists&&l.artists.length>0)c=encodeURIComponent(l.artists[0].name),u="method=album.getInfo&album="+encodeURIComponent(l.name)+"&artist="+c;u&&s(n,o,u).then(function(e){e.album&&(l=r({},l,{images:e.album.image}),n(a.albumLoaded(l)))})}}},t.loveTrack=function(e){return function(t,n){if(void 0!==n().core.tracks[e]){var o=n().core.tracks[e];if(o.artists){var i=encodeURIComponent(o.artists[0].name),s="method=track.love&track="+o.name+"&artist="+i;l(t,n,s).then(function(e){o=r({},o,{userloved:!0}),t({type:"TRACKS_LOADED",tracks:[o]})})}else t(a.handleException("Could not love LastFM track",o,"Track has no artists"))}else t(a.handleException("Could not love LastFM track",o,"Could not find track in index"))}},t.unloveTrack=function(e){return function(t,n){if(void 0!==n().core.tracks[e]){var o=n().core.tracks[e];if(o.artists){var i=encodeURIComponent(o.artists[0].name),s="method=track.unlove&track="+o.name+"&artist="+i;l(t,n,s).then(function(e){o=r({},o,{userloved:!1}),t({type:"TRACKS_LOADED",tracks:[o]})})}else t(a.handleException("Could not unlove LastFM track",o,"Track has no artists"))}else t(a.handleException("Could not unlove LastFM track",o,"Could not find track in index"))}},t.scrobble=function(e){return function(t,n){var r=e.name,o="Unknown";e.artists&&(o=e.artists[0].name);var i="method=track.scrobble";i+="&track="+r+"&artist="+(o=encodeURIComponent(o)),i+="×tamp="+Math.floor(Date.now()/1e3),l(t,n,i).then(function(e){},function(e){t(a.handleException("Could not scrobble LastFM track",e,e.description?e.description:null))})}};var a=n(9),o=n(3),i=n(2);var s=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return new Promise(function(t,a){var s="https://ws.audioscrobbler.com/2.0/?format=json&"+n,l="GET",u=n.substring(n.indexOf("method=")+7,n.length);u=u.substring(0,u.indexOf("&")),r?l="POST":s+="&api_key=4320a3ef51c9b3d69de552ac083c55e3";var c={method:l,timeout:3e4},p=i.generateGuid();e(o.startLoading(p,"lastfm_"+u)),fetch(s,c).then(function(t){return e(o.stopLoading(p)),t.status>=200&&t.status<300?Promise.resolve(t):Promise.reject(new Error(t.statusText))}).then(function(e){return e.json()}).then(function(e){t(e)}).catch(function(e){a(e)})})},l=function(e,t,n){return new Promise(function(r,a){t().lastfm.authorization||a({params:n,error:"No active LastFM authorization (session)"});var l=i.generateGuid(),u=n.substring(n.indexOf("method=")+7,n.length);u=u.substring(0,u.indexOf("&")),e(o.startLoading(l,"lastfm_"+u)),n+="&sk="+t().lastfm.authorization.key;var c=t().lastfm.authorization_url+"?action=sign_request&"+n;fetch(c,{method:"GET",cache:!1,timeout:3e4}).then(function(n){e(o.stopLoading(l)),s(e,t,n.params,!0).then(function(e){return r(e)},function(e){return a(e)})}).catch(function(e){return a(e)})})}},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&(t=t[0]);var n="medium";if(e.size&&(n=e.size),t[n])return t[n]}return null}(),n="thumbnail thumbnail--loaded";e.size&&(n+=" thumbnail--"+e.size),e.circle&&(n+=" thumbnail--circle"),e.className&&(n+=" "+e.className);var r=null;return e.canZoom&&t&&(r=a.default.createElement(o.default,{className:"thumbnail__zoom",to:"/image-zoom?url="+t},a.default.createElement(i.default,{name:"search"}))),a.default.createElement("div",{className:n},a.default.createElement("div",{className:"thumbnail__image",style:{backgroundImage:'url("'+(t||"/iris/assets/no-image.svg")+'")'}}),e.glow&&t&&a.default.createElement("div",{className:"thumbnail__image thumbnail__image--glow",style:{backgroundImage:'url("'+t+'")'}}),r)})},function(e,t,n){"use strict";var r=n(25);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.split("/")||[],r=t&&t.split("/")||[],i=e&&a(e),s=t&&a(t),l=i||s;if(e&&a(e)?r=n:n.length&&(r.pop(),r=r.concat(n)),!r.length)return"/";var u=void 0;if(r.length){var c=r[r.length-1];u="."===c||".."===c||""===c}else u=!1;for(var p=0,d=r.length;d>=0;d--){var f=r[d];"."===f?o(r,d):".."===f?(o(r,d),p++):p&&(o(r,d),p--)}if(!l)for(;p--;p)r.unshift("..");!l||""===r[0]||r[0]&&a(r[0])||r.unshift("");var h=r.join("/");return u&&"/"!==h.substr(-1)&&(h+="/"),h},s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var l=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])});var r=void 0===t?"undefined":s(t);if(r!==(void 0===n?"undefined":s(n)))return!1;if("object"===r){var a=t.valueOf(),o=n.valueOf();if(a!==t||o!==n)return e(a,o);var i=Object.keys(t),l=Object.keys(n);return i.length===l.length&&i.every(function(r){return e(t[r],n[r])})}return!1},u=!0,c="Invariant failed";var p=function(e,t){if(!e)throw u?new Error(c):new Error(c+": "+(t||""))};function d(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function h(e,t){return function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)}(e,t)?e.substr(t.length):e}function m(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function y(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function _(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(r.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function v(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&l(e.state,t.state)}function b(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter(function(e){return e!==r})}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r=0?t:0)+"#"+e)}function x(e){void 0===e&&(e={}),g||p(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),a=n.getUserConfirmation,o=void 0===a?E:a,i=n.hashType,s=void 0===i?"slash":i,l=e.basename?m(d(e.basename)):"",u=A[s],c=u.encodePath,f=u.decodePath;function k(){var e=f(C());return l&&(e=h(e,l)),_(e)}var w=b();function S(e){Object(r.a)(F,e),F.length=t.length,w.notifyListeners(F.location,F.action)}var O=!1,x=null;function R(){var e=C(),t=c(e);if(e!==t)P(t);else{var n=k(),r=F.location;if(!O&&v(r,n))return;if(x===y(n))return;x=null,function(e){if(O)O=!1,S();else{w.confirmTransitionTo(e,"POP",o,function(t){t?S({action:"POP",location:e}):function(e){var t=F.location,n=D.lastIndexOf(y(t));-1===n&&(n=0);var r=D.lastIndexOf(y(e));-1===r&&(r=0);var a=n-r;a&&(O=!0,I(a))}(e)})}}(n)}}var N=C(),M=c(N);N!==M&&P(M);var L=k(),D=[y(L)];function I(e){t.go(e)}var j=0;function U(e){1===(j+=e)&&1===e?window.addEventListener(T,R):0===j&&window.removeEventListener(T,R)}var Y=!1;var F={length:t.length,action:"POP",location:L,createHref:function(e){return"#"+c(l+y(e))},push:function(e,t){var n=_(e,void 0,void 0,F.location);w.confirmTransitionTo(n,"PUSH",o,function(e){if(e){var t=y(n),r=c(l+t);if(C()!==r){x=t,function(e){window.location.hash=e}(r);var a=D.lastIndexOf(y(F.location)),o=D.slice(0,-1===a?0:a+1);o.push(t),D=o,S({action:"PUSH",location:n})}else S()}})},replace:function(e,t){var n=_(e,void 0,void 0,F.location);w.confirmTransitionTo(n,"REPLACE",o,function(e){if(e){var t=y(n),r=c(l+t);C()!==r&&(x=t,P(r));var a=D.indexOf(y(F.location));-1!==a&&(D[a]=t),S({action:"REPLACE",location:n})}})},go:I,goBack:function(){I(-1)},goForward:function(){I(1)},block:function(e){void 0===e&&(e=!1);var t=w.setPrompt(e);return Y||(U(1),Y=!0),function(){return Y&&(Y=!1,U(-1)),t()}},listen:function(e){var t=w.appendListener(e);return U(1),function(){U(-1),t()}}};return F}function R(e,t,n){return Math.min(Math.max(e,t),n)}function N(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,a=t.initialEntries,o=void 0===a?["/"]:a,i=t.initialIndex,s=void 0===i?0:i,l=t.keyLength,u=void 0===l?6:l,c=b();function p(e){Object(r.a)(g,e),g.length=g.entries.length,c.notifyListeners(g.location,g.action)}function d(){return Math.random().toString(36).substr(2,u)}var f=R(s,0,o.length-1),h=o.map(function(e){return _(e,void 0,"string"==typeof e?d():e.key||d())}),m=y;function v(e){var t=R(g.index+e,0,g.entries.length-1),r=g.entries[t];c.confirmTransitionTo(r,"POP",n,function(e){e?p({action:"POP",location:r,index:t}):p()})}var g={length:h.length,action:"POP",location:h[f],index:f,entries:h,createHref:m,push:function(e,t){var r=_(e,t,d(),g.location);c.confirmTransitionTo(r,"PUSH",n,function(e){if(e){var t=g.index+1,n=g.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),p({action:"PUSH",location:r,index:t,entries:n})}})},replace:function(e,t){var r=_(e,t,d(),g.location);c.confirmTransitionTo(r,"REPLACE",n,function(e){e&&(g.entries[g.index]=r,p({action:"REPLACE",location:r}))})},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=g.index+e;return t>=0&&t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function p(e,t){for(var n=0;n0&&t+e.length!==n.length&&e.search(g)>-1&&":"!==n.charAt(t-2)&&("-"!==n.charAt(t+e.length)||"-"===n.charAt(t-1))&&n.charAt(t-1).search(/[^\s-]/)<0?e.toLowerCase():e.substr(1).search(/[A-Z]|\../)>-1?e:e.charAt(0).toUpperCase()+e.substr(1)})}(e):e}var w=function(e){var t,n,r,a,o,i,s,l="https://www.google-analytics.com/analytics.js";e&&e.gaAddress?l=e.gaAddress:e&&e.debug&&(l="https://www.google-analytics.com/analytics_debug.js"),t=window,n=document,r="script",a=l,o="ga",t.GoogleAnalyticsObject=o,t.ga=t.ga||function(){(t.ga.q=t.ga.q||[]).push(arguments)},t.ga.l=1*new Date,i=n.createElement(r),s=n.getElementsByTagName(r)[0],i.async=1,i.src=a,s.parentNode.insertBefore(i,s)};var S=[],O={calls:S,ga:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(e){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1?t-1:0),r=1;r0&&(D.apply(void 0,t),R&&"with arguments: ".concat(JSON.stringify(t))),window.ga}function H(e,t){e?"object"===C(e)?(0===Object.keys(e).length&&l("empty `fieldsObject` given to .set()"),j(t,"set",e),R&&"with fieldsObject: ".concat(JSON.stringify(e))):l("Expected `fieldsObject` arg to be an Object"):l("`fieldsObject` is required in .set()")}function z(e,t){j(t,"send",e),R&&("with fieldObject: ".concat(JSON.stringify(e)),"with trackers: ".concat(JSON.stringify(t)))}function B(e,t,n){if(e){var r=b(e);if(""!==r){var a={};if(n&&(a.title=n),j(t,"send",function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.category,n=e.variable,r=e.value,a=e.label,o=arguments.length>1?arguments[1]:void 0;if(t&&n&&r&&"number"==typeof r){var i={hitType:"timing",timingCategory:I(t),timingVar:I(n),timingValue:r};a&&(i.timingLabel=I(a)),z(i,o)}else l("args.category, args.variable AND args.value are required in timing() AND args.value has to be a number")}function W(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.category,n=e.action,r=e.label,a=e.value,o=e.nonInteraction,i=e.transport,s=T(e,["category","action","label","value","nonInteraction","transport"]),u=arguments.length>1?arguments[1]:void 0;if(t&&n){var c={hitType:"event",eventCategory:I(t),eventAction:I(n)};r&&(c.eventLabel=I(r)),void 0!==a&&("number"!=typeof a?l("Expected `args.value` arg to be a Number."):c.eventValue=a),void 0!==o&&("boolean"!=typeof o?l("`args.nonInteraction` must be a boolean."):c.nonInteraction=o),void 0!==i&&("string"!=typeof i?l("`args.transport` must be a string."):(-1===["beacon","xhr","image"].indexOf(i)&&l("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"),c.transport=i)),Object.keys(s).filter(function(e){return"dimension"===e.substr(0,"dimension".length)}).forEach(function(e){c[e]=s[e]}),Object.keys(s).filter(function(e){return"metric"===e.substr(0,"metric".length)}).forEach(function(e){c[e]=s[e]}),z(c,u)}else l("args.category AND args.action are required in event()")}function V(e,t){var n=e.description,r=e.fatal,a={hitType:"exception"};n&&(a.exDescription=I(n)),void 0!==r&&("boolean"!=typeof r?l("`args.fatal` must be a boolean."):a.exFatal=r),z(a,t)}var K={require:function(e,t){if(e){var n=b(e);if(""!==n)if(t){if("object"!==C(t))return void l("Expected `options` arg to be an Object");0===Object.keys(t).length&&l("Empty `options` given to .require()"),F("require",n,t),R&&"called ga('require', '".concat(n,"', ").concat(JSON.stringify(t))}else F("require",n),R&&"called ga('require', '".concat(n,"');");else l("`name` cannot be an empty string in .require()")}else l("`name` is required in .require()")},execute:function(e,t){var n,r;if(1==(arguments.length<=2?0:arguments.length-2)?n=arguments.length<=2?void 0:arguments[2]:(r=arguments.length<=2?void 0:arguments[2],n=arguments.length<=3?void 0:arguments[3]),"string"!=typeof e)l("Expected `pluginName` arg to be a String.");else if("string"!=typeof t)l("Expected `action` arg to be a String.");else{var a="".concat(e,":").concat(t);n=n||null,r&&n?(F(a,r,n),R&&("called ga('".concat(a,"');"),'actionType: "'.concat(r,'" with payload: ').concat(JSON.stringify(n)))):n?(F(a,n),R&&("called ga('".concat(a,"');"),"with payload: ".concat(JSON.stringify(n)))):(F(a),R&&"called ga('".concat(a,"');"))}}};function X(e,t,n){if("function"==typeof t)if(e&&e.label){var r={hitType:"event",eventCategory:"Outbound",eventAction:"Click",eventLabel:I(e.label)},a=!1,o=setTimeout(function(){a=!0,t()},250);r.hitCallback=function(){clearTimeout(o),a||t()},z(r,n)}else l("args.label is required in outboundLink()");else l("hitCallback function is required")}var $=O,Q={initialize:Y,ga:F,set:H,send:z,pageview:B,modalview:q,timing:G,event:W,exception:V,plugin:K,outboundLink:X,testModeAPI:O};function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"initialize",function(){return Z}),n.d(t,"ga",function(){return ee}),n.d(t,"set",function(){return te}),n.d(t,"send",function(){return ne}),n.d(t,"pageview",function(){return re}),n.d(t,"modalview",function(){return ae}),n.d(t,"timing",function(){return oe}),n.d(t,"event",function(){return ie}),n.d(t,"exception",function(){return se}),n.d(t,"plugin",function(){return le}),n.d(t,"outboundLink",function(){return ue}),n.d(t,"testModeAPI",function(){return ce}),n.d(t,"OutboundLink",function(){return pe});var Z=Y,ee=F,te=H,ne=z,re=B,ae=q,oe=G,ie=W,se=V,le=K,ue=X,ce=$;v.origTrackLink=v.trackLink,v.trackLink=X;var pe=v;t.default=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};if(o){var n=o.getItem(e);return n?JSON.parse(n):t}return console.warn("localStorage not available. Using default value for '"+e+"'."),t},s=t.setStorage=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(o){var r=o.getItem(e);if(!r||n)var i=t;else i=a({},JSON.parse(r),t);o.setItem(e,JSON.stringify(i))}else console.warn("localStorage not available. '"+e+"'' will not perist when you close your browser.")},l=(t.cache={get:function(e){var t=i("cache",{});if(void 0!==t['"'+e+'"'])return t['"'+e+'"']},set:function(e,t){var n=i("cache",{});return n['"'+e+'"']=t,s("cache",n),!0},clear:function(){s("cache",{},!0)}},t.toJSON=function(e){try{return JSON.parse(e)}catch(t){if(e.constructor==={}.constructor)return e;console.error("Could not convert non-JSON",string)}return{}},t.setFavicon=function(e){var t=document.getElementsByClassName("favicon"),n=!0,r=!1,a=void 0;try{for(var o,i=t[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value,l=document.createElement("link");l.className=s.className,l.rel=s.rel,l.href="/iris/assets/"+e,s.type&&(l.type=s.type),document.head.removeChild(s),document.head.appendChild(l)}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}},t.isCached=function(e){var t=new Image;return t.src=e,t.complete},t.digestMopidyImages=function(e,t){for(var n=[],a=0;a0&&void 0!==arguments[0]?arguments[0]:"numeric";if("numeric"==e){var t=(new Date).valueOf().toString(),n=Math.floor(100*Math.random()).toString();return parseInt(t+n)}var r="xxxxxxxxxx";return r.replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},t.getCurrentPusherConnection=function(e,t){var n=newProps.pusher.connections.find(function(e){return e.connectionid==newProps.pusher.connectionid});return n||!1},t.getTrackIcon=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return!1;if(!e)return!1;if(void 0===e.uri)return!1;if(void 0===t.tracks[e.uri])return!1;var n=t.tracks[e.uri];return!!n.images&&l(n.images).small},t.formatImages=function(e){var t={formatted:!0,small:null,medium:null,large:null,huge:null};if(!e)return t;if(Array.isArray(e)){if(e.length<=0)return t;for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;t.push(d(s))}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t},t.formatAlbums=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;t.push(u(s))}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t},t.formatArtists=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;t.push(c(s))}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t},t.formatPlaylists=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;t.push(d(s))}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t},t.formatUsers=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;t.push(p(s))}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t},t.formatAlbum=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["uri","provider","name","type","added_at","release_date","listeners","play_count","wiki","wiki_publish_date","popularity","images","artists_uris","tracks_uris","artists"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t.images&&!t.images.formatted&&(t.images=l(t.images)),e.date&&!t.date&&(t.release_date=e.date),e.album_type&&(t.type=e.album_type),void 0===t.provider&&void 0!==t.uri&&(t.provider=f(t.uri)),t}),c=t.formatArtist=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["uri","provider","mbid","name","type","popularity","followers","listeners","added_at","biography","biography_link","biography_publish_date","related_artists_uris","albums_uris","albums_total","albums_more","tracks_uris","tracks_total","tracks_more"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return e.images&&e.images.length>0&&(t.images=[l(e.images)]),e.followers&&void 0!==e.followers.total&&(t.followers=e.followers.total),e.bio&&(e.bio.content&&!t.biography&&(t.biography=e.bio.content),e.bio.links&&e.bio.links.link&&e.bio.links.link.href&&!t.biography_link&&(t.biography_link=e.bio.links.link.href),e.bio.published&&!t.biography_publish_date&&(t.biography_publish_date=e.bio.published)),void 0===t.provider&&void 0!==t.uri&&(t.provider=f(t.uri)),t},p=(t.formatPlaylist=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["uri","snapshot_id","provider","type","collaborative","public","name","description","images","popularity","followers","added_at","last_modified_date","can_edit","owner","user_uri","tracks_uris","tracks_total","tracks_more"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t.images&&!t.images.formatted&&(t.images=l(t.images)),e.followers&&void 0!==e.followers.total&&(t.followers=e.followers.total),e.tracks&&void 0!==e.tracks.total&&(t.tracks_total=e.tracks.total),e.owner&&(t.owner={id:e.owner.id,uri:e.owner.uri,name:e.owner.display_name?e.owner.display_name:null},t.user_uri=e.owner.uri),t.uri=_(t.uri),void 0===t.provider&&void 0!==t.uri&&(t.provider=f(t.uri)),t},t.formatUser=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["id","uri","provider","name","images","followers","playlists_uris","playlists_total","playlists_more"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return!t.images&&e.image?t.images=l(e.image):!t.images&&e.avatar?t.images=l(e.avatar):t.images&&!t.images.formatted&&(t.images=l(t.images)),e.followers&&void 0!==e.followers.total&&(t.followers=e.followers.total),e.realname&&(t.name=e.realname),e.display_name&&!t.name&&(t.name=e.display_name),e.id&&!t.name&&(t.name=e.id),void 0===t.provider&&void 0!==t.uri&&(t.provider=f(t.uri)),t}),d=t.formatTrack=function(e){var t={};e&&e.track&&m(e.track)&&(e.added_by&&(e.track.added_by=e.added_by),e.added_at&&(e.track.added_at=e.added_at),e.tlid&&(e.track.tlid=e.tlid),e=e.track);var n=!0,r=!1,a=void 0;try{for(var o,i=["uri","tlid","provider","name","images","release_date","disc_number","track_number","duration","followers","popularity","userloved","is_explicit","is_local","lyrics","lyrics_path","lyrics_results","artists","album"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return e.followers&&e.followers.total&&(t.followers=e.followers.total),void 0===t.duration&&void 0!==e.duration_ms?t.duration=e.duration_ms:void 0===t.duration&&void 0!==e.length&&(t.duration=e.length),void 0===t.track_number&&void 0!==e.track_no&&(t.track_number=e.track_no),void 0===t.disc_number&&void 0!==e.disc_no&&(t.disc_number=e.disc_no),void 0===t.release_date&&void 0!==e.date&&(t.release_date=e.date),void 0===t.explicit&&void 0!==e.explicit&&(t.is_explicit=e.explicit),e.album&&e.album.images&&(void 0!==t.images&&t.images.formatted||(t.images=l(e.album.images))),void 0===t.provider&&void 0!==t.uri&&(t.provider=f(t.uri)),t},f=(t.formatClient=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["id","connected","name","host_name","volume","mute","latency","power_on_command","power_off_command"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return e.config&&(void 0===t.latency&&void 0!==e.config.latency&&(t.latency=e.config.latency),!t.name&&e.config.name&&(t.name=e.config.name),e.config.volume&&(e.config.volume.percent&&(t.volume=e.config.volume.percent),e.config.volume.muted&&(t.mute=e.config.volume.muted))),void 0===t.name&&e.host&&e.host.name&&(t.name=e.host.name),t},t.formatGroup=function(e){var t={},n=!0,r=!1,a=void 0;try{for(var o,i=["id","name","mute","stream_id","clients_ids"][Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;e.hasOwnProperty(s)&&(t[s]=e[s])}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return void 0!==t.name&&""!==t.name||(t.name="Group "+e.id.substring(0,3)),void 0===t.mute&&void 0!==e.mute&&(t.mute=e.mute),t},t.collate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==(e=a({},e)).artists_uris&&(e.artists=[]),void 0!==e.albums_uris&&(e.albums=[]),void 0!==e.tracks_uris&&(e.tracks=[]),void 0!==e.users_uris&&(e.users=[]),void 0!==e.playlists_uris&&(e.playlists=[]),void 0!==e.related_artists_uris&&(e.related_artists=[]),void 0!==e.clients_ids&&(e.clients=[]),t.artists){if(e.artists_uris){var n=!0,r=!1,o=void 0;try{for(var i,s=e.artists_uris[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var l=i.value;t.artists[l]&&e.artists.push(t.artists[l])}}catch(e){r=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}}if(e.related_artists_uris){var u=!0,c=!1,p=void 0;try{for(var d,f=e.related_artists_uris[Symbol.iterator]();!(u=(d=f.next()).done);u=!0){l=d.value;t.artists[l]&&e.related_artists.push(t.artists[l])}}catch(e){c=!0,p=e}finally{try{!u&&f.return&&f.return()}finally{if(c)throw p}}}e.artist_uri&&t.artists[e.artist_uri]&&(e.artist=t.artists[e.artist_uri])}if(t.albums){if(e.albums_uris){var h=!0,m=!1,y=void 0;try{for(var _,v=e.albums_uris[Symbol.iterator]();!(h=(_=v.next()).done);h=!0){l=_.value;t.albums[l]&&e.albums.push(t.albums[l])}}catch(e){m=!0,y=e}finally{try{!h&&v.return&&v.return()}finally{if(m)throw y}}}e.album_uri&&t.albums[e.album_uri]&&(e.album=t.albums[e.album_uri])}if(t.tracks){if(e.tracks_uris){var b=!0,g=!1,E=void 0;try{for(var k,w=e.tracks_uris[Symbol.iterator]();!(b=(k=w.next()).done);b=!0){l=k.value;t.tracks[l]&&e.tracks.push(t.tracks[l])}}catch(e){g=!0,E=e}finally{try{!b&&w.return&&w.return()}finally{if(g)throw E}}}e.track_uri&&t.tracks[e.track_uri]&&(e.track=t.tracks[e.track_uri])}if(t.users){if(e.users_uris){var S=!0,O=!1,T=void 0;try{for(var A,C=e.users_uris[Symbol.iterator]();!(S=(A=C.next()).done);S=!0){l=A.value;t.users[l]&&e.users.push(t.users[l])}}catch(e){O=!0,T=e}finally{try{!S&&C.return&&C.return()}finally{if(O)throw T}}}e.user_uri&&t.users[e.user_uri]&&(e.user=t.users[e.user_uri])}if(t.playlists){if(e.playlists_uris){var P=!0,x=!1,R=void 0;try{for(var N,M=e.playlists_uris[Symbol.iterator]();!(P=(N=M.next()).done);P=!0){l=N.value;t.playlists[l]&&e.playlists.push(t.playlists[l])}}catch(e){x=!0,R=e}finally{try{!P&&M.return&&M.return()}finally{if(x)throw R}}}e.playlist_uri&&t.playlists[e.playlist_uri]&&(e.playlist=t.playlists[e.playlist_uri])}if(t.clients&&e.clients_ids){var L=!0,D=!1,I=void 0;try{for(var j,U=e.clients_ids[Symbol.iterator]();!(L=(j=U.next()).done);L=!0){var Y=j.value;t.clients[Y]&&e.clients.push(t.clients[Y])}}catch(e){D=!0,I=e}finally{try{!L&&U.return&&U.return()}finally{if(D)throw I}}}return e},t.uriSource=function(e){return!!e&&e.split(":")[0]}),h=t.uriType=function(e){if(!e)return null;var t=e.split(":");if("m3u"===t[0])return"playlist";if("iris"===t[0])return t[1];switch(t[1]){case"track":case"artist":case"album":case"playlist":case"genre":return t[1];case"user":return t.length>3&&"playlist"==t[3]?"playlist":t[1];default:return null}},m=(t.sourceIcon=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e&&(t=f(e)),t){case"local":case"m3u":return"folder";case"gmusic":return"google";case"podcast":case"podcast+file":case"podcast+http":case"podcast+https":case"podcast+itunes":return"podcast";case"tunein":case"somafm":case"dirble":return"microphone";default:return t}},t.getFromUri=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t.split(":");n[0];switch(e){case"mbid":var r=n.indexOf("mbid");if(r>-1)return n[r+1];break;case"artistid":if("artist"==n[1])return n[2];break;case"albumid":if("album"==n[1])return n[2];break;case"playlistid":if("playlist"==n[1])return n[2];if("user"==n[1]&&"playlist"==n[3])return n[4];break;case"playlistowner":if("user"==n[1]&&"playlist"==n[3])return n[2];break;case"trackid":if("track"==n[1])return n[2];break;case"userid":if("user"==n[1])return n[2];break;case"genreid":if("genre"==n[1])return n[2];break;case"seeds":if("discover"==n[1])return n[2];if("radio"===n[1]){var a=n[2].split(",");return a.map(function(e){return e.replace(/_/gi,":")})}break;case"searchtype":if("search"==n[1])return n[2];break;case"searchterm":if("search"==n[1])return n[3];break;default:return null}},t.buildLink=function(e){var t="/"+h(e)+"/";return t+=e=encodeURIComponent(e)},t.arrayOf=function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var l=i.value;void 0!==l[e]&&null!=l[e]&&n.push(l[e])}}catch(e){a=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw o}}return n},t.mergeDuplicates=function(e,t){var n=[],r={};for(var o in e){var i=e[o];i[t]in r&&(i=a({},r[i[t]],i)),r[i[t]]=i}for(o in r)n.push(r[o]);return n},t.removeDuplicates=function(e){var t=[];for(var n in e)t.indexOf(e[n])<=-1&&t.push(e[n]);return t},t.applyFilter=function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=[],o=0;o2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!e||e.length<=0)return[];function a(e){var n=t.split("."),r=!0,a=!1,o=void 0;try{for(var i,s=n[Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var l=i.value;if("first"==l){if(Array.isArray(e)&&e.length>0){e=e[0];continue}return null}if("length"==l)return Array.isArray(e)?e.length:0;if(void 0===e[l])return null;e=e[l]}}catch(e){a=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw o}}return e}function o(e,n){var o=a(e),i=a(n);if("uri"==t&&(o=f(o),i=f(i)),!r)return"boolean"==typeof o&&"boolean"==typeof i?o&&!i?-1:!o&&i?1:0:"number"==typeof o&&"number"==typeof i?null==o&&null==i?0:null==o?-1:null==i?1:parseInt(o)>parseInt(i)?1:parseInt(o)i.toLowerCase()?1:o.toLowerCase()l?-1:void 0}var i=Object.assign([],e.sort(o));return n&&i.reverse(),i},t.shuffle=function(e){var t=void 0,n=void 0,r=void 0;for(r=e.length-1;r>0;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},t.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},t.isObject=function(e){return e instanceof Object&&e.constructor===Object}),y=(t.isLoading=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(var n in e)if(e.hasOwnProperty(n))for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:["jaedb.github.io"],t=window.location.hostname;return e.includes(t)},t.getIndexedRecords=function(e,t){var n=[];t instanceof Array||(t=[t]);for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.getElementById("main");if(t||n.classList.remove("smooth-scroll"),e&&Number.isInteger(e))"function"==typeof n.scrollTo&&(n.scrollTop=e);else if(e){var r=null;"#"==e.charAt(0)?r=document.getElementById(e.substring(1)):"."==e.charAt(0)?(r=document.getElementsByClassName(e.substring(1))).length>0&&(r=r[0]):console.error("Invalid target type '"+e+"'. Must start with '#' or '.'."),r&&"function"==typeof r.scrollIntoView&&r.scrollIntoView()}else n.scrollTop=0;t||n.classList.add("smooth-scroll")},t.upgradeSpotifyPlaylistUris=function(e){var t=[],n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var s=o.value;s.includes("spotify:user:")&&(s=s.replace(/spotify:user:([^:]*?):/i,"spotify:")),t.push(s)}}catch(e){r=!0,a=e}finally{try{!n&&i.return&&i.return()}finally{if(r)throw a}}return t}),_=t.upgradeSpotifyPlaylistUri=function(e){return y([e])[0]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"SET_WINDOW_TITLE",title:e,play_state:t}},t.setCurrentTrackTransition=function(e){return{type:"SET_CURRENT_TRACK_TRANSITION",current_track_transition:e}},t.setSelectedTracks=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"==typeof e&&(e=[e]);return{type:"SET_SELECTED_TRACKS",keys:e}},t.showContextMenu=function(e){e.e.changedTouches?(e.position_x=e.e.changedTouches[0].clientX,e.position_y=e.e.changedTouches[0].clientY):e.e.touches?(e.position_x=e.e.touches[0].clientX,e.position_y=e.e.touches[0].clientY):(e.position_x=e.e.clientX,e.position_y=e.e.clientY);return{type:"SHOW_CONTEXT_MENU",data:e}},t.setSlimMode=function(e){return{type:"SET_SLIM_MODE",slim_mode:e}},t.setWindowFocus=function(e){return{type:"SET_WINDOW_FOCUS",window_focus:e}},t.hideContextMenu=function(){return{type:"HIDE_CONTEXT_MENU"}},t.removeContextMenu=function(){return{type:"REMOVE_CONTEXT_MENU"}},t.showTouchContextMenu=function(e){return{type:"SHOW_TOUCH_CONTEXT_MENU",data:e}},t.hideTouchContextMenu=function(){return{type:"HIDE_TOUCH_CONTEXT_MENU"}},t.removeTouchContextMenu=function(){return{type:"REMOVE_TOUCH_CONTEXT_MENU"}},t.lazyLoading=function(e){return{type:"LAZY_LOADING",start:e}},t.toggleSidebar=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"toggle",t={type:"TOGGLE_SIDEBAR"};"toggle"!=e&&(t.new_state=e);return t},t.dragStart=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return{type:"DRAG_START",context:t,from_uri:n,victims:r,victims_indexes:a,start_x:e.clientX,start_y:e.clientY}},t.dragActive=function(){return{type:"DRAG_ACTIVE"}},t.dragEnd=function(){return{type:"DRAG_END"}},t.set=function(e){return{type:"UI_SET",data:e}},t.installPrompt=function(e){return{type:"INSTALL_PROMPT",event:e}},t.createBrowserNotification=function(e){return{type:"BROWSER_NOTIFICATION",data:e}},t.createNotification=function(e){e.message&&(e.content=e.message);"shortcut"==e.type&&(e.duration=.4);return{type:"CREATE_NOTIFICATION",notification:r({key:a.generateGuid(),duration:5,type:"default",title:null,content:null,description:null,sticky:!1,closing:!1,render_content:!1},e)}},t.closeNotification=function(e){return{type:"CLOSE_NOTIFICATION",key:e}},t.removeNotification=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"REMOVE_NOTIFICATION",key:e,manual:t}},t.startLoading=function(e,t){return{type:"START_LOADING",source:t,key:e}},t.stopLoading=function(e){return{type:"STOP_LOADING",key:e}},t.startProcess=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:"START_PROCESS",key:e,message:t,data:n}},t.resumeProcess=function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"RESUME_PROCESS",key:e}},t.updateProcess=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:"UPDATE_PROCESS",key:e,message:t,data:n}},t.runProcess=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:e,data:t}},t.cancelProcess=function(e){return{type:"CANCEL_PROCESS",key:e}},t.processCancelled=function(e){return{type:"PROCESS_CANCELLED",key:e}},t.processFinishing=function(e){return{type:"PROCESS_FINISHING",key:e}},t.processFinished=function(e){return{type:"PROCESS_FINISHED",key:e}};var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(2))},function(e,t,n){"use strict";n.r(t),n.d(t,"__DO_NOT_USE__ActionTypes",function(){return o}),n.d(t,"applyMiddleware",function(){return y}),n.d(t,"bindActionCreators",function(){return p}),n.d(t,"combineReducers",function(){return u}),n.d(t,"compose",function(){return m}),n.d(t,"createStore",function(){return s});var r=n(68),a=function(){return Math.random().toString(36).substring(7).split("").join(".")},o={INIT:"@@redux/INIT"+a(),REPLACE:"@@redux/REPLACE"+a(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+a()}};function i(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function s(e,t,n){var a;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(s)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var l=e,u=t,c=[],p=c,d=!1;function f(){p===c&&(p=c.slice())}function h(){if(d)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return u}function m(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(d)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var t=!0;return f(),p.push(e),function(){if(t){if(d)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");t=!1,f();var n=p.indexOf(e);p.splice(n,1)}}}function y(e){if(!i(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,u=l(u,e)}finally{d=!1}for(var t=c=p,n=0;n=0||(a[n]=e[n]);return a}var f=n(67),h=n.n(f),m=n(11),y=n.n(m),_=n(66);function v(e,t){void 0===t&&(t={});var n=t,i=n.getDisplayName,s=void 0===i?function(e){return"ConnectAdvanced("+e+")"}:i,u=n.methodName,c=void 0===u?"connectAdvanced":u,f=n.renderCountProp,m=void 0===f?void 0:f,v=n.shouldHandleStateChanges,b=void 0===v||v,g=n.storeKey,E=void 0===g?"store":g,k=n.withRef,w=void 0!==k&&k,S=n.forwardRef,O=void 0!==S&&S,T=n.context,A=void 0===T?l:T,C=d(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]);y()(void 0===m,"renderCountProp is removed. render counting is built into the latest React dev tools profiling extension"),y()(!w,"withRef is removed. To access the wrapped instance, use a ref on the connected component");var P="To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React Redux's Provider and specific components like: . You may also pass a {context : MyContext} option to connect";y()("store"===E,"storeKey has been removed and does not do anything. "+P);var x=A;return function(t){var n=t.displayName||t.name||"Component",i=s(n),l=Object(p.a)({},C,{getDisplayName:s,methodName:c,renderCountProp:m,shouldHandleStateChanges:b,storeKey:E,displayName:i,wrappedComponentName:n,WrappedComponent:t}),u=C.pure,d=a.Component;u&&(d=a.PureComponent);var f=function(n){function a(t){var r,a,i,s,l,c,d,f,h,m,_;return r=n.call(this,t)||this,y()(O?!t.wrapperProps[E]:!t[E],"Passing redux store in props has been removed and does not do anything. "+P),r.selectDerivedProps=function(t,n,r,o){if(u&&a===n&&i===t)return s;r===l&&c===o||(l=r,c=o,d=e(r.dispatch,o)),a=n,i=t;var p=d(t,n);return s=p},r.selectChildElement=function(e,t,n){return t===f&&n===h&&_===e||(f=t,h=n,_=e,m=o.a.createElement(e,Object(p.a)({},t,{ref:n}))),m},r.indirectRenderWrappedComponent=r.indirectRenderWrappedComponent.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r)),r}r(a,n);var s=a.prototype;return s.indirectRenderWrappedComponent=function(e){return this.renderWrappedComponent(e)},s.renderWrappedComponent=function(e){y()(e,'Could not find "store" in the context of "'+i+'". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to '+i+" in connect options.");var n,r=e.storeState,a=e.store,o=this.props;O&&(o=this.props.wrapperProps,n=this.props.forwardedRef);var s=this.selectDerivedProps(r,o,a,l);return this.selectChildElement(t,s,n)},s.render=function(){var e=this.props.context&&this.props.context.Consumer&&Object(_.isContextConsumer)(o.a.createElement(this.props.context.Consumer,null))?this.props.context:x;return o.a.createElement(e.Consumer,null,this.indirectRenderWrappedComponent)},a}(d);if(f.WrappedComponent=t,f.displayName=i,O){var v=o.a.forwardRef(function(e,t){return o.a.createElement(f,{wrapperProps:e,forwardedRef:t})});return v.displayName=i,v.WrappedComponent=t,h()(v,t)}return h()(f,t)}}var b=Object.prototype.hasOwnProperty;function g(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function E(e,t){if(g(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var a=0;a=0;r--){var a=t[r](e);if(a)return a}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function L(e,t){return e===t}var D,I,j,U,Y,F,H,z,B,q,G,W,V=(j=(I=void 0===D?{}:D).connectHOC,U=void 0===j?v:j,Y=I.mapStateToPropsFactories,F=void 0===Y?A:Y,H=I.mapDispatchToPropsFactories,z=void 0===H?T:H,B=I.mergePropsFactories,q=void 0===B?P:B,G=I.selectorFactory,W=void 0===G?N:G,function(e,t,n,r){void 0===r&&(r={});var a=r,o=a.pure,i=void 0===o||o,s=a.areStatesEqual,l=void 0===s?L:s,u=a.areOwnPropsEqual,c=void 0===u?E:u,f=a.areStatePropsEqual,h=void 0===f?E:f,m=a.areMergedPropsEqual,y=void 0===m?E:m,_=d(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),v=M(e,F,"mapStateToProps"),b=M(t,z,"mapDispatchToProps"),g=M(n,q,"mergeProps");return U(W,Object(p.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:v,initMapDispatchToProps:b,initMergeProps:g,pure:i,areStatesEqual:l,areOwnPropsEqual:c,areStatePropsEqual:h,areMergedPropsEqual:y},_))});n.d(t,"Provider",function(){return c}),n.d(t,"connectAdvanced",function(){return v}),n.d(t,"ReactReduxContext",function(){return l}),n.d(t,"connect",function(){return V})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=i(r),o=i(n(136));function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,r.memo)(function(e){if(!e.name||""===e.name)return null;var t="icon icon--"+(e.type?e.type:"material");switch(e.className&&(t+=" "+e.className),e.type){case"svg":return a.default.createElement("img",{className:t,src:"/iris/assets/icons/"+e.name+".svg",onClick:function(t){return e.onClick?e.onClick(t):null}});case"gif":return a.default.createElement("img",{className:t,src:"/iris/assets/icons/"+e.name+".gif",onClick:function(t){return e.onClick?e.onClick(t):null}});case"fontawesome":return a.default.createElement(o.default,{className:t,type:"fontawesome",name:e.name,onClick:function(t){return e.onClick?e.onClick(t):null}});case"css":switch(e.name){case"playing":return a.default.createElement("i",{className:t+" icon--playing"},a.default.createElement("span",null),a.default.createElement("span",null),a.default.createElement("span",null))}default:return a.default.createElement("i",{className:t,onClick:function(t){return e.onClick?e.onClick(t):null}},e.name)}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.set=function(e){return{type:"MOPIDY_SET",data:e}},t.request=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:"MOPIDY_REQUEST",method:e,params:t,response_callback:n,error_callback:r}},t.connect=function(){return{type:"MOPIDY_CONNECT"}},t.connecting=function(){return{type:"MOPIDY_CONNECTING"}},t.disconnect=function(){return{type:"MOPIDY_DISCONNECT"}},t.debug=function(e,t){return{type:"MOPIDY_DEBUG",call:e,value:t}},t.restartStarted=function(){return{type:"MOPIDY_RESTART_STARTED"}},t.restartFinished=function(){return{type:"MOPIDY_RESTART_FINISHED"}},t.upgradeStarted=function(){return{type:"MOPIDY_UPGRADE_STARTED"}},t.upgradeFinished=function(){return{type:"MOPIDY_UPGRADE_FINISHED"}},t.localScanStarted=function(){return{type:"MOPIDY_LOCAL_SCAN_STARTED"}},t.localScanFinished=function(){return{type:"MOPIDY_LOCAL_SCAN_FINISHED"}},t.getPlayState=function(){return{type:"MOPIDY_GET_PLAY_STATE"}},t.play=function(){return{type:"MOPIDY_PLAY"}},t.pause=function(){return{type:"MOPIDY_PAUSE"}},t.stop=function(){return{type:"MOPIDY_STOP"}},t.next=function(){return{type:"MOPIDY_NEXT"}},t.previous=function(){return{type:"MOPIDY_PREVIOUS"}},t.getMute=function(){return{type:"MOPIDY_GET_MUTE"}},t.setMute=function(e){return{type:"MOPIDY_SET_MUTE",mute:e}},t.getVolume=function(){return{type:"MOPIDY_GET_VOLUME"}},t.setVolume=function(e){return{type:"MOPIDY_SET_VOLUME",volume:e}},t.getConsume=function(){return{type:"MOPIDY_GET_CONSUME"}},t.setConsume=function(e){return{type:"MOPIDY_SET_CONSUME",consume:e}},t.getRepeat=function(){return{type:"MOPIDY_GET_REPEAT"}},t.setRepeat=function(e){return{type:"MOPIDY_SET_REPEAT",repeat:e}},t.getRandom=function(){return{type:"MOPIDY_GET_RANDOM"}},t.setRandom=function(e){return{type:"MOPIDY_SET_RANDOM",random:e}},t.getTimePosition=function(){return{type:"MOPIDY_GET_TIME_POSITION"}},t.setTimePosition=function(e){return{type:"MOPIDY_SET_TIME_POSITION",time_position:parseInt(e)}},t.timePosition=function(e){return{type:"MOPIDY_TIME_POSITION",time_position:parseInt(e)}},t.getUriSchemes=function(){return{type:"MOPIDY_GET_URI_SCHEMES"}},t.getCurrentTrack=function(){return{type:"MOPIDY_GET_CURRENT_TRACK"}},t.currentTrackLoaded=function(e){return{type:"MOPIDY_CURRENT_TRACK_LOADED",tl_track:e}},t.getNextTrack=function(){return{type:"MOPIDY_GET_NEXT_TRACK"}},t.clearCurrentTrack=function(){return{type:"CLEAR_CURRENT_TRACK"}},t.getQueue=function(){return{type:"MOPIDY_GET_QUEUE"}},t.changeTrack=function(e){return{type:"MOPIDY_CHANGE_TRACK",tlid:e}},t.playURIs=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"MOPIDY_PLAY_URIS",uris:e,from_uri:t}},t.playAlbum=function(e){return{type:"MOPIDY_PLAY_ALBUM",uri:e}},t.playPlaylist=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"MOPIDY_PLAY_PLAYLIST",uri:e,shuffle:t}},t.enqueueURIs=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return{type:"MOPIDY_ENQUEUE_URIS",uris:e,from_uri:t,at_position:r,play_next:n,offset:a}},t.enqueueAlbum=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:"MOPIDY_ENQUEUE_ALBUM",uri:e,next:t,at_position:n}},t.enqueuePlaylist=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:"MOPIDY_ENQUEUE_PLAYLIST",uri:e,play_next:t,at_position:n}},t.enqueueURIsBatchDone=function(){return{type:"MOPIDY_ENQUEUE_URIS_BATCH_DONE"}},t.removeTracks=function(e){return{type:"MOPIDY_REMOVE_TRACKS",tlids:e}},t.reorderTracklist=function(e,t){var n=r.createRange(e);t>n.start&&(t-=n.length);return{type:"MOPIDY_REORDER_TRACKLIST",range_start:n.start,range_length:n.length,insert_before:t}},t.clearTracklist=function(){return{type:"MOPIDY_CLEAR_TRACKLIST"}},t.getImages=function(e,t){return{type:"MOPIDY_GET_IMAGES",context:e,uris:t}},t.createPlaylist=function(e,t){return{type:"MOPIDY_CREATE_PLAYLIST",name:e,scheme:t}},t.deletePlaylist=function(e){return{type:"MOPIDY_DELETE_PLAYLIST",uri:e}},t.getLibraryPlaylists=function(){return{type:"MOPIDY_GET_LIBRARY_PLAYLISTS"}},t.getPlaylist=function(e){return{type:"MOPIDY_GET_PLAYLIST",data:{uri:e}}},t.getPlaylists=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"MOPIDY_GET_PLAYLISTS",uris:e,processor:t}},t.getDirectory=function(e){return{type:"MOPIDY_GET_DIRECTORY",data:{uri:e}}},t.getTrack=function(e){return{type:"MOPIDY_GET_TRACK",data:{uri:e}}},t.getLibraryArtists=function(){return{type:"MOPIDY_GET_LIBRARY_ARTISTS",uri:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null}},t.clearLibraryArtists=function(){return{type:"MOPIDY_CLEAR_LIBRARY_ARTISTS"}},t.getArtist=function(e){return{type:"MOPIDY_GET_ARTIST",data:{uri:e}}},t.getArtists=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"MOPIDY_GET_ARTISTS",uris:e,processor:t}},t.getAlbum=function(e){return{type:"MOPIDY_GET_ALBUM",data:{uri:e}}},t.getAlbums=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"MOPIDY_GET_ALBUMS",uris:e,processor:t}},t.getLibraryAlbums=function(){return{type:"MOPIDY_GET_LIBRARY_ALBUMS",uri:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null}},t.clearLibraryAlbums=function(){return{type:"MOPIDY_CLEAR_LIBRARY_ALBUMS"}},t.runProcessor=function(e){return{type:e}},t.cancelProcessor=function(e){return{type:e+"_CANCEL"}},t.clearSearchResults=function(){return{type:"MOPIDY_CLEAR_SEARCH_RESULTS"}},t.getSearchResults=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return{type:"MOPIDY_GET_SEARCH_RESULTS",context:e,query:t,limit:n}},t.getQueueHistory=function(){return{type:"MOPIDY_GET_QUEUE_HISTORY"}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(2))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]&&arguments[2];return function(r,a){c(r,a,e).then(function(e){r({type:t,key:n,data:e})},function(e){r(o.handleException("Could not load URL",e))})}},t.getMore=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(r,a){c(r,a,e).then(function(e){t?r(o.loadedMore(t.parent_type,t.parent_key,t.records_type,e)):n?(n.data=e,r(n)):r(o.handleException("No callback handler for loading more items"))},function(e){r(o.handleException("Could not load more "+callback_action.parent_type+" "+callback_action.records_type+"s",e))})}},t.clearSearchResults=function(){return{type:"SPOTIFY_CLEAR_SEARCH_RESULTS"}},t.getSearchResults=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return function(s,l){s(i.startProcess("SPOTIFY_GET_SEARCH_RESULTS_PROCESSOR","Searching Spotify")),"all"==(e=e.replace(/s+$/,""))&&(e="album,artist,playlist,track");var p="search?q="+t;p+="&type="+e,p+="&country="+l().spotify.country,p+="&limit="+n,c(s,l,p+="&offset="+a).then(function(e){if(void 0!==e.tracks&&s({type:"SPOTIFY_SEARCH_RESULTS_LOADED",context:"tracks",query:t,results:u.formatTracks(e.tracks.items),more:e.tracks.next}),void 0!==e.artists&&(s({type:"ARTISTS_LOADED",artists:e.artists.items}),s({type:"SPOTIFY_SEARCH_RESULTS_LOADED",context:"artists",query:t,results:u.arrayOf("uri",e.artists.items),more:e.artists.next})),void 0!==e.albums&&(s({type:"ALBUMS_LOADED",albums:e.albums.items}),s({type:"SPOTIFY_SEARCH_RESULTS_LOADED",context:"albums",query:t,results:u.arrayOf("uri",e.albums.items),more:e.albums.next})),void 0!==e.playlists){var n=[],a=!0,o=!1,c=void 0;try{for(var p,d=e.playlists.items[Symbol.iterator]();!(a=(p=d.next()).done);a=!0){var f=p.value;n.push(r({},u.formatPlaylist(f),{can_edit:l().spotify.me&&f.owner.id==l().spotify.me.id,tracks_total:f.tracks.total}))}}catch(e){o=!0,c=e}finally{try{!a&&d.return&&d.return()}finally{if(o)throw c}}s({type:"PLAYLISTS_LOADED",playlists:n}),s({type:"SPOTIFY_SEARCH_RESULTS_LOADED",context:"playlists",query:t,results:u.arrayOf("uri",n),more:e.playlists.next})}s(i.processFinishing("SPOTIFY_GET_SEARCH_RESULTS_PROCESSOR"))},function(e){s(o.handleException("Could not load search results",e))})}},t.getAutocompleteResults=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["album","artist","playlist","track"];return function(r,a){r({type:"SPOTIFY_AUTOCOMPLETE_LOADING",field_id:e});var i=n.includes("genre");if(i){var s=n.indexOf("genre");n.splice(s,1)}var l="search?q="+t;l+="&type="+n.join(","),l+="&country="+a().spotify.country,c(r,a,l).then(function(n){var s=[];if(i){var l=a().spotify.genres;if(l)for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:null}},t.following=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET";return function(n,r){var a=u.uriType(e),i=void 0,s=void 0,l=null;switch("PUT"==t?l=!0:"DELETE"==t&&(l=!1),a){case"track":i="GET"==t?"me/tracks/contains/?ids="+u.getFromUri("trackid",e):"me/tracks/?ids="+u.getFromUri("trackid",e);break;case"album":i="GET"==t?"me/albums/contains/?ids="+u.getFromUri("albumid",e):"me/albums/?ids="+u.getFromUri("albumid",e);break;case"artist":"GET"==t?i="me/following/contains?type=artist&ids="+u.getFromUri("artistid",e):(i="me/following?type=artist&ids="+u.getFromUri("artistid",e),s={});break;case"user":"GET"==t?i="me/following/contains?type=user&ids="+u.getFromUri("userid",e):(i="me/following?type=user&ids="+u.getFromUri("userid",e),s={});break;case"playlist":i="GET"==t?"playlists/"+u.getFromUri("playlistid",e)+"/followers/contains?ids="+r().spotify.me.id:"playlists/"+u.getFromUri("playlistid",e)+"/followers"}c(n,r,i,t,s).then(function(t){l=t?t[0]:l,n({type:"SPOTIFY_LIBRARY_"+a.toUpperCase()+"_CHECK",key:e,in_library:l})},function(e){n(o.handleException("Could not follow/unfollow",e))})}},t.resolveRadioSeeds=function(e){return function(t,n){if(e.seed_artists.length>0){for(var r="",a=0;a0&&(r+=","),r+=u.getFromUri("artistid",e.seed_artists[a]);c(t,n,"artists?ids="+r).then(function(e){e&&e.artists?t({type:"ARTISTS_LOADED",artists:e.artists}):console.error("No Spotify artists returned",r)},function(e){t(o.handleException("Could not resolve radio artist seeds",e))})}if(e.seed_tracks.length>0){var i="";for(a=0;a0&&(i+=","),i+=u.getFromUri("trackid",e.seed_tracks[a]);c(t,n,"tracks?ids="+i).then(function(e){t({type:"TRACKS_LOADED",tracks:e.tracks})},function(e){t(o.handleException("Could not load radio track seeds",e))})}}},t.getFavorites=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long_term";return function(a,i){a({type:"SPOTIFY_FAVORITES_LOADED",artists:[],tracks:[]}),e.when(c(a,i,"me/top/artists?limit="+t+"&time_range="+n),c(a,i,"me/top/tracks?limit="+t+"&time_range="+n)).then(function(e,t){a({type:"SPOTIFY_FAVORITES_LOADED",artists:e.items,tracks:t.items})},function(e,t){a(o.handleException("Could not load favorites",r({},e,t)))})}},t.getRecommendations=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return function(r,a){r({type:"CLEAR_SPOTIFY_RECOMMENDATIONS"});for(var i=[],s=[],l=[],p=0;p0){var r={uri:e.uri,images:n.artists.items[0].images};t(o.artistLoaded(r))}},function(e){t(o.handleException("Could not load artists",e))})}},t.playArtistTopTracks=function(e){return function(t,n){var r=n().core.artists;if(void 0!==r[e]&&void 0!==r[e].tracks){var a=u.arrayOf("uri",r[e].tracks);t(s.playURIs(a,e))}else c(t,n,"artists/"+u.getFromUri("artistid",e)+"/top-tracks?country="+n().spotify.country).then(function(n){var r=u.arrayOf("uri",n.tracks);t(s.playURIs(r,e))},function(e){t(o.handleException("Could not play artist's top tracks",e))})}},t.getUser=function(e){return function(t,n){c(t,n,"users/"+u.getFromUri("userid",e)).then(function(e){t(o.userLoaded(u.formatUser(e)))},function(e){t(o.handleException("Could not load user",e))})}},t.getUserPlaylists=function(e){return function(t,n){c(t,n,"users/"+u.getFromUri("userid",e)+"/playlists?limit=40").then(function(a){var i=[],s=!0,l=!1,c=void 0;try{for(var p,d=a.items[Symbol.iterator]();!(s=(p=d.next()).done);s=!0){var f=p.value,h=!1;n().spotify.me&&f.owner.id==n().spotify.me.id&&(h=!0);var m=r({},u.formatPlaylist(f),{can_edit:h,tracks_total:f.tracks.total});i.push(m)}}catch(e){l=!0,c=e}finally{try{!s&&d.return&&d.return()}finally{if(l)throw c}}t(o.userPlaylistsLoaded(e,i,a.next,a.total))},function(e){t(o.handleException("Could not load user's playlists",e))})}},t.getAlbum=function(e){return function(t,n){c(t,n,"albums/"+u.getFromUri("albumid",e)).then(function(e){t(o.artistsLoaded(e.artists));for(var a=Object.assign([],e.tracks.items),i=r({},u.formatAlbum(e),{artists_uris:u.arrayOf("uri",e.artists),tracks_uris:u.arrayOf("uri",a),tracks_more:e.tracks.next,tracks_total:e.tracks.total}),s=0;s1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;return function(s,l){s(i.startProcess("SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR","Loading playlist tracks",{uri:e,next:"playlists/"+u.getFromUri("playlistid",e)+"/tracks?market="+l().spotify.country,shuffle:t,play_next:r,at_position:a,offset:o,callback_action:n}))}},t.getAllPlaylistTracksProcessor=function(e){return function(t,n){c(t,n,e.next).then(function(o){if(void 0!==n().ui.processes.SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR&&"cancelling"==n().ui.processes.SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR.status)return t(i.processCancelled("SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR")),!1;var l=[],c=[],p=!0,d=!1,f=void 0;try{for(var h,m=o.items[Symbol.iterator]();!(p=(h=m.next()).done);p=!0){var y=h.value;y.track&&c.push(y.track.uri)}}catch(e){d=!0,f=e}finally{try{!p&&m.return&&m.return()}finally{if(d)throw f}}l=e.uris?[].concat(a(e.uris),c):c,o.next?(t(i.updateProcess("SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR","Loading "+(o.total-l.length)+" playlist tracks",r({},e,{next:o.next,total:o.total,remaining:o.total-l.length}))),t(i.runProcess("SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR",r({},e,{next:o.next,uris:l})))):(e.shuffle&&(l=u.shuffle(l)),t(i.processFinished("SPOTIFY_GET_ALL_PLAYLIST_TRACKS_PROCESSOR")),"enqueue"==e.callback_action?t(s.enqueueURIs(l,e.uri,e.play_next,e.at_position,e.offset)):t(s.playURIs(l,e.uri)))},function(e){t(o.handleException("Could not load tracks to play playlist",e))})}},t.toggleFollowingPlaylist=function(e,t){if("PUT"==t)var n=1;if("DELETE"==t)n=0;return function(r,a){c(r,a,"playlists/"+u.getFromUri("playlistid",e)+"/followers",t).then(function(t){r({type:"SPOTIFY_PLAYLIST_FOLLOWING_LOADED",key:e,is_following:n})},function(e){r(o.handleException("Could not add/remove library playlist",e))})}},t.addTracksToPlaylist=function(e,t){return function(n,r){c(n,r,"playlists/"+u.getFromUri("playlistid",e)+"/tracks","POST",{uris:t}).then(function(r){n({type:"PLAYLIST_TRACKS_ADDED",key:e,tracks_uris:t,snapshot_id:r.snapshot_id})},function(e){n(o.handleException("Could not add tracks to playlist",e))})}},t.deleteTracksFromPlaylist=function(e,t,n){return function(r,a){c(r,a,"playlists/"+u.getFromUri("playlistid",e)+"/tracks","DELETE",{snapshot_id:t,positions:n}).then(function(t){r({type:"PLAYLIST_TRACKS_REMOVED",key:e,tracks_indexes:n,snapshot_id:t.snapshot_id})},function(e){r(o.handleException("Could not remove tracks from playlist",e))})}},t.reorderPlaylistTracks=function(e,t,n,r,a){return function(i,s){c(i,s,"playlists/"+u.getFromUri("playlistid",e)+"/tracks","PUT",{uri:e,range_start:t,range_length:n,insert_before:r,snapshot_id:a}).then(function(a){i({type:"PLAYLIST_TRACKS_REORDERED",key:e,range_start:t,range_length:n,insert_before:r,snapshot_id:a.snapshot_id})},function(e){i(o.handleException("Could not reorder playlist tracks",e))})}},t.flushLibrary=function(){return{type:"SPOTIFY_FLUSH_LIBRARY"}},t.getLibraryPlaylists=function(){return function(e,t){var n=t().ui.processes.SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR;n?"cancelled"==n.status?e(i.resumeProcess("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR")):"finished"!=n.status||t().spotify.library_playlists_loaded_all||e(i.startProcess("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR","Loading Spotify playlists",{next:"me/playlists?limit=50"})):e(i.startProcess("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR","Loading Spotify playlists",{next:"me/playlists?limit=50"}))}},t.getLibraryPlaylistsProcessor=function(e){return function(t,n){c(t,n,e.next).then(function(e){if((t({type:"SPOTIFY_LIBRARY_PLAYLISTS_LOADED",playlists:e.items}),void 0!==n().ui.processes.SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR)&&"cancelling"==n().ui.processes.SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR.status)return t(i.processCancelled("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR")),!1;if(e.next){var r=e.total-n().spotify.library_playlists.length;t(i.updateProcess("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR","Loading "+r+" Spotify playlists",{next:e.next,total:e.total,remaining:r})),t(i.runProcess("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR",{next:e.next}))}else t(i.processFinishing("SPOTIFY_GET_LIBRARY_PLAYLISTS_PROCESSOR")),t({type:"SPOTIFY_LIBRARY_PLAYLISTS_LOADED_ALL"})},function(e){t(o.handleException("Could not load library playlists",e))})}},t.getLibraryArtists=function(){return function(e,t){var n=t().ui.processes.SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR;n?"cancelled"==n.status?e(i.resumeProcess("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR")):"finished"!=n.status||t().spotify.library_artists_loaded_all||e(i.startProcess("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR","Loading Spotify artists",{next:"me/following?type=artist&limit=50"})):e(i.startProcess("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR","Loading Spotify artists",{next:"me/following?type=artist&limit=50"}))}},t.getLibraryArtistsProcessor=function(e){return function(t,n){c(t,n,e.next).then(function(e){if((t({type:"SPOTIFY_LIBRARY_ARTISTS_LOADED",artists:e.artists.items}),void 0!==n().ui.processes.SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR)&&"cancelling"==n().ui.processes.SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR.status)return t(i.processCancelled("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR")),!1;if(e.artists.next){var r=e.artists.total-n().spotify.library_artists.length;t(i.updateProcess("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR","Loading "+r+" Spotify artists",{next:e.artists.next,total:e.artists.total,remaining:r})),t(i.runProcess("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR",{next:e.artists.next}))}else t(i.processFinishing("SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR"))},function(e){t(o.handleException("Could not load library artists",e))})}},t.getLibraryAlbums=function(){return function(e,t){var n=t().ui.processes.SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR;n?"cancelled"==n.status?e(i.updateProcess("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR","Loading Spotify albums",{next:"me/albums?limit=50"})):"finished"!=n.status||t().spotify.library_albums_loaded_all||e(i.startProcess("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR","Loading Spotify albums",{next:"me/albums?limit=50"})):e(i.startProcess("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR","Loading Spotify albums",{next:"me/albums?limit=50"}))}},t.getLibraryAlbumsProcessor=function(e){return function(t,n){c(t,n,e.next).then(function(e){if((t({type:"SPOTIFY_LIBRARY_ALBUMS_LOADED",albums:e.items}),void 0!==n().ui.processes.SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR)&&"cancelling"==n().ui.processes.SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR.status)return t(i.processCancelled("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR")),!1;if(e.next){var r=e.total-n().spotify.library_albums.length;t(i.updateProcess("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR","Loading "+r+" Spotify albums",{next:e.next,total:e.total,remaining:r})),t(i.runProcess("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR",{next:e.next}))}else t(i.processFinishing("SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR"))},function(e){t(o.handleException("Could not load library albums",e))})}};n(19);function a(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t3&&void 0!==arguments[3]?arguments[3]:"GET",a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],u.generateGuid());return e(i.startLoading(s,"spotify_"+n)),new Promise(function(l,u){p(e,t).then(function(o){var c="https://api.spotify.com/v1/"+n;n.startsWith("https://api.spotify.com/")&&(c=n);var p={method:r,timeout:3e4,headers:{Authorization:"Bearer "+o,Accept:"application/json"}};a&&(p.body="string"==typeof a?a:JSON.stringify(a)),fetch(c,p).then(function(t){return e(i.stopLoading(s)),429===t.status&&console.error("You hit the Spotify API rate limiter"),t.text().then(function(e){return e?JSON.parse(e):{}})}).then(function(n){n&&n.error&&"The access token expired"===n.error.message&&e(d(e,t)),l(n)}).catch(function(e){u(e)})},function(t){e(o.handleException(t.error)),u(t)})})};function p(e,t){return new Promise(function(n,r){t().spotify.token_expiry&&(new Date).getTime()1&&void 0!==arguments[1]&&arguments[1];return function(r,a){var i={},s=[c(r,a,"artists/"+u.getFromUri("artistid",t),"GET",!1,!0).then(function(e){Object.assign(i,e)},function(e){r(o.handleException("Could not load artist",e))})];n&&(s.push(c(r,a,"artists/"+u.getFromUri("artistid",t)+"/top-tracks?country="+a().spotify.country).then(function(e){Object.assign(i,e)},function(e){r(o.handleException("Could not load artist's top tracks",e))})),s.push(c(r,a,"artists/"+u.getFromUri("artistid",t)+"/related-artists").then(function(e){r(o.artistsLoaded(e.artists)),Object.assign(i,{related_artists_uris:u.arrayOf("uri",e.artists)})},function(e){r(o.handleException("Could not load artist's related artists",e))}))),e.when.apply(e,s).then(function(){i.musicbrainz_id?r(l.getArtist(i.uri,!1,i.musicbrainz_id)):r(l.getArtist(i.uri,i.name.replace("&","and"))),r(o.artistLoaded(i)),n&&c(r,a,"artists/"+u.getFromUri("artistid",t)+"/albums?market="+a().spotify.country).then(function(e){r({type:"SPOTIFY_ARTIST_ALBUMS_LOADED",artist_uri:t,data:e})},function(e){r(o.handleException("Could not load artist's albums",e))})})}}}).call(this,n(21))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.getBroadcasts=function(){return function(t,n){var r={method:"GET",timeout:15e3};n().ui.test_mode?r.url="https://gist.githubusercontent.com/jaedb/cb3a5ee6909632abb2e0fe66d4c8c311/raw":r.url="https://gist.githubusercontent.com/jaedb/b677dccf80daf3ccb2ef12e96e495677/raw",e.ajax(r).then(function(e){t({type:"BROADCASTS_LOADED",broadcasts:JSON.parse(e)})},function(e,n,a){t(i("Could not fetch broadcasts from GitHub",{config:r,xhr:e,status:n,error:a},null,!1))})}},t.startSearch=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"SEARCH_STARTED",search_type:e,query:t,only_mopidy:n}},t.handleException=i,t.debugResponse=function(e){return{type:"DEBUG",response:e}},t.set=function(e){return{type:"CORE_SET",data:e}},t.clearCurrentTrack=function(){return{type:"CLEAR_CURRENT_TRACK"}},t.cachebustHttpStream=function(){return{type:"CACHEBUST_HTTP_STREAM"}},t.loadTrack=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_TRACK",uri:e,force_reload:t}},t.loadAlbum=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_ALBUM",uri:e,force_reload:t}},t.loadArtist=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_ARTIST",uri:e,force_reload:t}},t.loadPlaylist=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_PLAYLIST",uri:e,force_reload:t}},t.loadUser=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_USER",uri:e,force_reload:t}},t.loadUserPlaylists=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"LOAD_USER_PLAYLISTS",uri:e,force_reload:t}},t.trackLoaded=function(e){return s([e])},t.tracksLoaded=s,t.artistLoaded=function(e){return l([e])},t.artistsLoaded=l,t.albumLoaded=function(e){return u([e])},t.albumsLoaded=u,t.playlistLoaded=function(e){return c([e])},t.playlistsLoaded=c,t.userLoaded=function(e){return p([e])},t.usersLoaded=p,t.userPlaylistsLoaded=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:"USER_PLAYLISTS_LOADED",uri:e,playlists:t,more:n,total:r}},t.loadedMore=function(e,t,n,r){return{type:"LOADED_MORE",parent_type:e,parent_key:t,records_type:n,records_data:r}},t.removeFromIndex=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:"REMOVE_FROM_INDEX",index_name:e,key:t,new_key:n}},t.reorderPlaylistTracks=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=r.createRange(t);switch(r.uriSource(e)){case"spotify":return{type:"SPOTIFY_REORDER_PLAYLIST_TRACKS",key:e,range_start:o.start,range_length:o.length,insert_before:n,snapshot_id:a};case"m3u":return{type:"MOPIDY_REORDER_PLAYLIST_TRACKS",key:e,range_start:o.start,range_length:o.length,insert_before:n}}},t.savePlaylist=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;switch(r.uriSource(e)){case"spotify":return{type:"SPOTIFY_SAVE_PLAYLIST",key:e,name:t,description:""==n?null:n,image:i,is_public:a,is_collaborative:o};case"m3u":return{type:"MOPIDY_SAVE_PLAYLIST",key:e,name:t}}return!1},t.createPlaylist=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];switch(e){case"spotify":return""==n&&(n=null),a.createPlaylist(t,n,r,i);default:return o.createPlaylist(t,e)}return!1},t.deletePlaylist=function(e){switch(r.uriSource(e)){case"spotify":return a.following(e,"DELETE");default:return o.deletePlaylist(e)}return!1},t.removeTracksFromPlaylist=function(e,t){switch(r.uriSource(e)){case"spotify":return{type:"SPOTIFY_REMOVE_PLAYLIST_TRACKS",key:e,tracks_indexes:t};case"m3u":return{type:"MOPIDY_REMOVE_PLAYLIST_TRACKS",key:e,tracks_indexes:t}}},t.addTracksToPlaylist=function(e,t){switch(r.uriSource(e)){case"spotify":return{type:"SPOTIFY_ADD_PLAYLIST_TRACKS",key:e,tracks_uris:t};case"m3u":return{type:"MOPIDY_ADD_PLAYLIST_TRACKS",key:e,tracks_uris:t}}},t.getLibraryPlaylists=function(){return{type:"GET_LIBRARY_PLAYLISTS"}},t.getLibraryAlbums=function(){return{type:"GET_LIBRARY_ALBUMS"}},t.getLibraryArtists=function(){return{type:"GET_LIBRARY_ARTISTS"}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(2));var a=n(8),o=n(7);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return!e&&t.message?e=t.message:!e&&t.error.message&&(e=t.error.message),!n&&t.description?n=t.description:!n&&t.error&&t.error.description&&(n=t.error.description),{type:"HANDLE_EXCEPTION",message:e,description:n,data:t,show_notification:r}}function s(e){return{type:"TRACKS_LOADED",tracks:e}}function l(e){return{type:"ARTISTS_LOADED",artists:e}}function u(e){return{type:"ALBUMS_LOADED",albums:e}}function c(e){return{type:"PLAYLISTS_LOADED",playlists:e}}function p(e){return{type:"USERS_LOADED",users:e}}}).call(this,n(21))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];return{type:"PUSHER_SET_USERNAME",username:e.replace(/[\W_]+/g,""),force:t}},t.connect=function(){return{type:"PUSHER_CONNECT"}},t.disconnect=function(){return{type:"PUSHER_DISCONNECT"}},t.upgrade=function(){return{type:"PUSHER_UPGRADE"}},t.reload=function(){return{type:"PUSHER_RELOAD"}},t.restart=function(){return{type:"PUSHER_RESTART"}},t.localScan=function(){return{type:"PUSHER_LOCAL_SCAN"}},t.getConnections=function(){return{type:"PUSHER_GET_CONNECTIONS"}},t.connectionAdded=function(e){return{type:"PUSHER_CONNECTION_ADDED",connection:e}},t.updateConnection=function(e){return{type:"PUSHER_UPDATE_CONNECTION",connection:e}},t.connectionChanged=function(e){return{type:"PUSHER_CONNECTION_CHANGED",connection:e}},t.connectionRemoved=function(e){return{type:"PUSHER_CONNECTION_REMOVED",connection:e}},t.request=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:"PUSHER_REQUEST",method:e,params:t,response_callback:n,error_callback:r}},t.getConfig=function(){return{type:"PUSHER_GET_CONFIG"}},t.getVersion=function(){return{type:"PUSHER_GET_VERSION"}},t.deliverBroadcast=function(e,t){return{type:"PUSHER_DELIVER_BROADCAST",data:{method:e,params:t}}},t.deliverMessage=function(e,t,n){return{type:"PUSHER_DELIVER_MESSAGE",data:{recipient:e,method:t,params:n}}},t.getRadio=function(){return{type:"PUSHER_GET_RADIO"}},t.startRadio=function(e){return{type:"PUSHER_START_RADIO",uris:e}},t.updateRadio=function(e){return{type:"PUSHER_UPDATE_RADIO",uris:e}},t.stopRadio=function(){return{type:"PUSHER_STOP_RADIO"}},t.radioStarted=function(e){return{type:"PUSHER_RADIO_STARTED",radio:e}},t.radioChanged=function(e){return{type:"PUSHER_RADIO_CHANGED",radio:e}},t.radioStopped=function(){return{type:"PUSHER_RADIO_STOPPED"}},t.debug=function(){return{type:"PUSHER_DEBUG",message:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null}},t.getQueueMetadata=function(){return{type:"PUSHER_GET_QUEUE_METADATA"}},t.queueMetadataChanged=function(e){return{type:"PUSHER_QUEUE_METADATA_CHANGED",queue_metadata:e}},t.addQueueMetadata=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"PUSHER_ADD_QUEUE_METADATA",tlids:e,from_uri:t}},t.getCommands=function(){return{type:"PUSHER_GET_COMMANDS"}},t.setCommand=function(e){return{type:"PUSHER_SET_COMMAND",command:e}},t.setCommands=function(e){return{type:"PUSHER_SET_COMMANDS",commands:e}},t.removeCommand=function(e){return{type:"PUSHER_REMOVE_COMMAND",id:e}},t.runCommand=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:"PUSHER_RUN_COMMAND",id:e,notify:t}},t.commandsUpdated=function(e){return{type:"PUSHER_COMMANDS_UPDATED",commands:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]&&arguments[2];return function(r,o){if(n)var i="method=artist.getInfo&mbid="+n;else{t=t.replace("&","and");i="method=artist.getInfo&artist="+(t=encodeURIComponent(t))}s(r,o,i).then(function(t){if(t.artist){var n={uri:e,mbid:t.artist.mbid,biography:t.artist.bio.content,biography_publish_date:t.artist.bio.published,biography_link:t.artist.bio.links.link.href,listeners:parseInt(t.artist.stats.listeners)};r(a.artistLoaded(n))}},function(e){})}},t.getAlbum=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(o,i){if(r)var l="method=album.getInfo&mbid="+r;else{t=encodeURIComponent(t);l="method=album.getInfo&album="+(n=encodeURIComponent(n))+"&artist="+t}s(o,i,l).then(function(t){if(t.album){var n=i().core.albums[e],r={uri:e,images:t.album.image,listeners:parseInt(t.album.listeners),play_count:parseInt(t.album.playcount),mbid:t.album.mbid,wiki:t.album.wiki?t.album.wiki.content:null,wiki_publish_date:t.album.wiki?t.album.wiki.published:null};n&&n.images&&delete r.images,o(a.albumLoaded(r))}},function(e){})}},t.getImages=function(e,t){return function(n,o){var l=o().core[e][t];if(l)switch(e){case"tracks":if(l.mbid)var u="method=album.getInfo&mbid="+l.mbid;else if(l.artists&&l.artists.length>0&&l.album){var c=encodeURIComponent(l.artists[0].name);u="method=album.getInfo&album="+encodeURIComponent(l.album.name)+"&artist="+c}u&&s(n,o,u).then(function(e){if(e.album){var r=i.formatImages(e.album.image);n(a.trackLoaded({uri:t,images:r}))}});break;case"albums":if(l.mbid)u="method=album.getInfo&mbid="+l.mbid;else if(l.artists&&l.artists.length>0)c=encodeURIComponent(l.artists[0].name),u="method=album.getInfo&album="+encodeURIComponent(l.name)+"&artist="+c;u&&s(n,o,u).then(function(e){e.album&&(l=r({},l,{images:e.album.image}),n(a.albumLoaded(l)))})}}},t.loveTrack=function(e){return function(t,n){if(void 0!==n().core.tracks[e]){var o=n().core.tracks[e];if(o.artists){var i=encodeURIComponent(o.artists[0].name),s="method=track.love&track="+o.name+"&artist="+i;l(t,n,s).then(function(e){o=r({},o,{userloved:!0}),t({type:"TRACKS_LOADED",tracks:[o]})})}else t(a.handleException("Could not love LastFM track",o,"Track has no artists"))}else t(a.handleException("Could not love LastFM track",o,"Could not find track in index"))}},t.unloveTrack=function(e){return function(t,n){if(void 0!==n().core.tracks[e]){var o=n().core.tracks[e];if(o.artists){var i=encodeURIComponent(o.artists[0].name),s="method=track.unlove&track="+o.name+"&artist="+i;l(t,n,s).then(function(e){o=r({},o,{userloved:!1}),t({type:"TRACKS_LOADED",tracks:[o]})})}else t(a.handleException("Could not unlove LastFM track",o,"Track has no artists"))}else t(a.handleException("Could not unlove LastFM track",o,"Could not find track in index"))}},t.scrobble=function(e){return function(t,n){var r=e.name,o="Unknown";e.artists&&(o=e.artists[0].name);var i="method=track.scrobble";i+="&track="+r+"&artist="+(o=encodeURIComponent(o)),i+="×tamp="+Math.floor(Date.now()/1e3),l(t,n,i).then(function(e){},function(e){t(a.handleException("Could not scrobble LastFM track",e,e.description?e.description:null))})}};var a=n(9),o=n(3),i=n(2);var s=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return new Promise(function(t,a){var s="https://ws.audioscrobbler.com/2.0/?format=json&"+n,l="GET",u=n.substring(n.indexOf("method=")+7,n.length);u=u.substring(0,u.indexOf("&")),r?l="POST":s+="&api_key=4320a3ef51c9b3d69de552ac083c55e3";var c={method:l,timeout:3e4},p=i.generateGuid();e(o.startLoading(p,"lastfm_"+u)),fetch(s,c).then(function(t){return e(o.stopLoading(p)),t.status>=200&&t.status<300?Promise.resolve(t):Promise.reject(new Error(t.statusText))}).then(function(e){return e.json()}).then(function(e){t(e)}).catch(function(e){a(e)})})},l=function(e,t,n){return new Promise(function(r,a){t().lastfm.authorization||a({params:n,error:"No active LastFM authorization (session)"});var l=i.generateGuid(),u=n.substring(n.indexOf("method=")+7,n.length);u=u.substring(0,u.indexOf("&")),e(o.startLoading(l,"lastfm_"+u)),n+="&sk="+t().lastfm.authorization.key;var c=t().lastfm.authorization_url+"?action=sign_request&"+n;fetch(c,{method:"GET",cache:!1,timeout:3e4}).then(function(n){e(o.stopLoading(l)),s(e,t,n.params,!0).then(function(e){return r(e)},function(e){return a(e)})}).catch(function(e){return a(e)})})}},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&(t=t[0]);var n="medium";if(e.size&&(n=e.size),t[n])return t[n]}return null}(),n="thumbnail thumbnail--loaded";e.size&&(n+=" thumbnail--"+e.size),e.circle&&(n+=" thumbnail--circle"),e.className&&(n+=" "+e.className);var r=null;return e.canZoom&&t&&(r=a.default.createElement(o.default,{className:"thumbnail__zoom",to:"/image-zoom?url="+t},a.default.createElement(i.default,{name:"search"}))),a.default.createElement("div",{className:n},a.default.createElement("div",{className:"thumbnail__image",style:{backgroundImage:'url("'+(t||"/iris/assets/no-image.svg")+'")'}}),e.glow&&t&&a.default.createElement("div",{className:"thumbnail__image thumbnail__image--glow",style:{backgroundImage:'url("'+t+'")'}}),r)})},function(e,t,n){"use strict";var r=n(25);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.split("/")||[],r=t&&t.split("/")||[],i=e&&a(e),s=t&&a(t),l=i||s;if(e&&a(e)?r=n:n.length&&(r.pop(),r=r.concat(n)),!r.length)return"/";var u=void 0;if(r.length){var c=r[r.length-1];u="."===c||".."===c||""===c}else u=!1;for(var p=0,d=r.length;d>=0;d--){var f=r[d];"."===f?o(r,d):".."===f?(o(r,d),p++):p&&(o(r,d),p--)}if(!l)for(;p--;p)r.unshift("..");!l||""===r[0]||r[0]&&a(r[0])||r.unshift("");var h=r.join("/");return u&&"/"!==h.substr(-1)&&(h+="/"),h},s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var l=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])});var r=void 0===t?"undefined":s(t);if(r!==(void 0===n?"undefined":s(n)))return!1;if("object"===r){var a=t.valueOf(),o=n.valueOf();if(a!==t||o!==n)return e(a,o);var i=Object.keys(t),l=Object.keys(n);return i.length===l.length&&i.every(function(r){return e(t[r],n[r])})}return!1},u=!0,c="Invariant failed";var p=function(e,t){if(!e)throw u?new Error(c):new Error(c+": "+(t||""))};function d(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function h(e,t){return function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)}(e,t)?e.substr(t.length):e}function m(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function y(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function _(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(r.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function v(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&l(e.state,t.state)}function b(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter(function(e){return e!==r})}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r=0?t:0)+"#"+e)}function x(e){void 0===e&&(e={}),g||p(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),a=n.getUserConfirmation,o=void 0===a?E:a,i=n.hashType,s=void 0===i?"slash":i,l=e.basename?m(d(e.basename)):"",u=A[s],c=u.encodePath,f=u.decodePath;function k(){var e=f(C());return l&&(e=h(e,l)),_(e)}var w=b();function S(e){Object(r.a)(F,e),F.length=t.length,w.notifyListeners(F.location,F.action)}var O=!1,x=null;function R(){var e=C(),t=c(e);if(e!==t)P(t);else{var n=k(),r=F.location;if(!O&&v(r,n))return;if(x===y(n))return;x=null,function(e){if(O)O=!1,S();else{w.confirmTransitionTo(e,"POP",o,function(t){t?S({action:"POP",location:e}):function(e){var t=F.location,n=D.lastIndexOf(y(t));-1===n&&(n=0);var r=D.lastIndexOf(y(e));-1===r&&(r=0);var a=n-r;a&&(O=!0,I(a))}(e)})}}(n)}}var N=C(),M=c(N);N!==M&&P(M);var L=k(),D=[y(L)];function I(e){t.go(e)}var j=0;function U(e){1===(j+=e)&&1===e?window.addEventListener(T,R):0===j&&window.removeEventListener(T,R)}var Y=!1;var F={length:t.length,action:"POP",location:L,createHref:function(e){return"#"+c(l+y(e))},push:function(e,t){var n=_(e,void 0,void 0,F.location);w.confirmTransitionTo(n,"PUSH",o,function(e){if(e){var t=y(n),r=c(l+t);if(C()!==r){x=t,function(e){window.location.hash=e}(r);var a=D.lastIndexOf(y(F.location)),o=D.slice(0,-1===a?0:a+1);o.push(t),D=o,S({action:"PUSH",location:n})}else S()}})},replace:function(e,t){var n=_(e,void 0,void 0,F.location);w.confirmTransitionTo(n,"REPLACE",o,function(e){if(e){var t=y(n),r=c(l+t);C()!==r&&(x=t,P(r));var a=D.indexOf(y(F.location));-1!==a&&(D[a]=t),S({action:"REPLACE",location:n})}})},go:I,goBack:function(){I(-1)},goForward:function(){I(1)},block:function(e){void 0===e&&(e=!1);var t=w.setPrompt(e);return Y||(U(1),Y=!0),function(){return Y&&(Y=!1,U(-1)),t()}},listen:function(e){var t=w.appendListener(e);return U(1),function(){U(-1),t()}}};return F}function R(e,t,n){return Math.min(Math.max(e,t),n)}function N(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,a=t.initialEntries,o=void 0===a?["/"]:a,i=t.initialIndex,s=void 0===i?0:i,l=t.keyLength,u=void 0===l?6:l,c=b();function p(e){Object(r.a)(g,e),g.length=g.entries.length,c.notifyListeners(g.location,g.action)}function d(){return Math.random().toString(36).substr(2,u)}var f=R(s,0,o.length-1),h=o.map(function(e){return _(e,void 0,"string"==typeof e?d():e.key||d())}),m=y;function v(e){var t=R(g.index+e,0,g.entries.length-1),r=g.entries[t];c.confirmTransitionTo(r,"POP",n,function(e){e?p({action:"POP",location:r,index:t}):p()})}var g={length:h.length,action:"POP",location:h[f],index:f,entries:h,createHref:m,push:function(e,t){var r=_(e,t,d(),g.location);c.confirmTransitionTo(r,"PUSH",n,function(e){if(e){var t=g.index+1,n=g.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),p({action:"PUSH",location:r,index:t,entries:n})}})},replace:function(e,t){var r=_(e,t,d(),g.location);c.confirmTransitionTo(r,"REPLACE",n,function(e){e&&(g.entries[g.index]=r,p({action:"REPLACE",location:r}))})},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=g.index+e;return t>=0&&t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function p(e,t){for(var n=0;n0&&t+e.length!==n.length&&e.search(g)>-1&&":"!==n.charAt(t-2)&&("-"!==n.charAt(t+e.length)||"-"===n.charAt(t-1))&&n.charAt(t-1).search(/[^\s-]/)<0?e.toLowerCase():e.substr(1).search(/[A-Z]|\../)>-1?e:e.charAt(0).toUpperCase()+e.substr(1)})}(e):e}var w=function(e){var t,n,r,a,o,i,s,l="https://www.google-analytics.com/analytics.js";e&&e.gaAddress?l=e.gaAddress:e&&e.debug&&(l="https://www.google-analytics.com/analytics_debug.js"),t=window,n=document,r="script",a=l,o="ga",t.GoogleAnalyticsObject=o,t.ga=t.ga||function(){(t.ga.q=t.ga.q||[]).push(arguments)},t.ga.l=1*new Date,i=n.createElement(r),s=n.getElementsByTagName(r)[0],i.async=1,i.src=a,s.parentNode.insertBefore(i,s)};var S=[],O={calls:S,ga:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(e){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1?t-1:0),r=1;r0&&(D.apply(void 0,t),R&&"with arguments: ".concat(JSON.stringify(t))),window.ga}function H(e,t){e?"object"===C(e)?(0===Object.keys(e).length&&l("empty `fieldsObject` given to .set()"),j(t,"set",e),R&&"with fieldsObject: ".concat(JSON.stringify(e))):l("Expected `fieldsObject` arg to be an Object"):l("`fieldsObject` is required in .set()")}function z(e,t){j(t,"send",e),R&&("with fieldObject: ".concat(JSON.stringify(e)),"with trackers: ".concat(JSON.stringify(t)))}function B(e,t,n){if(e){var r=b(e);if(""!==r){var a={};if(n&&(a.title=n),j(t,"send",function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.category,n=e.variable,r=e.value,a=e.label,o=arguments.length>1?arguments[1]:void 0;if(t&&n&&r&&"number"==typeof r){var i={hitType:"timing",timingCategory:I(t),timingVar:I(n),timingValue:r};a&&(i.timingLabel=I(a)),z(i,o)}else l("args.category, args.variable AND args.value are required in timing() AND args.value has to be a number")}function W(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.category,n=e.action,r=e.label,a=e.value,o=e.nonInteraction,i=e.transport,s=T(e,["category","action","label","value","nonInteraction","transport"]),u=arguments.length>1?arguments[1]:void 0;if(t&&n){var c={hitType:"event",eventCategory:I(t),eventAction:I(n)};r&&(c.eventLabel=I(r)),void 0!==a&&("number"!=typeof a?l("Expected `args.value` arg to be a Number."):c.eventValue=a),void 0!==o&&("boolean"!=typeof o?l("`args.nonInteraction` must be a boolean."):c.nonInteraction=o),void 0!==i&&("string"!=typeof i?l("`args.transport` must be a string."):(-1===["beacon","xhr","image"].indexOf(i)&&l("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"),c.transport=i)),Object.keys(s).filter(function(e){return"dimension"===e.substr(0,"dimension".length)}).forEach(function(e){c[e]=s[e]}),Object.keys(s).filter(function(e){return"metric"===e.substr(0,"metric".length)}).forEach(function(e){c[e]=s[e]}),z(c,u)}else l("args.category AND args.action are required in event()")}function V(e,t){var n=e.description,r=e.fatal,a={hitType:"exception"};n&&(a.exDescription=I(n)),void 0!==r&&("boolean"!=typeof r?l("`args.fatal` must be a boolean."):a.exFatal=r),z(a,t)}var K={require:function(e,t){if(e){var n=b(e);if(""!==n)if(t){if("object"!==C(t))return void l("Expected `options` arg to be an Object");0===Object.keys(t).length&&l("Empty `options` given to .require()"),F("require",n,t),R&&"called ga('require', '".concat(n,"', ").concat(JSON.stringify(t))}else F("require",n),R&&"called ga('require', '".concat(n,"');");else l("`name` cannot be an empty string in .require()")}else l("`name` is required in .require()")},execute:function(e,t){var n,r;if(1==(arguments.length<=2?0:arguments.length-2)?n=arguments.length<=2?void 0:arguments[2]:(r=arguments.length<=2?void 0:arguments[2],n=arguments.length<=3?void 0:arguments[3]),"string"!=typeof e)l("Expected `pluginName` arg to be a String.");else if("string"!=typeof t)l("Expected `action` arg to be a String.");else{var a="".concat(e,":").concat(t);n=n||null,r&&n?(F(a,r,n),R&&("called ga('".concat(a,"');"),'actionType: "'.concat(r,'" with payload: ').concat(JSON.stringify(n)))):n?(F(a,n),R&&("called ga('".concat(a,"');"),"with payload: ".concat(JSON.stringify(n)))):(F(a),R&&"called ga('".concat(a,"');"))}}};function X(e,t,n){if("function"==typeof t)if(e&&e.label){var r={hitType:"event",eventCategory:"Outbound",eventAction:"Click",eventLabel:I(e.label)},a=!1,o=setTimeout(function(){a=!0,t()},250);r.hitCallback=function(){clearTimeout(o),a||t()},z(r,n)}else l("args.label is required in outboundLink()");else l("hitCallback function is required")}var $=O,Q={initialize:Y,ga:F,set:H,send:z,pageview:B,modalview:q,timing:G,event:W,exception:V,plugin:K,outboundLink:X,testModeAPI:O};function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"initialize",function(){return Z}),n.d(t,"ga",function(){return ee}),n.d(t,"set",function(){return te}),n.d(t,"send",function(){return ne}),n.d(t,"pageview",function(){return re}),n.d(t,"modalview",function(){return ae}),n.d(t,"timing",function(){return oe}),n.d(t,"event",function(){return ie}),n.d(t,"exception",function(){return se}),n.d(t,"plugin",function(){return le}),n.d(t,"outboundLink",function(){return ue}),n.d(t,"testModeAPI",function(){return ce}),n.d(t,"OutboundLink",function(){return pe});var Z=Y,ee=F,te=H,ne=z,re=B,ae=q,oe=G,ie=W,se=V,le=K,ue=X,ce=$;v.origTrackLink=v.trackLink,v.trackLink=X;var pe=v;t.default=function(e){for(var t=1;t+~]|"+j+")"+j+"*"),G=new RegExp(j+"|>"),W=new RegExp(F),V=new RegExp("^"+U+"$"),K={ID:new RegExp("^#("+U+")"),CLASS:new RegExp("^\\.("+U+")"),TAG:new RegExp("^("+U+"|[*])"),ATTR:new RegExp("^"+Y),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},X=/HTML$/i,$=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+j+"?|("+j+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ae=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d()},ie=ge(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{M.apply(x=L.call(E.childNodes),E.childNodes),x[E.childNodes.length].nodeType}catch(e){M={apply:x.length?function(e,t){N.apply(e,L.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,a){var o,s,u,c,p,h,_,v=t&&t.ownerDocument,k=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==k&&9!==k&&11!==k)return r;if(!a&&((t?t.ownerDocument||t:E)!==f&&d(t),t=t||f,m)){if(11!==k&&(p=Z.exec(e)))if(o=p[1]){if(9===k){if(!(u=t.getElementById(o)))return r;if(u.id===o)return r.push(u),r}else if(v&&(u=v.getElementById(o))&&b(t,u)&&u.id===o)return r.push(u),r}else{if(p[2])return M.apply(r,t.getElementsByTagName(e)),r;if((o=p[3])&&n.getElementsByClassName&&t.getElementsByClassName)return M.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!A[e+" "]&&(!y||!y.test(e))&&(1!==k||"object"!==t.nodeName.toLowerCase())){if(_=e,v=t,1===k&&G.test(e)){for((c=t.getAttribute("id"))?c=c.replace(re,ae):t.setAttribute("id",c=g),s=(h=i(e)).length;s--;)h[s]="#"+c+" "+be(h[s]);_=h.join(","),v=ee.test(e)&&_e(t.parentNode)||t}try{return M.apply(r,v.querySelectorAll(_)),r}catch(t){A(e,!0)}finally{c===g&&t.removeAttribute("id")}}}return l(e.replace(z,"$1"),t,r,a)}function le(){var e=[];return function t(n,a){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=a}}function ue(e){return e[g]=!0,e}function ce(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function pe(e,t){for(var n=e.split("|"),a=n.length;a--;)r.attrHandle[n[a]]=t}function de(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ye(e){return ue(function(t){return t=+t,ue(function(n,r){for(var a,o=e([],n.length,t),i=o.length;i--;)n[a=o[i]]&&(n[a]=!(r[a]=n[a]))})})}function _e(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!X.test(t||n&&n.nodeName||"HTML")},d=se.setDocument=function(e){var t,a,i=e?e.ownerDocument||e:E;return i!==f&&9===i.nodeType&&i.documentElement?(h=(f=i).documentElement,m=!o(f),E!==f&&(a=f.defaultView)&&a.top!==a&&(a.addEventListener?a.addEventListener("unload",oe,!1):a.attachEvent&&a.attachEvent("onunload",oe)),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(f.getElementsByClassName),n.getById=ce(function(e){return h.appendChild(e).id=g,!f.getElementsByName||!f.getElementsByName(g).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,a,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(a=t.getElementsByName(e),r=0;o=a[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],a=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[a++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},_=[],y=[],(n.qsa=J.test(f.querySelectorAll))&&(ce(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+j+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+j+"*(?:value|"+I+")"),e.querySelectorAll("[id~="+g+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+g+"+*").length||y.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+j+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=J.test(v=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=v.call(e,"*"),v.call(e,"[s!='']:x"),_.push("!=",F)}),y=y.length&&new RegExp(y.join("|")),_=_.length&&new RegExp(_.join("|")),t=J.test(h.compareDocumentPosition),b=t||J.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},C=t?function(e,t){if(e===t)return p=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===f||e.ownerDocument===E&&b(E,e)?-1:t===f||t.ownerDocument===E&&b(E,t)?1:c?D(c,e)-D(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return p=!0,0;var n,r=0,a=e.parentNode,o=t.parentNode,i=[e],s=[t];if(!a||!o)return e===f?-1:t===f?1:a?-1:o?1:c?D(c,e)-D(c,t):0;if(a===o)return de(e,t);for(n=e;n=n.parentNode;)i.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;i[r]===s[r];)r++;return r?de(i[r],s[r]):i[r]===E?-1:s[r]===E?1:0},f):f},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&d(e),n.matchesSelector&&m&&!A[t+" "]&&(!_||!_.test(t))&&(!y||!y.test(t)))try{var r=v.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){A(t,!0)}return se(t,f,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!==f&&d(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!==f&&d(e);var a=r.attrHandle[t.toLowerCase()],o=a&&P.call(r.attrHandle,t.toLowerCase())?a(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(re,ae)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],a=0,o=0;if(p=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(C),p){for(;t=e[o++];)t===e[o]&&(a=r.push(o));for(;a--;)e.splice(r[a],1)}return c=null,e},a=se.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=a(t);return n},(r=se.selectors={cacheLength:50,createPseudo:ue,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&W.test(n)&&(t=i(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=S[e+" "];return t||(t=new RegExp("(^|"+j+")"+e+"("+j+"|$)"))&&S(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var a=se.attr(r,e);return null==a?"!="===t:!t||(a+="","="===t?a===n:"!="===t?a!==n:"^="===t?n&&0===a.indexOf(n):"*="===t?n&&a.indexOf(n)>-1:"$="===t?n&&a.slice(-n.length)===n:"~="===t?(" "+a.replace(H," ")+" ").indexOf(n)>-1:"|="===t&&(a===n||a.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,a){var o="nth"!==e.slice(0,3),i="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===a?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,d,f,h,m=o!==i?"nextSibling":"previousSibling",y=t.parentNode,_=s&&t.nodeName.toLowerCase(),v=!l&&!s,b=!1;if(y){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===_:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[i?y.firstChild:y.lastChild],i&&v){for(b=(f=(u=(c=(p=(d=y)[g]||(d[g]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]||[])[0]===k&&u[1])&&u[2],d=f&&y.childNodes[f];d=++f&&d&&d[m]||(b=f=0)||h.pop();)if(1===d.nodeType&&++b&&d===t){c[e]=[k,f,b];break}}else if(v&&(b=f=(u=(c=(p=(d=t)[g]||(d[g]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]||[])[0]===k&&u[1]),!1===b)for(;(d=++f&&d&&d[m]||(b=f=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==_:1!==d.nodeType)||!++b||(v&&((c=(p=d[g]||(d[g]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]=[k,b]),d!==t)););return(b-=a)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,a=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[g]?a(t):a.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ue(function(e,n){for(var r,o=a(e,t),i=o.length;i--;)e[r=D(e,o[i])]=!(n[r]=o[i])}):function(e){return a(e,0,n)}):a}},pseudos:{not:ue(function(e){var t=[],n=[],r=s(e.replace(z,"$1"));return r[g]?ue(function(e,t,n,a){for(var o,i=r(e,null,a,[]),s=e.length;s--;)(o=i[s])&&(e[s]=!(t[s]=o))}):function(e,a,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:ue(function(e){return function(t){return se(e,t).length>0}}),contains:ue(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||a(t)).indexOf(e)>-1}}),lang:ue(function(e){return V.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return $.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ye(function(){return[0]}),last:ye(function(e,t){return[t-1]}),eq:ye(function(e,t,n){return[n<0?n+t:n]}),even:ye(function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e}),gt:ye(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var a=e.length;a--;)if(!e[a](t,n,r))return!1;return!0}:e[0]}function ke(e,t,n,r,a){for(var o,i=[],s=0,l=e.length,u=null!=t;s-1&&(o[u]=!(i[u]=p))}}else _=ke(_===i?_.splice(h,_.length):_),a?a(null,i,_,l):M.apply(i,_)})}function Se(e){for(var t,n,a,o=e.length,i=r.relative[e[0].type],s=i||r.relative[" "],l=i?1:0,c=ge(function(e){return e===t},s,!0),p=ge(function(e){return D(t,e)>-1},s,!0),d=[function(e,n,r){var a=!i&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r));return t=null,a}];l1&&Ee(d),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,l0,a=e.length>0,o=function(o,i,s,l,c){var p,h,y,_=0,v="0",b=o&&[],g=[],E=u,w=o||a&&r.find.TAG("*",c),S=k+=null==E?1:Math.random()||.1,O=w.length;for(c&&(u=i===f||i||c);v!==O&&null!=(p=w[v]);v++){if(a&&p){for(h=0,i||p.ownerDocument===f||(d(p),s=!m);y=e[h++];)if(y(p,i||f,s)){l.push(p);break}c&&(k=S)}n&&((p=!y&&p)&&_--,o&&b.push(p))}if(_+=v,n&&v!==_){for(h=0;y=t[h++];)y(b,g,i,s);if(o){if(_>0)for(;v--;)b[v]||g[v]||(g[v]=R.call(l));g=ke(g)}M.apply(l,g),c&&!o&&g.length>0&&_+t.length>1&&se.uniqueSort(l)}return c&&(k=S,u=E),b};return n?ue(o):o}(o,a))).selector=e}return s},l=se.select=function(e,t,n,a){var o,l,u,c,p,d="function"==typeof e&&e,f=!a&&i(e=d.selector||e);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===t.nodeType&&m&&r.relative[l[1].type]){if(!(t=(r.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=K.needsContext.test(e)?0:l.length;o--&&(u=l[o],!r.relative[c=u.type]);)if((p=r.find[c])&&(a=p(u.matches[0].replace(te,ne),ee.test(l[0].type)&&_e(t.parentNode)||t))){if(l.splice(o,1),!(e=a.length&&be(l)))return M.apply(n,a),n;break}}return(d||s(e,f))(a,t,!m,n,!t||ee.test(e)&&_e(t.parentNode)||t),n},n.sortStable=g.split("").sort(C).join("")===g,n.detectDuplicates=!!p,d(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))}),ce(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||pe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||pe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||pe(I,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(n);w.find=T,w.expr=T.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=T.uniqueSort,w.text=T.getText,w.isXMLDoc=T.isXML,w.contains=T.contains,w.escapeSelector=T.escape;var A=function(e,t,n){for(var r=[],a=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(a&&w(e).is(n))break;r.push(e)}return r},C=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},P=w.expr.match.needsContext;function x(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var R=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function N(e,t,n){return v(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return p.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,a=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(N(this,e||[],!1))},not:function(e){return this.pushStack(N(this,e||[],!0))},is:function(e){return!!N(this,"string"==typeof e&&P.test(e)?w(e):e||[],!1).length}});var M,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var r,a;if(!e)return this;if(n=n||M,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:i,!0)),R.test(r[1])&&w.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(a=i.getElementById(r[2]))&&(this[0]=a,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,M=w(i);var D=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};function j(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?p.call(w(e),this[0]):p.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return A(e,"parentNode")},parentsUntil:function(e,t,n){return A(e,"parentNode",n)},next:function(e){return j(e,"nextSibling")},prev:function(e){return j(e,"previousSibling")},nextAll:function(e){return A(e,"nextSibling")},prevAll:function(e){return A(e,"previousSibling")},nextUntil:function(e,t,n){return A(e,"nextSibling",n)},prevUntil:function(e,t,n){return A(e,"previousSibling",n)},siblings:function(e){return C((e.parentNode||{}).firstChild,e)},children:function(e){return C(e.firstChild)},contents:function(e){return void 0!==e.contentDocument?e.contentDocument:(x(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var a=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(a=w.filter(r,a)),this.length>1&&(I[e]||w.uniqueSort(a),D.test(e)&&a.reverse()),this.pushStack(a)}});var U=/[^\x20\t\r\n\f]+/g;function Y(e){return e}function F(e){throw e}function H(e,t,n,r){var a;try{e&&v(a=e.promise)?a.call(e).done(t).fail(n):e&&v(a=e.then)?a.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return w.each(e.match(U)||[],function(e,n){t[n]=!0}),t}(e):w.extend({},e);var t,n,r,a,o=[],i=[],s=-1,l=function(){for(a=a||e.once,r=t=!0;i.length;s=-1)for(n=i.shift();++s-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return a=i=[],o=n="",this},disabled:function(){return!o},lock:function(){return a=i=[],n||t||(o=n=""),this},locked:function(){return!!a},fireWith:function(e,n){return a||(n=[e,(n=n||[]).slice?n.slice():n],i.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},w.extend({Deferred:function(e){var t=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",a={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return a.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(n){w.each(t,function(t,r){var a=v(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=a&&a.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,a?[e]:arguments)})}),e=null}).promise()},then:function(e,r,a){var o=0;function i(e,t,r,a){return function(){var s=this,l=arguments,u=function(){var n,u;if(!(e=o&&(r!==F&&(s=void 0,l=[n]),t.rejectWith(s,l))}};e?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),n.setTimeout(c))}}return w.Deferred(function(n){t[0][3].add(i(0,n,v(a)?a:Y,n.notifyWith)),t[1][3].add(i(0,n,v(e)?e:Y)),t[2][3].add(i(0,n,v(r)?r:F))}).promise()},promise:function(e){return null!=e?w.extend(e,a):a}},o={};return w.each(t,function(e,n){var i=n[2],s=n[5];a[n[1]]=i.add,s&&i.add(function(){r=s},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),i.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=i.fireWith}),a.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),a=l.call(arguments),o=w.Deferred(),i=function(e){return function(n){r[e]=this,a[e]=arguments.length>1?l.call(arguments):n,--t||o.resolveWith(r,a)}};if(t<=1&&(H(e,o.done(i(n)).resolve,o.reject,!t),"pending"===o.state()||v(a[n]&&a[n].then)))return o.then();for(;n--;)H(a[n],i(n),o.reject);return o.promise()}});var z=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&z.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},w.readyException=function(e){n.setTimeout(function(){throw e})};var B=w.Deferred();function q(){i.removeEventListener("DOMContentLoaded",q),n.removeEventListener("load",q),w.ready()}w.fn.ready=function(e){return B.then(e).catch(function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||B.resolveWith(i,[w]))}}),w.ready.then=B.then,"complete"===i.readyState||"loading"!==i.readyState&&!i.documentElement.doScroll?n.setTimeout(w.ready):(i.addEventListener("DOMContentLoaded",q),n.addEventListener("load",q));var G=function(e,t,n,r,a,o,i){var s=0,l=e.length,u=null==n;if("object"===k(n))for(s in a=!0,n)G(e,t,s,n[s],!0,o,i);else if(void 0!==r&&(a=!0,v(r)||(i=!0),u&&(i?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(w(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){Z.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,a=n.shift(),o=w._queueHooks(e,t);"inprogress"===a&&(a=n.shift(),r--),a&&("fx"===t&&n.unshift("inprogress"),delete o.stop,a.call(e,function(){w.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,_e=/^$|^module$|\/(?:java|ecma)script/i,ve={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function be(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&x(e,t)?w.merge([e],n):n}function ge(e,t){for(var n=0,r=e.length;n-1)a&&a.push(o);else if(u=se(o),i=be(p.appendChild(o),"script"),u&&ge(i),n)for(c=0;o=i[c++];)_e.test(o.type||"")&&n.push(o);return p}Ee=i.createDocumentFragment().appendChild(i.createElement("div")),(ke=i.createElement("input")).setAttribute("type","radio"),ke.setAttribute("checked","checked"),ke.setAttribute("name","t"),Ee.appendChild(ke),_.checkClone=Ee.cloneNode(!0).cloneNode(!0).lastChild.checked,Ee.innerHTML="",_.noCloneChecked=!!Ee.cloneNode(!0).lastChild.defaultValue;var Oe=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ae=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Pe(){return!1}function xe(e,t){return e===function(){try{return i.activeElement}catch(e){}}()==("focus"===t)}function Re(e,t,n,r,a,o){var i,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Re(e,s,n,r,t[s],o);return e}if(null==r&&null==a?(a=n,r=n=void 0):null==a&&("string"==typeof n?(a=r,r=void 0):(a=r,r=n,n=void 0)),!1===a)a=Pe;else if(!a)return e;return 1===o&&(i=a,(a=function(e){return w().off(e),i.apply(this,arguments)}).guid=i.guid||(i.guid=w.guid++)),e.each(function(){w.event.add(this,t,a,r,n)})}function Ne(e,t,n){n?(J.set(e,t,!1),w.event.add(e,t,{namespace:!1,handler:function(e){var r,a,o=J.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(w.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=l.call(arguments),J.set(this,t,o),r=n(this,t),this[t](),o!==(a=J.get(this,t))||r?J.set(this,t,!1):a={},o!==a)return e.stopImmediatePropagation(),e.preventDefault(),a.value}else o.length&&(J.set(this,t,{value:w.event.trigger(w.extend(o[0],w.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===J.get(e,t)&&w.event.add(e,t,Ce)}w.event={global:{},add:function(e,t,n,r,a){var o,i,s,l,u,c,p,d,f,h,m,y=J.get(e);if(y)for(n.handler&&(n=(o=n).handler,a=o.selector),a&&w.find.matchesSelector(ie,a),n.guid||(n.guid=w.guid++),(l=y.events)||(l=y.events={}),(i=y.handle)||(i=y.handle=function(t){return void 0!==w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(U)||[""]).length;u--;)f=m=(s=Ae.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),f&&(p=w.event.special[f]||{},f=(a?p.delegateType:p.bindType)||f,p=w.event.special[f]||{},c=w.extend({type:f,origType:m,data:r,handler:n,guid:n.guid,selector:a,needsContext:a&&w.expr.match.needsContext.test(a),namespace:h.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,p.setup&&!1!==p.setup.call(e,r,h,i)||e.addEventListener&&e.addEventListener(f,i)),p.add&&(p.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),a?d.splice(d.delegateCount++,0,c):d.push(c),w.event.global[f]=!0)},remove:function(e,t,n,r,a){var o,i,s,l,u,c,p,d,f,h,m,y=J.hasData(e)&&J.get(e);if(y&&(l=y.events)){for(u=(t=(t||"").match(U)||[""]).length;u--;)if(f=m=(s=Ae.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),f){for(p=w.event.special[f]||{},d=l[f=(r?p.delegateType:p.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=o=d.length;o--;)c=d[o],!a&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,p.remove&&p.remove.call(e,c));i&&!d.length&&(p.teardown&&!1!==p.teardown.call(e,h,y.handle)||w.removeEvent(e,f,y.handle),delete l[f])}else for(f in l)w.event.remove(e,f+t[u],n,r,!0);w.isEmptyObject(l)&&J.remove(e,"handle events")}},dispatch:function(e){var t,n,r,a,o,i,s=w.event.fix(e),l=new Array(arguments.length),u=(J.get(this,"events")||{})[s.type]||[],c=w.event.special[s.type]||{};for(l[0]=s,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],i={},n=0;n-1:w.find(a,this,null,[u]).length),i[a]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,Le=/\s*$/g;function je(e,t){return x(e,"table")&&x(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function Ue(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ye(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,a,o,i,s,l,u;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),i=J.set(t,o),u=o.events))for(a in delete i.handle,i.events={},u)for(n=0,r=u[a].length;n1&&"string"==typeof h&&!_.checkClone&&De.test(h))return e.each(function(a){var o=e.eq(a);m&&(t[0]=h.call(this,a,o.html())),ze(o,t,n,r)});if(d&&(o=(a=Se(t,e[0].ownerDocument,!1,e,r)).firstChild,1===a.childNodes.length&&(a=o),o||r)){for(s=(i=w.map(be(a,"script"),Ue)).length;p")},clone:function(e,t,n){var r,a,o,i,s=e.cloneNode(!0),l=se(e);if(!(_.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(i=be(s),r=0,a=(o=be(e)).length;r0&&ge(i,!l&&be(e,"script")),s},cleanData:function(e){for(var t,n,r,a=w.event.special,o=0;void 0!==(n=e[o]);o++)if($(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)a[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Be(this,e,!0)},remove:function(e){return Be(this,e)},text:function(e){return G(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return ze(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return ze(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return ze(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return ze(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(be(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return G(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Le.test(e)&&!ve[(ye.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l}function ot(e,t,n){var r=Ge(e),a=(!_.boxSizingReliable()||n)&&"border-box"===w.css(e,"boxSizing",!1,r),o=a,i=Ve(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(qe.test(i)){if(!n)return i;i="auto"}return(!_.boxSizingReliable()&&a||"auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&e.getClientRects().length&&(a="border-box"===w.css(e,"boxSizing",!1,r),(o=s in e)&&(i=e[s])),(i=parseFloat(i)||0)+at(e,t,n||(a?"border":"content"),o,r,i)+"px"}function it(e,t,n,r,a){return new it.prototype.init(e,t,n,r,a)}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ve(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var a,o,i,s=X(t),l=et.test(t),u=e.style;if(l||(t=Je(s)),i=w.cssHooks[t]||w.cssHooks[s],void 0===n)return i&&"get"in i&&void 0!==(a=i.get(e,!1,r))?a:u[t];"string"===(o=typeof n)&&(a=ae.exec(n))&&a[1]&&(n=pe(e,t,a),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=a&&a[3]||(w.cssNumber[s]?"":"px")),_.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),i&&"set"in i&&void 0===(n=i.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var a,o,i,s=X(t);return et.test(t)||(t=Je(s)),(i=w.cssHooks[t]||w.cssHooks[s])&&"get"in i&&(a=i.get(e,!0,n)),void 0===a&&(a=Ve(e,t,r)),"normal"===a&&t in nt&&(a=nt[t]),""===n||n?(o=parseFloat(a),!0===n||isFinite(o)?o||0:a):a}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!Ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,t,r):ce(e,tt,function(){return ot(e,t,r)})},set:function(e,n,r){var a,o=Ge(e),i=!_.scrollboxSize()&&"absolute"===o.position,s=(i||r)&&"border-box"===w.css(e,"boxSizing",!1,o),l=r?at(e,t,r,s,o):0;return s&&i&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-at(e,t,"border",!1,o)-.5)),l&&(a=ae.exec(n))&&"px"!==(a[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),rt(0,n,l)}}}),w.cssHooks.marginLeft=Ke(_.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ve(e,"marginLeft"))||e.getBoundingClientRect().left-ce(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,a={},o="string"==typeof n?n.split(" "):[n];r<4;r++)a[e+oe[r]+t]=o[r]||o[r-2]||o[0];return a}},"margin"!==e&&(w.cssHooks[e+t].set=rt)}),w.fn.extend({css:function(e,t){return G(this,function(e,t,n){var r,a,o={},i=0;if(Array.isArray(t)){for(r=Ge(e),a=t.length;i1)}}),w.Tween=it,it.prototype={constructor:it,init:function(e,t,n,r,a,o){this.elem=e,this.prop=n,this.easing=a||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=it.propHooks[this.prop];return e&&e.get?e.get(this):it.propHooks._default.get(this)},run:function(e){var t,n=it.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):it.propHooks._default.set(this),this}},it.prototype.init.prototype=it.prototype,it.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||!w.cssHooks[e.prop]&&null==e.elem.style[Je(e.prop)]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},it.propHooks.scrollTop=it.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=it.prototype.init,w.fx.step={};var st,lt,ut=/^(?:toggle|show|hide)$/,ct=/queueHooks$/;function pt(){lt&&(!1===i.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(pt):n.setTimeout(pt,w.fx.interval),w.fx.tick())}function dt(){return n.setTimeout(function(){st=void 0}),st=Date.now()}function ft(e,t){var n,r=0,a={height:e};for(t=t?1:0;r<4;r+=2-t)a["margin"+(n=oe[r])]=a["padding"+n]=e;return t&&(a.opacity=a.width=e),a}function ht(e,t,n){for(var r,a=(mt.tweeners[t]||[]).concat(mt.tweeners["*"]),o=0,i=a.length;o1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,a,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(a=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?yt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):a&&"set"in a&&void 0!==(r=a.set(e,n,t))?r:(e.setAttribute(t,n+""),n):a&&"get"in a&&null!==(r=a.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!_.radioValue&&"radio"===t&&x(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,a=t&&t.match(U);if(a&&1===e.nodeType)for(;n=a[r++];)e.removeAttribute(n)}}),yt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=_t[t]||w.find.attr;_t[t]=function(e,t,r){var a,o,i=t.toLowerCase();return r||(o=_t[i],_t[i]=a,a=null!=n(e,t,r)?i:null,_t[i]=o),a}});var vt=/^(?:input|select|textarea|button)$/i,bt=/^(?:a|area)$/i;function gt(e){return(e.match(U)||[]).join(" ")}function Et(e){return e.getAttribute&&e.getAttribute("class")||""}function kt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(U)||[]}w.fn.extend({prop:function(e,t){return G(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,a,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,a=w.propHooks[t]),void 0!==n?a&&"set"in a&&void 0!==(r=a.set(e,n,t))?r:e[t]=n:a&&"get"in a&&null!==(r=a.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||bt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),_.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this}),w.fn.extend({addClass:function(e){var t,n,r,a,o,i,s,l=0;if(v(e))return this.each(function(t){w(this).addClass(e.call(this,t,Et(this)))});if((t=kt(e)).length)for(;n=this[l++];)if(a=Et(n),r=1===n.nodeType&&" "+gt(a)+" "){for(i=0;o=t[i++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");a!==(s=gt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,a,o,i,s,l=0;if(v(e))return this.each(function(t){w(this).removeClass(e.call(this,t,Et(this)))});if(!arguments.length)return this.attr("class","");if((t=kt(e)).length)for(;n=this[l++];)if(a=Et(n),r=1===n.nodeType&&" "+gt(a)+" "){for(i=0;o=t[i++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");a!==(s=gt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):v(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,Et(this),t),t)}):this.each(function(){var t,a,o,i;if(r)for(a=0,o=w(this),i=kt(e);t=i[a++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=Et(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+gt(Et(n))+" ").indexOf(t)>-1)return!0;return!1}});var wt=/\r/g;w.fn.extend({val:function(e){var t,n,r,a=this[0];return arguments.length?(r=v(e),this.each(function(n){var a;1===this.nodeType&&(null==(a=r?e.call(this,n,w(this).val()):e)?a="":"number"==typeof a?a+="":Array.isArray(a)&&(a=w.map(a,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,a,"value")||(this.value=a))})):a?(t=w.valHooks[a.type]||w.valHooks[a.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(a,"value"))?n:"string"==typeof(n=a.value)?n.replace(wt,""):null==n?"":n:void 0}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:gt(w.text(e))}},select:{get:function(e){var t,n,r,a=e.options,o=e.selectedIndex,i="select-one"===e.type,s=i?null:[],l=i?o+1:a.length;for(r=o<0?l:i?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},_.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),_.focusin="onfocusin"in n;var St=/^(?:focusinfocus|focusoutblur)$/,Ot=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(e,t,r,a){var o,s,l,u,c,p,d,f,m=[r||i],y=h.call(e,"type")?e.type:e,_=h.call(e,"namespace")?e.namespace.split("."):[];if(s=f=l=r=r||i,3!==r.nodeType&&8!==r.nodeType&&!St.test(y+w.event.triggered)&&(y.indexOf(".")>-1&&(_=y.split("."),y=_.shift(),_.sort()),c=y.indexOf(":")<0&&"on"+y,(e=e[w.expando]?e:new w.Event(y,"object"==typeof e&&e)).isTrigger=a?2:3,e.namespace=_.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+_.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:w.makeArray(t,[e]),d=w.event.special[y]||{},a||!d.trigger||!1!==d.trigger.apply(r,t))){if(!a&&!d.noBubble&&!b(r)){for(u=d.delegateType||y,St.test(u+y)||(s=s.parentNode);s;s=s.parentNode)m.push(s),l=s;l===(r.ownerDocument||i)&&m.push(l.defaultView||l.parentWindow||n)}for(o=0;(s=m[o++])&&!e.isPropagationStopped();)f=s,e.type=o>1?u:d.bindType||y,(p=(J.get(s,"events")||{})[e.type]&&J.get(s,"handle"))&&p.apply(s,t),(p=c&&s[c])&&p.apply&&$(s)&&(e.result=p.apply(s,t),!1===e.result&&e.preventDefault());return e.type=y,a||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(m.pop(),t)||!$(r)||c&&v(r[y])&&!b(r)&&((l=r[c])&&(r[c]=null),w.event.triggered=y,e.isPropagationStopped()&&f.addEventListener(y,Ot),r[y](),e.isPropagationStopped()&&f.removeEventListener(y,Ot),w.event.triggered=void 0,l&&(r[c]=l)),e.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),_.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,a=J.access(r,t);a||r.addEventListener(e,n,!0),J.access(r,t,(a||0)+1)},teardown:function(){var r=this.ownerDocument||this,a=J.access(r,t)-1;a?J.access(r,t,a):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Tt=n.location,At=Date.now(),Ct=/\?/;w.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+e),t};var Pt=/\[\]$/,xt=/\r?\n/g,Rt=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Mt(e,t,n,r){var a;if(Array.isArray(t))w.each(t,function(t,a){n||Pt.test(e)?r(e,a):Mt(e+"["+("object"==typeof a&&null!=a?t:"")+"]",a,n,r)});else if(n||"object"!==k(t))r(e,t);else for(a in t)Mt(e+"["+a+"]",t[a],n,r)}w.param=function(e,t){var n,r=[],a=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){a(this.name,this.value)});else for(n in e)Mt(n,e[n],t,a);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&Nt.test(this.nodeName)&&!Rt.test(e)&&(this.checked||!me.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(xt,"\r\n")}}):{name:t.name,value:n.replace(xt,"\r\n")}}).get()}});var Lt=/%20/g,Dt=/#.*$/,It=/([?&])_=[^&]*/,jt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ut=/^(?:GET|HEAD)$/,Yt=/^\/\//,Ft={},Ht={},zt="*/".concat("*"),Bt=i.createElement("a");function qt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,a=0,o=t.toLowerCase().match(U)||[];if(v(n))for(;r=o[a++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Gt(e,t,n,r){var a={},o=e===Ht;function i(s){var l;return a[s]=!0,w.each(e[s]||[],function(e,s){var u=s(t,n,r);return"string"!=typeof u||o||a[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),i(u),!1)}),l}return i(t.dataTypes[0])||!a["*"]&&i("*")}function Wt(e,t){var n,r,a=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((a[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}Bt.href=Tt.href,w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Wt(Wt(e,w.ajaxSettings),t):Wt(w.ajaxSettings,e)},ajaxPrefilter:qt(Ft),ajaxTransport:qt(Ht),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,a,o,s,l,u,c,p,d,f,h=w.ajaxSetup({},t),m=h.context||h,y=h.context&&(m.nodeType||m.jquery)?w(m):w.event,_=w.Deferred(),v=w.Callbacks("once memory"),b=h.statusCode||{},g={},E={},k="canceled",S={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=jt.exec(o);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=E[e.toLowerCase()]=E[e.toLowerCase()]||e,g[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)S.always(e[S.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||k;return r&&r.abort(t),O(0,t),this}};if(_.promise(S),h.url=((e||h.url||Tt.href)+"").replace(Yt,Tt.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(U)||[""],null==h.crossDomain){u=i.createElement("a");try{u.href=h.url,u.href=u.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=u.protocol+"//"+u.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),Gt(Ft,h,t,S),c)return S;for(d in(p=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Ut.test(h.type),a=h.url.replace(Dt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Lt,"+")):(f=h.url.slice(a.length),h.data&&(h.processData||"string"==typeof h.data)&&(a+=(Ct.test(a)?"&":"?")+h.data,delete h.data),!1===h.cache&&(a=a.replace(It,"$1"),f=(Ct.test(a)?"&":"?")+"_="+At+++f),h.url=a+f),h.ifModified&&(w.lastModified[a]&&S.setRequestHeader("If-Modified-Since",w.lastModified[a]),w.etag[a]&&S.setRequestHeader("If-None-Match",w.etag[a])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&S.setRequestHeader("Content-Type",h.contentType),S.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+zt+"; q=0.01":""):h.accepts["*"]),h.headers)S.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(!1===h.beforeSend.call(m,S,h)||c))return S.abort();if(k="abort",v.add(h.complete),S.done(h.success),S.fail(h.error),r=Gt(Ht,h,t,S)){if(S.readyState=1,p&&y.trigger("ajaxSend",[S,h]),c)return S;h.async&&h.timeout>0&&(l=n.setTimeout(function(){S.abort("timeout")},h.timeout));try{c=!1,r.send(g,O)}catch(e){if(c)throw e;O(-1,e)}}else O(-1,"No Transport");function O(e,t,i,s){var u,d,f,g,E,k=t;c||(c=!0,l&&n.clearTimeout(l),r=void 0,o=s||"",S.readyState=e>0?4:0,u=e>=200&&e<300||304===e,i&&(g=function(e,t,n){for(var r,a,o,i,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(a in s)if(s[a]&&s[a].test(r)){l.unshift(a);break}if(l[0]in n)o=l[0];else{for(a in n){if(!l[0]||e.converters[a+" "+l[0]]){o=a;break}i||(i=a)}o=o||i}if(o)return o!==l[0]&&l.unshift(o),n[o]}(h,S,i)),g=function(e,t,n,r){var a,o,i,s,l,u={},c=e.dataTypes.slice();if(c[1])for(i in e.converters)u[i.toLowerCase()]=e.converters[i];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(i=u[l+" "+o]||u["* "+o]))for(a in u)if((s=a.split(" "))[1]===o&&(i=u[l+" "+s[0]]||u["* "+s[0]])){!0===i?i=u[a]:!0!==u[a]&&(o=s[0],c.unshift(s[1]));break}if(!0!==i)if(i&&e.throws)t=i(t);else try{t=i(t)}catch(e){return{state:"parsererror",error:i?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(h,g,S,u),u?(h.ifModified&&((E=S.getResponseHeader("Last-Modified"))&&(w.lastModified[a]=E),(E=S.getResponseHeader("etag"))&&(w.etag[a]=E)),204===e||"HEAD"===h.type?k="nocontent":304===e?k="notmodified":(k=g.state,d=g.data,u=!(f=g.error))):(f=k,!e&&k||(k="error",e<0&&(e=0))),S.status=e,S.statusText=(t||k)+"",u?_.resolveWith(m,[d,k,S]):_.rejectWith(m,[S,k,f]),S.statusCode(b),b=void 0,p&&y.trigger(u?"ajaxSuccess":"ajaxError",[S,h,u?d:f]),v.fireWith(m,[S,k]),p&&(y.trigger("ajaxComplete",[S,h]),--w.active||w.event.trigger("ajaxStop")))}return S},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,a){return v(n)&&(a=a||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:a,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e,t){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){w.globalEval(e,t)}})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return v(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Kt=w.ajaxSettings.xhr();_.cors=!!Kt&&"withCredentials"in Kt,_.ajax=Kt=!!Kt,w.ajaxTransport(function(e){var t,r;if(_.cors||Kt&&!e.crossDomain)return{send:function(a,o){var i,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];for(i in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||a["X-Requested-With"]||(a["X-Requested-With"]="XMLHttpRequest"),a)s.setRequestHeader(i,a[i]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout(function(){t&&r()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,a){t=w("