iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
6 lines • 36.6 kB
JavaScript
/*! For license information please see 74427.cdb0c8bbdf3b0723.js.LICENSE.txt */
export const __webpack_ids__=["74427"];export const __webpack_modules__={88618:function(e,t,i){i.d(t,{Wg:()=>d,qN:()=>r.q});var a,n,o=i(9065),s=i(15093),r=i(11911);const l=null!==(n=null===(a=window.ShadyDOM)||void 0===a?void 0:a.inUse)&&void 0!==n&&n;class d extends r.H{constructor(){super(...arguments),this.disabled=!1,this.containingForm=null,this.formDataListener=e=>{this.disabled||this.setFormData(e.formData)}}findFormElement(){if(!this.shadowRoot||l)return null;const e=this.getRootNode().querySelectorAll("form");for(const t of Array.from(e))if(t.contains(this))return t;return null}connectedCallback(){var e;super.connectedCallback(),this.containingForm=this.findFormElement(),null===(e=this.containingForm)||void 0===e||e.addEventListener("formdata",this.formDataListener)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.containingForm)||void 0===e||e.removeEventListener("formdata",this.formDataListener),this.containingForm=null}click(){this.formElement&&!this.disabled&&(this.formElement.focus(),this.formElement.click())}firstUpdated(){super.firstUpdated(),this.shadowRoot&&this.mdcRoot.addEventListener("change",(e=>{this.dispatchEvent(new Event("change",e))}))}}d.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,o.__decorate)([(0,s.Cb)({type:Boolean})],d.prototype,"disabled",void 0)},72344:function(e,t,i){i.d(t,{p:()=>a});const a=(e,t)=>e&&e.config.components.includes(t)},73358:function(e,t,i){i.d(t,{AF:()=>s,Kk:()=>c,PS:()=>a,a5:()=>o,gD:()=>g,iY:()=>u,lC:()=>d,ot:()=>h,tj:()=>r,uo:()=>l,zF:()=>n});i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);const a=66977!=i.j?["alert","button","climate","cover","configurator","event","input_button","input_select","input_number","input_text","humidifier","lawn_mower","lock","media_player","number","scene","script","select","timer","text","update","vacuum","water_heater"]:null,n=99387==i.j?["sensor","binary_sensor","calendar","camera","device_tracker","image","weather"]:null,o=99387==i.j?["assist_satellite","conversation","stt","tts"]:null,s=["automation","button","cover","date","datetime","fan","group","humidifier","input_boolean","input_button","input_datetime","input_number","input_select","input_text","light","lock","media_player","number","scene","script","select","switch","text","time","vacuum","valve"],r=["closed","locked","off"],l="on",d="off",c=new Set(["fan","input_boolean","light","switch","group","automation","humidifier","valve"]),u=new Set(["camera","image","media_player"]),h="°C",g="°F"},68958:function(e,t,i){i.d(t,{t:()=>o});i(92745),i(9359),i(31526),i(88972);class a{constructor(e=window.localStorage){this.storage=void 0,this._storage={},this._listeners={},this.storage=e,e===window.localStorage&&window.addEventListener("storage",(e=>{e.key&&this.hasKey(e.key)&&(this._storage[e.key]=e.newValue?JSON.parse(e.newValue):e.newValue,this._listeners[e.key]&&this._listeners[e.key].forEach((t=>t(e.oldValue?JSON.parse(e.oldValue):e.oldValue,this._storage[e.key]))))}))}addFromStorage(e){if(!this._storage[e]){const t=this.storage.getItem(e);t&&(this._storage[e]=JSON.parse(t))}}subscribeChanges(e,t){return this._listeners[e]?this._listeners[e].push(t):this._listeners[e]=[t],()=>{this.unsubscribeChanges(e,t)}}unsubscribeChanges(e,t){if(!(e in this._listeners))return;const i=this._listeners[e].indexOf(t);-1!==i&&this._listeners[e].splice(i,1)}hasKey(e){return e in this._storage}getValue(e){return this._storage[e]}setValue(e,t){const i=this._storage[e];this._storage[e]=t;try{void 0===t?this.storage.removeItem(e):this.storage.setItem(e,JSON.stringify(t))}catch(e){}finally{this._listeners[e]&&this._listeners[e].forEach((e=>e(i,t)))}}}const n={},o=e=>t=>{const i=e.storage||"localStorage";let o;i&&i in n?o=n[i]:(o=new a(window[i]),n[i]=o);const s=String(t.key),r=e.key||String(t.key),l=t.initializer?t.initializer():void 0;o.addFromStorage(r);const d=!1!==e.subscribe?e=>o.subscribeChanges(r,((i,a)=>{e.requestUpdate(t.key,i)})):void 0,c=()=>o.hasKey(r)?e.deserializer?e.deserializer(o.getValue(r)):o.getValue(r):l;return{kind:"method",placement:"prototype",key:t.key,descriptor:{set(i){((i,a)=>{let n;e.state&&(n=c()),o.setValue(r,e.serializer?e.serializer(a):a),e.state&&i.requestUpdate(t.key,n)})(this,i)},get:()=>c(),enumerable:!0,configurable:!0},finisher(i){if(e.state&&e.subscribe){const e=i.prototype.connectedCallback,t=i.prototype.disconnectedCallback;i.prototype.connectedCallback=function(){e.call(this),this[`__unbsubLocalStorage${s}`]=d?.(this)},i.prototype.disconnectedCallback=function(){t.call(this),this[`__unbsubLocalStorage${s}`]?.(),this[`__unbsubLocalStorage${s}`]=void 0}}e.state&&i.createProperty(t.key,{noAccessor:!0,...e.stateOptions})}}}},84200:function(e,t,i){i.d(t,{r:()=>n});i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);const a=(e,t,i=true)=>{if(!e||e===document.body)return null;if((e=e.assignedSlot??e).parentElement)e=e.parentElement;else{const t=e.getRootNode();e=t instanceof ShadowRoot?t.host:null}return(i?Object.prototype.hasOwnProperty.call(e,t):e&&t in e)?e:a(e,t,i)},n=(e,t,i=true)=>{const n=new Set;for(;e;)n.add(e),e=a(e,t,i);return n}},81165:function(e,t,i){i.d(t,{j:()=>a});const a=(e=document)=>e.activeElement?.shadowRoot?.activeElement?a(e.activeElement.shadowRoot):e.activeElement},97969:function(e,t,i){i.d(t,{p:()=>a});const a=e=>e.substr(e.indexOf(".")+1)},47194:function(e,t,i){i.d(t,{C:()=>o,a:()=>n});var a=i(97969);const n=(e,t)=>void 0===t.friendly_name?(0,a.p)(e).replace(/_/g," "):(t.friendly_name??"").toString(),o=e=>n(e.entity_id,e.attributes)},22381:function(e,t,i){i.d(t,{D:()=>a});const a=(e,t,i=!1)=>{let a;const n=(...n)=>{const o=i&&!a;clearTimeout(a),a=window.setTimeout((()=>{a=void 0,e(...n)}),t),o&&e(...n)};return n.cancel=()=>{clearTimeout(a)},n}},37394:function(e,t,i){i.d(t,{n:()=>n});class a extends Error{constructor(e,...t){super(...t),this.timeout=void 0,Error.captureStackTrace&&Error.captureStackTrace(this,a),this.name="TimeoutError",this.timeout=e,this.message=`Timed out in ${e} ms.`}}const n=(e,t)=>{const i=new Promise(((t,i)=>{setTimeout((()=>{i(new a(e))}),e)}));return Promise.race([t,i])}},76320:function(e,t,i){i.d(t,{T:()=>a,y:()=>n});const a=e=>{requestAnimationFrame((()=>setTimeout(e,0)))},n=()=>new Promise((e=>{a(e)}))},95198:function(e,t,i){var a=i(44249),n=i(57243),o=i(15093);(0,a.Z)([(0,o.Mo)("ha-dialog-header")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",key:"render",value:function(){return n.dy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> <div class="header-title"> <slot name="title"></slot> </div> <div class="header-subtitle"> <slot name="subtitle"></slot> </div> </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}},{kind:"get",static:!0,key:"styles",value:function(){return[n.iv`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:flex-start;padding:4px;box-sizing:border-box}.header-content{flex:1;padding:10px 4px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{font-size:22px;line-height:28px;font-weight:400}.header-subtitle{font-size:14px;line-height:20px;color:var(--secondary-text-color)}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:12px}}.header-navigation-icon{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}`]}}]}}),n.oi)},73729:function(e,t,i){i.d(t,{i:()=>u});var a=i(44249),n=i(72621),o=i(74966),s=i(51408),r=i(57243),l=i(15093),d=i(76525);i(23334);const c=["button","ha-list-item"],u=(e,t)=>r.dy` <div class="header_title"> <ha-icon-button .label="${e?.localize("ui.common.close")??"Close"}" .path="${"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"}" dialogAction="close" class="header_button"></ha-icon-button> <span>${t}</span> </div> `;(0,a.Z)([(0,l.Mo)("ha-dialog")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:d.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(e,t){this.contentElement?.scrollTo(e,t)}},{kind:"method",key:"renderHeading",value:function(){return r.dy`<slot name="heading"> ${(0,n.Z)(i,"renderHeading",this,3)([])} </slot>`}},{kind:"method",key:"firstUpdated",value:function(){(0,n.Z)(i,"firstUpdated",this,3)([]),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,c].join(", "),this._updateScrolledAttribute(),this.contentElement?.addEventListener("scroll",this._onScroll,{passive:!0})}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this.contentElement.removeEventListener("scroll",this._onScroll)}},{kind:"field",key:"_onScroll",value(){return()=>{this._updateScrolledAttribute()}}},{kind:"method",key:"_updateScrolledAttribute",value:function(){this.contentElement&&this.toggleAttribute("scrolled",0!==this.contentElement.scrollTop)}},{kind:"field",static:!0,key:"styles",value:()=>[s.W,r.iv`:host([scrolled]) ::slotted(ha-dialog-header){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.mdc-dialog{--mdc-dialog-scroll-divider-color:var(
--dialog-scroll-divider-color,
var(--divider-color)
);z-index:var(--dialog-z-index,8);-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));--mdc-dialog-box-shadow:var(--dialog-box-shadow, none);--mdc-typography-headline6-font-weight:400;--mdc-typography-headline6-font-size:1.574rem}.mdc-dialog__actions{justify-content:var(--justify-action-buttons,flex-end);padding-bottom:max(env(safe-area-inset-bottom),24px)}.mdc-dialog__actions span:first-child{flex:var(--secondary-action-button-flex,unset)}.mdc-dialog__actions span:nth-child(2){flex:var(--primary-action-button-flex,unset)}.mdc-dialog__container{align-items:var(--vertical-align-dialog,center)}.mdc-dialog__title{padding:24px 24px 0 24px}.mdc-dialog__title:has(span){padding:12px 12px 0}.mdc-dialog__actions{padding:12px 24px 12px 24px}.mdc-dialog__title::before{content:unset}.mdc-dialog .mdc-dialog__content{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,24px)}:host([hideactions]) .mdc-dialog .mdc-dialog__content{padding-bottom:max(var(--dialog-content-padding,24px),env(safe-area-inset-bottom))}.mdc-dialog .mdc-dialog__surface{position:var(--dialog-surface-position,relative);top:var(--dialog-surface-top);margin-top:var(--dialog-surface-margin-top);min-height:var(--mdc-dialog-min-height,auto);border-radius:var(--ha-dialog-border-radius,28px);-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);background:var(--ha-dialog-surface-background,var(--mdc-theme-surface,#fff))}:host([flexContent]) .mdc-dialog .mdc-dialog__content{display:flex;flex-direction:column}.header_title{display:flex;align-items:center;direction:var(--direction)}.header_title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;padding-left:4px}.header_button{text-decoration:none;color:inherit;inset-inline-start:initial;inset-inline-end:-12px;direction:var(--direction)}.dialog-actions{inset-inline-start:initial!important;inset-inline-end:0px!important;direction:var(--direction)}`]}]}}),o.M)},2790:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaLanguagePicker:()=>v,getLanguageOptions:()=>f});var n=i(44249),o=i(72621),s=i(16485),r=(i(9359),i(70104),i(57243)),l=i(15093),d=i(27486),c=i(36522),u=i(49976),h=i(94369),g=i(1416),p=i(67862),m=(i(7285),i(92824),e([s,h]));[s,h]=m.then?(await m)():m;const f=(e,t,i,a)=>{let n=[];if(t){const t=p.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,h.u)(e,a)}))));return!i&&a&&n.sort(((e,t)=>(0,g.fe)(e.label,t.label,a.language))),n};let v=(0,n.Z)([(0,l.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,l.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Array})],key:"languages",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({attribute:"native-name",type:Boolean})],key:"nativeName",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({attribute:"no-sort",type:Boolean})],key:"noSort",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value:()=>!1},{kind:"field",decorators:[(0,l.SB)()],key:"_defaultLanguages",value:()=>[]},{kind:"field",decorators:[(0,l.IO)("ha-select")],key:"_select",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)(i,"firstUpdated",this,3)([e]),this._computeDefaultLanguageOptions()}},{kind:"method",key:"updated",value:function(e){(0,o.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,d.Z)(f)},{kind:"method",key:"_computeDefaultLanguageOptions",value:function(){this._defaultLanguages=Object.keys(p.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}" @selected="${this._changed}" @closed="${u.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)}}))},83166:function(e,t,i){i.d(t,{f:()=>c});var a=i(44249),n=i(72621),o=i(1105),s=i(33990),r=i(57243),l=i(15093),d=i(5111);let c=(0,a.Z)([(0,l.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,l.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:()=>[s.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"===d.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``]}]}}),o.P)},84961:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var n=i(44249),o=i(57243),s=i(15093),r=i(36522),l=i(28008),d=(i(73729),i(95198),i(32101),i(10177)),c=i(49976),u=e([d]);d=(u.then?(await u)():u)[0];const h="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",g="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",p="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",m="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",f="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",v="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";(0,n.Z)([(0,s.Mo)("dialog-media-player-browse")],(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.SB)()],key:"_currentItem",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_navigateIds",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_preferredLayout",value:()=>"auto"},{kind:"field",decorators:[(0,s.IO)("ha-media-player-browse")],key:"_browser",value:void 0},{kind:"method",key:"showDialog",value:function(e){this._params=e,this._navigateIds=e.navigateIds||[{media_content_id:void 0,media_content_type:void 0}]}},{kind:"method",key:"closeDialog",value:function(){this._params=void 0,this._navigateIds=void 0,this._currentItem=void 0,this._preferredLayout="auto",this.classList.remove("opened"),(0,r.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){return this._params&&this._navigateIds?o.dy` <ha-dialog open scrimClickAction escapeKeyAction hideActions flexContent .heading="${this._currentItem?this._currentItem.title:this.hass.localize("ui.components.media-browser.media-player-browser")}" @closed="${this.closeDialog}" @opened="${this._dialogOpened}"> <ha-dialog-header show-border slot="heading"> ${this._navigateIds.length>(this._params.minimumNavigateLevel??1)?o.dy` <ha-icon-button slot="navigationIcon" .path="${g}" @click="${this._goBack}"></ha-icon-button> `:o.Ld} <span slot="title"> ${this._currentItem?this._currentItem.title:this.hass.localize("ui.components.media-browser.media-player-browser")} </span> <ha-media-manage-button slot="actionItems" .hass="${this.hass}" .currentItem="${this._currentItem}" @media-refresh="${this._refreshMedia}"></ha-media-manage-button> <ha-button-menu slot="actionItems" @action="${this._handleMenuAction}" @closed="${c.U}" fixed> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${m}"></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="${h}"></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="${f}"></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="${v}"></ha-svg-icon> </mwc-list-item> </ha-button-menu> <ha-icon-button .label="${this.hass.localize("ui.common.close")}" .path="${p}" dialogAction="close" slot="actionItems"></ha-icon-button> </ha-dialog-header> <ha-media-player-browse dialog .hass="${this.hass}" .entityId="${this._params.entityId}" .navigateIds="${this._navigateIds}" .action="${this._action}" .preferredLayout="${this._preferredLayout}" @close-dialog="${this.closeDialog}" @media-picked="${this._mediaPicked}" @media-browsed="${this._mediaBrowsed}"></ha-media-player-browse> </ha-dialog> `:o.Ld}},{kind:"method",key:"_dialogOpened",value:function(){this.classList.add("opened")}},{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:"_goBack",value:function(){this._navigateIds=this._navigateIds?.slice(0,-1),this._currentItem=void 0}},{kind:"method",key:"_mediaBrowsed",value:function(e){this._navigateIds=e.detail.ids,this._currentItem=e.detail.current}},{kind:"method",key:"_mediaPicked",value:function(e){this._params.mediaPickedCallback(e.detail),"play"!==this._action&&this.closeDialog()}},{kind:"get",key:"_action",value:function(){return this._params.action||"play"}},{kind:"method",key:"_refreshMedia",value:function(){this._browser.refresh()}},{kind:"get",static:!0,key:"styles",value:function(){return[l.yu,o.iv`ha-dialog{--dialog-z-index:9;--dialog-content-padding:0}ha-media-player-browse{--media-browser-max-height:calc(100vh - 65px)}:host(.opened) ha-media-player-browse{height:calc(100vh - 65px)}@media (min-width:800px){ha-dialog{--mdc-dialog-max-width:800px;--dialog-surface-position:fixed;--dialog-surface-top:40px;--mdc-dialog-max-height:calc(100vh - 72px)}ha-media-player-browse{position:initial;--media-browser-max-height:calc(100vh - 145px);width:700px}}ha-dialog-header ha-media-manage-button{--mdc-theme-primary:var(--primary-text-color);margin:6px;display:block}`]}}]}}),o.oi);a()}catch(e){a(e)}}))},43546:function(e,t,i){i.d(t,{Cp:()=>h,GX:()=>d,PC:()=>r,TZ:()=>g,W2:()=>u,WD:()=>s,YY:()=>m,et:()=>l,iI:()=>o,j2:()=>p,lU:()=>c,oT:()=>n,uw:()=>a});i(9359),i(70104);const a=28639==i.j?`${location.protocol}//${location.host}`:null,n=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}})),o=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),s=()=>fetch("/auth/providers",{credentials:"same-origin"}),r=(e,t,i)=>fetch("/auth/login_flow",{method:"POST",credentials:"same-origin",body:JSON.stringify({client_id:e,handler:i,redirect_uri:t})}),l=(e,t)=>fetch(`/auth/login_flow/${e}`,{method:"POST",credentials:"same-origin",body:JSON.stringify(t)}),d=e=>fetch(`/auth/login_flow/${e}`,{method:"DELETE",credentials:"same-origin"}),c=(e,t,i,a)=>{e.includes("?")?e.endsWith("&")||(e+="&"):e+="?",e+=`code=${encodeURIComponent(t)}`,i&&(e+=`&state=${encodeURIComponent(i)}`),a&&(e+="&storeToken=true"),document.location.assign(e)},u=async(e,t,i,a)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:i,password:a}),h=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:i}),g=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:i}),p=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:i}),m=(e,t,i)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:i})},38042:function(e,t,i){if(i.d(t,{n:()=>n}),66977!=i.j)var a=i(62212);const n=(e,t,i,n,o)=>{const s=`${i}-optimistic`;return{...(0,a._)(t,i,n,(async(e,i)=>{const a=o?o(t,i):void 0;return t[s]=i,()=>{a&&a.then((e=>e())),t[s]=void 0}})),async save(i){const a=t[s];let n;a&&(n=a.state,a.setState(i,!0));try{return await e(t,i)}catch(e){throw a&&a.setState(n,!0),e}}}}},80027:function(e,t,i){if(i.d(t,{DS:()=>o,Fl:()=>n,rP:()=>s,tp:()=>r}),66977!=i.j)var a=i(38042);const n=async(e,t)=>(await e.sendMessagePromise({type:"frontend/get_user_data",key:t})).value,o=async(e,t,i)=>e.sendMessagePromise({type:"frontend/set_user_data",key:t,value:i}),s=(e,t)=>(0,a.n)(((i,a)=>o(e,t,a)),e,`_frontendUserData-${t}`,(()=>n(e,t))),r=(e,t,i)=>s(e,t).subscribe(i)},57816:function(e,t,i){if(i.d(t,{F3:()=>d,H0:()=>r,Lh:()=>l,Mt:()=>u,O:()=>m,RO:()=>g,WH:()=>s,ez:()=>o,t4:()=>c}),99387==i.j)var a=i(62212);if(99387==i.j)var n=i(22381);const o=99387==i.j?{bluetooth:"config/bluetooth",matter:"config/matter",mqtt:"config/mqtt",thread:"config/thread",zha:"config/zha/dashboard",zwave_js:"config/zwave_js/dashboard"}:null;let s=99387==i.j?function(e){return e[e.CRITICAL=50]="CRITICAL",e[e.ERROR=40]="ERROR",e[e.WARNING=30]="WARNING",e[e.INFO=20]="INFO",e[e.DEBUG=10]="DEBUG",e[e.NOTSET=0]="NOTSET",e}({}):null;const r=(e,t)=>t.issue_tracker||`https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+${e}%22`,l=(e,t,i)=>e(`component.${t}.title`)||i?.name||t,d=(e,t)=>{const i={type:"manifest/list"};return t&&(i.integrations=t),e.callWS(i)},c=(e,t)=>e.callWS({type:"manifest/get",integration:t}),u=e=>e.callWS({type:"integration/setup_info"}),h=e=>e.sendMessagePromise({type:"logger/log_info"}),g=(e,t,i,a)=>e.callWS({type:"logger/integration_log_level",integration:t,level:i,persistence:a}),p=(e,t)=>e.subscribeEvents((0,n.D)((()=>h(e).then((e=>t.setState(e,!0)))),200,!0),"logging_changed"),m=(e,t)=>(0,a.B)("_integration_log_info",h,p,e,t)},20382:function(e,t,i){if(i.d(t,{FS:()=>l,Jb:()=>c,Tt:()=>d,c_:()=>s,oJ:()=>u,t6:()=>r,y4:()=>n,zt:()=>o}),66977!=i.j)var a=i(80027);let n=function(e){return e.language="language",e.system="system",e.comma_decimal="comma_decimal",e.decimal_comma="decimal_comma",e.space_comma="space_comma",e.none="none",e}({}),o=function(e){return e.language="language",e.system="system",e.am_pm="12",e.twenty_four="24",e}({}),s=function(e){return e.local="local",e.server="server",e}({}),r=function(e){return e.language="language",e.system="system",e.DMY="DMY",e.MDY="MDY",e.YMD="YMD",e}({}),l=function(e){return e.language="language",e.monday="monday",e.tuesday="tuesday",e.wednesday="wednesday",e.thursday="thursday",e.friday="friday",e.saturday="saturday",e.sunday="sunday",e}({});const d=e=>(0,a.Fl)(e.connection,"language"),c=(e,t)=>(0,a.DS)(e.connection,"language",t),u=async(e,t,i,a,n)=>(await e.callWS({type:"frontend/get_translations",language:t,category:i,integration:a,config_flow:n})).resources},76131:function(e,t,i){i.r(t),i.d(t,{loadGenericDialog:()=>n,showAlertDialog:()=>s,showConfirmationDialog:()=>r,showPromptDialog:()=>l});var a=i(36522);const n=()=>Promise.all([i.e("46379"),i.e("66031"),i.e("25618"),i.e("7442"),i.e("73201"),i.e("19145")]).then(i.bind(i,79740)),o=(e,t,i)=>new Promise((o=>{const s=t.cancel,r=t.confirm;(0,a.B)(e,"show-dialog",{dialogTag:"dialog-box",dialogImport:n,dialogParams:{...t,...i,cancel:()=>{o(!!i?.prompt&&null),s&&s()},confirm:e=>{o(!i?.prompt||e),r&&r(e)}}})})),s=(e,t)=>o(e,t),r=(e,t)=>o(e,t,{confirmation:!0}),l=(e,t)=>o(e,t,{prompt:!0})},76525:function(e,t,i){i.d(t,{L$:()=>h,gA:()=>d,lD:()=>m,ts:()=>g,vC:()=>c});i(92745);var a=i(5111),n=i(84200);if(66977!=i.j)var o=i(81165);if(66977!=i.j)var s=i(76320);const r={},l=[],d=Symbol.for("HA focus target"),c=async(e,t,i,s,u,h=!0)=>{if(!(i in r)){if(!u)return!1;r[i]={element:u().then((()=>{const t=document.createElement(i);return e.provideHass(t),t.addEventListener("dialog-closed",p),t.addEventListener("dialog-closed",f),t}))}}if(h){const{history:n}=a.E;if(n.state?.dialog&&!l.length)return await new Promise((e=>{setTimeout(e)})),c(e,t,i,s,u,h);const o=l.findIndex((e=>e.dialogTag===i));-1!==o&&l.splice(o,1),l.push({element:e,root:t,dialogTag:i,dialogParams:s,dialogImport:u,addHistory:h});const r={dialog:i};n.state?.dialog?n.replaceState(r,""):(n.replaceState({...n.state,opensDialog:!0},""),n.pushState(r,""))}r[i].closedFocusTargets=(0,n.r)((0,o.j)(),d);const g=await r[i].element;return t.appendChild(g),g.showDialog(s),!0},u=async e=>{if(!(e in r))return!0;const t=await r[e].element;return!t.closeDialog||!1!==t.closeDialog()},h=async()=>{if(l.length){const e=l.pop(),t=await u(e.dialogTag);return t||l.push(e),l.length&&a.E.history.state?.opensDialog&&a.E.history.pushState({dialog:l[l.length-1].dialogTag},""),t}return!0},g=async()=>{for(let e=l.length-1;e>=0;e--){if(!(!l[e]||await u(l[e].dialogTag)))return!1}return!0},p=e=>{const t=l.findIndex((t=>t.dialogTag===e.detail.dialog));-1!==t&&l.splice(t,1),a.E.history.state?.dialog===e.detail.dialog&&(l.length?a.E.history.replaceState({dialog:l[l.length-1].dialogTag},""):-1!==t&&a.E.history.back())},m=(e,t)=>{e.addEventListener("show-dialog",(i=>{const{dialogTag:a,dialogImport:n,dialogParams:o,addHistory:s}=i.detail;c(e,t,a,o,n,s)}))},f=async e=>{if(!r[e.detail.dialog])return;const t=r[e.detail.dialog].closedFocusTargets;if(delete r[e.detail.dialog].closedFocusTargets,!t)return;let i=(0,o.j)();i instanceof HTMLElement&&i.blur(),await(0,s.y)();for(const e of t)if(e instanceof HTMLElement&&(e.focus(),i=(0,o.j)(),i&&i!==document.body))return}},62212:function(e,t,i){i.d(t,{B:()=>o,_:()=>n});var a=i(98330);const n=(e,t,i,n,o={unsubGrace:!0})=>{if(e[t])return e[t];let s,r,l=0,d=(0,a.M)();const c=()=>{if(!i)throw new Error("Collection does not support refresh");return i(e).then((e=>d.setState(e,!0)))},u=()=>c().catch((t=>{if(e.connected)throw t})),h=()=>{r=void 0,s&&s.then((e=>{e()})),d.clearState(),e.removeEventListener("ready",c),e.removeEventListener("disconnected",g)},g=()=>{r&&(clearTimeout(r),h())};return e[t]={get state(){return d.state},refresh:c,subscribe(t){l++,1===l&&(()=>{if(void 0!==r)return clearTimeout(r),void(r=void 0);n&&(s=n(e,d)),i&&(e.addEventListener("ready",u),u()),e.addEventListener("disconnected",g)})();const a=d.subscribe(t);return void 0!==d.state&&setTimeout((()=>t(d.state)),0),()=>{a(),l--,l||(o.unsubGrace?r=setTimeout(h,5e3):h())}}},e[t]},o=(e,t,i,a,o)=>n(a,e,t,i).subscribe(o)},98330:function(e,t,i){i.d(t,{M:()=>a});i(92745);const a=e=>{let t=[];function i(i,a){e=a?i:Object.assign(Object.assign({},e),i);let n=t;for(let t=0;t<n.length;t++)n[t](e)}return{get state(){return e},action(t){function a(e){i(e,!1)}return function(){let i=[e];for(let e=0;e<arguments.length;e++)i.push(arguments[e]);let n=t.apply(this,i);if(null!=n)return n instanceof Promise?n.then(a):a(n)}},setState:i,clearState(){e=void 0},subscribe:e=>(t.push(e),()=>{!function(e){let i=[];for(let a=0;a<t.length;a++)t[a]===e?e=null:i.push(t[a]);t=i}(e)})}}},53232:function(e,t,i){i.d(t,{E_:()=>f,OR:()=>l,_Y:()=>c,dZ:()=>r,fk:()=>u,hN:()=>s,hl:()=>g,i9:()=>p,pt:()=>o,ws:()=>m});var a=i(2841);const{I:n}=a.Al,o=e=>null===e||"object"!=typeof e&&"function"!=typeof e,s=(e,t)=>void 0===t?void 0!==(null==e?void 0:e._$litType$):(null==e?void 0:e._$litType$)===t,r=e=>{var t;return null!=(null===(t=null==e?void 0:e._$litType$)||void 0===t?void 0:t.h)},l=e=>void 0===e.strings,d=()=>document.createComment(""),c=(e,t,i)=>{var a;const o=e._$AA.parentNode,s=void 0===t?e._$AB:t._$AA;if(void 0===i){const t=o.insertBefore(d(),s),a=o.insertBefore(d(),s);i=new n(t,a,e,e.options)}else{const t=i._$AB.nextSibling,n=i._$AM,r=n!==e;if(r){let t;null===(a=i._$AQ)||void 0===a||a.call(i,e),i._$AM=e,void 0!==i._$AP&&(t=e._$AU)!==n._$AU&&i._$AP(t)}if(t!==s||r){let e=i._$AA;for(;e!==t;){const t=e.nextSibling;o.insertBefore(e,s),e=t}}}return i},u=(e,t,i=e)=>(e._$AI(t,i),e),h={},g=(e,t=h)=>e._$AH=t,p=e=>e._$AH,m=e=>{var t;null===(t=e._$AP)||void 0===t||t.call(e,!1,!0);let i=e._$AA;const a=e._$AB.nextSibling;for(;i!==a;){const e=i.nextSibling;i.remove(),i=e}},f=e=>{e._$AR()}}};
//# sourceMappingURL=74427.cdb0c8bbdf3b0723.js.map