(function(){"use strict";function a(){const b=sa(["",""]);return a=function(){return b},b}function b(){const a=sa(["",""]);return b=function(){return a},a}function c(){const a=sa(["\n
\n
\n ","\n
\n
"]);return c=function(){return a},a}function d(){const a=sa(["\n
\n ","\n ","\n
"]);return d=function(){return a},a}function e(){const a=sa(["\n
\n "," ","\n
"]);return e=function(){return a},a}function f(){const a=sa(["\n
\n \n
"]);return f=function(){return a},a}function g(){const a=sa(["\n
\n
"]);return g=function(){return a},a}function h(){const a=sa(["
"]);return h=function(){return a},a}function i(){const a=sa(["\n \n \n "]);return i=function(){return a},a}function j(){const a=sa(["\n \n \n "]);return j=function(){return a},a}function k(){const a=sa(["\n \n
\n ","\n
\n
\n
\n ","\n
\n ","\n ","\n
\n \n \n
\n
\n ","\n \n \n ","\n \n \n
\n
\n
\n \n \n
\n \n "]);return k=function(){return a},a}function l(){const a=sa(["\n :host {\n display: flex;\n line-height: 40px;\n max-height: 40px;\n }\n :host([flow]) mmp-media-controls {\n max-width: unset;\n }\n mmp-media-controls {\n max-width: 200px;\n }\n .group-button {\n height: 34px;\n width: 34px;\n min-width: 34px;\n margin: 3px;\n }\n paper-icon-button {\n min-width: 40px;\n }\n "]);return l=function(){return a},a}function m(){const a=sa(["\n \n ","\n \n "]);return m=function(){return a},a}function n(){const a=sa(["\n \n "]);return n=function(){return a},a}function o(){const a=sa(["\n \n "]);return o=function(){return a},a}function p(){const a=sa(["\n \n "]);return p=function(){return a},a}function q(){const a=sa(["\n \n "]);return q=function(){return a},a}function r(){const a=sa(["\n \n "]);return r=function(){return a},a}function s(){const a=sa(["\n \n \n "]);return s=function(){return a},a}function t(){const a=sa(["\n ","\n ","\n ","\n ","\n ","\n ","\n "]);return t=function(){return a},a}function u(){const a=sa(["\n \n ","\n \n "]);return u=function(){return a},a}function v(){const a=sa(["\n :host {\n display: flex;\n width: 100%;\n }\n .flex {\n display: flex;\n flex: 1;\n justify-content: space-between;\n }\n ha-paper-slider {\n max-width: none;\n min-width: 100px;\n width: 100%;\n }\n paper-icon-button {\n min-width: 40px;\n }\n .mmp-media-controls__volume {\n flex: 100;\n max-height: 40px;\n }\n .mmp-media-controls__volume.--buttons {\n justify-content: left;\n }\n .mmp-media-controls__media {\n direction: ltr;\n max-width: calc(40px * 3);\n margin-right: 0;\n margin-left: auto;\n }\n .mmp-media-controls__media[flow] {\n max-width: none;\n }\n .mmp-media-controls__shuffle {\n flex: 3;\n flex-shrink: 200;\n justify-content: center;\n }\n .mmp-media-controls__shuffle paper-icon-button {\n height: 36px;\n width: 36px;\n min-width: 36px;\n margin: 2px;\n }\n "]);return v=function(){return a},a}function w(){const a=sa(["\n \n \n "]);return w=function(){return a},a}function x(){const a=sa(["\n \n \n "]);return x=function(){return a},a}function y(){const a=sa(["\n \n \n "]);return y=function(){return a},a}function z(){const a=sa(["\n \n \n "]);return z=function(){return a},a}function A(){const a=sa(["\n
\n ","\n \n \n \n \n
"]);return A=function(){return a},a}function B(){const a=sa(["\n
\n ","\n \n \n
"]);return B=function(){return a},a}function C(){const a=sa([""]);return C=function(){return a},a}function D(){const a=sa(["\n
\n \n \n \n \n \n \n
\n "]);return D=function(){return a},a}function E(){const a=sa([""]);return E=function(){return a},a}function F(){const a=sa(["\n
\n \n \n
\n "]);return F=function(){return a},a}function G(){const a=sa([""]);return G=function(){return a},a}function H(){const a=sa(["\n ","\n ","\n ","\n "]);return H=function(){return a},a}function I(){const a=sa(["\n :host {\n max-width: 120px;\n min-width: 40px;\n }\n :host([full]) {\n max-width: none;\n }\n "]);return I=function(){return a},a}function J(){const a=sa(["\n \n "]);return J=function(){return a},a}function K(){const a=sa(["\n :host {\n max-width: 120px;\n min-width: 40px;\n }\n :host([full]) {\n max-width: none;\n }\n "]);return K=function(){return a},a}function L(){const a=sa(["\n \n "]);return L=function(){return a},a}function M(){const a=sa(["\n .mmp-progress {\n cursor: pointer;\n left: 0; right: 0; bottom: 0;\n position: absolute;\n pointer-events: auto;\n min-height: 10px;\n }\n .mmp-progress__duration {\n display: flex;\n justify-content: space-between;\n font-size: .8em;\n margin: 8px calc(var(--ha-card-border-radius, 4px) / 2);\n margin-top: 0;\n padding: 0 6px;\n }\n paper-progress {\n height: var(--paper-progress-height, 4px);\n bottom: 0;\n position: absolute;\n width: 100%;\n --paper-progress-active-color: var(--mmp-accent-color);\n --paper-progress-container-color: rgba(100,100,100,.15);\n --paper-progress-transition-duration: 1s;\n --paper-progress-transition-timing-function: linear;\n --paper-progress-transition-delay: 0s;\n }\n .mmp-progress[paused] paper-progress {\n --paper-progress-active-color: var(--disabled-text-color, rgba(150,150,150,.5));\n }\n "]);return M=function(){return a},a}function N(){const a=sa([""]);return N=function(){return a},a}function O(){const a=sa(["\n
\n ","\n ","\n
\n "]);return O=function(){return a},a}function P(){const a=sa(["\n
\n ","\n \n \n
\n "]);return P=function(){return a},a}function Q(){const a=sa(["\n :host {\n align-items: center;\n margin-left: 8px;\n display: flex;\n }\n .mmp-tts__input {\n cursor: text;\n flex: 1;\n margin-right: 8px;\n --paper-input-container-input: {\n font-size: 1em;\n };\n }\n ha-card[rtl] .mmp-tts__input {\n margin-right: auto;\n margin-left: 8px;\n }\n .mmp-tts__button {\n margin: 0;\n height: 30px;\n padding: 0 .4em;\n }\n paper-input {\n opacity: .75;\n --paper-input-container-color: var(--primary-text-color);\n --paper-input-container-focus-color: var(--primary-text-color);\n --paper-input-container: {\n padding: 0;\n };\n }\n paper-input[focused] {\n opacity: 1;\n }\n\n ha-card[artwork*='cover'][has-artwork] paper-input {\n --paper-input-container-focus-color: #FFFFFF;\n }\n ha-card[artwork*='cover'][has-artwork] paper-input {\n --paper-input-container-color: #FFFFFF;\n --paper-input-container-input-color: #FFFFFF;\n }\n "]);return Q=function(){return a},a}function R(){const a=sa(["\n \n \n \n SEND\n \n "]);return R=function(){return a},a}function S(){const a=sa(["\n .mmp-shortcuts__buttons {\n box-sizing: border-box;\n display: flex;\n flex-wrap: wrap;\n margin-top: 8px;\n }\n .mmp-shortcuts__button[color] {\n background: var(--mmp-active-color);\n }\n .mmp-shortcuts__button {\n min-width: calc(50% - 8px);\n flex: 1;\n }\n .mmp-shortcuts__button[columns='1'] {\n min-width: calc(100% - 8px);\n }\n .mmp-shortcuts__button[columns='3'] {\n min-width: calc(33.33% - 8px);\n }\n .mmp-shortcuts__button[columns='4'] {\n min-width: calc(25% - 8px);\n }\n .mmp-shortcuts__button[columns='5'] {\n min-width: calc(20% - 8px);\n }\n .mmp-shortcuts__button > span {\n line-height: 24px;\n text-transform: initial;\n }\n .mmp-shortcuts__button > *:nth-child(2) {\n margin-left: 4px;\n }\n "]);return S=function(){return a},a}function T(){const a=sa(["\n ","\n ","\n "]);return T=function(){return a},a}function U(){const a=sa(["",""]);return U=function(){return a},a}function V(){const a=sa([""]);return V=function(){return a},a}function W(){const a=sa(["\n \n ","\n ","\n "]);return W=function(){return a},a}function X(){const a=sa(["\n
\n ","\n
\n "]);return X=function(){return a},a}function Y(){const a=sa(["\n \n \n "]);return Y=function(){return a},a}function Z(){const a=sa([""]);return Z=function(){return a},a}function $(){const a=sa(["\n :host {\n display: block;\n }\n :host([faded]) {\n opacity: .75;\n }\n :host[small] .mmp-dropdown__label {\n max-width: 60px;\n display: block;\n position: relative;\n width: auto;\n text-transform: initial;\n }\n :host[full] .mmp-dropdown__label {\n max-width: none;\n }\n .mmp-dropdown {\n padding: 0;\n display: block;\n }\n .mmp-dropdown__button {\n display: flex;\n font-size: 1em;\n justify-content: space-between;\n align-items: center;\n height: 36px;\n margin: 2px 0;\n }\n .mmp-dropdown__button.icon {\n height: 40px;\n margin: 0;\n }\n .mmp-dropdown__button > div {\n display: flex;\n flex: 1;\n justify-content: space-between;\n align-items: center;\n height: 36px;\n max-width: 100%;\n }\n .mmp-dropdown__label {\n text-align: left;\n text-transform: none;\n }\n .mmp-dropdown__icon {\n height: 24px;\n width: 24px;\n min-width: 24px;\n }\n paper-item > *:nth-child(2) {\n margin-left: 4px;\n }\n paper-menu-button[focused] mmp-button iron-icon {\n color: var(--mmp-accent-color);\n transform: rotate(180deg);\n }\n paper-menu-button[focused] paper-icon-button {\n color: var(--mmp-accent-color);\n transform: rotate(180deg);\n }\n paper-menu-button[focused] paper-icon-button[focused] {\n color: var(--mmp-text-color);\n transform: rotate(0deg);\n }\n "]);return $=function(){return a},a}function _(){const a=sa(["",""]);return _=function(){return a},a}function aa(){const a=sa([""]);return aa=function(){return a},a}function ba(){const a=sa(["\n \n ","\n ","\n "]);return ba=function(){return a},a}function ca(){const a=sa(["\n \n
\n \n ","\n \n \n
\n
\n "]);return ca=function(){return a},a}function da(){const a=sa(["\n \n \n "]);return da=function(){return a},a}function ea(){const a=sa(["\n \n ","\n \n ","\n \n \n "]);return ea=function(){return a},a}function fa(){const a=sa(["\n .ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .label {\n margin: 0 8px;\n }\n paper-icon-button {\n transition: color .25s;\n }\n paper-icon-button[color] {\n color: var(--mmp-accent-color) !important;\n opacity: 1 !important;\n }\n paper-icon-button[inactive] {\n opacity: .5;\n }\n"]);return fa=function(){return a},a}function ga(){const a=sa(["\n .mmp-group-list {\n display: flex;\n flex-direction: column;\n margin-left: 8px;\n }\n .mmp-group-list__title {\n font-weight: 500;\n letter-spacing: .1em;\n margin: 8px 0 4px;\n text-transform: uppercase;\n }\n .mmp-group-list__buttons {\n display: flex;\n }\n .mmp-group-list__button {\n margin: 8px 8px 0 0;\n min-width: 0;\n text-transform: uppercase;\n text-align: center;\n width: 50%;\n --mdc-theme-primary: transparent;\n background: rgba(255,255,255,0.25);\n }\n "]);return ga=function(){return a},a}function ha(){const a=sa([""]);return ha=function(){return a},a}function ia(){const a=sa(["Leave"]);return ia=function(){return a},a}function ja(){const a=sa(["Ungroup"]);return ja=function(){return a},a}function ka(){const a=sa(["\n "]);return ka=function(){return a},a}function la(){const a=sa(["\n
\n Group speakers\n ","\n
\n \n ","\n \n \n Group all\n \n
\n
\n "]);return la=function(){return a},a}function ma(){const a=sa(["\n :host {\n position: relative;\n box-sizing: border-box;\n margin: 4px;\n min-width: 0;\n overflow: hidden;\n transition: background .5s;\n }\n :host([raised]) {\n background: rgba(255,255,255,0.25);\n min-height: 36px;\n box-shadow:\n 0px 3px 1px -2px rgba(0, 0, 0, 0.2),\n 0px 2px 2px 0px rgba(0, 0, 0, 0.14),\n 0px 1px 5px 0px rgba(0,0,0,.12);\n }\n :host([color]) {\n background: var(--mmp-accent-color) !important;\n transition: background .25s;\n }\n :host([faded]) {\n opacity: .75;\n }\n .container {\n height: 100%;\n width: 100%;\n }\n .slot-container {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 8px;\n width: auto;\n }\n paper-ripple {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n }\n "]);return ma=function(){return a},a}function na(){const a=sa(["\n
\n
\n \n
\n \n
\n "]);return na=function(){return a},a}function oa(){const a=sa(["\n paper-checkbox {\n padding: 8px 0;\n }\n paper-checkbox > span {\n font-weight: 600;\n }\n\n ha-card[artwork*='cover'][has-artwork] paper-checkbox[disabled] {\n --paper-checkbox-checkmark-color: rgba(0,0,0,.5);\n }\n ha-card[artwork*='cover'][has-artwork] paper-checkbox {\n --paper-checkbox-unchecked-color: #FFFFFF;\n --paper-checkbox-label-color: #FFFFFF;\n }\n "]);return oa=function(){return a},a}function pa(){const a=sa(["(master)"]);return pa=function(){return a},a}function qa(){const a=sa(["\n \n ","\n ","\n \n "]);return qa=function(){return a},a}function ra(){const a=sa(["\n :host {\n display: block;\n --mmp-accent-color: var(--mini-media-player-accent-color, var(--accent-color, #f39c12));\n --mmp-overlay-color: var(--mini-media-player-overlay-color, rgba(0,0,0,0.5));\n --mmp-overlay-base-color: var(--mini-media-player-overlay-base-color, #fff);\n --mmp-media-cover-info-color: var(--mini-media-player-media-cover-info-color, --mmp-text-color);\n --mmp-text-color: var(--primary-text-color);\n --mmp-text-color-inverted: var(--disabled-text-color);\n --mmp-active-color: var(--mmp-accent-color);\n --mmp-icon-color: var(--paper-item-icon-color, #44739e);\n --mmp-info-opacity: 1;\n --mdc-theme-primary: var(--mmp-text-color);\n --mdc-theme-on-primary: var(--mmp-text-color);\n --paper-checkbox-unchecked-color: var(--mmp-text-color);\n --paper-checkbox-label-color: var(--mmp-text-color);\n color: var(--mmp-text-color);\n }\n ha-card.--has-artwork[artwork*='cover'] {\n --mmp-text-color: var(--mmp-overlay-base-color);\n --mmp-text-color-inverted: #000;\n --mmp-active-color: rgba(255,255,255,.5);\n --mmp-icon-color: var(--mmp-text-color);\n --mmp-info-opacity: .75;\n --paper-slider-container-color: var(--mini-media-player-overlay-color, rgba(255,255,255,.75));\n --mdc-theme-primary: var(--mmp-text-color);\n --mdc-theme-on-primary: var(--mmp-text-color);\n --paper-checkbox-unchecked-color: var(--mmp-text-color);\n --paper-checkbox-label-color: var(--mmp-text-color);\n color: var(--mmp-text-color);\n }\n ha-card {\n cursor: default;\n display: flex;\n background: transparent;\n overflow: hidden;\n padding: 0;\n position: relative;\n }\n ha-card.--group {\n box-shadow: none;\n }\n ha-card.--more-info {\n cursor: pointer;\n }\n ha-card.--collapse {\n overflow: visible;\n }\n .mmp__bg, .mmp__player, .mmp__container {\n border-radius: var(--ha-card-border-radius, 0);\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n }\n .mmp__container {\n overflow: hidden;\n height: 100%;\n width: 100%;\n position: absolute;\n pointer-events: none;\n }\n ha-card:before {\n content: '';\n padding-top: 0px;\n transition: padding-top .5s cubic-bezier(.21,.61,.35,1);\n will-change: padding-top;\n }\n ha-card.--initial .entity__artwork,\n ha-card.--initial .entity__icon {\n animation-duration: .001s;\n }\n ha-card.--initial:before,\n ha-card.--initial .mmp-player {\n transition: none;\n }\n header {\n display: none;\n }\n ha-card[artwork='full-cover'].--has-artwork:before {\n padding-top: 56%;\n }\n ha-card[artwork='full-cover'].--has-artwork[content='music']:before,\n ha-card[artwork='full-cover-fit'].--has-artwork:before {\n padding-top: 100%;\n }\n .mmp__bg {\n background: var(--paper-card-background-color, white);\n position: absolute;\n top: 0; right: 0; bottom: 0; left: 0;\n overflow: hidden;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n }\n ha-card.--group .mmp__bg {\n background: transparent;\n }\n .cover,\n .cover:before {\n display: block;\n opacity: 0;\n position: absolute;\n top: 0; right: 0; bottom: 0; left: 0;\n transition: opacity .75s cubic-bezier(.21,.61,.35,1);\n will-change: opacity;\n }\n .cover {\n animation: fade-in .5s cubic-bezier(.21,.61,.35,1);\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n }\n .cover:before {\n background: var(--mmp-overlay-color);\n content: '';\n }\n ha-card[artwork*='full-cover'].--has-artwork .mmp-player {\n background: linear-gradient(to top, var(--mmp-overlay-color) 25%, transparent 100%);\n border-bottom-left-radius: var(--ha-card-border-radius, 0);\n border-bottom-right-radius: var(--ha-card-border-radius, 0);\n }\n ha-card.--has-artwork .cover,\n ha-card.--has-artwork[artwork='cover'] .cover:before,\n ha-card.--bg .cover {\n opacity: .999;\n }\n ha-card[artwork='default'] .cover {\n display: none;\n }\n ha-card.--bg .cover {\n display: block;\n }\n ha-card[artwork='full-cover-fit'].--has-artwork .cover {\n background-color: black;\n background-size: contain;\n }\n .mmp-player {\n align-self: flex-end;\n box-sizing: border-box;\n position: relative;\n padding: 16px;\n transition: padding .25s ease-out;\n width: 100%;\n will-change: padding;\n }\n ha-card.--group .mmp-player {\n padding: 2px 0;\n }\n .flex {\n display: flex;\n display: -ms-flexbox;\n display: -webkit-flex;\n flex-direction: row;\n }\n .mmp-player__core {\n position: relative;\n }\n .entity__info {\n justify-content: center;\n display: flex;\n flex-direction: column;\n margin-left: 8px;\n position: relative;\n overflow: hidden;\n user-select: none;\n }\n ha-card.--rtl .entity__info {\n margin-left: auto;\n margin-right: 8px;\n }\n ha-card[content='movie'] .attr__media_season,\n ha-card[content='movie'] .attr__media_episode {\n display: none;\n }\n .entity__icon {\n color: var(--mmp-icon-color);\n }\n .entity__artwork, .entity__icon {\n animation: fade-in .25s ease-out;\n background-position: center center;\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 100%;\n height: 40px;\n width: 40px;\n min-width: 40px;\n line-height: 40px;\n margin-right: 8px;\n position: relative;\n text-align: center;\n will-change: border-color;\n transition: border-color .25s ease-out;\n }\n ha-card.--rtl .entity__artwork,\n ha-card.--rtl .entity__icon {\n margin-right: auto;\n }\n .entity__artwork[border] {\n border: 2px solid var(--primary-text-color);\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n }\n .entity__artwork[border][state='playing'] {\n border-color: var(--mmp-accent-color);\n }\n .entity__info__name,\n .entity__info__media[short] {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .entity__info__name {\n line-height: 20px;\n color: var(--mmp-text-color);\n }\n .entity__info__media {\n color: var(--secondary-text-color);\n max-height: 6em;\n word-break: break-word;\n opacity: var(--mmp-info-opacity);\n transition: color .5s;\n }\n .entity__info__media[short] {\n max-height: 20px;\n overflow: hidden;\n }\n .attr__app_name {\n display: none;\n }\n .attr__app_name:first-child,\n .attr__app_name:first-of-type {\n display: inline;\n }\n .mmp-player__core[inactive] .entity__info__media {\n color: var(--mmp-text-color);\n max-width: 200px;\n opacity: .5;\n }\n .mmp-player__core[inactive] .entity__info__media {\n }\n .entity__info__media[short-scroll] {\n max-height: 20px;\n white-space: nowrap;\n }\n .entity__info__media[scroll] > span {\n visibility: hidden;\n }\n .entity__info__media[scroll] > div {\n animation: move linear infinite;\n }\n .entity__info__media[scroll] .marquee {\n animation: slide linear infinite;\n }\n .entity__info__media[scroll] .marquee,\n .entity__info__media[scroll] > div {\n animation-duration: inherit;\n visibility: visible;\n }\n .entity__info__media[scroll] {\n animation-duration: 10s;\n mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);\n -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);\n }\n .marquee {\n visibility: hidden;\n position: absolute;\n white-space: nowrap;\n }\n ha-card[artwork*='cover'].--has-artwork .entity__info__media {\n color: var(--mmp-media-cover-info-color);\n }\n .entity__info__media span:before {\n content: ' - ';\n }\n .entity__info__media span:first-of-type:before {\n content: '';\n }\n .entity__info__media span:empty {\n display: none;\n }\n .mmp-player__adds {\n margin-left: 48px;\n position: relative;\n }\n ha-card.--rtl .mmp-player__adds {\n margin-left: auto;\n margin-right: 48px;\n }\n .mmp-player__adds > *:nth-child(2) {\n margin-top: 0px;\n }\n mmp-powerstrip {\n flex: 1;\n justify-content: flex-end;\n margin-right: 0;\n margin-left: auto;\n width: auto;\n max-width: 100%;\n }\n mmp-media-controls {\n flex-wrap: wrap;\n justify-content: center;\n }\n ha-card.--flow mmp-powerstrip {\n justify-content: space-between;\n margin-left: auto;\n }\n ha-card.--flow.--rtl mmp-powerstrip {\n margin-right: auto;\n }\n ha-card.--flow .entity__info {\n display: none;\n }\n ha-card.--responsive .mmp-player__adds {\n margin-left: 0;\n }\n ha-card.--responsive.--rtl .mmp-player__adds {\n margin-right: 0;\n }\n ha-card.--responsive .mmp-player__adds > mmp-media-controls {\n padding: 0;\n }\n ha-card.--runtime .mmp-player {\n padding-bottom: calc(16px + 8px);\n }\n ha-card.--runtime.--group .mmp-player {\n padding-bottom: calc(16px + 8px);\n }\n .mmp-player div:empty {\n display: none;\n }\n @keyframes slide {\n 100% { transform: translateX(-100%); }\n }\n @keyframes move {\n from { transform: translateX(100%); }\n to { transform: translateX(0); }\n }\n @keyframes fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n"]);return ra=function(){return a},a}function sa(a,b){return b||(b=a.slice(0)),Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(b)}}))}function ta(a){for(var b=1;ba.parentNode.removeChild(a))}function va(a,b){let c=2"function"==typeof a&&Ia.has(a),Ka=window.customElements!==void 0&&window.customElements.polyfillWrapFlushCallback!==void 0,La=function(a,b){let c=2"),Qa=new RegExp("".concat(Oa,"|").concat(Pa)),Ra="$lit$";class Sa{constructor(a,b){this.parts=[],this.element=b;let c=-1,d=0;const e=[],f=b=>{const g=b.content,h=document.createTreeWalker(g,133,null,!1);for(let g=0;h.nextNode();){c++;const b=h.currentNode;if(1===b.nodeType){if(b.hasAttributes()){const e=b.attributes;let f=0;for(let a=0;a-1!==a.index,Ua=()=>document.createComment(""),Va=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class Wa{constructor(a,b,c){this._parts=[],this.template=a,this.processor=b,this.options=c}update(a){let b=0;for(const c of this._parts)void 0!==c&&c.setValue(a[b]),b++;for(const b of this._parts)void 0!==b&&b.commit()}_clone(){const a=Ka?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),b=this.template.parts;let c=0,d=0;const e=a=>{const f=document.createTreeWalker(a,133,null,!1);for(let g=f.nextNode();cnull===a||"object"!=typeof a&&"function"!=typeof a;class Za{constructor(a,b,c){this.dirty=!0,this.element=a,this.name=b,this.strings=c,this.parts=[];for(let d=0;dthis.handleEvent(a)}setValue(a){this._pendingValue=a}commit(){for(;Ja(this._pendingValue);){const a=this._pendingValue;this._pendingValue=Ma,a(this)}if(this._pendingValue===Ma)return;const a=this._pendingValue,b=this.value,c=null==a||null!=b&&(a.capture!==b.capture||a.once!==b.once||a.passive!==b.passive);c&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),null!=a&&(null==b||c)&&(this._options=fb(a),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=a,this._pendingValue=Ma}handleEvent(a){"function"==typeof this.value?this.value.call(this.eventContext||this.element,a):this.value.handleEvent(a)}}const fb=a=>a&&(db?{capture:a.capture,passive:a.passive,once:a.once}:a.capture);const gb=new class{handleAttributeExpressions(a,b,c,d){const e=b[0];if("."===e){const d=new bb(a,b.slice(1),c);return d.parts}if("@"===e)return[new eb(a,b.slice(1),d.eventContext)];if("?"===e)return[new ab(a,b.slice(1),c)];const f=new Za(a,b,c);return f.parts}handleTextExpression(a){return new _a(a)}},hb=new Map,ib=new WeakMap,jb=(a,b,c)=>{let d=ib.get(b);d===void 0&&(La(b,b.firstChild),ib.set(b,d=new _a(Object.assign({templateFactory:sa},c))),d.appendInto(b)),d.setValue(a),d.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const kb=function(a){for(var b=arguments.length,c=Array(1{let b=11===a.nodeType?0:1;for(const c=document.createTreeWalker(a,lb,null,!1);c.nextNode();)b++;return b},nb=function(a){let b=1"".concat(a,"--").concat(b);let pb=!0;"undefined"==typeof window.ShadyCSS?pb=!1:"undefined"==typeof window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected.Please update to at least @webcomponents/webcomponentsjs@2.0.2 and@webcomponents/shadycss@1.3.1."),pb=!1);const qb=a=>b=>{const c=ob(b.type,a);let d=hb.get(c);void 0===d&&(d={stringsArray:new WeakMap,keyString:new Map},hb.set(c,d));let e=d.stringsArray.get(b.strings);if(void 0!==e)return e;const f=b.strings.join(Oa);if(e=d.keyString.get(f),void 0===e){const c=b.getTemplateElement();pb&&window.ShadyCSS.prepareTemplateDom(c,a),e=new Sa(b,c),d.keyString.set(f,e)}return d.stringsArray.set(b.strings,e),e},rb=["html","svg"],sb=a=>{rb.forEach(b=>{const c=hb.get(ob(b,a));c!==void 0&&c.keyString.forEach(a=>{const b=a.element.content,c=new Set;Array.from(b.querySelectorAll("style")).forEach(a=>{c.add(a)}),ua(a,c)})})},tb=new Set,ub=(a,b,c)=>{tb.add(c);const d=a.querySelectorAll("style");if(0===d.length)return void window.ShadyCSS.prepareTemplateStyles(b.element,c);const e=document.createElement("style");for(let f=0;f{const d=c.scopeName,e=ib.has(b),f=b instanceof ShadowRoot&&pb&&a instanceof Xa,g=f&&!tb.has(d),h=g?document.createDocumentFragment():b;if(jb(a,h,Object.assign({templateFactory:qb(d)},c)),g){const a=ib.get(h);ib.delete(h),a.value instanceof Wa&&ub(h,a.value.template,d),La(b,b.firstChild),b.appendChild(h),ib.set(b,a)}!e&&f&&window.ShadyCSS.styleElement(b.host)};window.JSCompiler_renameProperty=a=>a;const wb={toAttribute(a,b){return b===Boolean?a?"":null:b===Object||b===Array?null==a?a:JSON.stringify(a):a},fromAttribute(a,b){return b===Boolean?null!==a:b===Number?null===a?null:+a:b===Object||b===Array?JSON.parse(a):a}},xb=(a,b)=>b!==a&&(b===b||a===a),yb={attribute:!0,type:String,converter:wb,reflect:!1,hasChanged:xb},zb=Promise.resolve(!0),Ab=1,Bb=4,Cb=8,Db=16,Eb=32;class Fb extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=zb,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const a=[];return this._classProperties.forEach((b,c)=>{const d=this._attributeNameForProperty(c,b);void 0!==d&&(this._attributeToPropertyMap.set(d,c),a.push(d))}),a}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const a=Object.getPrototypeOf(this)._classProperties;a!==void 0&&a.forEach((a,b)=>this._classProperties.set(b,a))}}static createProperty(a){let b=1{if(this.hasOwnProperty(b)){const a=this[b];delete this[b],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(b,a)}})}_applyInstanceProperties(){this._instanceProperties.forEach((a,b)=>this[b]=a),this._instanceProperties=void 0}connectedCallback(){this._updateState|=Eb,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(a,b,c){b!==c&&this._attributeToProperty(a,c)}_propertyToAttribute(a,b){let c=2{b=a,c=d});try{yield d}catch(a){}a._hasConnected||(yield new Promise(b=>a._hasConnectedResolver=b));try{const b=a.performUpdate();null!=b&&(yield b)}catch(a){c(a)}b(!a._hasRequestedUpdate)})()}get _hasConnected(){return this._updateState&Eb}get _hasRequestedUpdate(){return this._updateState&Bb}get hasUpdated(){return this._updateState&Ab}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let a=!1;const b=this._changedProperties;try{a=this.shouldUpdate(b),a&&this.update(b)}catch(b){throw a=!1,b}finally{this._markUpdated()}a&&(!(this._updateState&Ab)&&(this._updateState|=Ab,this.firstUpdated(b)),this.updated(b))}_markUpdated(){this._changedProperties=new Map,this._updateState&=~Bb}get updateComplete(){return this._updatePromise}shouldUpdate(a){return!0}update(a){this._reflectingProperties!==void 0&&0this._propertyToAttribute(b,this[b],a)),this._reflectingProperties=void 0)}updated(a){}firstUpdated(a){}}Fb.finalized=!0;const Gb="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hb=Symbol();class Ib{constructor(a,b){if(b!==Hb)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=a}get styleSheet(){return void 0===this._styleSheet&&(Gb?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const Jb=a=>{if(a instanceof Ib)return a.cssText;throw new Error("Value passed to 'css' function must be a 'css' function result: ".concat(a,". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security."))},Kb=function(a){for(var b=arguments.length,c=Array(1b+Jb(c)+a[d+1],a[0]);return new Ib(e,Hb)};(window.litElementVersions||(window.litElementVersions=[])).push("2.0.1");const Lb=a=>a.flat?a.flat(1/0):xa(a);class Mb extends Fb{static finalize(){super.finalize(),this._styles=this.hasOwnProperty(JSCompiler_renameProperty("styles",this))?this._getUniqueStyles():this._styles||[]}static _getUniqueStyles(){const a=this.styles,b=[];if(Array.isArray(a)){const c=Lb(a),d=c.reduceRight((a,b)=>(a.add(b),a),new Set);d.forEach(a=>b.unshift(a))}else a&&b.push(a);return b}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const a=this.constructor._styles;0===a.length||(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow?Gb?this.renderRoot.adoptedStyleSheets=a.map(a=>a.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(a.map(a=>a.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&window.ShadyCSS!==void 0&&window.ShadyCSS.styleElement(this)}update(a){super.update(a);const b=this.render();b instanceof Xa&&this.constructor.render(b,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(a=>{const b=document.createElement("style");b.textContent=a.cssText,this.renderRoot.appendChild(b)}))}render(){}}Mb.finalized=!0,Mb.render=vb,window.navigator.userAgent.match("Trident")&&(DOMTokenList.prototype.toggle=function(a,b){return void 0===b||b?this.add(a):this.remove(a),void 0===b||b});const Nb=new WeakMap,Ob=new WeakMap,Pb=(a=>function(){const b=a(...arguments);return Ia.set(b,!0),b})(a=>b=>{if(!(b instanceof $a)||b instanceof cb||"class"!==b.committer.name||1ta({text:this.attr[a.attr],prefix:""},a)).filter(a=>a.text)}get hasProgress(){return!this.config.hide.progress&&!this.idle&&ic.every(a=>a in this.attr)}get progress(){return this.position+(Date.now()-new Date(this.updatedAt).getTime())/1e3}get idleView(){const a=this.config.idle_view;return!!(a.when_idle&&this.isIdle||a.when_standby&&this.isStandby||a.when_paused&&this.isPaused)||!!(this.updatedAt&&a.after&&!this.isPlaying)&&this.checkIdleAfter(a.after)}get trackIdle(){return this.active&&!this.isPlaying&&this.updatedAt&&this.config.idle_view&&this.config.idle_view.after}checkIdleAfter(a){const b=(Date.now()-new Date(this.updatedAt).getTime())/1e3;return this.idle=b>60*a,this.active=this.isActive,this.idle}get supportsShuffle(){return"undefined"!=typeof this.attr.shuffle}get supportsMute(){return"undefined"!=typeof this.attr.is_volume_muted}getAttribute(a){return this.attr[a]||""}fetchThumbnail(){var a=this;return wa(function*(){try{const b=yield a.hass.callWS({type:"media_player_thumbnail",entity_id:a.config.entity}),c=b.content_type,d=b.content;return"url(data:".concat(c,";base64,").concat(d,")")}catch(a){return console.error("mini-media-player: Failed fetching thumbnail"),!1}})()}toggle(a){return this.config.toggle_power?this.callService(a,"toggle"):this.isOff?this.callService(a,"turn_on"):void this.callService(a,"turn_off")}toggleMute(a){this.callService(a,"volume_mute",{is_volume_muted:!this.muted})}toggleShuffle(a){this.callService(a,"shuffle_set",{shuffle:!this.shuffle})}setSource(a,b){this.callService(a,"select_source",{source:b})}setMedia(a,b){this.callService(a,"play_media",ta({},b))}playPause(a){this.callService(a,"media_play_pause")}setSoundMode(a,b){this.callService(a,"select_sound_mode",{sound_mode:b})}next(a){this.callService(a,"media_next_track")}prev(a){this.callService(a,"media_previous_track")}stop(a){this.callService(a,"media_stop")}volumeUp(a){this.callService(a,"volume_up")}volumeDown(a){this.callService(a,"volume_down")}seek(a,b){this.callService(a,"media_seek",{seek_position:b})}setVolume(a,b){this.config.speaker_group.sync_volume?this.group.forEach(c=>{const d=this.config.speaker_group.entities.find(a=>a.entity_id===c)||{};let e=b;d.volume_offset&&(e+=d.volume_offset/100,1e&&(e=0)),this.callService(a,"volume_set",{entity_id:c,volume_level:e})}):this.callService(a,"volume_set",{entity_id:this.config.entity,volume_level:b})}handleGroupChange(a,b,c){const d=this.config.speaker_group.platform,e={entity_id:b};if(c){if(e.master=this.config.entity,"sonos"===d)return this.callService(a,"join",e,d);this.callService(a,"".concat(d,"_JOIN"),e)}else{if("sonos"===d)return this.callService(a,"unjoin",e,d);this.callService(a,"".concat(d,"_UNJOIN"),e)}}toggleScript(a,b){let c=2a.stopPropagation(),this.handleClick,this.item.name,this.master?kb(pa()):"")}handleClick(a){a.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:{entity:this.item.entity_id,checked:!this.checked}}))}static get styles(){return Kb(oa())}}customElements.define("mmp-group-item",mc);class nc extends Mb{render(){return kb(na())}static get styles(){return Kb(ma())}}customElements.define("mmp-button",nc);class oc extends Mb{static get properties(){return{entities:{},player:{},visible:Boolean}}get group(){return this.player.group}get master(){return this.player.master}get isMaster(){return this.player.isMaster}handleGroupChange(a){const b=a.detail,c=b.entity,d=b.checked;this.player.handleGroupChange(a,c,d)}render(){let a=0kb(ka(),this.handleGroupChange,a,a.entity_id===this.player.id||b.includes(a.entity_id),a.entity_id===this.player.id||c!==this.player.id,a.entity_id===c)),2>b.length,a=>this.player.handleGroupChange(a,d?b:this.player.entity_id,!1),d?kb(ja()):kb(ia()),!d,a=>this.player.handleGroupChange(a,this.entities.map(a=>a.entity_id),!0)):kb(ha())}static get styles(){return Kb(ga())}}customElements.define("mmp-group-list",oc);const pc=Kb(fa());class qc extends Mb{static get properties(){return{items:[],label:String,selected:String}}get selectedId(){return this.items.map(a=>a.id).indexOf(this.selected)}onChange(a){this.dispatchEvent(new CustomEvent("change",{detail:a}))}render(){return kb(ea(),"right","top",44,a=>a.stopPropagation(),this.icon?kb(da(),gc.DROPDOWN):kb(ca(),this.selected||this.label,gc.DROPDOWN),this.selectedId,this.items.map(a=>kb(ba(),a.id||a.name,()=>this.onChange(a),a.icon?kb(aa(),a.icon):"",a.name?kb(_(),a.name):"")))}static get styles(){return[pc,Kb($())]}}customElements.define("mmp-dropdown",qc);class rc extends Mb{static get properties(){return{player:{},shortcuts:{}}}get buttons(){return this.shortcuts.buttons}get list(){return this.shortcuts.list}get show(){return!this.shortcuts.hide_when_off||this.player.active}get active(){return this.player.getAttribute(this.shortcuts.attribute)}get height(){return this.shortcuts.column_height||36}render(){if(!this.show)return kb(Z());const a=this.active,b=this.list?kb(Y(),this.handleShortcut,this.list,this.shortcuts.label,a):"",c=this.buttons?kb(X(),this.buttons.map(b=>kb(W(),"min-height: ".concat(this.height,"px;"),this.shortcuts.columns,b.id===a,a=>this.handleShortcut(a,b),b.icon?kb(V(),b.icon):"",b.name?kb(U(),b.name):""))):"";return kb(T(),c,b)}handleShortcut(a,b){const c=b||a.detail,d=c.type,e=c.id,f=c.data;if("source"===d)return this.player.setSource(a,e);if("service"===d)return this.player.toggleService(a,e,f);if("script"===d)return this.player.toggleScript(a,e,f);if("sound_mode"===d)return this.player.setSoundMode(a,e);this.player.setMedia(a,{media_content_type:d,media_content_id:e})}static get styles(){return[pc,Kb(S())]}}customElements.define("mmp-shortcuts",rc);const sc=function(a,b){let c=2a.stopPropagation(),this.handleTts)}handleTts(a){const b=this.config,c=this.message,d={message:c,entity_id:b.entity_id||this.entity};b.language&&(d.language=b.language),"alexa"===b.platform?this.hass.callService("notify","alexa_media",{message:c,data:{type:b.type||"tts"},target:d.entity_id}):"sonos"===b.platform?this.hass.callService("script","sonos_say",{sonos_entity:d.entity_id,volume:b.volume||.5,message:c}):"ga"===b.platform?this.hass.callService("notify","ga_broadcast",{message:c}):this.hass.callService("tts","".concat(b.platform,"_say"),d),a.stopPropagation(),this.reset()}reset(){this.input.value=""}static get styles(){return Kb(Q())}}customElements.define("mmp-tts",tc);var uc=a=>{let b=parseInt(a%60,10),c=parseInt(a/60%60,10),d=parseInt(a/3600%24,10);return d=10>d?"0".concat(d):d,c=10>c?"0".concat(c):c,b=10>b?"0".concat(b):b,"".concat("00"===d?"":"".concat(d,":")).concat(c,":").concat(b)};class vc extends Mb{static get properties(){return{_player:{},showTime:Boolean,progress:Number,duration:Number,tracker:{},track:Boolean}}set player(a){this._player=a,this.hasProgress&&this.trackProgress()}get duration(){return this.player.mediaDuration}get player(){return this._player}get hasProgress(){return this.player.hasProgress}render(){return this.player.active&&this.hasProgress?kb(P(),this.handleSeek,!this.player.isPlaying,this.showTime?kb(O(),uc(this.progress),uc(this.duration)):"",this.progress,this.duration):kb(N())}trackProgress(){this.progress=this.player.progress,this.tracker||(this.tracker=setInterval(()=>this.trackProgress(),1e3)),this.player.isPlaying||(clearInterval(this.tracker),this.tracker=null)}handleSeek(a){const b=this.duration,c=a.offsetX/a.target.offsetWidth*b;this.player.seek(a,c)}disconnectedCallback(){clearInterval(this.tracker)}static get styles(){return Kb(M())}}customElements.define("mmp-progress",vc);class wc extends Mb{static get properties(){return{player:{},selected:String,icon:Boolean}}get source(){return this.player.source}get sources(){return this.player.sources.map(a=>({name:a,id:a,type:"source"}))}render(){return kb(L(),this.handleSource,this.sources,this.source,this.selected||this.source,this.icon)}handleSource(a){const b=a.detail.id;this.player.setSource(a,b),this.selected=b}static get styles(){return Kb(K())}}customElements.define("mmp-source-menu",wc);class xc extends Mb{static get properties(){return{player:{},selected:String,icon:Boolean}}get mode(){return this.player.soundMode}get modes(){return this.player.soundModes.map(a=>({name:a,id:a,type:"soundMode"}))}render(){return kb(J(),this.handleChange,this.modes,this.mode,this.selected||this.mode,this.icon)}handleChange(a){const b=a.detail.id;this.player.setSoundMode(a,b),this.selected=b}static get styles(){return Kb(I())}}customElements.define("mmp-sound-menu",xc);class yc extends Mb{static get properties(){return{player:{},config:{}}}get showShuffle(){return!this.config.hide.shuffle&&this.player.supportsShuffle}get maxVol(){return this.config.max_volume||100}get minVol(){return this.config.min_volume||0}render(){const a=this.config.hide;return kb(H(),a.volume?kb(G()):this.renderVolControls(this.player.muted),this.showShuffle?kb(F(),a=>this.player.toggleShuffle(a),gc.SHUFFLE,this.player.shuffle):kb(E()),a.controls?kb(C()):kb(D(),this.config.flow,a=>this.player.prev(a),gc.PREV,a=>this.player.playPause(a),gc.PLAY[this.player.isPlaying],a=>this.player.next(a),gc.NEXT))}renderVolControls(a){return this.config.volume_stateless?this.renderVolButtons(a):this.renderVolSlider(a)}renderVolSlider(a){return kb(B(),this.renderMuteButton(a),this.handleVolumeChange,a=>a.stopPropagation(),a,this.minVol,this.maxVol,100*this.player.vol,"ltr")}renderVolButtons(a){return kb(A(),this.renderMuteButton(a),a=>this.player.volumeDown(a),gc.VOL_DOWN,a=>this.player.volumeUp(a),gc.VOL_UP)}renderMuteButton(a){if(!this.config.hide.mute)switch(this.config.replace_mute){case"play":return kb(z(),a=>this.player.playPause(a),gc.PLAY[this.player.isPlaying]);case"stop":return kb(y(),a=>this.player.stop(a),gc.STOP);case"next":return kb(x(),a=>this.player.next(a),gc.NEXT);default:return this.player.supportsMute?kb(w(),a=>this.player.toggleMute(a),gc.MUTE[a]):void 0;}}handleVolumeChange(a){const b=parseFloat(a.target.value)/100;this.player.setVolume(a,b)}static get styles(){return[pc,Kb(v())]}}customElements.define("mmp-media-controls",yc);class zc extends Mb{static get properties(){return{hass:{},player:{},config:{},groupVisible:Boolean,idle:Boolean}}get showGroupButton(){return this.config.speaker_group.entities}get showPowerButton(){return!this.config.hide.power}get powerColor(){return this.player.active&&!this.config.hide.power_state}get sourceSize(){return"icon"===this.config.source||this.config.collapse||this.idle}get soundSize(){return"icon"===this.config.sound_mode||this.config.collapse||this.idle}get hasSource(){return 0this.player.toggle(a),this.powerColor):"")}handleGroupClick(a){a.stopPropagation(),this.dispatchEvent(new CustomEvent("toggleGroupList"))}get renderIdleView(){return this.player.isPaused?kb(n(),gc.PLAY[this.player.isPlaying],a=>this.player.playPause(a)):kb(m(),sc(this.hass,"state.media_player.idle","Idle"))}static get styles(){return[pc,Kb(l())]}}customElements.define("mmp-powerstrip",zc),customElements.get("ha-paper-slider")||customElements.define("ha-paper-slider",class extends customElements.get("paper-slider"){});class Ac extends Mb{constructor(){super(),this._overflow=!1,this.initial=!0,this.picture=!1,this.thumbnail=!1,this.edit=!1,this.rtl=!1}static get properties(){return{_hass:{},config:{},entity:{},player:{},_overflow:Boolean,break:Boolean,initial:Boolean,picture:String,thumbnail:String,edit:Boolean,rtl:Boolean,idle:Boolean}}static get styles(){return lc}set hass(a){if(a){const b=a.states[this.config.entity];this._hass=a,b&&this.entity!==b&&(this.entity=b,this.player=new kc(a,this.config,b),this.rtl=this.computeRTL(a),this.idle=this.player.idle,this.player.trackIdle&&this.updateIdleStatus())}}get hass(){return this._hass}set overflow(a){this._overflow!==a&&(this._overflow=a)}get overflow(){return this._overflow}get name(){return this.config.name||this.player.name}setConfig(a){if(!a.entity||"media_player"!==a.entity.split(".")[0])throw new Error("Specify an entity from within the media_player domain.");const b=ta({artwork:"default",info:"default",more_info:!0,source:"default",sound_mode:"default",toggle_power:!0},a,{hide:ta({},fc,a.hide),speaker_group:ta({show_group_count:!0,platform:"sonos"},a.sonos,a.speaker_group),shortcuts:ta({label:"Shortcuts..."},a.shortcuts)});b.max_volume=+b.max_volume||100,b.min_volume=+b.min_volume||0,b.collapse=b.hide.controls||b.hide.volume,b.info=b.collapse&&"scroll"!==b.info?"short":b.info,b.flow=b.hide.icon&&b.hide.name&&b.hide.info,this.config=b}shouldUpdate(a){return void 0===this.break&&this.computeRect(this),hc.some(b=>a.has(b))&&this.player}firstUpdated(){const a=new ec(a=>{a.forEach(a=>{window.requestAnimationFrame(()=>{"scroll"===this.config.info&&this.computeOverflow(),this._resizeTimer||(this.computeRect(a),this._resizeTimer=setTimeout(()=>{this._resizeTimer=null,this.computeRect(this._resizeEntry)},250)),this._resizeEntry=a})})});a.observe(this),setTimeout(()=>this.initial=!1,250),this.edit=this.config.speaker_group.expanded||!1}updated(){"scroll"===this.config.info&&setTimeout(()=>{this.computeOverflow()},10)}render(){let a=0kb(b(),"attr__".concat(a.attr),a.prefix+a.text))):"",e.map(b=>kb(a(),"attr__".concat(b.attr),b.prefix+b.text)))}}speakerCount(){if(this.config.speaker_group.show_group_count){const a=this.player.groupCount;return 1{this.thumbnail=a}),this.picture=b),!!(c&&this.thumbnail)}computeIcon(){return this.config.icon?this.config.icon:this.player.icon||gc.DEFAULT}computeOverflow(){const a=this.shadowRoot.querySelector(".marquee");if(a){const b=a.clientWidth>a.parentNode.clientWidth;this.overflow=!!(b&&this.player.active)&&7.5+a.clientWidth/50}}computeRect(a){const b=a.contentRect||a.getBoundingClientRect(),c=b.left,d=b.width;this.break=d+2*c<390}computeRTL(a){const b=a.language||"en";return!!a.translationMetadata.translations[b]&&(a.translationMetadata.translations[b].isRTL||!1)}toggleGroupList(){this.edit=!this.edit}handleMoreInfo(a){a.stopPropagation(),this.config.more_info&&this.fire("hass-more-info",{entityId:this.config.entity})}fire(a,b,c){const d=c||{},f=null===b||void 0===b?{}:b,g=new Event(a,{bubbles:void 0===d.bubbles||d.bubbles,cancelable:!!d.cancelable,composed:void 0===d.composed||d.composed});return g.detail=f,this.dispatchEvent(g),g}updateIdleStatus(){this._idleTracker&&clearTimeout(this._idleTracker);const a=(Date.now()-new Date(this.player.updatedAt).getTime())/1e3;this._idleTracker=setTimeout(()=>{this.idle=this.player.checkIdleAfter(this.config.idle_view.after),this.player.idle=this.idle,this._idleTracker=null},1e3*(60*this.config.idle_view.after-a))}getCardSize(){return this.config.collapse?1:2}}customElements.define("mini-media-player",Ac)})})();