iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
8 lines • 37.3 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["46916"],{46355:function(i,t,e){e.d(t,{D:()=>y,S:()=>v});e(9359),e(56475),e(40251);var n=e(57243),a=e(75101),o=e(57816),s=e(91715),r=e(38572),l=e(76131),d=e(72548),c=e(91395),h=e(73192),g=e(72344),u=e(83523);let p,m,_,f=i=>i;const v=["zha","zwave_js","matter"],y=async(i,t,e,v)=>{if(null!=v&&v.domain){const i=await t.loadBackendTranslation("title",v.domain);v.domain=(0,o.Lh)(i,v.domain)}if(null!=v&&v.brand){var y;const i=await(0,s.G)(t);v.brand=(null===(y=i.core.integration[v.brand])||void 0===y?void 0:y.name)||v.brand}if("zwave_js"===e){const o=null!=v&&v.config_entry?void 0:(await(0,a.pB)(t,{domain:e})).filter((i=>!i.disabled_by));if(!((0,g.p)(t,"zwave_js")&&(null!=v&&v.config_entry||null!=o&&o.length)))return void(0,l.showConfirmationDialog)(i,{title:t.localize("ui.panel.config.integrations.config_flow.missing_zwave_zigbee_title",{integration:"Z-Wave"}),text:t.localize("ui.panel.config.integrations.config_flow.missing_zwave_zigbee",{integration:"Z-Wave",brand:(null==v?void 0:v.brand)||(null==v?void 0:v.domain)||"Z-Wave",supported_hardware_link:(0,n.dy)(p||(p=f`<a href="${0}" target="_blank" rel="noreferrer">${0}</a>`),(0,h.R)(t,"/docs/z-wave/controllers"),t.localize("ui.panel.config.integrations.config_flow.supported_hardware"))}),confirmText:t.localize("ui.panel.config.integrations.config_flow.proceed"),confirm:()=>{(0,r.t)(i,{startFlowHandler:"zwave_js"})}});(0,c.B)(i,{entry_id:(null==v?void 0:v.config_entry)||o[0].entry_id})}else if("zha"===e){const o=null!=v&&v.config_entry?void 0:(await(0,a.pB)(t,{domain:e})).filter((i=>!i.disabled_by));if(!((0,g.p)(t,"zha")&&(null!=v&&v.config_entry||null!=o&&o.length)))return void(0,l.showConfirmationDialog)(i,{title:t.localize("ui.panel.config.integrations.config_flow.missing_zwave_zigbee_title",{integration:"Zigbee"}),text:t.localize("ui.panel.config.integrations.config_flow.missing_zwave_zigbee",{integration:"Zigbee",brand:(null==v?void 0:v.brand)||(null==v?void 0:v.domain)||"Zigbee",supported_hardware_link:(0,n.dy)(m||(m=f`<a href="${0}" target="_blank" rel="noreferrer">${0}</a>`),(0,h.R)(t,"/integrations/zha/#known-working-zigbee-radio-modules"),t.localize("ui.panel.config.integrations.config_flow.supported_hardware"))}),confirmText:t.localize("ui.panel.config.integrations.config_flow.proceed"),confirm:()=>{(0,r.t)(i,{startFlowHandler:"zha"})}});(0,u.c)("/config/zha/add")}else if("matter"===e){const o=null!=v&&v.config_entry?void 0:(await(0,a.pB)(t,{domain:e})).filter((i=>!i.disabled_by));if(!((0,g.p)(t,e)&&(null!=v&&v.config_entry||null!=o&&o.length)))return void(0,l.showConfirmationDialog)(i,{title:t.localize("ui.panel.config.integrations.config_flow.missing_zwave_zigbee_title",{integration:"Matter"}),text:t.localize("ui.panel.config.integrations.config_flow.missing_matter",{integration:"Matter",brand:(null==v?void 0:v.brand)||(null==v?void 0:v.domain)||"Matter",supported_hardware_link:(0,n.dy)(_||(_=f`<a href="${0}" target="_blank" rel="noreferrer">${0}</a>`),(0,h.R)(t,"/integrations/matter"),t.localize("ui.panel.config.integrations.config_flow.supported_hardware"))}),confirmText:t.localize("ui.panel.config.integrations.config_flow.proceed"),confirm:()=>{(0,r.t)(i,{startFlowHandler:"matter"})}});(0,d.H)(i)}}},87707:function(i,t,e){e.d(t,{Q:()=>n});const n=i=>!(!i.detail.selected||"property"!==i.detail.source)&&(i.currentTarget.selected=!1,!0)},73729:function(i,t,e){e.d(t,{i:()=>m});var n=e(61701),a=e(72621),o=(e(22152),e(71695),e(47021),e(74966)),s=e(51408),r=e(57243),l=e(50778),d=e(76525);e(23334);let c,h,g,u=i=>i;const p=["button","ha-list-item"],m=(i,t)=>{var e;return(0,r.dy)(c||(c=u` <div class="header_title"> <ha-icon-button .label="${0}" .path="${0}" dialogAction="close" class="header_button"></ha-icon-button> <span>${0}</span> </div> `),null!==(e=null==i?void 0:i.localize("ui.common.close"))&&void 0!==e?e:"Close","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",t)};(0,n.Z)([(0,l.Mo)("ha-dialog")],(function(i,t){class e extends t{constructor(...t){super(...t),i(this)}}return{F:e,d:[{kind:"field",key:d.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(i,t){var e;null===(e=this.contentElement)||void 0===e||e.scrollTo(i,t)}},{kind:"method",key:"renderHeading",value:function(){return(0,r.dy)(h||(h=u`<slot name="heading"> ${0} </slot>`),(0,a.Z)(e,"renderHeading",this,3)([]))}},{kind:"method",key:"firstUpdated",value:function(){var i;(0,a.Z)(e,"firstUpdated",this,3)([]),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,p].join(", "),this._updateScrolledAttribute(),null===(i=this.contentElement)||void 0===i||i.addEventListener("scroll",this._onScroll,{passive:!0})}},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)(e,"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(){return[s.W,(0,r.iv)(g||(g=u`: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)},5828:function(i,t,e){e.r(t),e.d(t,{HaIconButtonPrev:()=>d});var n=e(61701),a=(e(71695),e(47021),e(57243)),o=e(50778),s=e(5111);e(23334);let r,l=i=>i;let d=(0,n.Z)([(0,o.Mo)("ha-icon-button-prev")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_icon",value(){return"rtl"===s.E.document.dir?"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z":"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"}},{kind:"method",key:"render",value:function(){var i;return(0,a.dy)(r||(r=l` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(i=this.hass)||void 0===i?void 0:i.localize("ui.common.back"))||"Back",this._icon)}}]}}),a.oi)},13928:function(i,t,e){e.r(t),e.d(t,{HaIconNext:()=>r});var n=e(61701),a=(e(71695),e(47021),e(50778)),o=e(5111),s=e(37583);let r=(0,n.Z)([(0,a.Mo)("ha-icon-next")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",decorators:[(0,a.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"}}]}}),s.HaSvgIcon)},91715:function(i,t,e){e.d(t,{G:()=>n,p:()=>a});e(71695),e(47021);const n=i=>i.callWS({type:"integration/descriptions"}),a=(i,t)=>{if(i){if(t in i){const e=i[t];if("integration_type"in e)return e}for(const e of Object.values(i))if("integrations"in e&&e.integrations&&t in e.integrations)return e.integrations[t]}}},24391:function(i,t,e){e.a(i,(async function(i,n){try{e.r(t);var a=e(61701),o=e(72621),s=(e(19083),e(71695),e(92745),e(61893),e(9359),e(56475),e(31526),e(70104),e(19423),e(40251),e(19134),e(61006),e(47706),e(88044),e(47021),e(31622),e(2060),e(41298)),r=e(57243),l=e(50778),d=e(20552),c=e(69634),h=e(27486),g=e(72344),u=e(36522),p=e(46355),m=e(83523),_=e(1416),f=e(73729),v=(e(5828),e(36841),e(75101)),y=e(15681),k=e(57816),w=e(91715),b=e(38572),x=e(76131),$=e(28008),L=e(47641),z=e(98908),C=e(1213),B=e(17170),P=e(84361),M=i([z,C,B]);[z,C,B]=M.then?(await M)():M;let I,S,F,H,j,D,Z,O,A=i=>i;(0,a.Z)([(0,l.Mo)("dialog-add-integration")],(function(i,t){class e extends t{constructor(...t){super(...t),i(this)}}return{F:e,d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_integrations",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_helpers",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_initialFilter",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_filter",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_pickedBrand",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_prevPickedBrand",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_flowsInProgress",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_open",value(){return!1}},{kind:"field",decorators:[(0,l.SB)()],key:"_narrow",value(){return!1}},{kind:"field",key:"_width",value:void 0},{kind:"field",key:"_height",value:void 0},{kind:"method",key:"showDialog",value:async function(i){const t=this._load();if(this._open=!0,this._pickedBrand=null==i?void 0:i.brand,this._initialFilter=null==i?void 0:i.initialFilter,this._narrow=matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches,null!=i&&i.domain&&this._createFlow(i.domain),null!=i&&i.brand){var e;await t;const n=null===(e=this._integrations)||void 0===e?void 0:e[i.brand];n&&"integrations"in n&&n.integrations&&this._fetchFlowsInProgress(Object.keys(n.integrations))}}},{kind:"method",key:"closeDialog",value:function(){this._open=!1,this._integrations=void 0,this._helpers=void 0,this._pickedBrand=void 0,this._prevPickedBrand=void 0,this._flowsInProgress=void 0,this._filter=void 0,this._width=void 0,this._height=void 0,(0,u.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"willUpdate",value:function(i){if((0,o.Z)(e,"willUpdate",this,3)([i]),this.hasUpdated||(0,L.o)(),void 0===this._filter&&void 0!==this._initialFilter&&(this._filter=this._initialFilter),void 0!==this._initialFilter&&""===this._filter)this._initialFilter=void 0,this._filter=void 0,this._width=void 0,this._height=void 0;else if(this.hasUpdated&&i.has("_filter")&&!i.has("_open")&&(!this._width||!this._height)){var t;const i=null===(t=this.shadowRoot.querySelector("mwc-list"))||void 0===t?void 0:t.getBoundingClientRect();this._width=null==i?void 0:i.width,this._height=null==i?void 0:i.height}}},{kind:"field",key:"_filterIntegrations",value(){return(0,h.Z)(((i,t,e,n,a)=>{const o=p.S.filter((i=>e.includes(i))).map((i=>({name:n(`ui.panel.config.integrations.add_${i}_device`),domain:i,config_flow:!0,is_built_in:!0,is_add:!0}))).sort(((i,t)=>(0,_.fe)(i.name,t.name,this.hass.locale.language))),r=[],l=[];if(Object.entries(i).forEach((([i,t])=>{if(!("integration_type"in t)||"hardware"!==t.integration_type)if("integration_type"in t&&(t.config_flow||t.iot_standards||t.supported_by)){var e;const a=t.supported_by?(0,w.p)(this._integrations,t.supported_by):t;if(!a)return;r.push({domain:i,name:t.name||(0,k.Lh)(n,i),config_flow:a.config_flow,iot_standards:a.iot_standards,supported_by:t.supported_by,is_built_in:!1!==a.is_built_in,overwrites_built_in:t.overwrites_built_in,cloud:null===(e=a.iot_class)||void 0===e?void 0:e.startsWith("cloud_"),single_config_entry:t.single_config_entry})}else if("integration_type"in t||!("iot_standards"in t)&&!("integrations"in t)){if(a&&"integration_type"in t){var o;l.push({domain:i,name:t.name||(0,k.Lh)(n,i),config_flow:t.config_flow,is_built_in:!1!==t.is_built_in,overwrites_built_in:t.overwrites_built_in,cloud:null===(o=t.iot_class)||void 0===o?void 0:o.startsWith("cloud_")})}}else r.push({domain:i,name:t.name||(0,k.Lh)(n,i),iot_standards:t.iot_standards,integrations:t.integrations?Object.entries(t.integrations).map((([i,t])=>t.name||(0,k.Lh)(n,i))):void 0,domains:t.integrations?Object.keys(t.integrations):void 0,is_built_in:!1!==t.is_built_in,overwrites_built_in:t.overwrites_built_in})})),a){const i={keys:[{name:"name",weight:5},{name:"domain",weight:5},{name:"integrations",weight:2},"supported_by","iot_standards"],isCaseSensitive:!1,minMatchCharLength:Math.min(a.length,2),threshold:.2,ignoreDiacritics:!0},e=Object.entries(t).map((([i,t])=>{var e;return{domain:i,name:t.name||(0,k.Lh)(n,i),config_flow:t.config_flow,is_helper:!0,is_built_in:!1!==t.is_built_in,cloud:null===(e=t.iot_class)||void 0===e?void 0:e.startsWith("cloud_")}}));return[...new s.Z(r,i).search(a).map((i=>i.item)),...new s.Z(l,i).search(a).map((i=>i.item)),...new s.Z(e,i).search(a).map((i=>i.item))]}return[...o,...r.sort(((i,t)=>(0,_.fe)(i.name||"",t.name||"",this.hass.locale.language)))]}))}},{kind:"method",key:"_getIntegrations",value:function(){return this._filterIntegrations(this._integrations,this._helpers,this.hass.config.components,this.hass.localize,this._filter)}},{kind:"method",key:"render",value:function(){var i;if(!this._open)return r.Ld;const t=this._integrations?this._getIntegrations():void 0,e=this._pickedBrand?(null===(i=this._integrations)||void 0===i?void 0:i[this._pickedBrand])||(0,w.p)(this._integrations,this._pickedBrand):void 0;return(0,r.dy)(I||(I=A`<ha-dialog open ="${0}" scrimClickAction hideActions .heading="${0}"> ${0} </ha-dialog>`),this.closeDialog,(0,f.i)(this.hass,this.hass.localize("ui.panel.config.integrations.new")),!this._pickedBrand||this._integrations&&!e?this._renderAll(t):(0,r.dy)(S||(S=A`<div slot="heading"> <ha-icon-button-prev ="${0}"></ha-icon-button-prev> <h2 class="mdc-dialog__title"> ${0} </h2> </div> ${0}`),this._prevClicked,this._calculateBrandHeading(e),this._renderIntegration(e)))}},{kind:"method",key:"_calculateBrandHeading",value:function(i){var t,e;return null==i||!i.iot_standards||"integrations"in i||null!==(t=this._flowsInProgress)&&void 0!==t&&t.length?!i||null!=i&&i.iot_standards||"integrations"in i||null===(e=this._flowsInProgress)||void 0===e||!e.length?this.hass.localize("ui.panel.config.integrations.what_to_add"):this.hass.localize("ui.panel.config.integrations.confirm_add_discovered"):this.hass.localize("ui.panel.config.integrations.what_device_type")}},{kind:"method",key:"_renderIntegration",value:function(i){return(0,r.dy)(F||(F=A`<ha-domain-integrations .hass="${0}" .domain="${0}" .integration="${0}" .flowsInProgress="${0}" style="${0}" -dialog="${0}" -by="${0}" -brand="${0}"></ha-domain-integrations>`),this.hass,this._pickedBrand,i,this._flowsInProgress,(0,c.V)({minWidth:`${this._width}px`,minHeight:"581px"}),this.closeDialog,this._handleSupportedByEvent,this._handleSelectBrandEvent)}},{kind:"method",key:"_handleSelectBrandEvent",value:function(i){this._prevPickedBrand=this._pickedBrand,this._pickedBrand=i.detail.brand}},{kind:"method",key:"_handleSupportedByEvent",value:function(i){this._supportedBy(i.detail.integration)}},{kind:"method",key:"_supportedBy",value:function(i){const t=(0,w.p)(this._integrations,i.supported_by);(0,x.showConfirmationDialog)(this,{text:this.hass.localize("ui.panel.config.integrations.config_flow.supported_brand_flow",{supported_brand:i.name||(0,k.Lh)(this.hass.localize,i.domain),flow_domain_name:(null==t?void 0:t.name)||(0,k.Lh)(this.hass.localize,i.supported_by)}),confirm:()=>{this.closeDialog(),p.S.includes(i.supported_by)?(0,p.D)(this,this.hass,i.supported_by):t?this._handleIntegrationPicked({domain:i.supported_by,name:t.name||(0,k.Lh)(this.hass.localize,i.supported_by),config_flow:t.config_flow,iot_standards:t.iot_standards}):(0,x.showAlertDialog)(this,{text:"Integration not found",warning:!0})}})}},{kind:"method",key:"_renderAll",value:function(i){return(0,r.dy)(H||(H=A`<search-input .hass="${0}" dialogInitialFocus="${0}" .filter="${0}" -changed="${0}" .label="${0}" ="${0}"></search-input> ${0} `),this.hass,(0,d.o)(this._narrow?void 0:""),this._filter,this._filterChanged,this.hass.localize("ui.panel.config.integrations.search_brand"),this._maybeSubmit,i?(0,r.dy)(j||(j=A`<mwc-list dialogInitialFocus="${0}"> <lit-virtualizer scroller tabindex="-1" class="ha-scrollbar" style="${0}" ="${0}" ="${0}" .items="${0}" .keyFunction="${0}" .renderItem="${0}"> </lit-virtualizer> </mwc-list>`),(0,d.o)(this._narrow?"":void 0),(0,c.V)({width:`${this._width}px`,height:this._narrow?"calc(100vh - 184px)":"500px"}),this._integrationPicked,this._handleKeyPress,i,this._keyFunction,this._renderRow):(0,r.dy)(D||(D=A`<div class="flex center"> <ha-spinner></ha-spinner> </div>`)))}},{kind:"field",key:"_keyFunction",value(){return i=>i.domain}},{kind:"field",key:"_renderRow",value(){return i=>i?(0,r.dy)(Z||(Z=A` <ha-integration-list-item brand .hass="${0}" .integration="${0}" tabindex="0"> </ha-integration-list-item> `),this.hass,i):r.Ld}},{kind:"method",key:"_load",value:async function(){const i=await(0,w.G)(this.hass);for(const t in i.custom.integration)Object.prototype.hasOwnProperty.call(i.custom.integration,t)&&(i.custom.integration[t].is_built_in=!1);this._integrations=Object.assign(Object.assign({},i.core.integration),i.custom.integration);for(const t in i.custom.helper)Object.prototype.hasOwnProperty.call(i.custom.helper,t)&&(i.custom.helper[t].is_built_in=!1);this._helpers=Object.assign(Object.assign({},i.core.helper),i.custom.helper),this.hass.loadBackendTranslation("title",i.core.translated_name,!0)}},{kind:"method",key:"_filterChanged",value:async function(i){this._filter=i.detail.value}},{kind:"method",key:"_integrationPicked",value:function(i){const t=i.target.closest("ha-integration-list-item");t&&this._handleIntegrationPicked(t.integration)}},{kind:"method",key:"_handleKeyPress",value:function(i){"Enter"===i.key&&this._integrationPicked(i)}},{kind:"method",key:"_handleIntegrationPicked",value:async function(i){if(i.supported_by)return void this._supportedBy(i);if(i.is_add)return(0,p.D)(this,this.hass,i.domain),void this.closeDialog();if(i.is_helper)return this.closeDialog(),void(0,m.c)(`/config/helpers/add?domain=${i.domain}`);if(i.integrations){let t=i.domains||[];return"apple"===i.domain&&(t=t.filter((i=>"homekit_controller"!==i))),this._fetchFlowsInProgress(t),void(this._pickedBrand=i.domain)}if(p.S.includes(i.domain)&&(0,g.p)(this.hass,i.domain))return void(this._pickedBrand=i.domain);if(i.iot_standards)return void(this._pickedBrand=i.domain);if(i.single_config_entry){if((await(0,v.pB)(this.hass,{domain:i.domain})).length>0){this.closeDialog();const t=await this.hass.loadBackendTranslation("title",i.name);return void(0,x.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.integrations.config_flow.single_config_entry_title"),text:this.hass.localize("ui.panel.config.integrations.config_flow.single_config_entry",{integration_name:(0,k.Lh)(t,i.name)})})}}if(i.config_flow)return void this._createFlow(i.domain);if("cloud"===i.domain&&(0,g.p)(this.hass,"cloud"))return this.closeDialog(),void(0,m.c)("/config/cloud");if(["google_assistant","alexa"].includes(i.domain)&&(0,g.p)(this.hass,"cloud"))return this.closeDialog(),void(0,m.c)("/config/voice-assistants/assistants");const t=await(0,k.t4)(this.hass,i.domain);(0,P.u)(this,{manifest:t})}},{kind:"method",key:"_createFlow",value:async function(i){var t;const e=await this._fetchFlowsInProgress([i]);if(null!=e&&e.length)return void(this._pickedBrand=i);const n=await(0,k.t4)(this.hass,i);this.closeDialog(),(0,b.t)(this,{startFlowHandler:i,showAdvanced:null===(t=this.hass.userData)||void 0===t?void 0:t.showAdvanced,manifest:n,navigateToResult:!0})}},{kind:"method",key:"_fetchFlowsInProgress",value:async function(i){const t=(await(0,y.D7)(this.hass.connection)).filter((t=>i.includes(t.handler)||"alternative_domain"in t.context&&i.includes(t.context.alternative_domain)));return t.length&&(this._flowsInProgress=t),t}},{kind:"method",key:"_maybeSubmit",value:function(i){if("Enter"!==i.key)return;const t=this._getIntegrations();t.length>0&&this._handleIntegrationPicked(t[0])}},{kind:"method",key:"_prevClicked",value:function(){this._pickedBrand=this._prevPickedBrand,this._prevPickedBrand||(this._flowsInProgress=void 0),this._prevPickedBrand=void 0}},{kind:"field",static:!0,key:"styles",value(){return[$.$c,$.yu,(0,r.iv)(O||(O=A` all and (min-width:550px){ha-dialog{--mdc-dialog-min-width:500px}}ha-dialog{--dialog-content-padding:0}search-input{display:block;margin:16px 16px 0}.divider{border-bottom-color:var(--divider-color)}h2{padding-inline-end:66px;direction:var(--direction)}p{text-align:center;padding:16px;margin:0}p>a{color:var(--primary-color)}.flex.center{display:flex;justify-content:center;align-items:center}ha-spinner{margin:24px 0}mwc-list{position:relative}lit-virtualizer{contain:size layout!important}ha-integration-list-item{width:100%}ha-icon-button-prev{color:var(--secondary-text-color);position:absolute;left:16px;top:14px;inset-inline-end:initial;inset-inline-start:16px;direction:var(--direction)}.mdc-dialog__title{margin:0;margin-bottom:8px;margin-left:48px;margin-inline-start:48px;margin-inline-end:initial;padding:24px 24px 0 24px;color:var(--mdc-dialog-heading-ink-color,rgba(0,0,0,.87));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)}`))]}}]}}),r.oi);n()}catch(I){n(I)}}))},98908:function(i,t,e){e.a(i,(async function(i,t){try{var n=e(61701),a=(e(19083),e(71695),e(61893),e(9359),e(56475),e(70104),e(19423),e(40251),e(61006),e(88044),e(47021),e(57243)),o=e(50778),s=e(72344),r=e(36522),l=e(46355),d=e(87707),c=e(83523),h=e(1416),g=e(15681),u=e(57816),p=e(38572),m=e(28008),_=e(88238),f=e(1213),v=e(84361),y=i([f]);f=(y.then?(await y)():y)[0];let k,w,b,x,$,L,z,C,B,P,M,I=i=>i;const S={zigbee:"zha",zwave:"zwave_js"};(0,n.Z)([(0,o.Mo)("ha-domain-integrations")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"domain",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"integration",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"flowsInProgress",value:void 0},{kind:"method",key:"render",value:function(){var i,t,e,n,o,s;return(0,a.dy)(k||(k=I`<mwc-list> ${0} ${0} ${0} ${0} ${0} </mwc-list> `),null!==(i=this.flowsInProgress)&&void 0!==i&&i.length?(0,a.dy)(w||(w=I`<h3> ${0} </h3> ${0} <li divider role="separator"></li> ${0}`),this.hass.localize("ui.panel.config.integrations.discovered"),this.flowsInProgress.map((i=>{var t;return(0,a.dy)(b||(b=I`<mwc-list-item graphic="medium" .flow="${0}" -selected="${0}" hasMeta> <img alt="" slot="graphic" loading="lazy" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </mwc-list-item>`),i,this._flowInProgressPicked,(0,_.X1)({domain:i.handler,type:"icon",useFallback:!0,darkOptimized:null===(t=this.hass.themes)||void 0===t?void 0:t.darkMode}),(0,g.WW)(this.hass.localize,i))})),this.integration&&"integrations"in this.integration&&this.integration.integrations?(0,a.dy)(x||(x=I`<h3> ${0} </h3>`),this.hass.localize("ui.panel.config.integrations.available_integrations")):""):"",null!==(t=this.integration)&&void 0!==t&&t.iot_standards?this.integration.iot_standards.filter((i=>l.S.includes(S[i]||i))).map((i=>{var t;const e=S[i]||i;return(0,a.dy)($||($=I`<mwc-list-item graphic="medium" .domain="${0}" -selected="${0}" hasMeta> <img slot="graphic" loading="lazy" alt="" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </mwc-list-item>`),e,this._standardPicked,(0,_.X1)({domain:e,type:"icon",useFallback:!0,darkOptimized:null===(t=this.hass.themes)||void 0===t?void 0:t.darkMode}),this.hass.localize(`ui.panel.config.integrations.add_${e}_device`))})):"",this.integration&&"integrations"in this.integration&&this.integration.integrations?Object.entries(this.integration.integrations).sort(((i,t)=>i[1].config_flow&&!t[1].config_flow?-1:t[1].config_flow&&!i[1].config_flow?0:(0,h.fe)(i[1].name||(0,u.Lh)(this.hass.localize,i[0]),t[1].name||(0,u.Lh)(this.hass.localize,t[0]),this.hass.locale.language))).map((([i,t])=>{var e;return(0,a.dy)(L||(L=I`<ha-integration-list-item .hass="${0}" .domain="${0}" .integration="${0}" -selected="${0}"> </ha-integration-list-item>`),this.hass,i,Object.assign(Object.assign({},t),{},{domain:i,name:t.name||(0,u.Lh)(this.hass.localize,i),is_built_in:!1!==t.is_built_in,cloud:null===(e=t.iot_class)||void 0===e?void 0:e.startsWith("cloud_")}),this._integrationPicked)})):"",l.S.includes(this.domain)?(0,a.dy)(z||(z=I`<mwc-list-item graphic="medium" .domain="${0}" -selected="${0}" hasMeta> <img slot="graphic" loading="lazy" alt="" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </mwc-list-item>`),this.domain,this._standardPicked,(0,_.X1)({domain:this.domain,type:"icon",useFallback:!0,darkOptimized:null===(e=this.hass.themes)||void 0===e?void 0:e.darkMode}),this.hass.localize(`ui.panel.config.integrations.add_${this.domain}_device`)):"",this.integration&&"config_flow"in this.integration&&this.integration.config_flow?(0,a.dy)(C||(C=I`${0}`),null!==(n=this.flowsInProgress)&&void 0!==n&&n.length?(0,a.dy)(B||(B=I`<mwc-list-item .domain="${0}" -selected="${0}" .integration="${0}" hasMeta> ${0} <ha-icon-next slot="meta"></ha-icon-next> </mwc-list-item>`),this.domain,this._integrationPicked,Object.assign(Object.assign({},this.integration),{},{domain:this.domain,name:this.integration.name||(0,u.Lh)(this.hass.localize,this.domain),is_built_in:!1!==this.integration.is_built_in,cloud:null===(o=this.integration.iot_class)||void 0===o?void 0:o.startsWith("cloud_")}),this.hass.localize("ui.panel.config.integrations.new_flow",{integration:this.integration.name||(0,u.Lh)(this.hass.localize,this.domain)})):(0,a.dy)(P||(P=I`<ha-integration-list-item .hass="${0}" .domain="${0}" .integration="${0}" -selected="${0}"> </ha-integration-list-item>`),this.hass,this.domain,Object.assign(Object.assign({},this.integration),{},{domain:this.domain,name:this.integration.name||(0,u.Lh)(this.hass.localize,this.domain),is_built_in:!1!==this.integration.is_built_in,cloud:null===(s=this.integration.iot_class)||void 0===s?void 0:s.startsWith("cloud_")}),this._integrationPicked)):"")}},{kind:"method",key:"_integrationPicked",value:async function(i){var t,e;if(!(0,d.Q)(i))return;const n=i.currentTarget.domain;if(["cloud","google_assistant","alexa"].includes(n)&&(0,s.p)(this.hass,"cloud"))return void(0,c.c)("/config/cloud");const a=i.currentTarget.integration;if(a.supported_by)return void(0,r.B)(this,"supported-by",{integration:a});if(a.iot_standards)return void(0,r.B)(this,"select-brand",{brand:a.domain});if(n===this.domain&&("integration_type"in this.integration&&!this.integration.config_flow||!("integration_type"in this.integration)&&(!this.integration.integrations||!(n in this.integration.integrations)))||!("integration_type"in this.integration)&&(null===(t=this.integration.integrations)||void 0===t||null===(t=t[n])||void 0===t||!t.config_flow)){const i=await(0,u.t4)(this.hass,n);return void(0,v.u)(this,{manifest:i})}const o=this.getRootNode();(0,p.t)(o instanceof ShadowRoot?o.host:this,{startFlowHandler:n,showAdvanced:null===(e=this.hass.userData)||void 0===e?void 0:e.showAdvanced,navigateToResult:!0,manifest:await(0,u.t4)(this.hass,n)}),(0,r.B)(this,"close-dialog")}},{kind:"method",key:"_flowInProgressPicked",value:async function(i){var t;if(!(0,d.Q)(i))return;const e=i.currentTarget.flow,n=this.getRootNode();(0,p.t)(n instanceof ShadowRoot?n.host:this,{continueFlowId:e.flow_id,navigateToResult:!0,showAdvanced:null===(t=this.hass.userData)||void 0===t?void 0:t.showAdvanced,manifest:await(0,u.t4)(this.hass,e.handler)}),(0,r.B)(this,"close-dialog")}},{kind:"method",key:"_standardPicked",value:function(i){if(!(0,d.Q)(i))return;const t=i.currentTarget.domain,e=this.getRootNode();(0,r.B)(this,"close-dialog"),(0,l.D)(e instanceof ShadowRoot?e.host:this,this.hass,t,{brand:this.domain})}},{kind:"field",static:!0,key:"styles",value(){return[m.Qx,(0,a.iv)(M||(M=I`:host{display:block;--mdc-list-item-graphic-size:40px;--mdc-list-side-padding:24px}h3{margin:8px 24px 0;color:var(--secondary-text-color);font-size:14px;font-weight:500}h3:first-of-type{margin-top:0}img{width:40px;height:40px}li[divider]{margin-top:8px}`))]}}]}}),a.oi);t()}catch(k){t(k)}}))},1213:function(i,t,e){e.a(i,(async function(i,t){try{var n=e(61701),a=(e(71695),e(47021),e(65703)),o=e(46289),s=e(57243),r=e(50778),l=e(35359),d=e(57816),c=e(88238),h=(e(37583),e(13928),e(56032)),g=i([h]);h=(g.then?(await g)():g)[0];let u,p,m,_,f,v,y,k,w=i=>i;const b="M14 2H6C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H18C19.11 22 20 21.11 20 20V8L14 2M18 20H6V4H13V9H18V20M9.54 15.65L11.63 17.74L10.35 19L7 15.65L10.35 12.3L11.63 13.56L9.54 15.65M17 15.65L13.65 19L12.38 17.74L14.47 15.65L12.38 13.56L13.65 12.3L17 15.65Z",x="M2,10.96C1.5,10.68 1.35,10.07 1.63,9.59L3.13,7C3.24,6.8 3.41,6.66 3.6,6.58L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.66,6.72 20.82,6.88 20.91,7.08L22.36,9.6C22.64,10.08 22.47,10.69 22,10.96L21,11.54V16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V10.96C2.7,11.13 2.32,11.14 2,10.96M12,4.15V4.15L12,10.85V10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V12.69L14,15.59C13.67,15.77 13.3,15.76 13,15.6V19.29L19,15.91M13.85,13.36L20.13,9.73L19.55,8.72L13.27,12.35L13.85,13.36Z",$="M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";(0,n.Z)([(0,r.Mo)("ha-integration-list-item")],(function(i,t){return{F:class extends t{constructor(...t){super(...t),i(this)}},d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"integration",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:String,reflect:!0})],key:"graphic",value(){return"medium"}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"hasMeta",value(){return!0}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"brand",value(){return!1}},{kind:"method",key:"renderSingleLine",value:function(){return this.integration?(0,s.dy)(u||(u=w`${0} ${0}`),this.integration.name||(0,d.Lh)(this.hass.localize,this.integration.domain),this.integration.is_helper?" (helper)":""):s.Ld}},{kind:"method",key:"renderGraphic",value:function(){var i;if(!this.integration)return s.Ld;const t={multi:this.multipleGraphics};return(0,s.dy)(p||(p=w` <span class="mdc-deprecated-list-item__graphic material-icons ${0}"> <img alt="" loading="lazy" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> </span>`),(0,l.$)(t),(0,c.X1)({domain:this.integration.domain,type:"icon",useFallback:!0,darkOptimized:null===(i=this.hass.themes)||void 0===i?void 0:i.darkMode,brand:this.brand}))}},{kind:"method",key:"renderMeta",value:function(){return this.integration?(0,s.dy)(m||(m=w`<span class="mdc-deprecated-list-item__meta material-icons"> ${0} ${0} ${0} </span>`),this.integration.cloud?(0,s.dy)(_||(_=w`<ha-tooltip placement="left" .content="${0}"><ha-svg-icon .path="${0}"></ha-svg-icon></ha-tooltip>`),this.hass.localize("ui.panel.config.integrations.config_entry.depends_on_cloud"),$):s.Ld,this.integration.is_built_in?s.Ld:(0,s.dy)(f||(f=w`<span class="${0}"><ha-tooltip placement="left" .content="${0}"><ha-svg-icon .path="${0}"></ha-svg-icon></ha-tooltip></span>`),this.integration.overwrites_built_in?"overwrites":"custom",this.hass.localize(this.integration.overwrites_built_in?"ui.panel.config.integrations.config_entry.custom_overwrites_core":"ui.panel.config.integrations.config_entry.custom_integration"),x),this.integration.config_flow||this.integration.integrations||this.integration.iot_standards?(0,s.dy)(y||(y=w`<ha-icon-next></ha-icon-next>`)):(0,s.dy)(v||(v=w`<ha-tooltip placement="left" .content="${0}"> <ha-svg-icon .path="${0}" class="open-in-new"></ha-svg-icon> </ha-tooltip>`),this.hass.localize("ui.panel.config.integrations.config_entry.yaml_only"),b)):s.Ld}},{kind:"get",static:!0,key:"styles",value:function(){return[o.W,(0,s.iv)(k||(k=w`:host{--mdc-list-side-padding:24px;--mdc-list-item-graphic-size:40px}: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)}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)}img{width:40px;height:40px}.mdc-deprecated-list-item__meta{width:auto;white-space:nowrap}.mdc-deprecated-list-item__meta>*{margin-right:8px;margin-inline-end:8px;margin-inline-start:initial}.mdc-deprecated-list-item__meta>:last-child{margin-right:0px;margin-inline-end:0px;margin-inline-start:initial}ha-icon-next{margin-right:8px;margin-inline-end:8px;margin-inline-start:initial}.open-in-new{--mdc-icon-size:22px;padding:1px}.custom{color:var(--warning-color)}.overwrites{color:var(--error-color)}`))]}}]}}),a.K);t()}catch(u){t(u)}}))},72548:function(i,t,e){e.d(t,{H:()=>o});e(71695),e(40251),e(47021);var n=e(36522);const a=()=>Promise.all([e.e("46379"),e.e("66031"),e.e("72206"),e.e("97983"),e.e("25618"),e.e("42950"),e.e("65505"),e.e("5080"),e.e("70317"),e.e("86626"),e.e("40410")]).then(e.bind(e,25679)),o=i=>{(0,n.B)(i,"show-dialog",{dialogTag:"dialog-matter-add-device",dialogImport:a,dialogParams:{}})}},91395:function(i,t,e){e.d(t,{B:()=>o});e(71695),e(40251),e(47021);var n=e(36522);const a=()=>Promise.all([e.e("46379"),e.e("66031"),e.e("72206"),e.e("91552"),e.e("97983"),e.e("25618"),e.e("78456"),e.e("56898"),e.e("2142"),e.e("29570"),e.e("71588"),e.e("7010"),e.e("60443"),e.e("87810")]).then(e.bind(e,10772)),o=(i,t)=>{(0,n.B)(i,"show-dialog",{dialogTag:"dialog-zwave_js-add-node",dialogImport:a,dialogParams:t})}},47641:function(i,t,e){e.d(t,{o:()=>n});e(71695),e(40251),e(47021);const n=async()=>{await Promise.all([e.e("37066"),e.e("24606")]).then(e.bind(e,24700))}}}]);
//# sourceMappingURL=46916.e9c93593d391df86.js.map