Files
2026-01-30 23:31:00 -06:00

6 lines
47 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! For license information please see 9045.c53528c5b41f7eaa.js.LICENSE.txt */
(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([["9045"],{2292:function(e,t,i){var n={"./flow-preview-generic.ts":["7433","1552","686","6898","513","2206","4224","2139","4645","4320","5958","6160","4044","4284","7599","669"],"./flow-preview-generic_camera.ts":["96738","1552","686","6898","513","2206","4224","2139","4645","4320","5958","6160","4044","4284","7599","9336"],"./flow-preview-generic":["7433","1552","686","6898","513","2206","4224","2139","4645","4320","5958","6160","4044","4284","7599","669"],"./flow-preview-generic_camera":["96738","1552","686","6898","513","2206","4224","2139","4645","4320","5958","6160","4044","4284","7599","9336"],"./flow-preview-template.ts":["76144","1552","686","6898","513","2206","4224","2139","4645","4320","5958","6160","4044","4284","7599","8063"],"./flow-preview-template":["76144","1552","686","6898","513","2206","4224","2139","4645","4320","5958","6160","4044","4284","7599","8063"]};function s(e){if(!i.o(n,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[e],s=t[0];return Promise.all(t.slice(1).map(i.e)).then((function(){return i(s)}))}s.keys=()=>Object.keys(n),s.id="2292",e.exports=s},69181:function(e,t,i){"use strict";i.a(e,(async function(e,t){try{var n=i(73577),s=(i(19083),i(71695),i(19423),i(40251),i(61006),i(39527),i(92181),i(99790),i(13334),i(36993),i(47021),i(57243)),o=i(50778),a=i(35359),r=i(27486),l=i(11297),d=i(79575),c=i(59848),u=i(71656),h=i(92374),p=i(4557),f=i(88233),v=i(69484),g=(i(59897),i(74064),i(10508),e([v]));v=(g.then?(await g)():g)[0];let m,_,y,k,w=e=>e;const b="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z",$=e=>(0,s.dy)(m||(m=w`<ha-list-item graphic="icon" class="${0}"> ${0} ${0} </ha-list-item>`),(0,a.$)({"add-new":e.area_id===C}),e.icon?(0,s.dy)(_||(_=w`<ha-icon slot="graphic" .icon="${0}"></ha-icon>`),e.icon):(0,s.dy)(y||(y=w`<ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon>`),b),e.name),C="___ADD_NEW___",x="___NO_ITEMS___",S="___ADD_NEW_SUGGESTION___";(0,n.Z)([(0,o.Mo)("ha-area-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"no-add"})],key:"noAdd",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Array,attribute:"include-domains"})],key:"includeDomains",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Array,attribute:"exclude-domains"})],key:"excludeDomains",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Array,attribute:"include-device-classes"})],key:"includeDeviceClasses",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Array,attribute:"exclude-areas"})],key:"excludeAreas",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"deviceFilter",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"entityFilter",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_opened",value:void 0},{kind:"field",decorators:[(0,o.IO)("ha-combo-box",!0)],key:"comboBox",value:void 0},{kind:"field",key:"_suggestion",value:void 0},{kind:"field",key:"_init",value(){return!1}},{kind:"method",key:"open",value:async function(){var e;await this.updateComplete,await(null===(e=this.comboBox)||void 0===e?void 0:e.open())}},{kind:"method",key:"focus",value:async function(){var e;await this.updateComplete,await(null===(e=this.comboBox)||void 0===e?void 0:e.focus())}},{kind:"field",key:"_getAreas",value(){return(0,r.Z)(((e,t,i,n,s,o,a,r,l,c)=>{let u,p,f={};(n||s||o||a||r)&&(f=(0,h.R6)(i),u=t,p=i.filter((e=>e.area_id)),n&&(u=u.filter((e=>{const t=f[e.id];return!(!t||!t.length)&&f[e.id].some((e=>n.includes((0,d.M)(e.entity_id))))})),p=p.filter((e=>n.includes((0,d.M)(e.entity_id))))),s&&(u=u.filter((e=>{const t=f[e.id];return!t||!t.length||i.every((e=>!s.includes((0,d.M)(e.entity_id))))})),p=p.filter((e=>!s.includes((0,d.M)(e.entity_id))))),o&&(u=u.filter((e=>{const t=f[e.id];return!(!t||!t.length)&&f[e.id].some((e=>{const t=this.hass.states[e.entity_id];return!!t&&(t.attributes.device_class&&o.includes(t.attributes.device_class))}))})),p=p.filter((e=>{const t=this.hass.states[e.entity_id];return t.attributes.device_class&&o.includes(t.attributes.device_class)}))),a&&(u=u.filter((e=>a(e)))),r&&(u=u.filter((e=>{const t=f[e.id];return!(!t||!t.length)&&f[e.id].some((e=>{const t=this.hass.states[e.entity_id];return!!t&&r(t)}))})),p=p.filter((e=>{const t=this.hass.states[e.entity_id];return!!t&&r(t)}))));let v,g=e;return u&&(v=u.filter((e=>e.area_id)).map((e=>e.area_id))),p&&(v=(null!=v?v:[]).concat(p.filter((e=>e.area_id)).map((e=>e.area_id)))),v&&(g=g.filter((e=>v.includes(e.area_id)))),c&&(g=g.filter((e=>!c.includes(e.area_id)))),g.length||(g=[{area_id:x,floor_id:null,name:this.hass.localize("ui.components.area-picker.no_areas"),picture:null,icon:null,aliases:[],labels:[],created_at:0,modified_at:0}]),l?g:[...g,{area_id:C,floor_id:null,name:this.hass.localize("ui.components.area-picker.add_new"),picture:null,icon:"mdi:plus",aliases:[],labels:[],created_at:0,modified_at:0}]}))}},{kind:"method",key:"updated",value:function(e){if(!this._init&&this.hass||this._init&&e.has("_opened")&&this._opened){this._init=!0;const e=this._getAreas(Object.values(this.hass.areas),Object.values(this.hass.devices),Object.values(this.hass.entities),this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.noAdd,this.excludeAreas).map((e=>Object.assign(Object.assign({},e),{},{strings:[e.area_id,...e.aliases,e.name]})));this.comboBox.items=e,this.comboBox.filteredItems=e}}},{kind:"method",key:"render",value:function(){var e;return(0,s.dy)(k||(k=w` <ha-combo-box .hass="${0}" .helper="${0}" item-value-path="area_id" item-id-path="area_id" item-label-path="name" .value="${0}" .disabled="${0}" .required="${0}" .label="${0}" .placeholder="${0}" .renderer="${0}" @filter-changed="${0}" @opened-changed="${0}" @value-changed="${0}"> </ha-combo-box> `),this.hass,this.helper,this._value,this.disabled,this.required,void 0===this.label&&this.hass?this.hass.localize("ui.components.area-picker.area"):this.label,this.placeholder?null===(e=this.hass.areas[this.placeholder])||void 0===e?void 0:e.name:void 0,$,this._filterChanged,this._openedChanged,this._areaChanged)}},{kind:"method",key:"_filterChanged",value:function(e){var t;const i=e.target,n=e.detail.value;if(!n)return void(this.comboBox.filteredItems=this.comboBox.items);const s=(0,c.q)(n,(null===(t=i.items)||void 0===t?void 0:t.filter((e=>![x,C].includes(e.label_id))))||[]);0===s.length?this.noAdd?(this._suggestion=n,this.comboBox.filteredItems=[{area_id:S,floor_id:null,name:this.hass.localize("ui.components.area-picker.add_new_sugestion",{name:this._suggestion}),icon:"mdi:plus",picture:null,labels:[],aliases:[],created_at:0,modified_at:0}]):this.comboBox.filteredItems=[{area_id:x,floor_id:null,name:this.hass.localize("ui.components.area-picker.no_match"),icon:null,picture:null,labels:[],aliases:[],created_at:0,modified_at:0}]:this.comboBox.filteredItems=s}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_openedChanged",value:function(e){this._opened=e.detail.value}},{kind:"method",key:"_areaChanged",value:function(e){e.stopPropagation();let t=e.detail.value;if(t===x)return t="",void this.comboBox.setInputValue("");[S,C].includes(t)?(e.target.value=this._value,this.hass.loadFragmentTranslation("config"),(0,f.E)(this,{suggestedName:t===S?this._suggestion:"",createEntry:async e=>{try{const t=await(0,u.Lo)(this.hass,e),i=[...Object.values(this.hass.areas),t];this.comboBox.filteredItems=this._getAreas(i,Object.values(this.hass.devices),Object.values(this.hass.entities),this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.noAdd,this.excludeAreas),await this.updateComplete,await this.comboBox.updateComplete,this._setValue(t.area_id)}catch(t){(0,p.Ys)(this,{title:this.hass.localize("ui.components.area-picker.failed_create_area"),text:t.message})}}}),this._suggestion=void 0,this.comboBox.setInputValue("")):t!==this._value&&this._setValue(t)}},{kind:"method",key:"_setValue",value:function(e){this.value=e,setTimeout((()=>{(0,l.B)(this,"value-changed",{value:e}),(0,l.B)(this,"change")}),0)}}]}}),s.oi);t()}catch(m){t(m)}}))},90977:function(e,t,i){"use strict";var n=i(73577),s=i(72621),o=(i(71695),i(47021),i(58795)),a=i(57243),r=i(50778);let l,d=e=>e;(0,n.Z)([(0,r.Mo)("ha-circular-progress")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:"aria-label",type:String})],key:"ariaLabel",value(){return"Loading"}},{kind:"field",decorators:[(0,r.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,s.Z)(i,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--md-circular-progress-size","16px");break;case"small":this.style.setProperty("--md-circular-progress-size","28px");break;case"medium":this.style.setProperty("--md-circular-progress-size","48px");break;case"large":this.style.setProperty("--md-circular-progress-size","68px")}}},{kind:"field",static:!0,key:"styles",value(){return[...(0,s.Z)(i,"styles",this),(0,a.iv)(l||(l=d`:host{--md-sys-color-primary:var(--primary-color);--md-circular-progress-size:48px}`))]}}]}}),o.B)},12328:function(e,t,i){"use strict";i.d(t,{x:function(){return n}});i(63721),i(52247),i(39527),i(41360);const n=e=>{const t={};return e.forEach((e=>{var i,s;if(void 0!==(null===(i=e.description)||void 0===i?void 0:i.suggested_value)&&null!==(null===(s=e.description)||void 0===s?void 0:s.suggested_value))t[e.name]=e.description.suggested_value;else if("default"in e)t[e.name]=e.default;else if(e.required){if("boolean"===e.type)t[e.name]=!1;else if("string"===e.type)t[e.name]="";else if("integer"===e.type)t[e.name]="valueMin"in e?e.valueMin:0;else if("constant"===e.type)t[e.name]=e.value;else if("float"===e.type)t[e.name]=0;else if("select"===e.type){if(e.options.length){const i=e.options[0];t[e.name]=Array.isArray(i)?i[0]:i}}else if("positive_time_period_dict"===e.type)t[e.name]={hours:0,minutes:0,seconds:0};else if("expandable"===e.type)t[e.name]=n(e.schema);else if("selector"in e){const i=e.selector;var o;if("device"in i)t[e.name]=null!==(o=i.device)&&void 0!==o&&o.multiple?[]:"";else if("entity"in i){var a;t[e.name]=null!==(a=i.entity)&&void 0!==a&&a.multiple?[]:""}else if("area"in i){var r;t[e.name]=null!==(r=i.area)&&void 0!==r&&r.multiple?[]:""}else if("label"in i){var l;t[e.name]=null!==(l=i.label)&&void 0!==l&&l.multiple?[]:""}else if("boolean"in i)t[e.name]=!1;else if("addon"in i||"attribute"in i||"file"in i||"icon"in i||"template"in i||"text"in i||"theme"in i||"object"in i)t[e.name]="";else if("number"in i){var d,c;t[e.name]=null!==(d=null===(c=i.number)||void 0===c?void 0:c.min)&&void 0!==d?d:0}else if("select"in i){var u;if(null!==(u=i.select)&&void 0!==u&&u.options.length){const n=i.select.options[0],s="string"==typeof n?n:n.value;t[e.name]=i.select.multiple?[s]:s}}else if("country"in i){var h;null!==(h=i.country)&&void 0!==h&&null!==(h=h.countries)&&void 0!==h&&h.length&&(t[e.name]=i.country.countries[0])}else if("language"in i){var p;null!==(p=i.language)&&void 0!==p&&null!==(p=p.languages)&&void 0!==p&&p.length&&(t[e.name]=i.language.languages[0])}else if("duration"in i)t[e.name]={hours:0,minutes:0,seconds:0};else if("time"in i)t[e.name]="00:00:00";else if("date"in i||"datetime"in i){const i=(new Date).toISOString().slice(0,10);t[e.name]=`${i}T00:00:00`}else if("color_rgb"in i)t[e.name]=[0,0,0];else if("color_temp"in i){var f,v;t[e.name]=null!==(f=null===(v=i.color_temp)||void 0===v?void 0:v.min_mireds)&&void 0!==f?f:153}else if("action"in i||"trigger"in i||"condition"in i)t[e.name]=[];else{if(!("media"in i)&&!("target"in i))throw new Error(`Selector ${Object.keys(i)[0]} not supported in initial form data`);t[e.name]={}}}}else;})),t}},54220:function(e,t,i){"use strict";i.r(t),i.d(t,{HaIconNext:function(){return r}});var n=i(73577),s=(i(71695),i(47021),i(50778)),o=i(13089),a=i(10508);let r=(0,n.Z)([(0,s.Mo)("ha-icon-next")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"path",value(){return"rtl"===o.E.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}]}}),a.HaSvgIcon)},71656:function(e,t,i){"use strict";i.d(t,{IO:function(){return o},Lo:function(){return s},a:function(){return a}});i(71695),i(92745),i(19423),i(47021);var n=i(32770);i(86912);const s=(e,t)=>e.callWS(Object.assign({type:"config/area_registry/create"},t)),o=(e,t,i)=>e.callWS(Object.assign({type:"config/area_registry/update",area_id:t},i)),a=(e,t)=>(i,s)=>{const o=t?t.indexOf(i):-1,a=t?t.indexOf(s):-1;if(-1===o&&-1===a){var r,l,d,c;const t=null!==(r=null==e||null===(l=e[i])||void 0===l?void 0:l.name)&&void 0!==r?r:i,o=null!==(d=null==e||null===(c=e[s])||void 0===c?void 0:c.name)&&void 0!==d?d:s;return(0,n.$)(t,o)}return-1===o?1:-1===a?-1:o-a}},80495:function(e,t,i){"use strict";i.d(t,{Bg:function(){return u},DT:function(){return c},SY:function(){return l},aJ:function(){return a},cz:function(){return r},ko:function(){return d}});var n=i(4468),s=i(36719);let o=function(e){return e[e.ANNOUNCE=1]="ANNOUNCE",e}({});const a=(e,t,i)=>e.connection.subscribeMessage(i,{type:"assist_satellite/intercept_wake_word",entity_id:t}),r=(e,t)=>e.callWS({type:"assist_satellite/test_connection",entity_id:t}),l=(e,t,i)=>e.callService("assist_satellite","announce",{message:i},{entity_id:t}),d=(e,t)=>e.callWS({type:"assist_satellite/get_configuration",entity_id:t}),c=(e,t,i)=>e.callWS({type:"assist_satellite/set_wake_words",entity_id:t,wake_word_ids:i}),u=e=>e&&e.state!==s.nZ&&(0,n.e)(e,o.ANNOUNCE)},41946:function(e,t,i){"use strict";i.d(t,{iI:function(){return s},oT:function(){return n}});i(19083),i(77439),i(19423),i(40251),i(97499),i(61006),i(13334);const n=e=>e.map((e=>{if("string"!==e.type)return e;switch(e.name){case"username":return Object.assign(Object.assign({},e),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},e),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},e),{},{autocomplete:"one-time-code",autofocus:!0});default:return e}})),s=(e,t)=>e.callWS({type:"auth/sign_path",path:t})},79983:function(e,t,i){"use strict";i.d(t,{D4:function(){return o},D7:function(){return d},Ky:function(){return s},XO:function(){return a},d4:function(){return l},oi:function(){return r}});i(56587),i(1275);const n={"HA-Frontend-Base":`${location.protocol}//${location.host}`},s=(e,t,i)=>{var s;return e.callApi("POST","config/config_entries/flow",{handler:t,show_advanced_options:Boolean(null===(s=e.userData)||void 0===s?void 0:s.showAdvanced),entry_id:i},n)},o=(e,t)=>e.callApi("GET",`config/config_entries/flow/${t}`,void 0,n),a=(e,t,i)=>e.callApi("POST",`config/config_entries/flow/${t}`,i,n),r=(e,t)=>e.callApi("DELETE",`config/config_entries/flow/${t}`),l=(e,t)=>e.callApi("GET","config/config_entries/flow_handlers"+(t?`?type=${t}`:"")),d=e=>e.sendMessagePromise({type:"config_entries/flow/progress"})},83336:function(e,t,i){"use strict";i.d(t,{X:function(){return n}});const n=(e,t)=>e.subscribeEvents(t,"data_entry_flow_progressed")},36719:function(e,t,i){"use strict";i.d(t,{ON:function(){return a},PX:function(){return r},V_:function(){return l},lz:function(){return o},nZ:function(){return s},rk:function(){return c}});var n=i(95907);const s="unavailable",o="unknown",a="on",r="off",l=[s,o],d=[s,o,r],c=(0,n.z)(l);(0,n.z)(d)},44699:function(e,t,i){"use strict";i.d(t,{H:function(){return s},O:function(){return o}});i(19083);const n=["generic_camera","template"],s=(e,t,i,n,s,o)=>e.connection.subscribeMessage(o,{type:`${t}/start_preview`,flow_id:i,flow_type:n,user_input:s}),o=e=>n.includes(e)?e:"generic"},86912:function(e,t,i){"use strict";i(61893),i(32770),i(56587)},22975:function(e,t,i){"use strict";i.a(e,(async function(e,n){try{i.r(t);var s=i(73577),o=i(72621),a=(i(19083),i(71695),i(77439),i(40251),i(47021),i(31622),i(57243)),r=i(50778),l=i(11297),d=(i(90977),i(44118),i(59897),i(83336)),c=i(66193),u=i(26205),h=i(4557),p=(i(76085),i(27599)),f=(i(12924),i(53139),i(45385),i(29065),i(72959),e([p]));p=(f.then?(await f)():f)[0];let v,g,m,_,y,k,w,b,$,C,x,S=e=>e;const D="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",F="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z";let z=0;(0,s.Z)([(0,r.Mo)("dialog-data-entry-flow")],(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.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_loading",value:void 0},{kind:"field",key:"_instance",value(){return z}},{kind:"field",decorators:[(0,r.SB)()],key:"_step",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_handler",value:void 0},{kind:"field",key:"_unsubDataEntryFlowProgressed",value:void 0},{kind:"method",key:"showDialog",value:async function(e){this._params=e,this._instance=z++;const t=this._instance;let i;if(e.startFlowHandler){this._loading="loading_flow",this._handler=e.startFlowHandler;try{i=await this._params.flowConfig.createFlow(this.hass,e.startFlowHandler)}catch(n){this.closeDialog();let e=n.message||n.body||"Unknown error";return"string"!=typeof e&&(e=JSON.stringify(e)),void(0,h.Ys)(this,{title:this.hass.localize("ui.panel.config.integrations.config_flow.error"),text:`${this.hass.localize("ui.panel.config.integrations.config_flow.could_not_load")}: ${e}`})}if(t!==this._instance)return}else{if(!e.continueFlowId)return;this._loading="loading_flow";try{i=await e.flowConfig.fetchFlow(this.hass,e.continueFlowId)}catch(n){this.closeDialog();let e=n.message||n.body||"Unknown error";return"string"!=typeof e&&(e=JSON.stringify(e)),void(0,h.Ys)(this,{title:this.hass.localize("ui.panel.config.integrations.config_flow.error"),text:`${this.hass.localize("ui.panel.config.integrations.config_flow.could_not_load")}: ${e}`})}}t===this._instance&&(this._processStep(i),this._loading=void 0)}},{kind:"method",key:"closeDialog",value:function(){if(!this._params)return;const e=Boolean(this._step&&["create_entry","abort"].includes(this._step.type));var t;(!this._step||e||this._params.continueFlowId||this._params.flowConfig.deleteFlow(this.hass,this._step.flow_id),this._step&&this._params.dialogClosedCallback)&&this._params.dialogClosedCallback({flowFinished:e,entryId:"result"in this._step?null===(t=this._step.result)||void 0===t?void 0:t.entry_id:void 0});this._loading=void 0,this._step=void 0,this._params=void 0,this._handler=void 0,this._unsubDataEntryFlowProgressed&&(this._unsubDataEntryFlowProgressed.then((e=>{e()})),this._unsubDataEntryFlowProgressed=void 0),(0,l.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){var e,t,i,n;return this._params?(0,a.dy)(v||(v=S` <ha-dialog open @closed="${0}" scrimClickAction escapeKeyAction hideActions> <div> ${0} </div> </ha-dialog> `),this.closeDialog,this._loading||null===this._step?(0,a.dy)(g||(g=S` <step-flow-loading .flowConfig="${0}" .hass="${0}" .loadingReason="${0}" .handler="${0}" .step="${0}"></step-flow-loading> `),this._params.flowConfig,this.hass,this._loading,this._handler,this._step):void 0===this._step?"":(0,a.dy)(m||(m=S` <div class="dialog-actions"> ${0} <ha-icon-button .label="${0}" .path="${0}" dialogAction="close"></ha-icon-button> </div> ${0} `),["form","menu","external","progress","data_entry_flow_progressed"].includes(null===(e=this._step)||void 0===e?void 0:e.type)&&null!==(t=this._params.manifest)&&void 0!==t&&t.is_built_in||null!==(i=this._params.manifest)&&void 0!==i&&i.documentation?(0,a.dy)(_||(_=S` <a href="${0}" target="_blank" rel="noreferrer noopener"> <ha-icon-button .label="${0}" .path="${0}"> </ha-icon-button></a> `),this._params.manifest.is_built_in?(0,u.R)(this.hass,`/integrations/${this._params.manifest.domain}`):null===(n=this._params)||void 0===n||null===(n=n.manifest)||void 0===n?void 0:n.documentation,this.hass.localize("ui.common.help"),F):"",this.hass.localize("ui.panel.config.integrations.config_flow.dismiss"),D,"form"===this._step.type?(0,a.dy)(y||(y=S` <step-flow-form .flowConfig="${0}" .step="${0}" .hass="${0}"></step-flow-form> `),this._params.flowConfig,this._step,this.hass):"external"===this._step.type?(0,a.dy)(k||(k=S` <step-flow-external .flowConfig="${0}" .step="${0}" .hass="${0}"></step-flow-external> `),this._params.flowConfig,this._step,this.hass):"abort"===this._step.type?(0,a.dy)(w||(w=S` <step-flow-abort .params="${0}" .step="${0}" .hass="${0}" .domain="${0}"></step-flow-abort> `),this._params,this._step,this.hass,this._step.handler):"progress"===this._step.type?(0,a.dy)(b||(b=S` <step-flow-progress .flowConfig="${0}" .step="${0}" .hass="${0}"></step-flow-progress> `),this._params.flowConfig,this._step,this.hass):"menu"===this._step.type?(0,a.dy)($||($=S` <step-flow-menu .flowConfig="${0}" .step="${0}" .hass="${0}"></step-flow-menu> `),this._params.flowConfig,this._step,this.hass):(0,a.dy)(C||(C=S` <step-flow-create-entry .flowConfig="${0}" .step="${0}" .hass="${0}"></step-flow-create-entry> `),this._params.flowConfig,this._step,this.hass))):a.Ld}},{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)(i,"firstUpdated",this,3)([e]),this.addEventListener("flow-update",(e=>{const{step:t,stepPromise:i}=e.detail;this._processStep(t||i)}))}},{kind:"method",key:"willUpdate",value:function(e){(0,o.Z)(i,"willUpdate",this,3)([e]),e.has("_step")&&this._step&&["external","progress"].includes(this._step.type)&&this._subscribeDataEntryFlowProgressed()}},{kind:"method",key:"_processStep",value:async function(e){if(e instanceof Promise){this._loading="loading_step";try{this._step=await e}catch(i){var t;return this.closeDialog(),void(0,h.Ys)(this,{title:this.hass.localize("ui.panel.config.integrations.config_flow.error"),text:null==i||null===(t=i.body)||void 0===t?void 0:t.message})}finally{this._loading=void 0}}else void 0!==e?(this._step=void 0,await this.updateComplete,this._step=e):this.closeDialog()}},{kind:"method",key:"_subscribeDataEntryFlowProgressed",value:async function(){this._unsubDataEntryFlowProgressed||(this._unsubDataEntryFlowProgressed=(0,d.X)(this.hass.connection,(async e=>{var t;e.data.flow_id===(null===(t=this._step)||void 0===t?void 0:t.flow_id)&&this._processStep(this._params.flowConfig.fetchFlow(this.hass,this._step.flow_id))})))}},{kind:"get",static:!0,key:"styles",value:function(){return[c.yu,(0,a.iv)(x||(x=S`ha-dialog{--dialog-content-padding:0}.dialog-actions{padding:16px;position:absolute;top:0;right:0;inset-inline-start:initial;inset-inline-end:0px;direction:var(--direction)}.dialog-actions>*{color:var(--secondary-text-color)}`))]}}]}}),a.oi);n()}catch(v){n(v)}}))},18694:function(e,t,i){"use strict";i.d(t,{t:function(){return m}});i(63721),i(71695),i(40251),i(47021);var n=i(57243),s=i(79983),o=i(1275),a=i(43373);let r,l,d,c,u,h,p,f,v,g=e=>e;const m=(e,t)=>(0,a.w)(e,t,{flowType:"config_flow",showDevices:!0,createFlow:async(e,i)=>{const[n]=await Promise.all([(0,s.Ky)(e,i,t.entryId),e.loadFragmentTranslation("config"),e.loadBackendTranslation("config",i),e.loadBackendTranslation("selector",i),e.loadBackendTranslation("title",i)]);return n},fetchFlow:async(e,t)=>{const i=await(0,s.D4)(e,t);return await e.loadFragmentTranslation("config"),await e.loadBackendTranslation("config",i.handler),await e.loadBackendTranslation("selector",i.handler),i},handleFlowStep:s.XO,deleteFlow:s.oi,renderAbortDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.abort.${t.reason}`,t.description_placeholders);return i?(0,n.dy)(r||(r=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):t.reason},renderShowFormStepHeader(e,t){return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.title`,t.description_placeholders)||e.localize(`component.${t.handler}.title`)},renderShowFormStepDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return i?(0,n.dy)(l||(l=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):""},renderShowFormStepFieldLabel(e,t,i,n){var s;if("expandable"===i.type)return e.localize(`component.${t.handler}.config.step.${t.step_id}.sections.${i.name}.name`);const o=null!=n&&null!==(s=n.path)&&void 0!==s&&s[0]?`sections.${n.path[0]}.`:"";return e.localize(`component.${t.handler}.config.step.${t.step_id}.${o}data.${i.name}`)||i.name},renderShowFormStepFieldHelper(e,t,i,s){var o;if("expandable"===i.type)return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.sections.${i.name}.description`);const a=null!=s&&null!==(o=s.path)&&void 0!==o&&o[0]?`sections.${s.path[0]}.`:"",r=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.${a}data_description.${i.name}`,t.description_placeholders);return r?(0,n.dy)(d||(d=g`<ha-markdown breaks .content="${0}"></ha-markdown>`),r):""},renderShowFormStepFieldError(e,t,i){return e.localize(`component.${t.translation_domain||t.translation_domain||t.handler}.config.error.${i}`,t.description_placeholders)||i},renderShowFormStepFieldLocalizeValue(e,t,i){return e.localize(`component.${t.handler}.selector.${i}`)},renderShowFormStepSubmitButton(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.submit`)||e.localize("ui.panel.config.integrations.config_flow."+(!1===t.last_step?"next":"submit"))},renderExternalStepHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize("ui.panel.config.integrations.config_flow.external_step.open_site")},renderExternalStepDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.${t.step_id}.description`,t.description_placeholders);return(0,n.dy)(c||(c=g` <p> ${0} </p> ${0} `),e.localize("ui.panel.config.integrations.config_flow.external_step.description"),i?(0,n.dy)(u||(u=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):"")},renderCreateEntryDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.create_entry.${t.description||"default"}`,t.description_placeholders);return(0,n.dy)(h||(h=g` ${0} <p> ${0} </p> `),i?(0,n.dy)(p||(p=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):"",e.localize("ui.panel.config.integrations.config_flow.created_config",{name:t.title}))},renderShowFormProgressHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`)},renderShowFormProgressDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.progress.${t.progress_action}`,t.description_placeholders);return i?(0,n.dy)(f||(f=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):""},renderMenuHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`)},renderMenuDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return i?(0,n.dy)(v||(v=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):""},renderMenuOption(e,t,i){return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_options.${i}`,t.description_placeholders)},renderLoadingDescription(e,t,i,n){if("loading_flow"!==t&&"loading_step"!==t)return"";const s=(null==n?void 0:n.handler)||i;return e.localize(`ui.panel.config.integrations.config_flow.loading.${t}`,{integration:s?(0,o.Lh)(e.localize,s):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},76085:function(e,t,i){"use strict";var n=i("73577"),s=i("72621"),o=(i("71695"),i("40251"),i("47021"),i("31622"),i("57243")),a=i("50778"),r=i("11297");const l=()=>i.e("2138").then(i.bind(i,41088));var d=i("18694"),c=i("95204");let u,h=e=>e;(0,n.Z)([(0,a.Mo)("step-flow-abort")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"params",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"domain",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(i,"firstUpdated",this,3)([e]),"missing_credentials"===this.step.reason&&this._handleMissingCreds()}},{kind:"method",key:"render",value:function(){return"missing_credentials"===this.step.reason?o.Ld:(0,o.dy)(u||(u=h` <h2> ${0} </h2> <div class="content"> ${0} </div> <div class="buttons"> <mwc-button @click="${0}">${0}</mwc-button> </div> `),this.params.flowConfig.renderAbortHeader?this.params.flowConfig.renderAbortHeader(this.hass,this.step):this.hass.localize(`component.${this.domain}.title`),this.params.flowConfig.renderAbortDescription(this.hass,this.step),this._flowDone,this.hass.localize("ui.panel.config.integrations.config_flow.close"))}},{kind:"method",key:"_handleMissingCreds",value:async function(){var e,t;e=this.params.dialogParentElement,t={selectedDomain:this.domain,manifest:this.params.manifest,applicationCredentialAddedCallback:()=>{var e;(0,d.t)(this.params.dialogParentElement,{dialogClosedCallback:this.params.dialogClosedCallback,startFlowHandler:this.domain,showAdvanced:null===(e=this.hass.userData)||void 0===e?void 0:e.showAdvanced})}},(0,r.B)(e,"show-dialog",{dialogTag:"dialog-add-application-credential",dialogImport:l,dialogParams:t}),this._flowDone()}},{kind:"method",key:"_flowDone",value:function(){(0,r.B)(this,"flow-update",{step:void 0})}},{kind:"get",static:!0,key:"styles",value:function(){return c.i}}]}}),o.oi)},27599:function(e,t,i){"use strict";i.a(e,(async function(e,t){try{var n=i(73577),s=(i(19083),i(71695),i(40251),i(61006),i(39527),i(99790),i(13334),i(36993),i(47021),i(31622),i(57243)),o=i(50778),a=i(27486),r=i(11297),l=i(79575),d=i(69181),c=i(80495),u=i(92374),h=i(4557),p=i(4383),f=i(95204),v=e([d]);d=(v.then?(await v)():v)[0];let g,m,_,y,k,w,b,$,C=e=>e;(0,n.Z)([(0,o.Mo)("step-flow-create-entry")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"field",key:"_devices",value(){return(0,a.Z)(((e,t,i)=>e&&i?t.filter((e=>e.config_entries.includes(i))):[]))}},{kind:"field",key:"_deviceEntities",value(){return(0,a.Z)(((e,t,i)=>t.filter((t=>t.device_id===e&&(!i||(0,l.M)(t.entity_id)===i)))))}},{kind:"method",key:"willUpdate",value:function(e){var t,i;if(!e.has("devices")&&!e.has("hass"))return;const n=this._devices(this.flowConfig.showDevices,Object.values(this.hass.devices),null===(t=this.step.result)||void 0===t?void 0:t.entry_id);if(1!==n.length||n[0].primary_config_entry!==(null===(i=this.step.result)||void 0===i?void 0:i.entry_id))return;const s=this._deviceEntities(n[0].id,Object.values(this.hass.entities),"assist_satellite");s.length&&s.some((e=>(0,c.Bg)(this.hass.states[e.entity_id])))&&(this._flowDone(),(0,p.k)(this,{deviceId:n[0].id}))}},{kind:"method",key:"render",value:function(){var e,t;const i=this.hass.localize,n=this._devices(this.flowConfig.showDevices,Object.values(this.hass.devices),null===(e=this.step.result)||void 0===e?void 0:e.entry_id);return(0,s.dy)(g||(g=C` <h2>${0}!</h2> <div class="content"> ${0} ${0} ${0} </div> <div class="buttons"> <mwc-button @click="${0}">${0}</mwc-button> </div> `),i("ui.panel.config.integrations.config_flow.success"),this.flowConfig.renderCreateEntryDescription(this.hass,this.step),"not_loaded"===(null===(t=this.step.result)||void 0===t?void 0:t.state)?(0,s.dy)(m||(m=C`<span class="error">${0}</span>`),i("ui.panel.config.integrations.config_flow.not_loaded")):s.Ld,0===n.length?s.Ld:(0,s.dy)(_||(_=C` <p> ${0}: </p> <div class="devices"> ${0} </div> `),i("ui.panel.config.integrations.config_flow.found_following_devices"),n.map((e=>{var t;return(0,s.dy)(y||(y=C` <div class="device"> <div> <b>${0}</b><br> ${0} </div> <ha-area-picker .hass="${0}" .device="${0}" .value="${0}" @value-changed="${0}"></ha-area-picker> </div> `),(0,u.jL)(e,this.hass),e.model||e.manufacturer?(0,s.dy)(w||(w=C`${0} ${0}`),e.model,e.manufacturer?(0,s.dy)(b||(b=C`(${0})`),e.manufacturer):""):(0,s.dy)(k||(k=C` `)),this.hass,e.id,null!==(t=e.area_id)&&void 0!==t?t:void 0,this._areaPicked)}))),this._flowDone,i("ui.panel.config.integrations.config_flow.finish"))}},{kind:"method",key:"_flowDone",value:function(){(0,r.B)(this,"flow-update",{step:void 0})}},{kind:"method",key:"_areaPicked",value:async function(e){const t=e.currentTarget,i=t.device,n=e.detail.value;try{await(0,u.t1)(this.hass,i,{area_id:n})}catch(s){(0,h.Ys)(this,{text:this.hass.localize("ui.panel.config.integrations.config_flow.error_saving_area",{error:s.message})}),t.value=null}}},{kind:"get",static:!0,key:"styles",value:function(){return[f.i,(0,s.iv)($||($=C`.devices{display:flex;flex-wrap:wrap;margin:-4px;max-height:600px;overflow-y:auto}.device{border:1px solid var(--divider-color);padding:5px;border-radius:4px;margin:4px;display:inline-block;width:250px}.buttons>:last-child{margin-left:auto;margin-inline-start:auto;margin-inline-end:initial}@media all and (max-width:450px),all and (max-height:500px){.device{width:100%}}.error{color:var(--error-color)}`))]}}]}}),s.oi);t()}catch(g){t(g)}}))},12924:function(e,t,i){"use strict";var n=i(73577),s=i(72621),o=(i(71695),i(47021),i(31622),i(57243)),a=i(50778),r=i(95204);let l,d,c=e=>e;(0,n.Z)([(0,a.Mo)("step-flow-external")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"method",key:"render",value:function(){const e=this.hass.localize;return(0,o.dy)(l||(l=c` <h2>${0}</h2> <div class="content"> ${0} <div class="open-button"> <a href="${0}" target="_blank" rel="noreferrer"> <mwc-button raised> ${0} </mwc-button> </a> </div> </div> `),this.flowConfig.renderExternalStepHeader(this.hass,this.step),this.flowConfig.renderExternalStepDescription(this.hass,this.step),this.step.url,e("ui.panel.config.integrations.config_flow.external_step.open_site"))}},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(i,"firstUpdated",this,3)([e]),window.open(this.step.url)}},{kind:"get",static:!0,key:"styles",value:function(){return[r.i,(0,o.iv)(d||(d=c`.open-button{text-align:center;padding:24px 0}.open-button a{text-decoration:none}`))]}}]}}),o.oi)},53139:function(e,t,i){"use strict";var n=i(73577),s=i(72621),o=(i(19083),i(71695),i(19423),i(40251),i(61006),i(39527),i(92181),i(67670),i(41360),i(47021),i(14394),i(31622),i(57243)),a=i(50778),r=i(38653),l=i(11297),d=i(3812),c=(i(17949),i(90977),i(12328)),u=(i(42877),i(61158),i(41946)),h=i(95204),p=i(66193),f=i(44699);let v,g,m,_,y,k,w=e=>e;(0,n.Z)([(0,a.Mo)("step-flow-form")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_loading",value(){return!1}},{kind:"field",decorators:[(0,a.SB)()],key:"_stepData",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_errorMsg",value:void 0},{kind:"method",key:"disconnectedCallback",value:function(){(0,s.Z)(n,"disconnectedCallback",this,3)([]),this.removeEventListener("keydown",this._handleKeyDown)}},{kind:"method",key:"render",value:function(){const e=this.step,t=this._stepDataProcessed;return(0,o.dy)(v||(v=w` <h2>${0}</h2> <div class="content" @click="${0}"> ${0} ${0} <ha-form .hass="${0}" .data="${0}" .disabled="${0}" @value-changed="${0}" .schema="${0}" .error="${0}" .computeLabel="${0}" .computeHelper="${0}" .computeError="${0}" .localizeValue="${0}"></ha-form> </div> ${0} <div class="buttons"> ${0} </div> `),this.flowConfig.renderShowFormStepHeader(this.hass,this.step),this._clickHandler,this.flowConfig.renderShowFormStepDescription(this.hass,this.step),this._errorMsg?(0,o.dy)(g||(g=w`<ha-alert alert-type="error">${0}</ha-alert>`),this._errorMsg):"",this.hass,t,this._loading,this._stepDataChanged,(0,u.oT)(e.data_schema),e.errors,this._labelCallback,this._helperCallback,this._errorCallback,this._localizeValueCallback,e.preview?(0,o.dy)(m||(m=w`<div class="preview" @set-flow-errors="${0}"> <h3> ${0}: </h3> ${0} </div>`),this._setError,this.hass.localize("ui.panel.config.integrations.config_flow.preview"),(0,r.h)(`flow-preview-${(0,f.O)(e.preview)}`,{hass:this.hass,domain:e.preview,flowType:this.flowConfig.flowType,handler:e.handler,stepId:e.step_id,flowId:e.flow_id,stepData:t})):o.Ld,this._loading?(0,o.dy)(_||(_=w` <div class="submit-spinner"> <ha-circular-progress indeterminate></ha-circular-progress> </div> `)):(0,o.dy)(y||(y=w` <div> <mwc-button @click="${0}"> ${0} </mwc-button> </div> `),this._submitStep,this.flowConfig.renderShowFormStepSubmitButton(this.hass,this.step)))}},{kind:"method",key:"_setError",value:function(e){this.step=Object.assign(Object.assign({},this.step),{},{errors:e.detail})}},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(n,"firstUpdated",this,3)([e]),setTimeout((()=>this.shadowRoot.querySelector("ha-form").focus()),0),this.addEventListener("keydown",this._handleKeyDown)}},{kind:"method",key:"willUpdate",value:function(e){var t;(0,s.Z)(n,"willUpdate",this,3)([e]),e.has("step")&&null!==(t=this.step)&&void 0!==t&&t.preview&&i(2292)(`./flow-preview-${(0,f.O)(this.step.preview)}`)}},{kind:"method",key:"_clickHandler",value:function(e){(0,d.J)(e,!1)&&(0,l.B)(this,"flow-update",{step:void 0})}},{kind:"field",key:"_handleKeyDown",value(){return e=>{"Enter"===e.key&&this._submitStep()}}},{kind:"get",key:"_stepDataProcessed",value:function(){return void 0!==this._stepData||(this._stepData=(0,c.x)(this.step.data_schema)),this._stepData}},{kind:"method",key:"_submitStep",value:async function(){const e=this._stepData||{};if(!(void 0===e?void 0===this.step.data_schema.find((e=>e.required)):e&&this.step.data_schema.every((t=>!t.required||!["",void 0].includes(e[t.name])))))return void(this._errorMsg=this.hass.localize("ui.panel.config.integrations.config_flow.not_all_required_fields"));this._loading=!0,this._errorMsg=void 0;const t=this.step.flow_id,i={};Object.keys(e).forEach((t=>{const n=e[t];[void 0,""].includes(n)||(i[t]=n)}));try{const e=await this.flowConfig.handleFlowStep(this.hass,this.step.flow_id,i);if(!this.step||t!==this.step.flow_id)return;(0,l.B)(this,"flow-update",{step:e})}catch(n){n&&n.body?(n.body.message&&(this._errorMsg=n.body.message),n.body.errors&&(this.step=Object.assign(Object.assign({},this.step),{},{errors:n.body.errors})),n.body.message||n.body.errors||(this._errorMsg="Unknown error occurred")):this._errorMsg="Unknown error occurred"}finally{this._loading=!1}}},{kind:"method",key:"_stepDataChanged",value:function(e){this._stepData=e.detail.value}},{kind:"field",key:"_labelCallback",value(){return(e,t,i)=>this.flowConfig.renderShowFormStepFieldLabel(this.hass,this.step,e,i)}},{kind:"field",key:"_helperCallback",value(){return(e,t)=>this.flowConfig.renderShowFormStepFieldHelper(this.hass,this.step,e,t)}},{kind:"field",key:"_errorCallback",value(){return e=>this.flowConfig.renderShowFormStepFieldError(this.hass,this.step,e)}},{kind:"field",key:"_localizeValueCallback",value(){return e=>this.flowConfig.renderShowFormStepFieldLocalizeValue(this.hass,this.step,e)}},{kind:"get",static:!0,key:"styles",value:function(){return[p.Qx,h.i,(0,o.iv)(k||(k=w`.error{color:red}.submit-spinner{margin-right:16px;margin-inline-end:16px;margin-inline-start:initial}ha-alert,ha-form{margin-top:24px;display:block}h2{word-break:break-word;padding-inline-end:72px;direction:var(--direction)}`))]}}]}}),o.oi)},45385:function(e,t,i){"use strict";var n=i(73577),s=(i(71695),i(47021),i(57243)),o=i(50778);i(90977);let a,r,l,d=e=>e;(0,n.Z)([(0,o.Mo)("step-flow-loading")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"loadingReason",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"handler",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"method",key:"render",value:function(){const e=this.flowConfig.renderLoadingDescription(this.hass,this.loadingReason,this.handler,this.step);return(0,s.dy)(a||(a=d` <div class="init-spinner"> ${0} <ha-circular-progress indeterminate></ha-circular-progress> </div> `),e?(0,s.dy)(r||(r=d`<div>${0}</div>`),e):"")}},{kind:"get",static:!0,key:"styles",value:function(){return(0,s.iv)(l||(l=d`.init-spinner{padding:50px 100px;text-align:center}ha-circular-progress{margin-top:16px}`))}}]}}),s.oi)},29065:function(e,t,i){"use strict";var n=i(73577),s=(i(71695),i(13334),i(47021),i(87319),i(57243)),o=i(50778),a=(i(54220),i(95204)),r=i(11297);let l,d,c,u,h=e=>e;(0,n.Z)([(0,o.Mo)("step-flow-menu")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"method",key:"render",value:function(){let e,t;if(Array.isArray(this.step.menu_options)){e=this.step.menu_options,t={};for(const i of e)t[i]=this.flowConfig.renderMenuOption(this.hass,this.step,i)}else e=Object.keys(this.step.menu_options),t=this.step.menu_options;const i=this.flowConfig.renderMenuDescription(this.hass,this.step);return(0,s.dy)(l||(l=h` <h2>${0}</h2> ${0} <div class="options"> ${0} </div> `),this.flowConfig.renderMenuHeader(this.hass,this.step),i?(0,s.dy)(d||(d=h`<div class="content">${0}</div>`),i):"",e.map((e=>(0,s.dy)(c||(c=h` <mwc-list-item hasMeta .step="${0}" @click="${0}"> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </mwc-list-item> `),e,this._handleStep,t[e]))))}},{kind:"method",key:"_handleStep",value:function(e){(0,r.B)(this,"flow-update",{stepPromise:this.flowConfig.handleFlowStep(this.hass,this.step.flow_id,{next_step_id:e.currentTarget.step})})}},{kind:"field",static:!0,key:"styles",value(){return[a.i,(0,s.iv)(u||(u=h`.options{margin-top:20px;margin-bottom:8px}.content{padding-bottom:16px;border-bottom:1px solid var(--divider-color)}.content+.options{margin-top:8px}mwc-list-item{--mdc-list-side-padding:24px}`))]}}]}}),s.oi)},72959:function(e,t,i){"use strict";var n=i(73577),s=(i(71695),i(47021),i(31622),i(57243)),o=i(50778),a=(i(90977),i(95204));let r,l,d=e=>e;(0,n.Z)([(0,o.Mo)("step-flow-progress")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"method",key:"render",value:function(){return(0,s.dy)(r||(r=d` <h2> ${0} </h2> <div class="content"> <ha-circular-progress indeterminate></ha-circular-progress> ${0} </div> `),this.flowConfig.renderShowFormProgressHeader(this.hass,this.step),this.flowConfig.renderShowFormProgressDescription(this.hass,this.step))}},{kind:"get",static:!0,key:"styles",value:function(){return[a.i,(0,s.iv)(l||(l=d`.content{padding:50px 100px;text-align:center}ha-circular-progress{margin-bottom:16px}`))]}}]}}),s.oi)},95204:function(e,t,i){"use strict";i.d(t,{i:function(){return s}});let n;const s=(0,i(57243).iv)(n||(n=(e=>e)`h2{margin:24px 38px 0 0;margin-inline-start:0px;margin-inline-end:38px;padding:0 24px;padding-inline-start:24px;padding-inline-end:24px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(
--mdc-typography-headline6-font-family,
var(--mdc-typography-font-family, Roboto, sans-serif)
);font-size:var(--mdc-typography-headline6-font-size, 1.25rem);line-height:var(--mdc-typography-headline6-line-height, 2rem);font-weight:var(--mdc-typography-headline6-font-weight,500);letter-spacing:var(--mdc-typography-headline6-letter-spacing, .0125em);text-decoration:var(--mdc-typography-headline6-text-decoration,inherit);text-transform:var(--mdc-typography-headline6-text-transform,inherit);box-sizing:border-box}.content,.preview{margin-top:20px;padding:0 24px}.buttons{position:relative;padding:8px 16px 8px 24px;margin:8px 0 0;color:var(--primary-color);display:flex;justify-content:flex-end}ha-markdown{overflow-wrap:break-word}ha-markdown a{color:var(--primary-color)}ha-markdown img:first-child:last-child{display:block;margin:0 auto}`))},4383:function(e,t,i){"use strict";i.d(t,{k:function(){return o}});i(71695),i(40251),i(47021);var n=i(11297);const s=()=>Promise.all([i.e("1552"),i.e("686"),i.e("6898"),i.e("513"),i.e("2206"),i.e("4224"),i.e("1533"),i.e("5958"),i.e("6160"),i.e("3732")]).then(i.bind(i,66738)),o=(e,t)=>{(0,n.B)(e,"show-dialog",{dialogTag:"ha-voice-assistant-setup-dialog",dialogImport:s,dialogParams:t})}},88233:function(e,t,i){"use strict";i.d(t,{E:function(){return o}});i(71695),i(40251),i(47021);var n=i(11297);const s=()=>Promise.all([i.e("1552"),i.e("8006"),i.e("2311"),i.e("5220"),i.e("9009"),i.e("680"),i.e("6216")]).then(i.bind(i,40600)),o=(e,t)=>{(0,n.B)(e,"show-dialog",{dialogTag:"dialog-area-registry-detail",dialogImport:s,dialogParams:t})}},26205:function(e,t,i){"use strict";i.d(t,{R:function(){return n}});i(19083),i(61006);const n=(e,t)=>`https://${e.config.version.includes("b")?"rc":e.config.version.includes("dev")?"next":"www"}.home-assistant.io${t}`},87319:function(e,t,i){"use strict";var n=i(9065),s=i(50778),o=i(65703),a=i(46289);let r=class extends o.K{};r.styles=[a.W],r=(0,n.gn)([(0,s.Mo)("mwc-list-item")],r)},68107:function(e,t,i){"use strict";var n=i(40810),s=i(73994),o=i(63983),a=i(71998),r=i(4576);n({target:"Iterator",proto:!0,real:!0},{every:function(e){a(this),o(e);var t=r(this),i=0;return!s(t,(function(t,n){if(!e(t,i++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},92181:function(e,t,i){"use strict";i(68107)}}]);
//# sourceMappingURL=9045.c53528c5b41f7eaa.js.map