UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

11 lines 43.1 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["21494"],{64214:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{DG:()=>g,E8:()=>_,W0:()=>p,o0:()=>u,yD:()=>v});var a=i(16485),o=i(27486),r=i(46467),d=i(33570),l=i(11104),s=i(16922),c=e([a,r,d,l]);[a,r,d,l]=c.then?(await c)():c;const u=(e,t,i)=>h(t,i.time_zone).format(e),h=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,s.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,s.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)}))),p=e=>m().format(e),m=(0,o.Z)((()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}))),g=(e,t,i)=>f(t,i.time_zone).format(e),f=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",hour:(0,s.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,s.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)}))),v=(e,t,i)=>y(t,i.time_zone).format(e),y=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",day:"numeric",hour:(0,s.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,s.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)}))),_=(e,t,i)=>k(t,i.time_zone).format(e),k=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,s.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,s.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)})));n()}catch(u){n(u)}}))},11104:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{Q:()=>u,f:()=>h});var a,o,r,d=i(16485),l=i(20382),s=e([d]);d=(s.then?(await s)():s)[0];const c=null===(a=Intl.DateTimeFormat)||void 0===a||null===(o=(r=a.call(Intl)).resolvedOptions)||void 0===o?void 0:o.call(r).timeZone,u=null!=c?c:"UTC",h=(e,t)=>e===l.c_.local&&c?u:t;n()}catch(c){n(c)}}))},49976:function(e,t,i){i.d(t,{U:()=>n});const n=e=>e.stopPropagation()},50602:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{SL:()=>l,l4:()=>h,sJ:()=>s,uf:()=>u});var a=i(16485),o=(i(19083),i(19423),i(11740),i(61006),i(20382)),r=i(34618),d=e([a]);a=(d.then?(await d)():d)[0];const l=e=>s(e.attributes),s=(e,t)=>!!e.unit_of_measurement||!!e.state_class||(t||[]).includes(e.device_class||""),c=e=>{switch(e.number_format){case o.y4.comma_decimal:return["en-US","en"];case o.y4.decimal_comma:return["de","es","it"];case o.y4.space_comma:return["fr","sv","cs"];case o.y4.system:return;default:return e.language}},u=(e,t,i)=>{const n=t?c(t):void 0;return Number.isNaN=Number.isNaN||function e(t){return"number"==typeof t&&e(t)},(null==t?void 0:t.number_format)===o.y4.none||Number.isNaN(Number(e))?Number.isNaN(Number(e))||""===e||(null==t?void 0:t.number_format)!==o.y4.none?"string"==typeof e?e:`${(0,r.N)(e,null==i?void 0:i.maximumFractionDigits).toString()}${"currency"===(null==i?void 0:i.style)?` ${i.currency}`:""}`:new Intl.NumberFormat("en-US",p(e,Object.assign(Object.assign({},i),{},{useGrouping:!1}))).format(Number(e)):new Intl.NumberFormat(n,p(e,i)).format(Number(e))},h=(e,t)=>{var i;const n=null==t?void 0:t.display_precision;return null!=n?{maximumFractionDigits:n,minimumFractionDigits:n}:Number.isInteger(Number(null==e||null===(i=e.attributes)||void 0===i?void 0:i.step))&&Number.isInteger(Number(null==e?void 0:e.state))?{maximumFractionDigits:0}:void 0},p=(e,t)=>{const i=Object.assign({maximumFractionDigits:2},t);if("string"!=typeof e)return i;if(!t||void 0===t.minimumFractionDigits&&void 0===t.maximumFractionDigits){const t=e.indexOf(".")>-1?e.split(".")[1].length:0;i.minimumFractionDigits=t,i.maximumFractionDigits=t}return i};n()}catch(l){n(l)}}))},49542:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{o:()=>v});var a=i(61701),o=i(16485),r=(i(71695),i(61893),i(9359),i(70104),i(47021),i(57243)),d=i(50778),l=i(27486),s=i(36522),c=i(49976),u=i(1416),h=(i(7285),i(92824),e([o]));o=(h.then?(await h)():h)[0];let p,m,g,f=e=>e;const v=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"];(0,a.Z)([(0,d.Mo)("ha-country-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)()],key:"language",value(){return"en"}},{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:"countries",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:"no-sort",type:Boolean})],key:"noSort",value(){return!1}},{kind:"field",key:"_getOptions",value(){return(0,l.Z)(((e,t)=>{let i=[];const n=new Intl.DisplayNames(e,{type:"region",fallback:"code"});return i=t?t.map((e=>({value:e,label:n?n.of(e):e}))):v.map((e=>({value:e,label:n?n.of(e):e}))),this.noSort||i.sort(((t,i)=>(0,u.fe)(t.label,i.label,e))),i}))}},{kind:"method",key:"render",value:function(){const e=this._getOptions(this.language,this.countries);return(0,r.dy)(p||(p=f` <ha-select .label="${0}" .value="${0}" .required="${0}" .helper="${0}" .disabled="${0}" @selected="${0}" @closed="${0}" fixedMenuPosition naturalMenuWidth> ${0} </ha-select> `),this.label,this.value,this.required,this.helper,this.disabled,this._changed,c.U,e.map((e=>(0,r.dy)(m||(m=f` <ha-list-item .value="${0}">${0}</ha-list-item> `),e.value,e.label))))}},{kind:"field",static:!0,key:"styles",value(){return(0,r.iv)(g||(g=f`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,s.B)(this,"value-changed",{value:this.value}))}}]}}),r.oi);n()}catch(p){n(p)}}))},55486:function(e,t,i){var n=i(61701),a=(i(71695),i(47021),i(4918)),o=i(6394),r=i(57243),d=i(50778),l=i(35359),s=i(36522);let c,u,h=e=>e;(0,n.Z)([(0,d.Mo)("ha-formfield")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"method",key:"render",value:function(){const e={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return(0,r.dy)(c||(c=h` <div class="mdc-form-field ${0}"> <slot></slot> <label class="mdc-label" @click="${0}"> <slot name="label">${0}</slot> </label> </div>`),(0,l.$)(e),this._labelClick,this.label)}},{kind:"method",key:"_labelClick",value:function(){const e=this.input;if(e&&(e.focus(),!e.disabled))switch(e.tagName){case"HA-CHECKBOX":e.checked=!e.checked,(0,s.B)(e,"change");break;case"HA-RADIO":e.checked=!0,(0,s.B)(e,"change");break;default:e.click()}}},{kind:"field",static:!0,key:"styles",value(){return[o.W,(0,r.iv)(u||(u=h`:host(:not([alignEnd])) ::slotted(ha-switch){margin-right:10px;margin-inline-end:10px;margin-inline-start:inline}.mdc-form-field{align-items:var(--ha-formfield-align-items,center);gap:4px}.mdc-form-field>label{direction:var(--direction);margin-inline-start:0;margin-inline-end:auto;padding:0}:host([disabled]) label{color:var(--disabled-text-color)}`))]}}]}}),a.a)},7285:function(e,t,i){var n=i(61701),a=i(72621),o=(i(71695),i(47021),i(65703)),r=i(46289),d=i(57243),l=i(50778);let s,c,u,h=e=>e;(0,n.Z)([(0,l.Mo)("ha-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,a.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[r.W,(0,d.iv)(s||(s=h`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,d.iv)(c||(c=h`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,d.iv)(u||(u=h``))]}}]}}),o.K)},72781:function(e,t,i){var n=i(61701),a=(i(71695),i(47021),i(47711)),o=i(81577),r=i(57243),d=i(50778);let l,s=e=>e;(0,n.Z)([(0,d.Mo)("ha-radio")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[o.W,(0,r.iv)(l||(l=s`:host{--mdc-theme-secondary:var(--primary-color)}`))]}}]}}),a.J)},92824:function(e,t,i){var n=i(61701),a=i(72621),o=(i(71695),i(40251),i(47021),i(60930)),r=i(9714),d=i(57243),l=i(50778),s=i(22381),c=i(76320);i(23334);let u,h,p,m,g=e=>e;(0,n.Z)([(0,l.Mo)("ha-select")],(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:"icon",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"clearable",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)()],key:"options",value:void 0},{kind:"method",key:"render",value:function(){return(0,d.dy)(u||(u=g` ${0} ${0} `),(0,a.Z)(i,"render",this,3)([]),this.clearable&&!this.required&&!this.disabled&&this.value?(0,d.dy)(h||(h=g`<ha-icon-button label="clear" @click="${0}" .path="${0}"></ha-icon-button>`),this._clearValue,"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"):d.Ld)}},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?(0,d.dy)(p||(p=g`<span class="mdc-select__icon"><slot name="icon"></slot></span>`)):d.Ld}},{kind:"method",key:"connectedCallback",value:function(){(0,a.Z)(i,"connectedCallback",this,3)([]),window.addEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"firstUpdated",value:async function(){var e;((0,a.Z)(i,"firstUpdated",this,3)([]),this.inlineArrow)&&(null===(e=this.shadowRoot)||void 0===e||null===(e=e.querySelector(".mdc-select__selected-text-container"))||void 0===e||e.classList.add("inline-arrow"))}},{kind:"method",key:"updated",value:function(e){if((0,a.Z)(i,"updated",this,3)([e]),e.has("inlineArrow")){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".mdc-select__selected-text-container");this.inlineArrow?null==e||e.classList.add("inline-arrow"):null==e||e.classList.remove("inline-arrow")}e.get("options")&&(this.layoutOptions(),this.selectByValue(this.value))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)(i,"disconnectedCallback",this,3)([]),window.removeEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"_clearValue",value:function(){!this.disabled&&this.value&&(this.valueSetDirectly=!0,this.select(-1),this.mdcFoundation.handleChange())}},{kind:"field",key:"_translationsUpdated",value(){return(0,s.D)((async()=>{await(0,c.y)(),this.layoutOptions()}),500)}},{kind:"field",static:!0,key:"styles",value(){return[r.W,(0,d.iv)(m||(m=g`:host([clearable]){position:relative}.mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:var(--secondary-text-color)}.mdc-select__anchor{width:var(--ha-select-min-width,200px)}.mdc-select--filled .mdc-select__anchor{height:var(--ha-select-height,56px)}.mdc-select--filled .mdc-floating-label{inset-inline-start:12px;inset-inline-end:initial;direction:var(--direction)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{inset-inline-start:48px;inset-inline-end:initial;direction:var(--direction)}.mdc-select .mdc-select__anchor{padding-inline-start:12px;padding-inline-end:0px;direction:var(--direction)}.mdc-select__anchor .mdc-floating-label--float-above{transform-origin:var(--float-start)}.mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,0px)}:host([clearable]) .mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:absolute;top:10px;right:28px;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);inset-inline-start:initial;inset-inline-end:28px;direction:var(--direction)}.inline-arrow{flex-grow:0}`))]}}]}}),o.K)},17170:function(e,t,i){i.a(e,(async function(e,t){try{var n=i(61701),a=i(72621),o=(i(71695),i(47021),i(97677)),r=i(43580),d=i(57243),l=i(50778),s=e([o]);o=(s.then?(await s)():s)[0];let c,u=e=>e;(0,n.Z)([(0,l.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,a.Z)(i,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value(){return[r.Z,(0,d.iv)(c||(c=u`:host{--indicator-color:var( --ha-spinner-indicator-color, var(--primary-color) );--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}]}}),o.Z);t()}catch(c){t(c)}}))},83166:function(e,t,i){var n=i(61701),a=i(72621),o=(i(71695),i(47021),i(1105)),r=i(33990),d=i(57243),l=i(50778),s=i(5111);let c,u,h,p,m=e=>e;(0,n.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(){return!1}},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"iconTrailing",value(){return!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,a.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(0,d.dy)(c||(c=m` <span class="mdc-text-field__icon mdc-text-field__icon--${0}" tabindex="${0}"> <slot name="${0}Icon"></slot> </span> `),i,t?1:-1,i)}},{kind:"field",static:!0,key:"styles",value(){return[r.W,(0,d.iv)(u||(u=m`.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"===s.E.document.dir?(0,d.iv)(h||(h=m`.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}`)):(0,d.iv)(p||(p=m``))]}}]}}),o.P)},66929:function(e,t,i){i.d(t,{HL:()=>a,S7:()=>n});i(19423);const n=(e,t)=>e.callWS(Object.assign({type:"config/core/update"},t)),a=e=>e.callWS({type:"config/core/detect"})},87602:function(e,t,i){i.d(t,{l:()=>n});const n={BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BA:"BAM",BB:"BBD",WF:"XPF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BH:"BHD",BI:"BIF",BJ:"XOF",BT:"BTN",JM:"JMD",BV:"NOK",BW:"BWP",WS:"WST",BQ:"USD",BR:"BRL",BS:"BSD",JE:"GBP",BY:"BYN",BZ:"BZD",RU:"RUB",RW:"RWF",RS:"RSD",TL:"USD",RE:"EUR",TM:"TMT",TJ:"TJS",RO:"RON",TK:"NZD",GW:"XOF",GU:"USD",GT:"GTQ",GS:"GBP",GR:"EUR",GQ:"XAF",GP:"EUR",JP:"JPY",GY:"GYD",GG:"GBP",GF:"EUR",GE:"GEL",GD:"XCD",GB:"GBP",GA:"XAF",SV:"USD",GN:"GNF",GM:"GMD",GL:"DKK",GI:"GIP",GH:"GHS",OM:"OMR",TN:"TND",JO:"JOD",HR:"EUR",HT:"HTG",HU:"HUF",HK:"HKD",HN:"HNL",HM:"AUD",VE:"VED",PR:"USD",PS:"ILS",PW:"USD",PT:"EUR",SJ:"NOK",PY:"PYG",IQ:"IQD",PA:"PAB",PF:"XPF",PG:"PGK",PE:"PEN",PK:"PKR",PH:"PHP",PN:"NZD",PL:"PLN",PM:"EUR",ZM:"ZMW",EH:"MAD",EE:"EUR",EG:"EGP",ZA:"ZAR",EC:"USD",IT:"EUR",VN:"VND",SB:"SBD",ET:"ETB",SO:"SOS",ZW:"ZWL",SA:"SAR",ES:"EUR",ER:"ERN",ME:"EUR",MD:"MDL",MG:"MGA",MF:"EUR",MA:"MAD",MC:"EUR",UZ:"UZS",MM:"MMK",ML:"XOF",MO:"MOP",MN:"MNT",MH:"USD",MK:"MKD",MU:"MUR",MT:"EUR",MW:"MWK",MV:"MVR",MQ:"EUR",MP:"USD",MS:"XCD",MR:"MRO",IM:"GBP",UG:"UGX",TZ:"TZS",MY:"MYR",MX:"MXN",IL:"ILS",FR:"EUR",IO:"USD",SH:"SHP",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",NI:"NIO",NL:"EUR",NO:"NOK",NA:"NAD",VU:"VUV",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NZ:"NZD",NP:"NPR",NR:"AUD",NU:"NZD",CK:"NZD",XK:"EUR",CI:"XOF",CH:"CHF",CO:"COP",CN:"CNY",CM:"XAF",CL:"CLP",CC:"AUD",CA:"CAD",CG:"XAF",CF:"XAF",CD:"CDF",CZ:"CZK",CY:"EUR",CX:"AUD",CR:"CRC",CW:"ANG",CV:"CVE",CU:"CUP",SZ:"SZL",SY:"SYP",SX:"ANG",KG:"KGS",KE:"KES",SS:"SSP",SR:"SRD",KI:"AUD",KH:"KHR",KN:"XCD",KM:"KMF",ST:"STD",SK:"EUR",KR:"KRW",SI:"EUR",KP:"KPW",KW:"KWD",SN:"XOF",SM:"EUR",SL:"SLL",SC:"SCR",KZ:"KZT",KY:"KYD",SG:"SGD",SE:"SEK",SD:"SDG",DO:"DOP",DM:"XCD",DJ:"DJF",DK:"DKK",VG:"USD",DE:"EUR",YE:"YER",DZ:"DZD",US:"USD",UY:"UYU",YT:"EUR",UM:"USD",LB:"LBP",LC:"XCD",LA:"LAK",TV:"AUD",TW:"TWD",TT:"TTD",TR:"TRY",LK:"LKR",LI:"CHF",LV:"EUR",TO:"TOP",LT:"EUR",LU:"EUR",LR:"LRD",LS:"LSL",TH:"THB",TF:"EUR",TG:"XOF",TD:"XAF",TC:"USD",LY:"LYD",VA:"EUR",VC:"XCD",AE:"AED",AD:"EUR",AG:"XCD",AF:"AFN",AI:"XCD",VI:"USD",IS:"ISK",IR:"IRR",AM:"AMD",AL:"ALL",AO:"AOA",AQ:"",AS:"USD",AR:"ARS",AU:"AUD",AT:"EUR",AW:"AWG",IN:"INR",AX:"EUR",AZ:"AZN",IE:"EUR",ID:"IDR",UA:"UAH",QA:"QAR",MZ:"MZN"}},54754:function(e,t,i){i.d(t,{a:()=>a,k:()=>n});i(52247),i(40251);const n=(e,t,i,n)=>fetch(`https://nominatim.openstreetmap.org/search.php?q=${e}&format=jsonv2${n?`&limit=${n}`:""}${i?"&addressdetails=1":""}&accept-language=${t.locale.language}&email=abuse@home-assistant.io`,{headers:{"User-Agent":`HomeAssistant/${t.config.version}`}}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)})),a=(e,t,i)=>fetch(`https://nominatim.openstreetmap.org/reverse.php?lat=${e[0]}&lon=${e[1]}&accept-language=${t.locale.language}&zoom=${null!=i?i:18}&format=jsonv2&email=abuse@home-assistant.io`,{headers:{"User-Agent":`HomeAssistant/${t.config.version}`}}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)}))},69919:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{EX:()=>l,SO:()=>s,Sk:()=>u,TN:()=>v,UJ:()=>h,Ym:()=>f,hF:()=>c});i(19083),i(61893),i(9359),i(56475),i(70104),i(40251);var a=i(73358),o=i(75278),r=i(50602),d=(i(1416),i(76131),e([r]));r=(d.then?(await d)():d)[0];let l=function(e){return e[e.INSTALL=1]="INSTALL",e[e.SPECIFIC_VERSION=2]="SPECIFIC_VERSION",e[e.PROGRESS=4]="PROGRESS",e[e.BACKUP=8]="BACKUP",e[e.RELEASE_NOTES=16]="RELEASE_NOTES",e}({});const s=e=>(0,o.e)(e,l.PROGRESS)&&null!==e.attributes.update_percentage,c=(e,t=!1)=>(e.state===a.uo||t&&Boolean(e.attributes.skipped_version))&&(0,o.e)(e,l.INSTALL),u=e=>!!e.attributes.in_progress,h=(e,t)=>e.callWS({type:"update/release_notes",entity_id:t}),p="ioBroker Core",m="ioBroker Supervisor",g="ioBroker Operating System",f=(e,t)=>{const i=e.state,n=e.attributes;if("off"===i){return n.latest_version&&n.skipped_version===n.latest_version?n.latest_version:t.formatEntityState(e)}if("on"===i&&u(e)){return(0,o.e)(e,l.PROGRESS)&&null!==n.update_percentage?t.localize("ui.card.update.installing_with_progress",{progress:(0,r.uf)(n.update_percentage,t.locale,{maximumFractionDigits:n.display_precision,minimumFractionDigits:n.display_precision})}):t.localize("ui.card.update.installing")}return t.formatEntityState(e)},v=(e,t)=>{var i;if("hassio"!==(null===(i=t[e.entity_id])||void 0===i?void 0:i.domain))return"generic";const n=e.attributes.title||"";return n===p?"home_assistant":[p,m,g].includes(n)?"generic":"addon"};n()}catch(l){n(l)}}))},85590:function(e,t,i){i.a(e,(async function(e,n){try{i.r(t);var a=i(61701),o=i(72621),r=(i(19083),i(71695),i(40251),i(61006),i(47021),i(31622),i(57243)),d=i(50778),l=i(11104),s=i(36522),c=(i(99426),i(17170)),u=i(49542),h=i(66929),p=i(87602),m=i(37013),g=i(44180),f=i(66982),v=e([c,f,l,u]);[c,f,l,u]=v.then?(await v)():v;let y,_,k,b,x,S=e=>e;(0,a.Z)([(0,d.Mo)("onboarding-core-config")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"onboardingLocalize",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_working",value(){return!1}},{kind:"field",decorators:[(0,d.SB)()],key:"_location",value:void 0},{kind:"field",key:"_elevation",value(){return"0"}},{kind:"field",key:"_timeZone",value(){return l.Q}},{kind:"field",key:"_language",value(){return(0,g.sS)()}},{kind:"field",decorators:[(0,d.SB)()],key:"_country",value:void 0},{kind:"field",key:"_unitSystem",value:void 0},{kind:"field",key:"_currency",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_skipCore",value(){return!1}},{kind:"method",key:"render",value:function(){return this._location?this._skipCore?(0,r.dy)(_||(_=S`<div class="row center"> <ha-spinner></ha-spinner> </div>`)):(0,r.dy)(k||(k=S` ${0} <p> ${0} </p> <ha-country-picker class="flex" .language="${0}" .label="${0}" required .disabled="${0}" .value="${0}" @value-changed="${0}"> </ha-country-picker> <div class="footer"> <mwc-button @click="${0}" .disabled="${0}"> ${0} </mwc-button> </div> `),this._error?(0,r.dy)(b||(b=S`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):r.Ld,this.onboardingLocalize("ui.panel.page-onboarding.core-config.country_intro"),this.hass.locale.language,this.hass.localize("ui.panel.config.core.section.core.core_config.country")||"Country",this._working,this._countryValue,this._handleCountryChanged,this._save,this._working,this.onboardingLocalize("ui.panel.page-onboarding.core-config.finish")):(0,r.dy)(y||(y=S`<onboarding-location .hass="${0}" .onboardingLocalize="${0}" @value-changed="${0}"></onboarding-location>`),this.hass,this.onboardingLocalize,this._locationChanged)}},{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)(i,"firstUpdated",this,3)([e]),this.addEventListener("keyup",(e=>{this._location&&"Enter"===e.key&&this._save(e)}))}},{kind:"get",key:"_countryValue",value:function(){return this._country||""}},{kind:"method",key:"_handleCountryChanged",value:function(e){this._country=e.detail.value}},{kind:"method",key:"_locationChanged",value:async function(e){if(this._location=e.detail.value.location,e.detail.value.country&&(this._country=e.detail.value.country),e.detail.value.elevation&&(this._elevation=e.detail.value.elevation),e.detail.value.currency&&(this._currency=e.detail.value.currency),e.detail.value.language&&(this._language=e.detail.value.language),e.detail.value.timezone&&(this._timeZone=e.detail.value.timezone),e.detail.value.unit_system&&(this._unitSystem=e.detail.value.unit_system),this._country)return this._skipCore=!0,void this._save(e);let t;if(navigator.language){const e=navigator.language.split("-").pop().toUpperCase();u.o.includes(e)&&(t=e)}this._country=t,(0,s.B)(this,"onboarding-progress",{increase:.5}),await this.updateComplete,setTimeout((()=>this.renderRoot.querySelector("ha-country-picker").focus()),100)}},{kind:"method",key:"_save",value:async function(e){if(this._location&&this._country){e.preventDefault(),this._working=!0;try{await(0,h.S7)(this.hass,{location_name:this.onboardingLocalize("ui.panel.page-onboarding.core-config.location_name_default"),latitude:this._location[0],longitude:this._location[1],elevation:Number(this._elevation),unit_system:this._unitSystem||["US","MM","LR"].includes(this._country)?"us_customary":"metric",time_zone:this._timeZone||"UTC",currency:this._currency||p.l[this._country]||"EUR",country:this._country,language:this._language});const e=await(0,m.Rj)(this.hass);(0,s.B)(this,"onboarding-step",{type:"core_config",result:e})}catch(t){this._skipCore=!1,this._working=!1,this._error=t.message}}}},{kind:"field",static:!0,key:"styles",value(){return(0,r.iv)(x||(x=S`.row{display:flex;flex-direction:row;margin:0 -8px;align-items:center;--ha-select-min-width:100px}.secondary{color:var(--secondary-text-color)}p{font-size:14px;line-height:20px}ha-textfield{display:block}.flex{flex:1}.middle-text{margin:16px 0}.row{margin-top:16px}.center{justify-content:center}.row>*{margin:0 8px}.radio-group{display:flex;flex-direction:column;flex:1}.footer{margin-top:16px;text-align:right}a{color:var(--primary-color)}`))}}]}}),r.oi);n()}catch(y){n(y)}}))},66982:function(e,t,i){i.a(e,(async function(e,t){try{var n=i(61701),a=i(72621),o=(i(71695),i(9359),i(1331),i(70104),i(40251),i(47021),i(31622),i(2060),i(57243)),r=i(50778),d=i(27486),l=i(36522),s=(i(99426),i(17170)),c=(i(55486),i(7285),i(72781),i(83166),i(5346)),u=i(66929),h=i(54754),p=i(76131),m=i(17409),g=e([s,c]);[s,c]=g.then?(await g)():g;let f,v,y,_,k,b,x,S,C,M,A=e=>e;const L="M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z",w="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",D="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z",E="M15.5,12C18,12 20,14 20,16.5C20,17.38 19.75,18.2 19.31,18.9L22.39,22L21,23.39L17.88,20.32C17.19,20.75 16.37,21 15.5,21C13,21 11,19 11,16.5C11,14 13,12 15.5,12M15.5,14A2.5,2.5 0 0,0 13,16.5A2.5,2.5 0 0,0 15.5,19A2.5,2.5 0 0,0 18,16.5A2.5,2.5 0 0,0 15.5,14M19.5,2A0.5,0.5 0 0,1 20,2.5V11.81C19.42,11.26 18.75,10.81 18,10.5V4.7L15,5.86V10C14.3,10.07 13.62,10.24 13,10.5V5.87L9,4.47V16.13H9V16.5C9,17.14 9.09,17.76 9.26,18.34L8,17.9L2.66,19.97L2.5,20A0.5,0.5 0 0,1 2,19.5V4.38C2,4.15 2.15,3.97 2.36,3.9L8,2L14,4.1L19.34,2.03L19.5,2M4,5.46V17.31L7,16.15V4.45L4,5.46Z",R=[52.3731339,4.8903147],U=matchMedia("(prefers-color-scheme: dark)"),N="location";(0,n.Z)([(0,r.Mo)("onboarding-location")],(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)({attribute:!1})],key:"onboardingLocalize",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_working",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_location",value(){return R}},{kind:"field",decorators:[(0,r.SB)()],key:"_places",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_search",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_highlightedMarker",value:void 0},{kind:"field",key:"_elevation",value:void 0},{kind:"field",key:"_unitSystem",value:void 0},{kind:"field",key:"_currency",value:void 0},{kind:"field",key:"_timeZone",value:void 0},{kind:"field",key:"_country",value:void 0},{kind:"field",decorators:[(0,r.IO)("ha-locations-editor",!0)],key:"map",value:void 0},{kind:"method",key:"render",value:function(){var e;const t=this.onboardingLocalize("ui.panel.page-onboarding.core-config.location_address",{openstreetmap:(0,o.dy)(f||(f=A`<a href="https://www.openstreetmap.org/" target="_blank" rel="noopener noreferrer">OpenStreetMap</a>`)),osm_privacy_policy:(0,o.dy)(v||(v=A`<a href="https://wiki.osmfoundation.org/wiki/Privacy_Policy" target="_blank" rel="noopener noreferrer">${0}</a>`),this.onboardingLocalize("ui.panel.page-onboarding.core-config.osm_privacy_policy"))});return(0,o.dy)(y||(y=A` <h1> ${0} </h1> ${0} <p> ${0} </p> <div class="location-search"> <ha-textfield label="${0}" .disabled="${0}" icon iconTrailing @keyup="${0}"> <ha-svg-icon slot="leadingIcon" .path="${0}"></ha-svg-icon> ${0} </ha-textfield> ${0} </div> <ha-locations-editor class="flex" .hass="${0}" .locations="${0}" zoom="14" .themeMode="${0}" .disabled="${0}" @location-updated="${0}" @marker-clicked="${0}"></ha-locations-editor> <p class="attribution">${0}</p> <div class="footer"> <mwc-button @click="${0}" unelevated .disabled="${0}"> ${0} </mwc-button> </div> `),this.onboardingLocalize("ui.panel.page-onboarding.core-config.location_header"),this._error?(0,o.dy)(_||(_=A`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):o.Ld,this.onboardingLocalize("ui.panel.page-onboarding.core-config.intro_location"),this.onboardingLocalize("ui.panel.page-onboarding.core-config.address_label"),this._working,this._addressSearch,w,this._working?(0,o.dy)(k||(k=A` <ha-spinner slot="trailingIcon" size="small"></ha-spinner> `)):(0,o.dy)(b||(b=A` <ha-icon-button @click="${0}" slot="trailingIcon" .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> `),this._handleButtonClick,this._working,this.onboardingLocalize(this._search?"ui.common.search":"ui.panel.page-onboarding.core-config.button_detect"),this._search?E:L),void 0!==this._places?(0,o.dy)(x||(x=A` <mwc-list activatable> ${0} </mwc-list> `),null!==(e=this._places)&&void 0!==e&&e.length?this._places.map((e=>{const t=[e.name||e.address[e.category],e.address.house_number,e.address.road||e.address.waterway,e.address.village||e.address.town,e.address.suburb||e.address.subdivision,e.address.city||e.address.municipality].filter(Boolean).join(", "),i=[e.address.county||e.address.state_district||e.address.region,e.address.state,e.address.country].filter(Boolean).join(", ");return(0,o.dy)(S||(S=A`<ha-list-item @click="${0}" .placeId="${0}" .selected="${0}" .activated="${0}" .twoline="${0}"> ${0} <span slot="secondary">${0}</span> </ha-list-item>`),this._itemClicked,e.place_id,this._highlightedMarker===e.place_id,this._highlightedMarker===e.place_id,t&&i,t||i,t?i:"")})):(0,o.dy)(C||(C=A`<ha-list-item noninteractive>${0}</ha-list-item>`),null===this._places?"":"No results")):o.Ld,this.hass,this._markerLocations(this._location,this._places,this._highlightedMarker),U.matches?"dark":"light",this._working,this._locationChanged,this._markerClicked,t,this._save,this._working,this.onboardingLocalize("ui.panel.page-onboarding.core-config.finish"))}},{kind:"method",key:"firstUpdated",value:function(e){(0,a.Z)(i,"firstUpdated",this,3)([e]),setTimeout((()=>this.renderRoot.querySelector("ha-textfield").focus()),100),this.addEventListener("keyup",(e=>{"Enter"===e.key&&this._save(e)}))}},{kind:"method",key:"updated",value:function(e){if(e.has("_highlightedMarker")&&this._highlightedMarker){var t,i;const e=null===(t=this._places)||void 0===t?void 0:t.find((e=>e.place_id===this._highlightedMarker));4===(null==e||null===(i=e.boundingbox)||void 0===i?void 0:i.length)?this.map.fitBounds([[e.boundingbox[0],e.boundingbox[2]],[e.boundingbox[1],e.boundingbox[3]]],{zoom:16,pad:0}):this.map.fitMarker(String(this._highlightedMarker),{zoom:16})}}},{kind:"field",key:"_markerLocations",value(){return(0,d.Z)(((e,t,i)=>t?null!=t&&t.length?t.map((t=>({id:String(t.place_id),iconPath:t.place_id===i?void 0:D,latitude:e&&t.place_id===i?e[0]:Number(t.lat),longitude:e&&t.place_id===i?e[1]:Number(t.lon),location_editable:t.place_id===i}))):[]:[{id:N,latitude:(e||R)[0],longitude:(e||R)[1],location_editable:!0}]))}},{kind:"method",key:"_locationChanged",value:function(e){this._location=e.detail.location,e.detail.id!==N&&this._reverseGeocode()}},{kind:"method",key:"_markerClicked",value:function(e){if(e.detail.id===N)return;this._highlightedMarker=Number(e.detail.id);const t=this._places.find((t=>t.place_id===Number(e.detail.id)));this._location=[Number(t.lat),Number(t.lon)],this._country=t.address.country_code.toUpperCase()}},{kind:"method",key:"_itemClicked",value:function(e){this._highlightedMarker=e.currentTarget.placeId;const t=this._places.find((t=>t.place_id===e.currentTarget.placeId));this._location=[Number(t.lat),Number(t.lon)],this._country=t.address.country_code.toUpperCase()}},{kind:"method",key:"_addressSearch",value:async function(e){e.stopPropagation(),this._search=e.currentTarget.value.length>0,"Enter"===e.key&&this._searchAddress(e.currentTarget.value)}},{kind:"method",key:"_searchAddress",value:async function(e){this._working=!0,this._highlightedMarker=void 0,this._error=void 0,this._places=null,this.map.addEventListener("markers-updated",(()=>{setTimeout((()=>{var e;((null===(e=this._places)||void 0===e?void 0:e.length)||0)>2&&this.map.fitMap({pad:.5})}),500)}),{once:!0});try{var t;this._places=await(0,h.k)(e,this.hass,!0,3),null!==(t=this._places)&&void 0!==t&&t.length&&(this._highlightedMarker=this._places[0].place_id,this._location=[Number(this._places[0].lat),Number(this._places[0].lon)],this._country=this._places[0].address.country_code.toUpperCase())}catch(i){this._places=void 0,this._error=i.message}finally{this._working=!1}}},{kind:"method",key:"_reverseGeocode",value:async function(){if(!this._location)return;this._places=null;const e=await(0,h.a)(this._location,this.hass);this._country=e.address.country_code.toUpperCase(),this._places=[e],this._highlightedMarker=e.place_id}},{kind:"method",key:"_handleButtonClick",value:async function(e){this._search?this._searchAddress(e.target.parentElement.value):this._detectLocation()}},{kind:"method",key:"_detectLocation",value:function(){if(window.isSecureContext&&navigator.geolocation){this._working=!0;const e={enableHighAccuracy:!0,timeout:5e3,maximumAge:0};navigator.geolocation.getCurrentPosition((async e=>{this.map.addEventListener("markers-updated",(()=>{this.map.fitMarker(N)}),{once:!0}),this._location=[e.coords.latitude,e.coords.longitude],e.coords.altitude&&(this._elevation=String(Math.round(e.coords.altitude)));try{await this._reverseGeocode()}finally{this._working=!1}}),(()=>{this._working=!1,this._whoAmI()}),e)}else this._whoAmI()}},{kind:"method",key:"_whoAmI",value:async function(){if(await(0,p.showConfirmationDialog)(this,{title:this.onboardingLocalize("ui.panel.page-onboarding.core-config.title_location_detect"),text:this.onboardingLocalize("ui.panel.page-onboarding.core-config.intro_location_detect")})){this._working=!0;try{const e=await(0,u.HL)(this.hass);e.latitude&&e.longitude&&(this.map.addEventListener("markers-updated",(()=>{this.map.fitMarker(N)}),{once:!0}),this._location=[Number(e.latitude),Number(e.longitude)]),e.elevation&&(this._elevation=String(e.elevation)),e.unit_system&&(this._unitSystem=e.unit_system),e.time_zone&&(this._timeZone=e.time_zone),e.currency&&(this._currency=e.currency),e.country&&(this._country=e.country)}catch(e){this._error=`Failed to detect location information: ${e.message}`}finally{this._working=!1}}}},{kind:"method",key:"_save",value:async function(e){this._location&&(e.preventDefault(),(0,l.B)(this,"value-changed",{value:{location:this._location,country:this._country,elevation:this._elevation,unit_system:this._unitSystem,time_zone:this._timeZone,currency:this._currency}}))}},{kind:"get",static:!0,key:"styles",value:function(){return[m.I,(0,o.iv)(M||(M=A`.location-search{margin-top:32px;margin-bottom:32px}ha-textfield{display:block}ha-textfield>ha-icon-button{position:absolute;top:10px;right:10px;inset-inline-end:10px;inset-inline-start:initial;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);inset-inline-start:initial;inset-inline-end:10px;direction:var(--direction)}ha-textfield>ha-spinner{position:relative;left:12px;inset-inline-start:12px;inset-inline-end:initial}ha-locations-editor{display:block;height:300px;margin-top:8px;border-radius:var(--mdc-shape-large,16px);overflow:hidden}mwc-list{width:100%;border:1px solid var(--divider-color);box-sizing:border-box;border-top-width:0;border-bottom-left-radius:var(--mdc-shape-small,4px);border-bottom-right-radius:var(--mdc-shape-small,4px);--mdc-list-vertical-padding:0}ha-list-item{height:72px}.attribution{margin:0;padding:4px 16px 12px 16px;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-family:var( --mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif) );font-size:var(--mdc-typography-caption-font-size, .75rem);font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:var( --mdc-typography-caption-letter-spacing, .0333333333em );text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:var(--mdc-typography-caption-text-transform,inherit)}.attribution a{color:inherit}`))]}}]}}),o.oi);t()}catch(f){t(f)}}))}}]); //# sourceMappingURL=21494.95e853a6d05032de.js.map