iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 45.2 kB
JavaScript
export const __webpack_ids__=["70889"];export const __webpack_modules__={92636:function(e,t,i){i.d(t,{z:()=>a});const a=e=>(t,i)=>e.includes(t,i)},59847:function(e,t,i){i.d(t,{N:()=>n});var a=i(73850);const n=e=>(0,a.M)(e.entity_id)},75278:function(e,t,i){i.d(t,{e:()=>a});const a=(e,t)=>n(e.attributes,t),n=(e,t)=>!!(e.supported_features&t)},59826:function(e,t,i){var a=i(44249),n=i(31622),s=i(57243),o=i(15093),r=i(22344);(0,a.Z)([(0,o.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[r.W,s.iv`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}:host([destructive]){--mdc-theme-primary:var(--error-color)}`]}]}}),n.Button)},33067:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),n=i(57243),s=i(15093),o=i(94571),r=i(45729),d=i(88238),l=(i(65981),e([r]));r=(l.then?(await l)():l)[0];(0,a.Z)([(0,s.Mo)("ha-domain-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"domain",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"deviceClass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"brand-fallback",type:Boolean})],key:"brandFallback",value:void 0},{kind:"method",key:"render",value:function(){if(this.icon)return n.dy`<ha-icon .icon="${this.icon}"></ha-icon>`;if(!this.domain)return n.Ld;if(!this.hass)return this._renderFallback();const e=(0,r.KS)(this.hass,this.domain,this.deviceClass).then((e=>e?n.dy`<ha-icon .icon="${e}"></ha-icon>`:this._renderFallback()));return n.dy`${(0,o.C)(e)}`}},{kind:"method",key:"_renderFallback",value:function(){if(this.domain&&this.domain in r.Ls)return n.dy` <ha-svg-icon .path="${r.Ls[this.domain]}"></ha-svg-icon> `;if(this.brandFallback){const e=(0,d.X1)({domain:this.domain,type:"icon",darkOptimized:this.hass.themes?.darkMode});return n.dy` <img alt="" src="${e}" crossorigin="anonymous" referrerpolicy="no-referrer"> `}return n.dy`<ha-svg-icon .path="${r.Rb}"></ha-svg-icon>`}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`img{width:var(--mdc-icon-size,24px)}`}]}}),n.oi);t()}catch(e){t(e)}}))},54202:function(e,t,i){i.r(t),i.d(t,{HaIconButtonArrowPrev:()=>r});var a=i(44249),n=i(57243),s=i(15093),o=i(5111);i(23334);let r=(0,a.Z)([(0,s.Mo)("ha-icon-button-arrow-prev")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_icon",value:()=>"rtl"===o.E.document.dir?"M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z":"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"},{kind:"method",key:"render",value:function(){return n.dy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}"></ha-icon-button> `}}]}}),n.oi)},23334:function(e,t,i){i.r(t),i.d(t,{HaIconButton:()=>r});var a=i(44249),n=(i(74269),i(57243)),s=i(15093),o=i(20552);i(37583);let r=(0,a.Z)([(0,s.Mo)("ha-icon-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:String})],key:"path",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:String})],key:"label",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:String,attribute:"aria-haspopup"})],key:"ariaHasPopup",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"hide-title",type:Boolean})],key:"hideTitle",value:()=>!1},{kind:"field",decorators:[(0,s.IO)("mwc-icon-button",!0)],key:"_button",value:void 0},{kind:"method",key:"focus",value:function(){this._button?.focus()}},{kind:"field",static:!0,key:"shadowRootOptions",value:()=>({mode:"open",delegatesFocus:!0})},{kind:"method",key:"render",value:function(){return n.dy` <mwc-icon-button aria-label="${(0,o.o)(this.label)}" title="${(0,o.o)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,o.o)(this.ariaHasPopup)}" .disabled="${this.disabled}"> ${this.path?n.dy`<ha-svg-icon .path="${this.path}"></ha-svg-icon>`:n.dy`<slot></slot>`} </mwc-icon-button> `}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:inline-block;outline:0}:host([disabled]){pointer-events:none}mwc-icon-button{--mdc-theme-on-primary:currentColor;--mdc-theme-text-disabled-on-light:var(--disabled-text-color)}`}]}}),n.oi)},2790:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{getLanguageOptions:()=>m});var n=i(44249),s=i(72621),o=i(16485),r=(i(9359),i(70104),i(57243)),d=i(15093),l=i(27486),c=i(36522),h=i(49976),u=i(94369),p=i(1416),f=i(67862),v=(i(7285),i(92824),e([o,u]));[o,u]=v.then?(await v)():v;const m=(e,t,i,a)=>{let n=[];if(t){const t=f.o.translations;n=e.map((e=>{let i=t[e]?.nativeName;if(!i)try{i=new Intl.DisplayNames(e,{type:"language",fallback:"code"}).of(e)}catch(t){i=e}return{value:e,label:i}}))}else a&&(n=e.map((e=>({value:e,label:(0,u.u)(e,a)}))));return!i&&a&&n.sort(((e,t)=>(0,p.fe)(e.label,t.label,a.language))),n};(0,n.Z)([(0,d.Mo)("ha-language-picker")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Array})],key:"languages",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"native-name",type:Boolean})],key:"nativeName",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"no-sort",type:Boolean})],key:"noSort",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value:()=>!1},{kind:"field",decorators:[(0,d.SB)()],key:"_defaultLanguages",value:()=>[]},{kind:"field",decorators:[(0,d.IO)("ha-select")],key:"_select",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(i,"firstUpdated",this,3)([e]),this._computeDefaultLanguageOptions()}},{kind:"method",key:"updated",value:function(e){(0,s.Z)(i,"updated",this,3)([e]);const t=e.has("hass")&&this.hass&&e.get("hass")&&e.get("hass").locale.language!==this.hass.locale.language;if(e.has("languages")||e.has("value")||t){if(this._select.layoutOptions(),this._select.value!==this.value&&(0,c.B)(this,"value-changed",{value:this._select.value}),!this.value)return;const e=this._getLanguagesOptions(this.languages??this._defaultLanguages,this.nativeName,this.noSort,this.hass?.locale).findIndex((e=>e.value===this.value));-1===e&&(this.value=void 0),t&&this._select.select(e)}}},{kind:"field",key:"_getLanguagesOptions",value:()=>(0,l.Z)(m)},{kind:"method",key:"_computeDefaultLanguageOptions",value:function(){this._defaultLanguages=Object.keys(f.o.translations)}},{kind:"method",key:"render",value:function(){const e=this._getLanguagesOptions(this.languages??this._defaultLanguages,this.nativeName,this.noSort,this.hass?.locale),t=this.value??(this.required?e[0]?.value:this.value);return r.dy` <ha-select .label="${this.label??(this.hass?.localize("ui.components.language-picker.language")||"Language")}" .value="${t||""}" .required="${this.required}" .disabled="${this.disabled}" ="${this._changed}" ="${h.U}" fixedMenuPosition naturalMenuWidth .inlineArrow="${this.inlineArrow}"> ${0===e.length?r.dy`<ha-list-item value="">${this.hass?.localize("ui.components.language-picker.no_languages")||"No languages"}</ha-list-item>`:e.map((e=>r.dy` <ha-list-item .value="${e.value}">${e.label}</ha-list-item> `))} </ha-select> `}},{kind:"field",static:!0,key:"styles",value:()=>r.iv`ha-select{width:100%}`},{kind:"method",key:"_changed",value:function(e){const t=e.target;""!==t.value&&t.value!==this.value&&(this.value=t.value,(0,c.B)(this,"value-changed",{value:this.value}))}}]}}),r.oi);a()}catch(e){a(e)}}))},43344:function(e,t,i){var a=i(44249),n=i(72621),s=i(57243),o=i(15093),r=i(36522),d=i(83716);i(23334);(0,a.Z)([(0,o.Mo)("ha-menu-button")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"hassio",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_hasNotifications",value:()=>!1},{kind:"field",decorators:[(0,o.SB)()],key:"_show",value:()=>!1},{kind:"field",key:"_alwaysVisible",value:()=>!1},{kind:"field",key:"_attachNotifOnConnect",value:()=>!1},{kind:"field",key:"_unsubNotifications",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}},{kind:"method",key:"render",value:function(){if(!this._show)return s.Ld;const e=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return s.dy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${"M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z"}" ="${this._toggleMenu}"></ha-icon-button> ${e?s.dy`<div class="dot"></div>`:""} `}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),this.hassio&&(this._alwaysVisible=(Number(window.parent.frontendVersion)||0)<20190710)}},{kind:"method",key:"willUpdate",value:function(e){if((0,n.Z)(i,"willUpdate",this,3)([e]),!e.has("narrow")&&!e.has("hass"))return;const t=e.has("hass")?e.get("hass"):this.hass,a=(e.has("narrow")?e.get("narrow"):this.narrow)||"always_hidden"===t?.dockedSidebar,s=this.narrow||"always_hidden"===this.hass.dockedSidebar;this.hasUpdated&&a===s||(this._show=s||this._alwaysVisible,s?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}},{kind:"method",key:"_subscribeNotifications",value:function(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,d.r)(this.hass.connection,(e=>{this._hasNotifications=e.length>0}))}},{kind:"method",key:"_toggleMenu",value:function(){(0,r.B)(this,"hass-toggle-menu")}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:50%;border:2px solid var(--app-header-background-color)}`}]}}),s.oi)},74421:function(e,t,i){var a=i(44249),n=i(72621),s=i(31875),o=i(57243),r=i(15093),d=i(5111);(0,a.Z)([(0,r.Mo)("ha-slider")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this.dir=d.E.document.dir}},{kind:"field",static:!0,key:"styles",value(){return[...(0,n.Z)(i,"styles",this),o.iv`:host{--md-sys-color-primary:var(--primary-color);--md-sys-color-on-primary:var(--text-primary-color);--md-sys-color-outline:var(--outline-color);--md-sys-color-on-surface:var(--primary-text-color);--md-slider-handle-width:14px;--md-slider-handle-height:14px;--md-slider-state-layer-size:24px;min-width:100px;min-inline-size:100px;width:200px}`]}}]}}),s.$)},37583:function(e,t,i){i.r(t),i.d(t,{HaSvgIcon:()=>o});var a=i(44249),n=i(57243),s=i(15093);let o=(0,a.Z)([(0,s.Mo)("ha-svg-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"secondaryPath",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"viewBox",value:void 0},{kind:"method",key:"render",value:function(){return n.YP` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?n.YP`<path class="primary-path" d="${this.path}"></path>`:n.Ld} ${this.secondaryPath?n.YP`<path class="secondary-path" d="${this.secondaryPath}"></path>`:n.Ld} </g> </svg>`}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`}]}}),n.oi)},83166:function(e,t,i){var a=i(44249),n=i(72621),s=i(1105),o=i(33990),r=i(57243),d=i(15093),l=i(5111);(0,a.Z)([(0,d.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,d.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(e){(0,n.Z)(i,"updated",this,3)([e]),(e.has("invalid")||e.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||e.has("invalid")&&void 0!==e.get("invalid"))&&this.reportValidity()),e.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),e.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),e.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(e,t=!1){const i=t?"trailing":"leading";return r.dy` <span class="mdc-text-field__icon mdc-text-field__icon--${i}" tabindex="${t?1:-1}"> <slot name="${i}Icon"></slot> </span> `}},{kind:"field",static:!0,key:"styles",value:()=>[o.W,r.iv`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}input[type=color]{height:20px}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=color]::-webkit-color-swatch-wrapper{padding:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}#helper-text ha-markdown{display:inline-block}`,"rtl"===l.E.document.dir?r.iv`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}`:r.iv``]}]}}),s.P)},85366:function(e,t,i){var a=i(44249),n=i(82238),s=i(66575),o=i(57243),r=i(15093);(0,a.Z)([(0,r.Mo)("ha-top-app-bar-fixed")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[s.W,o.iv`.mdc-top-app-bar__row{height:var(--header-height);border-bottom:var(--app-header-border-bottom)}.mdc-top-app-bar--fixed-adjust{padding-top:var(--header-height)}.mdc-top-app-bar{--mdc-typography-headline6-font-weight:400;color:var(--app-header-text-color,var(--mdc-theme-on-primary,#fff));background-color:var(--app-header-background-color,var(--mdc-theme-primary))}.mdc-top-app-bar__title{font-size:20px;padding-inline-start:24px;padding-inline-end:initial}`]}]}}),n.s)},43546:function(e,t,i){i.d(t,{Cp:()=>o,TZ:()=>r,W2:()=>s,YY:()=>l,iI:()=>n,j2:()=>d,oT:()=>a});i(9359),i(70104);const a=e=>e.map((e=>{if("string"!==e.type)return e;switch(e.name){case"username":return{...e,autocomplete:"username",autofocus:!0};case"password":return{...e,autocomplete:"current-password"};case"code":return{...e,autocomplete:"one-time-code",autofocus:!0};default:return e}})),n=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),s=async(e,t,i,a)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:i,password:a}),o=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:i}),r=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:i}),d=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:i}),l=(e,t,i)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:i})},83716:function(e,t,i){i.d(t,{r:()=>a});const a=(e,t)=>{const i=new n,a=e.subscribeMessage((e=>t(i.processMessage(e))),{type:"persistent_notification/subscribe"});return()=>{a.then((e=>e?.()))}};class n{constructor(){this.notifications=void 0,this.notifications={}}processMessage(e){if("removed"===e.type)for(const t of Object.keys(e.notifications))delete this.notifications[t];else this.notifications={...this.notifications,...e.notifications};return Object.values(this.notifications)}}},6736:function(e,t,i){i.d(t,{f:()=>o});var a=i(44249),n=i(72621),s=(i(9359),i(52924),i(15093));const o=e=>(0,a.Z)(null,(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",key:"hassSubscribeRequiredHostProps",value:void 0},{kind:"field",key:"__unsubs",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._checkSubscribed()}},{kind:"method",key:"disconnectedCallback",value:function(){if((0,n.Z)(i,"disconnectedCallback",this,3)([]),this.__unsubs){for(;this.__unsubs.length;){const e=this.__unsubs.pop();e instanceof Promise?e.then((e=>e())):e()}this.__unsubs=void 0}}},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([e]),e.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const t of e.keys())if(this.hassSubscribeRequiredHostProps.includes(t))return void this._checkSubscribed()}},{kind:"method",key:"hassSubscribe",value:function(){return[]}},{kind:"method",key:"_checkSubscribed",value:function(){void 0===this.__unsubs&&this.isConnected&&void 0!==this.hass&&!this.hassSubscribeRequiredHostProps?.some((e=>void 0===this[e]))&&(this.__unsubs=this.hassSubscribe())}}]}}),e)},1490:function(e,t,i){var a=i(44249),n=i(72621),s=i(57243),o=i(15093);(0,a.Z)([(0,o.Mo)("hui-marquee")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)()],key:"text",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"active",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({reflect:!0,type:Boolean})],key:"animating",value:()=>!1},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),this.addEventListener("mouseover",(()=>this.classList.add("hovering")),{capture:!0}),this.addEventListener("mouseout",(()=>this.classList.remove("hovering")))}},{kind:"method",key:"updated",value:function(e){(0,n.Z)(i,"updated",this,3)([e]),e.has("text")&&this.animating&&(this.animating=!1),e.has("active")&&this.active&&this.offsetWidth<this.scrollWidth&&(this.animating=!0)}},{kind:"method",key:"render",value:function(){return this.text?s.dy` <div class="marquee-inner" ="${this._onIteration}"> <span>${this.text}</span> ${this.animating?s.dy` <span>${this.text}</span> `:""} </div> `:s.Ld}},{kind:"method",key:"_onIteration",value:function(){this.active||(this.animating=!1)}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{display:flex;position:relative;align-items:center;height:1.2em;contain:strict}.marquee-inner{position:absolute;left:0;right:0;text-overflow:ellipsis;overflow:hidden}:host(.hovering) .marquee-inner{text-overflow:initial;overflow:initial}:host([animating]) .marquee-inner{left:initial;right:initial;animation:marquee 10s linear infinite}:host([animating]) .marquee-inner span{padding-right:16px;padding-inline-end:16px;padding-inline-start:initial} marquee{0%{transform:translateX(0%)}100%{transform:translateX(-50%)}}`}]}}),s.oi)},9694:function(e,t,i){i.d(t,{B:()=>n,V:()=>s});var a=i(89890);const n="Unsupported Media";class s{constructor(e,t,i,a,s){this.hass=e,this.item=t,this.resolved=i,this.onChange=s,this.player=void 0,this.buffering=!0,this._removed=!1,this._handleChange=()=>{this._removed||this.onChange()};const o=new Audio(this.resolved.url);if(""===o.canPlayType(i.mime_type))throw new Error(n);o.autoplay=!0,o.volume=a,o.addEventListener("play",this._handleChange),o.addEventListener("playing",(()=>{this.buffering=!1,this._handleChange()})),o.addEventListener("pause",this._handleChange),o.addEventListener("ended",this._handleChange),o.addEventListener("canplaythrough",this._handleChange),this.player=o}pause(){this.buffering=!1,this.player.pause()}play(){this.player.play()}setVolume(e){this.player.volume=e,this.onChange()}remove(){this._removed=!0,this.onChange=void 0,this.player&&this.player.pause()}static idleStateObj(){const e=(new Date).toISOString();return{state:"idle",entity_id:a.N8,last_changed:e,last_updated:e,attributes:{},context:{id:"",user_id:null,parent_id:null}}}toStateObj(){const e=s.idleStateObj();return e.state=this.buffering?"buffering":this.player.paused||this.player.ended?"paused":"playing",e.attributes={media_title:this.item.title,entity_picture:this.item.thumbnail,volume_level:this.player.volume,supported_features:a.yZ.PLAY|a.yZ.PAUSE|a.yZ.VOLUME_SET},this.player.duration&&(e.attributes.media_duration=this.player.duration,e.attributes.media_position=this.player.currentTime,e.attributes.media_position_updated_at=e.last_updated),e}}},12494:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),n=i(72621),s=(i(9359),i(56475),i(70104),i(24427),i(57243)),o=i(15093),r=i(35359),d=i(94571),l=i(36522),c=i(73850),h=i(59847),u=i(47194),p=i(75278),f=i(22381),v=(i(74421),i(59826),i(34273),i(17170)),m=i(33067),y=(i(23334),i(7285),i(51223)),g=(i(37583),i(96194)),b=i(89890),_=i(76131),k=i(6736),w=(i(1490),i(9694)),x=e([v,m,y]);[v,m,y]=x.then?(await x)():x;const $="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",C="M21,16H3V4H21M21,2H3C1.89,2 1,2.89 1,4V16A2,2 0 0,0 3,18H10V20H8V22H16V20H14V18H21A2,2 0 0,0 23,16V4C23,2.89 22.1,2 21,2Z",I="M14,19H18V5H14M6,19H10V5H6V19Z",M="M8,5.14V19.14L19,12.14L8,5.14Z",V="M3,5V19L11,12M13,19H16V5H13M18,5V19H21V5",H="M18,18H6V6H18V18Z",P="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z";(0,a.Z)([(0,o.Mo)("ha-bar-media-player")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"entityId",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,o.IO)("mwc-linear-progress")],key:"_progressBar",value:void 0},{kind:"field",decorators:[(0,o.IO)("#CurrentProgress")],key:"_currentProgress",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_marqueeActive",value:()=>!1},{kind:"field",decorators:[(0,o.SB)()],key:"_newMediaExpected",value:()=>!1},{kind:"field",decorators:[(0,o.SB)()],key:"_browserPlayer",value:void 0},{kind:"field",key:"_progressInterval",value:void 0},{kind:"field",key:"_browserPlayerVolume",value:()=>.8},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]);const e=this._stateObj;e&&!this._progressInterval&&this._showProgressBar&&"playing"===e.state&&(this._progressInterval=window.setInterval((()=>this._updateProgressBar()),1e3))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._progressInterval&&(clearInterval(this._progressInterval),this._progressInterval=void 0),this._tearDownBrowserPlayer()}},{kind:"method",key:"showResolvingNewMediaPicked",value:function(){this._tearDownBrowserPlayer(),this._newMediaExpected=!0,this._debouncedResetMediaExpected()}},{kind:"field",key:"_debouncedResetMediaExpected",value(){return(0,f.D)((()=>{this._newMediaExpected=!1}),2e3)}},{kind:"method",key:"hideResolvingNewMediaPicked",value:function(){this._newMediaExpected=!1}},{kind:"method",key:"playItem",value:function(e,t){if(this.entityId!==b.N8)throw Error("Only browser supported");this._tearDownBrowserPlayer();try{this._browserPlayer=new w.V(this.hass,e,t,this._browserPlayerVolume,(()=>this.requestUpdate("_browserPlayer")))}catch(e){if(e.message!==w.B)throw e;(0,_.showAlertDialog)(this,{text:this.hass.localize("ui.components.media-browser.media_not_supported")})}this._newMediaExpected=!1}},{kind:"method",key:"render",value:function(){if(this._newMediaExpected)return s.dy` <div class="controls-progress buffering"> ${(0,d.C)(new Promise((e=>{setTimeout(e,500)})).then((()=>s.dy`<ha-spinner></ha-spinner>`)))} </div> `;const e=this.entityId===b.N8,t=this._stateObj;if(!t)return this._renderChoosePlayer(t);const i=this.narrow?"playing"===t.state&&((0,p.e)(t,b.yZ.PAUSE)||(0,p.e)(t,b.yZ.STOP))||("paused"===t.state||"idle"===t.state)&&(0,p.e)(t,b.yZ.PLAY)||"on"===t.state&&((0,p.e)(t,b.yZ.PLAY)||(0,p.e)(t,b.yZ.PAUSE))?[{icon:"on"===t.state?V:"playing"!==t.state?M:(0,p.e)(t,b.yZ.PAUSE)?I:H,action:"playing"!==t.state?"media_play":(0,p.e)(t,b.yZ.PAUSE)?"media_pause":"media_stop"}]:void 0:(0,b.xt)(t,!0),a=(0,b.Mj)(t),n=(0,b.DQ)(t.attributes.media_duration),o=(0,b.WL)(t.attributes.media_title||t.attributes.media_content_id),l=t.attributes.entity_picture_local||t.attributes.entity_picture;return s.dy` <div class="${(0,r.$)({info:!0,pointer:!e,app:"app"===this._browserPlayer?.item.media_class})}" ="${this._openMoreInfo}"> ${l?s.dy`<img alt="" src="${this.hass.hassUrl(l)}">`:""} <div class="media-info"> <hui-marquee .text="${o||a||("playing"!==t.state&&"on"!==t.state?this.hass.localize("ui.card.media_player.nothing_playing"):"")}" .active="${this._marqueeActive}" ="${this._marqueeMouseOver}" ="${this._marqueeMouseLeave}"></hui-marquee> <span class="secondary"> ${o?a:""} </span> </div> </div> <div class="controls-progress ${"buffering"===t.state?"buffering":""}"> ${"buffering"===t.state?s.dy`<ha-spinner></ha-spinner> `:s.dy` <div class="controls"> ${void 0===i?"":i.map((e=>s.dy` <ha-icon-button .label="${this.hass.localize(`ui.card.media_player.${e.action}`)}" .path="${e.icon}" action="${e.action}" ="${this._handleControlClick}"> </ha-icon-button> `))} </div> ${t.attributes.media_duration===1/0?s.Ld:this.narrow?s.dy`<mwc-linear-progress></mwc-linear-progress>`:s.dy` <div class="progress"> <div id="CurrentProgress"></div> <mwc-linear-progress wide></mwc-linear-progress> <div>${n}</div> </div> `} `} </div> ${this._renderChoosePlayer(t)} `}},{kind:"method",key:"_renderChoosePlayer",value:function(e){const t=this.entityId===b.N8;return s.dy` <div class="choose-player ${t?"browser":""}"> ${!this.narrow&&e&&(0,p.e)(e,b.yZ.VOLUME_SET)?s.dy` <ha-button-menu y="0" x="76"> <ha-icon-button slot="trigger" .path="${P}"></ha-icon-button> <ha-slider labeled min="0" max="100" step="1" .value="${100*e.attributes.volume_level}" ="${this._handleVolumeChange}"> </ha-slider> </ha-button-menu> `:""} <ha-button-menu> ${this.narrow?s.dy` <ha-icon-button slot="trigger"> ${this._renderIcon(t,e)} </ha-icon-button> `:s.dy` <ha-button slot="trigger" .label="${this.narrow?s.Ld:`${e?(0,u.C)(e):this.entityId}\n `}"> <span slot="icon"> ${this._renderIcon(t,e)} </span> <ha-svg-icon slot="trailingIcon" .path="${$}"></ha-svg-icon> </ha-button> `} <ha-list-item .player="${b.N8}" ?selected="${t}" ="${this._selectPlayer}"> ${this.hass.localize("ui.components.media-browser.web-browser")} </ha-list-item> ${this._mediaPlayerEntities.map((e=>s.dy` <ha-list-item ?selected="${e.entity_id===this.entityId}" .disabled="${e.state===g.nZ}" .player="${e.entity_id}" ="${this._selectPlayer}"> ${(0,u.C)(e)} </ha-list-item> `))} </ha-button-menu> </div> `}},{kind:"method",key:"_renderIcon",value:function(e,t){return e?s.dy`<ha-svg-icon .path="${C}"></ha-svg-icon>`:t?s.dy` <ha-state-icon .hass="${this.hass}" .stateObj="${t}"></ha-state-icon> `:s.dy` <ha-domain-icon .hass="${this.hass}" .domain="${(0,c.M)(this.entityId)}"></ha-domain-icon> `}},{kind:"method",key:"willUpdate",value:function(e){if((0,n.Z)(i,"willUpdate",this,3)([e]),e.has("entityId")&&this._tearDownBrowserPlayer(),!e.has("hass")||this.entityId===b.N8)return;const t=e.get("hass");t&&t.states[this.entityId]===this.hass.states[this.entityId]||(this._newMediaExpected=!1)}},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([e]),this.entityId===b.N8){if(!e.has("_browserPlayer"))return}else{const t=e.get("hass");if(t&&t.states[this.entityId]===this._stateObj)return}const t=this._stateObj;this._updateProgressBar(),!this._progressInterval&&this._showProgressBar&&"playing"===t?.state?this._progressInterval=window.setInterval((()=>this._updateProgressBar()),1e3):!this._progressInterval||this._showProgressBar&&"playing"===t?.state||(clearInterval(this._progressInterval),this._progressInterval=void 0)}},{kind:"get",key:"_stateObj",value:function(){return this.entityId===b.N8?this._browserPlayer?this._browserPlayer.toStateObj():w.V.idleStateObj():this.hass.states[this.entityId]}},{kind:"method",key:"_tearDownBrowserPlayer",value:function(){this._browserPlayer&&(this._browserPlayer.remove(),this._browserPlayer=void 0)}},{kind:"method",key:"_openMoreInfo",value:function(){this.entityId!==b.N8&&(0,l.B)(this,"hass-more-info",{entityId:this.entityId})}},{kind:"get",key:"_showProgressBar",value:function(){if(!this.hass)return!1;const e=this._stateObj;return e&&("playing"===e.state||"paused"===e.state)&&"media_duration"in e.attributes&&"media_position"in e.attributes}},{kind:"get",key:"_mediaPlayerEntities",value:function(){return Object.values(this.hass.states).filter((e=>"media_player"===(0,h.N)(e)&&(0,p.e)(e,b.yZ.BROWSE_MEDIA)&&!this.hass.entities[e.entity_id]?.hidden))}},{kind:"method",key:"_updateProgressBar",value:function(){const e=this._stateObj;if(!this._progressBar||!this._currentProgress||!e)return;if(!e.attributes.media_duration)return this._progressBar.progress=0,void(this._currentProgress.innerHTML="");const t=(0,b.rs)(e);this._progressBar.progress=t/e.attributes.media_duration,this._currentProgress&&(this._currentProgress.innerHTML=(0,b.DQ)(t))}},{kind:"method",key:"_handleControlClick",value:function(e){const t=e.currentTarget.getAttribute("action");this._browserPlayer?"media_pause"===t?this._browserPlayer.pause():"media_play"===t&&this._browserPlayer.play():(0,b.kr)(this.hass,this._stateObj,e.currentTarget.getAttribute("action"))}},{kind:"method",key:"_marqueeMouseOver",value:function(){this._marqueeActive||(this._marqueeActive=!0)}},{kind:"method",key:"_marqueeMouseLeave",value:function(){this._marqueeActive&&(this._marqueeActive=!1)}},{kind:"method",key:"_selectPlayer",value:function(e){const t=e.currentTarget.player;(0,l.B)(this,"player-picked",{entityId:t})}},{kind:"method",key:"_handleVolumeChange",value:async function(e){e.stopPropagation();const t=Number(e.target.value)/100;this._browserPlayer?(this._browserPlayerVolume=t,this._browserPlayer.setVolume(t)):await(0,b.fI)(this.hass,this.entityId,t)}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{display:flex;height:100px;box-sizing:border-box;background:var(--ha-card-background,var(--card-background-color,#fff));border-top:1px solid var(--divider-color);padding-bottom:env(safe-area-inset-bottom)}mwc-linear-progress{width:100%;padding:0 4px;--mdc-theme-primary:var(--secondary-text-color)}ha-button-menu ha-button[slot=trigger]{line-height:1;--mdc-theme-primary:var(--primary-text-color);--mdc-icon-size:16px}.info{flex:1;display:flex;align-items:center;width:100%;margin-right:16px;margin-inline-end:16px;margin-inline-start:initial;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pointer{cursor:pointer}.progress,.secondary{color:var(--secondary-text-color)}.choose-player{flex:1;display:flex;justify-content:flex-end;align-items:center;padding:16px}.controls{height:48px;padding-bottom:4px}.controls-progress{flex:2;display:flex;align-items:center;justify-content:center;flex-direction:column;direction:ltr}.progress{display:flex;width:100%;align-items:center}mwc-linear-progress[wide]{margin:0 4px}.media-info{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:16px;padding-inline-start:16px;padding-inline-end:initial;width:100%}hui-marquee{font-size:1.2em;margin:0px 0 4px}img{height:100%}.app img{height:68px;margin:16px 0 16px 16px}:host([narrow]){height:57px}:host([narrow]) .controls-progress{flex:unset;min-width:48px}:host([narrow]) .controls-progress.buffering{flex:1}:host([narrow]) .media-info{padding-left:8px;padding-inline-start:8px;padding-inline-end:initial}:host([narrow]) .controls{display:flex;padding-bottom:0;--mdc-icon-size:30px}:host([narrow]) .choose-player{padding-left:0;padding-right:8px;padding-inline-start:0;padding-inline-end:8px;min-width:48px;flex:unset;justify-content:center}:host([narrow]) .choose-player.browser{justify-content:flex-end}:host([narrow]) mwc-linear-progress{padding:0;position:absolute;top:-4px;left:0}ha-list-item[selected]{font-weight:700}span[slot=icon]{display:flex;align-items:center}ha-svg-icon[slot=trailingIcon]{margin-inline-start:8px!important;margin-inline-end:0px!important;direction:var(--direction)}`}]}}),(0,k.f)(s.oi));t()}catch(e){t(e)}}))},3880:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var n=i(44249),s=i(72621),o=(i(9359),i(70104),i(31622),i(57243)),r=i(15093),d=i(68958),l=i(36522),c=i(83523),h=(i(43344),i(23334),i(54202),i(10177)),u=(i(32101),i(89890)),p=i(1079),f=i(28008),v=i(12494),m=i(70217),y=i(76131),g=i(99650),b=(i(85366),e([h,v]));[h,v]=b.then?(await b)():b;const _="M10,4V8H14V4H10M16,4V8H20V4H16M16,10V14H20V10H16M16,16V20H20V16H16M14,20V16H10V20H14M8,20V16H4V20H8M8,14V10H4V14H8M8,8V4H4V8H8M10,14H14V10H10V14M4,2H20A2,2 0 0,1 22,4V20A2,2 0 0,1 20,22H4C2.92,22 2,21.1 2,20V4A2,2 0 0,1 4,2Z",k="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z",w="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",x="M3,5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V5M5,5V19H19V5H5M11,7H13A2,2 0 0,1 15,9V17H13V13H11V17H9V9A2,2 0 0,1 11,7M11,9V11H13V9H11Z",$="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",C=(e,t)=>{let i=`/media-browser/${e}`;for(const e of t.slice(1))i+="/"+encodeURIComponent(`${e.media_content_type},${e.media_content_id}`);return i};(0,n.Z)([(0,r.Mo)("ha-panel-media-browser")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,reflect:!0})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_currentItem",value:void 0},{kind:"field",decorators:[(0,d.t)({key:"mediaBrowserPreferredLayout",state:!0,subscribe:!1})],key:"_preferredLayout",value:()=>"auto"},{kind:"field",key:"_navigateIds",value:()=>[{media_content_id:void 0,media_content_type:void 0}]},{kind:"field",decorators:[(0,d.t)({key:"mediaBrowseEntityId",state:!0,subscribe:!1})],key:"_entityId",value:()=>u.N8},{kind:"field",decorators:[(0,r.IO)("ha-media-player-browse")],key:"_browser",value:void 0},{kind:"field",decorators:[(0,r.IO)("ha-bar-media-player")],key:"_player",value:void 0},{kind:"method",key:"render",value:function(){return o.dy` <ha-top-app-bar-fixed> ${this._navigateIds.length>1?o.dy` <ha-icon-button-arrow-prev slot="navigationIcon" .path="${w}" ="${this._goBack}"></ha-icon-button-arrow-prev> `:o.dy` <ha-menu-button slot="navigationIcon" .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `} <div slot="title"> ${this._currentItem?this._currentItem.title:this.hass.localize("ui.components.media-browser.media-player-browser")} </div> <ha-media-manage-button slot="actionItems" .hass="${this.hass}" .currentItem="${this._currentItem}" -refresh="${this._refreshMedia}"></ha-media-manage-button> <ha-button-menu slot="actionItems" ="${this._handleMenuAction}"> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${$}"></ha-icon-button> <mwc-list-item graphic="icon"> ${this.hass.localize("ui.components.media-browser.auto")} <ha-svg-icon class="${"auto"===this._preferredLayout?"selected_menu_item":""}" slot="graphic" .path="${x}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon"> ${this.hass.localize("ui.components.media-browser.grid")} <ha-svg-icon class="${"grid"===this._preferredLayout?"selected_menu_item":""}" slot="graphic" .path="${_}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon"> ${this.hass.localize("ui.components.media-browser.list")} <ha-svg-icon slot="graphic" class="${"list"===this._preferredLayout?"selected_menu_item":""}" .path="${k}"></ha-svg-icon> </mwc-list-item> </ha-button-menu> <ha-media-player-browse .hass="${this.hass}" .entityId="${this._entityId}" .navigateIds="${this._navigateIds}" .preferredLayout="${this._preferredLayout}" -picked="${this._mediaPicked}" -browsed="${this._mediaBrowsed}"></ha-media-player-browse> </ha-top-app-bar-fixed> <ha-bar-media-player .hass="${this.hass}" .entityId="${this._entityId}" .narrow="${this.narrow}" -picked="${this._playerPicked}"></ha-bar-media-player> `}},{kind:"method",key:"_handleMenuAction",value:async function(e){switch(e.detail.index){case 0:this._preferredLayout="auto";break;case 1:this._preferredLayout="grid";break;case 2:this._preferredLayout="list"}}},{kind:"method",key:"willUpdate",value:function(e){if((0,s.Z)(i,"willUpdate",this,3)([e]),!e.has("route"))return;if(""===this.route.path)return void(0,c.c)(`/media-browser/${this._entityId}`,{replace:!0});const[t,...a]=this.route.path.substring(1).split("/");if(t!==this._entityId){if(t!==u.N8&&void 0===this.hass.states[t])return(0,c.c)(`/media-browser/${u.N8}`,{replace:!0}),void(0,y.showAlertDialog)(this,{text:this.hass.localize("ui.panel.media-browser.error.player_not_exist",{name:t})});this._entityId=t}this._navigateIds=[{media_content_type:void 0,media_content_id:void 0},...a.map((e=>{const t=decodeURIComponent(e),i=t.indexOf(",");return{media_content_type:t.substring(0,i),media_content_id:t.substring(i+1)}}))],this._currentItem=void 0}},{kind:"method",key:"_goBack",value:function(){(0,c.c)(C(this._entityId,this._navigateIds.slice(0,-1)))}},{kind:"method",key:"_mediaBrowsed",value:function(e){e.detail.ids!==this._navigateIds?(0,c.c)(C(this._entityId,e.detail.ids),{replace:e.detail.replace}):this._currentItem=e.detail.current}},{kind:"method",key:"_mediaPicked",value:async function(e){const t=e.detail.item;if(this._entityId!==u.N8){this._player.showResolvingNewMediaPicked();try{await(0,u.qV)(this.hass,this._entityId,t.media_content_id,t.media_content_type)}catch(e){this._player.hideResolvingNewMediaPicked()}return}if((0,g.B)(t.media_content_id))return void(0,l.B)(this,"hass-more-info",{entityId:(0,g.zj)(t.media_content_id)});let i;this._player.showResolvingNewMediaPicked();try{i=await(0,p.uy)(this.hass,t.media_content_id)}catch(e){return(0,y.showAlertDialog)(this,{title:this.hass.localize("ui.components.media-browser.media_browsing_error"),text:e.message}),void this._player.hideResolvingNewMediaPicked()}i.mime_type.startsWith("audio/")?this._player.playItem(t,i):((0,m.I)(this,{sourceUrl:i.url,sourceType:i.mime_type,title:t.title,can_play:t.can_play}),this._player.hideResolvingNewMediaPicked())}},{kind:"method",key:"_playerPicked",value:function(e){const t=e.detail.entityId;t!==this._entityId&&(0,c.c)(C(t,this._navigateIds))}},{kind:"method",key:"_refreshMedia",value:function(){this._browser.refresh()}},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,o.iv`ha-media-manage-button{--mdc-theme-primary:var(--app-header-text-color)}ha-media-player-browse{height:calc(100vh - (100px + var(--header-height)))}:host([narrow]) ha-media-player-browse{height:calc(100vh - (57px + var(--header-height)))}.selected_menu_item{color:var(--primary-color)}ha-bar-media-player{position:fixed;width:var(--mdc-top-app-bar-width,100%)}`]}}]}}),o.oi);a()}catch(e){a(e)}}))},70217:function(e,t,i){i.d(t,{I:()=>n});var a=i(36522);const n=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"hui-dialog-web-browser-play-media",dialogImport:()=>Promise.all([i.e("97983"),i.e("55964")]).then(i.bind(i,5486)),dialogParams:t})}}};
//# sourceMappingURL=70889.705690b5fb914361.js.map