iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
12 lines • 34.7 kB
JavaScript
;(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["27933"],{43537:function(e,t,i){i.d(t,{Z:()=>a});const o=e=>e<10?`0${e}`:e;function a(e){const t=Math.floor(e/3600),i=Math.floor(e%3600/60),a=Math.floor(e%3600%60);return t>0?`${t}:${o(i)}:${o(a)}`:i>0?`${i}:${o(a)}`:a>0?""+a:null}},84200:function(e,t,i){i.d(t,{r:()=>a});i(71695),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021);const o=(e,t,i=true)=>{var a;if(!e||e===document.body)return null;if((e=null!==(a=e.assignedSlot)&&void 0!==a?a:e).parentElement)e=e.parentElement;else{const t=e.getRootNode();e=t instanceof ShadowRoot?t.host:null}return(i?Object.prototype.hasOwnProperty.call(e,t):e&&t in e)?e:o(e,t,i)},a=(e,t,i=true)=>{const a=new Set;for(;e;)a.add(e),e=o(e,t,i);return a}},81165:function(e,t,i){i.d(t,{j:()=>o});const o=(e=document)=>{var t;return null!==(t=e.activeElement)&&void 0!==t&&null!==(t=t.shadowRoot)&&void 0!==t&&t.activeElement?o(e.activeElement.shadowRoot):e.activeElement}},29567:function(e,t,i){i.d(t,{h:()=>n});i(52247),i(71695),i(9359),i(31526),i(47021);var o=i(57243),a=i(92903);const n=(0,a.XM)(class extends a.Xe{constructor(e){if(super(e),this._element=void 0,e.type!==a.pX.CHILD)throw new Error("dynamicElementDirective can only be used in content bindings")}update(e,[t,i]){return this._element&&this._element.localName===t?(i&&Object.entries(i).forEach((([e,t])=>{this._element[e]=t})),o.Jb):this.render(t,i)}render(e,t){return this._element=document.createElement(e),t&&Object.entries(t).forEach((([e,t])=>{this._element[e]=t})),this._element}})},49976:function(e,t,i){i.d(t,{U:()=>o});const o=e=>e.stopPropagation()},76320:function(e,t,i){i.d(t,{T:()=>o,y:()=>a});i(40251);const o=e=>{requestAnimationFrame((()=>setTimeout(e,0)))},a=()=>new Promise((e=>{o(e)}))},73729:function(e,t,i){i.d(t,{i:()=>f});var o=i(61701),a=i(72621),n=(i(22152),i(71695),i(47021),i(74966)),r=i(51408),l=i(57243),s=i(50778),d=i(76525);i(23334);let c,p,h,u=e=>e;const m=["button","ha-list-item"],f=(e,t)=>{var i;return(0,l.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!==(i=null==e?void 0:e.localize("ui.common.close"))&&void 0!==i?i:"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,o.Z)([(0,s.Mo)("ha-dialog")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:d.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(e,t){var i;null===(i=this.contentElement)||void 0===i||i.scrollTo(e,t)}},{kind:"method",key:"renderHeading",value:function(){return(0,l.dy)(p||(p=u`<slot name="heading"> ${0} </slot>`),(0,a.Z)(i,"renderHeading",this,3)([]))}},{kind:"method",key:"firstUpdated",value:function(){var e;(0,a.Z)(i,"firstUpdated",this,3)([]),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,m].join(", "),this._updateScrolledAttribute(),null===(e=this.contentElement)||void 0===e||e.addEventListener("scroll",this._onScroll,{passive:!0})}},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)(i,"disconnectedCallback",this,3)([]),this.contentElement.removeEventListener("scroll",this._onScroll)}},{kind:"field",key:"_onScroll",value(){return()=>{this._updateScrolledAttribute()}}},{kind:"method",key:"_updateScrolledAttribute",value:function(){this.contentElement&&this.toggleAttribute("scrolled",0!==this.contentElement.scrollTop)}},{kind:"field",static:!0,key:"styles",value(){return[r.W,(0,l.iv)(h||(h=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)}`))]}}]}}),n.M)},17170:function(e,t,i){i.a(e,(async function(e,o){try{i.r(t),i.d(t,{HaSpinner:()=>u});var a=i(61701),n=i(72621),r=(i(71695),i(47021),i(97677)),l=i(43580),s=i(57243),d=i(50778),c=e([r]);r=(c.then?(await c)():c)[0];let p,h=e=>e,u=(0,a.Z)([(0,d.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,n.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[l.Z,(0,s.iv)(p||(p=h`: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)}`))]}}]}}),r.Z);o()}catch(p){o(p)}}))},56032:function(e,t,i){i.a(e,(async function(e,t){try{var o=i(61701),a=(i(71695),i(47021),i(80519)),n=i(1261),r=i(57243),l=i(50778),s=i(85605),d=e([a]);a=(d.then?(await d)():d)[0];let c,p=e=>e;(0,s.jx)("tooltip.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:150,easing:"ease"}}),(0,s.jx)("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:400,easing:"ease"}});(0,o.Z)([(0,l.Mo)("ha-tooltip")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[n.Z,(0,r.iv)(c||(c=p`:host{--sl-tooltip-background-color:var(--secondary-background-color);--sl-tooltip-color:var(--primary-text-color);--sl-tooltip-font-family:Roboto,sans-serif;--sl-tooltip-font-size:12px;--sl-tooltip-font-weight:normal;--sl-tooltip-line-height:1;--sl-tooltip-padding:8px;--sl-tooltip-border-radius:var(--ha-tooltip-border-radius, 4px);--sl-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--sl-z-index-tooltip:var(--ha-tooltip-z-index, 1000)}`))]}}]}}),a.Z);t()}catch(c){t(c)}}))},15681:function(e,t,i){if(i.d(t,{D4:()=>c,D7:()=>f,Ky:()=>d,P3:()=>l,V3:()=>v,WW:()=>y,XO:()=>p,ZJ:()=>_,d4:()=>m,oi:()=>u,pV:()=>r,zO:()=>h}),66977!=i.j)var o=i(62212);var a=i(22381),n=i(57816);const r=99387==i.j?["bluetooth","dhcp","discovery","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"]:null,l=99387==i.j?["reauth"]:null,s={"HA-Frontend-Base":`${location.protocol}//${location.host}`},d=(e,t,i)=>{var o;return e.callApi("POST","config/config_entries/flow",{handler:t,show_advanced_options:Boolean(null===(o=e.userData)||void 0===o?void 0:o.showAdvanced),entry_id:i},s)},c=(e,t)=>e.callApi("GET",`config/config_entries/flow/${t}`,void 0,s),p=(e,t,i)=>e.callApi("POST",`config/config_entries/flow/${t}`,i,s),h=(e,t,i)=>e.callWS({type:"config_entries/ignore_flow",flow_id:t,title:i}),u=(e,t)=>e.callApi("DELETE",`config/config_entries/flow/${t}`),m=(e,t)=>e.callApi("GET","config/config_entries/flow_handlers"+(t?`?type=${t}`:"")),f=e=>e.sendMessagePromise({type:"config_entries/flow/progress"}),g=(e,t)=>e.subscribeEvents((0,a.D)((()=>f(e).then((e=>t.setState(e,!0)))),500,!0),"config_entry_discovered"),_=e=>(0,o._)(e,"_configFlowProgress",f,g),v=(e,t)=>_(e.connection).subscribe(t),y=(e,t)=>t.context.title_placeholders&&0!==Object.keys(t.context.title_placeholders).length?e(`component.${t.handler}.config.flow_title`,t.context.title_placeholders)||("name"in t.context.title_placeholders?t.context.title_placeholders.name:(0,n.Lh)(e,t.handler)):(0,n.Lh)(e,t.handler)},18216:function(e,t,i){i.d(t,{G1:()=>a,Rm:()=>n,W2:()=>o,YL:()=>r});i(19423);const o=e=>e.callWS({type:"counter/list"}),a=(e,t)=>e.callWS(Object.assign({type:"counter/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"counter/update",counter_id:t},i)),r=(e,t)=>e.callWS({type:"counter/delete",counter_id:t})},9343:function(e,t,i){i.d(t,{Aj:()=>o,Xr:()=>n,Z0:()=>a,wO:()=>r});i(19423);const o=e=>e.callWS({type:"input_boolean/list"}),a=(e,t)=>e.callWS(Object.assign({type:"input_boolean/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"input_boolean/update",input_boolean_id:t},i)),r=(e,t)=>e.callWS({type:"input_boolean/delete",input_boolean_id:t})},6819:function(e,t,i){i.d(t,{Sv:()=>a,Wq:()=>n,Wx:()=>r,fY:()=>o});i(19423);const o=e=>e.callWS({type:"input_button/list"}),a=(e,t)=>e.callWS(Object.assign({type:"input_button/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"input_button/update",input_button_id:t},i)),r=(e,t)=>e.callWS({type:"input_button/delete",input_button_id:t})},25542:function(e,t,i){i.d(t,{FF:()=>l,Gi:()=>s,Qp:()=>a,g2:()=>o,s2:()=>n,vY:()=>r});i(19423);const o=e=>`${e.attributes.year||"1970"}-${String(e.attributes.month||"01").padStart(2,"0")}-${String(e.attributes.day||"01").padStart(2,"0")}T${String(e.attributes.hour||"00").padStart(2,"0")}:${String(e.attributes.minute||"00").padStart(2,"0")}:${String(e.attributes.second||"00").padStart(2,"0")}`,a=(e,t,i=void 0,o=void 0)=>{const a={entity_id:t,time:i,date:o};e.callService("input_datetime","set_datetime",a)},n=e=>e.callWS({type:"input_datetime/list"}),r=(e,t)=>e.callWS(Object.assign({type:"input_datetime/create"},t)),l=(e,t,i)=>e.callWS(Object.assign({type:"input_datetime/update",input_datetime_id:t},i)),s=(e,t)=>e.callWS({type:"input_datetime/delete",input_datetime_id:t})},57800:function(e,t,i){i.d(t,{K4:()=>o,Mt:()=>a,fH:()=>r,hb:()=>n});i(19423);const o=e=>e.callWS({type:"input_number/list"}),a=(e,t)=>e.callWS(Object.assign({type:"input_number/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"input_number/update",input_number_id:t},i)),r=(e,t)=>e.callWS({type:"input_number/delete",input_number_id:t})},67759:function(e,t,i){i.d(t,{Ek:()=>n,H3:()=>l,LN:()=>a,ON:()=>r,cv:()=>o});i(19423);const o=(e,t,i)=>e.callService("input_select","select_option",{option:i,entity_id:t}),a=e=>e.callWS({type:"input_select/list"}),n=(e,t)=>e.callWS(Object.assign({type:"input_select/create"},t)),r=(e,t,i)=>e.callWS(Object.assign({type:"input_select/update",input_select_id:t},i)),l=(e,t)=>e.callWS({type:"input_select/delete",input_select_id:t})},52261:function(e,t,i){i.d(t,{$t:()=>n,KB:()=>l,YL:()=>a,jt:()=>r,sO:()=>o});i(19423);const o=(e,t,i)=>e.callService(t.split(".",1)[0],"set_value",{value:i,entity_id:t}),a=e=>e.callWS({type:"input_text/list"}),n=(e,t)=>e.callWS(Object.assign({type:"input_text/create"},t)),r=(e,t,i)=>e.callWS(Object.assign({type:"input_text/update",input_text_id:t},i)),l=(e,t)=>e.callWS({type:"input_text/delete",input_text_id:t})},76154:function(e,t,i){i.d(t,{AS:()=>n,Fv:()=>r,KY:()=>o,fn:()=>a,wn:()=>l});i(19423);const o=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],a=e=>e.callWS({type:"schedule/list"}),n=(e,t)=>e.callWS(Object.assign({type:"schedule/create"},t)),r=(e,t,i)=>e.callWS(Object.assign({type:"schedule/update",schedule_id:t},i)),l=(e,t)=>e.callWS({type:"schedule/delete",schedule_id:t})},84428:function(e,t,i){i.d(t,{rv:()=>d,mK:()=>s,aT:()=>a,mZ:()=>r,eF:()=>n,WH:()=>l});i(19423),i(9359),i(70104);var o=i(43537);const a=e=>e.callWS({type:"timer/list"}),n=(e,t)=>e.callWS(Object.assign({type:"timer/create"},t)),r=(e,t,i)=>e.callWS(Object.assign({type:"timer/update",timer_id:t},i)),l=(e,t)=>e.callWS({type:"timer/delete",timer_id:t}),s=e=>{if(!e.attributes.remaining)return;let t=function(e){const t=e.split(":").map(Number);return 3600*t[0]+60*t[1]+t[2]}(e.attributes.remaining);if("active"===e.state){const i=(new Date).getTime(),o=new Date(e.attributes.finishes_at).getTime();t=Math.max((o-i)/1e3,0)}return t},d=(e,t,i)=>{if(!t)return null;if("idle"===t.state||0===i)return e.formatEntityState(t);let a=(0,o.Z)(i||0)||"0";return"paused"===t.state&&(a=`${a} (${e.formatEntityState(t)})`),a}},38572:function(e,t,i){i.d(t,{t:()=>_});i(63721),i(71695),i(40251),i(47021);var o=i(57243),a=i(15681),n=i(57816),r=i(7956);let l,s,d,c,p,h,u,m,f,g=e=>e;const _=(e,t)=>(0,r.w)(e,t,{flowType:"config_flow",showDevices:!0,createFlow:async(e,i)=>{const[o]=await Promise.all([(0,a.Ky)(e,i,t.entryId),e.loadFragmentTranslation("config"),e.loadBackendTranslation("config",i),e.loadBackendTranslation("selector",i),e.loadBackendTranslation("title",i)]);return o},fetchFlow:async(e,t)=>{const i=await(0,a.D4)(e,t);return await e.loadFragmentTranslation("config"),await e.loadBackendTranslation("config",i.handler),await e.loadBackendTranslation("selector",i.handler),i},handleFlowStep:a.XO,deleteFlow:a.oi,renderAbortDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.abort.${t.reason}`,t.description_placeholders);return i?(0,o.dy)(l||(l=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,o.dy)(s||(s=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):""},renderShowFormStepFieldLabel(e,t,i,o){var a;if("expandable"===i.type)return e.localize(`component.${t.handler}.config.step.${t.step_id}.sections.${i.name}.name`);const n=null!=o&&null!==(a=o.path)&&void 0!==a&&a[0]?`sections.${o.path[0]}.`:"";return e.localize(`component.${t.handler}.config.step.${t.step_id}.${n}data.${i.name}`)||i.name},renderShowFormStepFieldHelper(e,t,i,a){var n;if("expandable"===i.type)return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.sections.${i.name}.description`);const r=null!=a&&null!==(n=a.path)&&void 0!==n&&n[0]?`sections.${a.path[0]}.`:"",l=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.${r}data_description.${i.name}`,t.description_placeholders);return l?(0,o.dy)(d||(d=g`<ha-markdown breaks .content="${0}"></ha-markdown>`),l):""},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,o.dy)(c||(c=g` <p> ${0} </p> ${0} `),e.localize("ui.panel.config.integrations.config_flow.external_step.description"),i?(0,o.dy)(p||(p=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,o.dy)(h||(h=g` ${0} <p> ${0} </p> `),i?(0,o.dy)(u||(u=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,o.dy)(m||(m=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,o.dy)(f||(f=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,o){if("loading_flow"!==t&&"loading_step"!==t)return"";const a=(null==o?void 0:o.handler)||i;return e.localize(`ui.panel.config.integrations.config_flow.loading.${t}`,{integration:a?(0,n.Lh)(e.localize,a):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},7956:function(e,t,i){i.d(t,{w:()=>n});i(71695),i(19423),i(40251),i(47021);var o=i(36522);const a=()=>Promise.all([i.e("46379"),i.e("66031"),i.e("72206"),i.e("97983"),i.e("24199"),i.e("78943"),i.e("2142"),i.e("58640"),i.e("52430"),i.e("4697"),i.e("8871"),i.e("27090"),i.e("8949")]).then(i.bind(i,12656)),n=(e,t,i)=>{(0,o.B)(e,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:a,dialogParams:Object.assign(Object.assign({},t),{},{flowConfig:i,dialogParentElement:e})})}},76525:function(e,t,i){i.d(t,{L$:()=>h,gA:()=>d,lD:()=>f,ts:()=>u,vC:()=>c});i(71695),i(92745),i(19423),i(40251),i(47021);var o=i(5111),a=i(84200);if(66977!=i.j)var n=i(81165);var r=i(76320);const l={},s=[],d=Symbol.for("HA focus target"),c=async(e,t,i,r,p,h=!0)=>{if(!(i in l)){if(!p)return!1;l[i]={element:p().then((()=>{const t=document.createElement(i);return e.provideHass(t),t.addEventListener("dialog-closed",m),t.addEventListener("dialog-closed",g),t}))}}if(h){var u,f;const{history:a}=o.E;if(null!==(u=a.state)&&void 0!==u&&u.dialog&&!s.length)return await new Promise((e=>{setTimeout(e)})),c(e,t,i,r,p,h);const n=s.findIndex((e=>e.dialogTag===i));-1!==n&&s.splice(n,1),s.push({element:e,root:t,dialogTag:i,dialogParams:r,dialogImport:p,addHistory:h});const l={dialog:i};null!==(f=a.state)&&void 0!==f&&f.dialog?a.replaceState(l,""):(a.replaceState(Object.assign(Object.assign({},a.state),{},{opensDialog:!0}),""),a.pushState(l,""))}l[i].closedFocusTargets=(0,a.r)((0,n.j)(),d);const _=await l[i].element;return t.appendChild(_),_.showDialog(r),!0},p=async e=>{if(!(e in l))return!0;const t=await l[e].element;return!t.closeDialog||!1!==t.closeDialog()},h=async()=>{if(s.length){var e;const t=s.pop(),i=await p(t.dialogTag);return i||s.push(t),s.length&&null!==(e=o.E.history.state)&&void 0!==e&&e.opensDialog&&o.E.history.pushState({dialog:s[s.length-1].dialogTag},""),i}return!0},u=async()=>{for(let e=s.length-1;e>=0;e--){if(!(!s[e]||await p(s[e].dialogTag)))return!1}return!0},m=e=>{var t;const i=s.findIndex((t=>t.dialogTag===e.detail.dialog));-1!==i&&s.splice(i,1),(null===(t=o.E.history.state)||void 0===t?void 0:t.dialog)===e.detail.dialog&&(s.length?o.E.history.replaceState({dialog:s[s.length-1].dialogTag},""):-1!==i&&o.E.history.back())},f=(e,t)=>{e.addEventListener("show-dialog",(i=>{const{dialogTag:o,dialogImport:a,dialogParams:n,addHistory:r}=i.detail;c(e,t,o,n,a,r)}))},g=async e=>{if(!l[e.detail.dialog])return;const t=l[e.detail.dialog].closedFocusTargets;if(delete l[e.detail.dialog].closedFocusTargets,!t)return;let i=(0,n.j)();i instanceof HTMLElement&&i.blur(),await(0,r.y)();for(const o of t)if(o instanceof HTMLElement&&(o.focus(),i=(0,n.j)(),i&&i!==document.body))return}},49335:function(e,t,i){i.a(e,(async function(e,o){try{i.r(t),i.d(t,{DialogHelperDetail:()=>V});var a=i(61701),n=(i(19083),i(71695),i(92745),i(61893),i(9359),i(70104),i(52924),i(40251),i(61006),i(47021),i(31622),i(57243)),r=i(50778),l=i(35359),s=i(27486),d=i(72344),c=i(29567),p=i(17170),h=i(73729),u=(i(7285),i(56032)),m=(i(37583),i(15681)),f=i(18216),g=i(9343),_=i(6819),v=i(25542),y=i(57800),b=i(67759),w=i(52261),k=i(57816),x=i(76154),$=i(84428),S=i(38572),z=i(28008),j=i(88238),F=i(96530),E=i(36522),W=i(1416),L=i(49976),O=e([p,u]);[p,u]=O.then?(await O)():O;let T,P,C,D,H,A,M,B,Z,I,R=e=>e;const X="M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",K={input_boolean:{create:g.Z0,import:()=>Promise.all([i.e("24199"),i.e("78943"),i.e("31193")]).then(i.bind(i,57998)),alias:["switch","toggle"]},input_button:{create:_.Sv,import:()=>Promise.all([i.e("24199"),i.e("78943"),i.e("31061")]).then(i.bind(i,62841))},input_text:{create:w.$t,import:()=>Promise.all([i.e("24199"),i.e("78943"),i.e("7010"),i.e("11995")]).then(i.bind(i,42191))},input_number:{create:y.Mt,import:()=>Promise.all([i.e("24199"),i.e("78943"),i.e("7010"),i.e("28777")]).then(i.bind(i,8269))},input_datetime:{create:v.vY,import:()=>Promise.all([i.e("24199"),i.e("78943"),i.e("7010"),i.e("12146")]).then(i.bind(i,17092))},input_select:{create:b.Ek,import:()=>Promise.all([i.e("91552"),i.e("24199"),i.e("78943"),i.e("63329")]).then(i.bind(i,15687)),alias:["select","dropdown"]},counter:{create:f.G1,import:()=>Promise.all([i.e("24199"),i.e("78943"),i.e("26594")]).then(i.bind(i,75058))},timer:{create:$.eF,import:()=>Promise.all([i.e("24199"),i.e("78943"),i.e("29570"),i.e("94739")]).then(i.bind(i,30964)),alias:["countdown"]},schedule:{create:x.AS,import:()=>Promise.all([i.e("24199"),i.e("78943"),i.e("49016"),i.e("78018"),i.e("4279"),i.e("9117")]).then(i.bind(i,63358))}};let V=(0,a.Z)([(0,r.Mo)("dialog-helper-detail")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_item",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_opened",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_domain",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_submitting",value(){return!1}},{kind:"field",decorators:[(0,r.IO)(".form")],key:"_form",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_helperFlows",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_loading",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_filter",value:void 0},{kind:"field",key:"_params",value:void 0},{kind:"method",key:"showDialog",value:async function(e){this._params=e,this._domain=e.domain,this._item=void 0,this._domain&&this._domain in K&&await K[this._domain].import(),this._opened=!0,await this.updateComplete,this.hass.loadFragmentTranslation("config");const t=await(0,m.d4)(this.hass,["helper"]);await this.hass.loadBackendTranslation("title",t,!0),this._helperFlows=t}},{kind:"method",key:"closeDialog",value:function(){this._opened=!1,this._error=void 0,this._domain=void 0,this._params=void 0,this._filter=void 0,(0,E.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){if(!this._opened)return n.Ld;let e;var t;if(this._domain)e=(0,n.dy)(T||(T=R` <div class="form" @value-changed="${0}"> ${0} ${0} </div> <mwc-button slot="primaryAction" @click="${0}" .disabled="${0}"> ${0} </mwc-button> ${0} `),this._valueChanged,this._error?(0,n.dy)(P||(P=R`<div class="error">${0}</div>`),this._error):"",(0,c.h)(`ha-${this._domain}-form`,{hass:this.hass,item:this._item,new:!0}),this._createItem,this._submitting,this.hass.localize("ui.panel.config.helpers.dialog.create"),null!==(t=this._params)&&void 0!==t&&t.domain?n.Ld:(0,n.dy)(C||(C=R`<mwc-button slot="secondaryAction" @click="${0}" .disabled="${0}"> ${0} </mwc-button>`),this._goBack,this._submitting,this.hass.localize("ui.common.back")));else if(this._loading||void 0===this._helperFlows)e=(0,n.dy)(D||(D=R`<ha-spinner></ha-spinner>`));else{const t=this._filterHelpers(K,this._helperFlows,this._filter);e=(0,n.dy)(H||(H=R` <search-input .hass="${0}" dialogInitialFocus="true" .filter="${0}" @value-changed="${0}" .label="${0}"></search-input> <mwc-list class="ha-scrollbar" innerRole="listbox" itemRoles="option" innerAriaLabel="${0}" rootTabbable dialogInitialFocus> ${0} </mwc-list> `),this.hass,this._filter,this._filterChanged,this.hass.localize("ui.panel.config.integrations.search_helper"),this.hass.localize("ui.panel.config.helpers.dialog.create_helper"),t.map((([e,t])=>{var i;const o=!(e in K)||(0,d.p)(this.hass,e);return(0,n.dy)(A||(A=R` <ha-list-item .disabled="${0}" hasmeta .domain="${0}" @request-selected="${0}" graphic="icon"> <img slot="graphic" loading="lazy" alt="" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> <span class="item-text"> ${0} </span> ${0} </ha-list-item> `),!o,e,this._domainPicked,(0,j.X1)({domain:e,type:"icon",useFallback:!0,darkOptimized:null===(i=this.hass.themes)||void 0===i?void 0:i.darkMode}),t,o?(0,n.dy)(M||(M=R`<ha-icon-next slot="meta"></ha-icon-next>`)):(0,n.dy)(B||(B=R`<ha-tooltip hoist slot="meta" .content="${0}" @click="${0}"> <ha-svg-icon path="${0}"></ha-svg-icon> </ha-tooltip>`),this.hass.localize("ui.dialogs.helper_settings.platform_not_loaded",{platform:e}),L.U,X))})))}return(0,n.dy)(Z||(Z=R` <ha-dialog open @closed="${0}" class="${0}" scrimClickAction escapeKeyAction .hideActions="${0}" .heading="${0}"> ${0} </ha-dialog> `),this.closeDialog,(0,l.$)({"button-left":!this._domain}),!this._domain,(0,h.i)(this.hass,this._domain?this.hass.localize("ui.panel.config.helpers.dialog.create_platform",{platform:(0,F.X)(this._domain)&&this.hass.localize(`ui.panel.config.helpers.types.${this._domain}`)||this._domain}):this.hass.localize("ui.panel.config.helpers.dialog.create_helper")),e)}},{kind:"field",key:"_filterHelpers",value(){return(0,s.Z)(((e,t,i)=>{const o=[];for(const a of Object.keys(e))o.push([a,this.hass.localize(`ui.panel.config.helpers.types.${a}`)||a]);if(t)for(const a of t)o.push([a,(0,k.Lh)(this.hass.localize,a)]);return o.filter((([t,o])=>{if(i){var a;const n=i.toLowerCase();return o.toLowerCase().includes(n)||t.toLowerCase().includes(n)||((null===(a=e[t])||void 0===a?void 0:a.alias)||[]).some((e=>e.toLowerCase().includes(n)))}return!0})).sort(((e,t)=>(0,W.$K)(e[1],t[1],this.hass.locale.language)))}))}},{kind:"method",key:"_filterChanged",value:async function(e){this._filter=e.detail.value}},{kind:"method",key:"_valueChanged",value:function(e){this._item=e.detail.value}},{kind:"method",key:"_createItem",value:async function(){if(this._domain&&this._item){this._submitting=!0,this._error="";try{var e;const t=await K[this._domain].create(this.hass,this._item);null!==(e=this._params)&&void 0!==e&&e.dialogClosedCallback&&t.id&&this._params.dialogClosedCallback({flowFinished:!0,entityId:`${this._domain}.${t.id}`}),this.closeDialog()}catch(t){this._error=t.message||"Unknown error"}finally{this._submitting=!1}}}},{kind:"method",key:"_domainPicked",value:async function(e){const t=e.target.closest("ha-list-item").domain;if(t in K){this._loading=!0;try{await K[t].import(),this._domain=t}finally{this._loading=!1}this._focusForm()}else(0,S.t)(this,{startFlowHandler:t,manifest:await(0,k.t4)(this.hass,t),dialogClosedCallback:this._params.dialogClosedCallback}),this.closeDialog()}},{kind:"method",key:"_focusForm",value:async function(){var e;await this.updateComplete,(null===(e=this._form)||void 0===e?void 0:e.lastElementChild).focus()}},{kind:"method",key:"_goBack",value:function(){this._domain=void 0,this._item=void 0,this._error=void 0}},{kind:"get",static:!0,key:"styles",value:function(){return[z.$c,z.yu,(0,n.iv)(I||(I=R`ha-dialog.button-left{--justify-action-buttons:flex-start}ha-dialog{--dialog-content-padding:0;--dialog-scroll-divider-color:transparent;--mdc-dialog-max-height:60vh}@media all and (min-width:550px){ha-dialog{--mdc-dialog-min-width:500px}}ha-icon-next{width:24px}ha-tooltip{pointer-events:auto}.form{padding:24px}search-input{display:block;margin:16px 16px 0}mwc-list{height:calc(60vh - 184px)}@media all and (max-width:450px),all and (max-height:500px){mwc-list{height:calc(100vh - 184px)}}`))]}}]}}),n.oi);o()}catch(T){o(T)}}))},28008:function(e,t,i){i.d(t,{$c:()=>u,Qx:()=>p,k1:()=>c,yu:()=>h});var o=i(57243);let a,n,r,l,s,d=e=>e;const c=(0,o.iv)(a||(a=d`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`)),p=(0,o.iv)(n||(n=d`:host{font-family:var(--paper-font-body1_-_font-family);-webkit-font-smoothing:var(--paper-font-body1_-_-webkit-font-smoothing);font-size:var(--paper-font-body1_-_font-size);font-weight:var(--paper-font-body1_-_font-weight);line-height:var(--paper-font-body1_-_line-height)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}h1{font-family:var(--paper-font-headline_-_font-family);-webkit-font-smoothing:var(--paper-font-headline_-_-webkit-font-smoothing);white-space:var(--paper-font-headline_-_white-space);overflow:var(--paper-font-headline_-_overflow);text-overflow:var(--paper-font-headline_-_text-overflow);font-size:var(--paper-font-headline_-_font-size);font-weight:var(--paper-font-headline_-_font-weight);line-height:var(--paper-font-headline_-_line-height)}h2{font-family:var(--paper-font-title_-_font-family);-webkit-font-smoothing:var(--paper-font-title_-_-webkit-font-smoothing);white-space:var(--paper-font-title_-_white-space);overflow:var(--paper-font-title_-_overflow);text-overflow:var(--paper-font-title_-_text-overflow);font-size:var(--paper-font-title_-_font-size);font-weight:var(--paper-font-title_-_font-weight);line-height:var(--paper-font-title_-_line-height)}h3{font-family:var(--paper-font-subhead_-_font-family);-webkit-font-smoothing:var(--paper-font-subhead_-_-webkit-font-smoothing);white-space:var(--paper-font-subhead_-_white-space);overflow:var(--paper-font-subhead_-_overflow);text-overflow:var(--paper-font-subhead_-_text-overflow);font-size:var(--paper-font-subhead_-_font-size);font-weight:var(--paper-font-subhead_-_font-weight);line-height:var(--paper-font-subhead_-_line-height)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}ha-button.warning,mwc-button.warning{--mdc-theme-primary:var(--error-color)}${0} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`),c),h=(0,o.iv)(r||(r=d`ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between}ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)}@media all and (max-width:450px),all and (max-height:500px){ha-dialog{--mdc-dialog-min-width:calc(
100vw - env(safe-area-inset-right) - env(safe-area-inset-left)
);--mdc-dialog-max-width:calc(
100vw - env(safe-area-inset-right) - env(safe-area-inset-left)
);--mdc-dialog-min-height:100%;--mdc-dialog-max-height:100%;--vertical-align-dialog:flex-end;--ha-dialog-border-radius:0}}ha-button.warning,mwc-button.warning{--mdc-theme-primary:var(--error-color)}.error{color:var(--error-color)}`)),u=(0,o.iv)(l||(l=d`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{-webkit-border-radius:4px;border-radius:4px;background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`));(0,o.iv)(s||(s=d`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))},88238:function(e,t,i){i.d(t,{RU:()=>a,X1:()=>o,u4:()=>n,zC:()=>r});i(88044);const o=e=>`https://brands.home-assistant.io/${e.brand?"brands/":""}${e.useFallback?"_/":""}${e.domain}/${e.darkOptimized?"dark_":""}${e.type}.png`,a=e=>`https://brands.home-assistant.io/hardware/${e.category}/${e.darkOptimized?"dark_":""}${e.manufacturer}${e.model?`_${e.model}`:""}.png`,n=e=>e.split("/")[4],r=e=>e.startsWith("https://brands.home-assistant.io/")}}]);
//# sourceMappingURL=27933.c9eca9a231bf3472.js.map