UNPKG

iobroker.lovelace

Version:

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

23 lines 31.1 kB
/*! For license information please see 97704.031ca91e48ea3795.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[97704],{71769:function(e,t,a){a.d(t,{m:function(){return i}});const i=(e,t)=>{const a=matchMedia(e),i=e=>t(e.matches);return a.addListener(i),t(a.matches),()=>a.removeListener(i)}},64481:function(e,t,a){a.d(t,{D:function(){return o},J:function(){return s}});a(16280),a(3362),a(55815),a(64979),a(79739);let i=!1;try{i="true"===window.localStorage.getItem("disableViewTransition")}catch(l){}const o=e=>{i=e},r=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},s=e=>{if(!document.startViewTransition||i)return e(!1),Promise.resolve();let t=!1;try{const a=document.startViewTransition(()=>{t=!0,e(!0)});return a.ready.catch(r),a.finished.catch(r)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),t?Promise.reject(a):(e(!1),Promise.resolve())}}},14693:function(e,t,a){a.a(e,async function(e,i){try{a.d(t,{r:function(){return M}});a(62953);var o=a(40445),r=a(35211),s=a(5124),l=a(67576),n=a(71769),d=a(22792),h=a(99611),c=(a(76538),a(26300)),p=a(72554),u=e([h,c,p]);[h,c,p]=u.then?(await u)():u;let g,v,f,y,m,b,w,x,_,C,k,$=e=>e;const S="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",L="(max-width: 870px), (max-height: 500px)";class M extends s.WF{connectedCallback(){super.connectedCallback(),this._unsubMediaQuery=(0,n.m)(L,e=>{this._modeSet&&!this.allowModeChange||(this.mode=e?"bottom-sheet":"dialog",this._modeSet=!0)})}get _defaultAriaLabelledBy(){return this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)}_renderCloseButton(e){var t,a,i;return this.hideCloseButton?(0,s.qy)(g||(g=$`<span slot="${0}"></span>`),e):(0,s.qy)(v||(v=$` <slot name="headerNavigationIcon" slot="${0}"> <ha-icon-button data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> </slot> `),e,null!==(t=null===(a=this._i18n)||void 0===a||null===(i=a.localize)||void 0===i?void 0:i.call(a,"ui.common.close"))&&void 0!==t?t:"Close",S)}_renderHeaderContent(){return(0,s.qy)(f||(f=$` <ha-dialog-header .subtitlePosition="${0}"> ${0} ${0} ${0} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> `),this.headerSubtitlePosition,this._renderCloseButton("navigationIcon"),void 0!==this.headerTitle?(0,s.qy)(y||(y=$`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,s.qy)(m||(m=$`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,s.qy)(b||(b=$`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,s.qy)(w||(w=$`<slot name="headerSubtitle" slot="subtitle"></slot>`)))}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._unsubMediaQuery)||void 0===e||e.call(this),this._unsubMediaQuery=void 0,this._modeSet=!1}render(){return"bottom-sheet"===this.mode?(0,s.qy)(x||(x=$` <ha-bottom-sheet .ariaLabelledBy="${0}" .ariaDescribedBy="${0}" .flexContent="${0}" .open="${0}" .preventScrimClose="${0}"> ${0} <slot></slot> <slot name="footer" slot="footer"></slot> </ha-bottom-sheet> `),this._defaultAriaLabelledBy,this.ariaDescribedBy,this.flexContent,this.open,this.preventScrimClose,this.withoutHeader?s.s6:(0,s.qy)(_||(_=$` <slot name="header" slot="header">${0}</slot> `),this._renderHeaderContent())):(0,s.qy)(C||(C=$` <ha-dialog .open="${0}" .type="${0}" .width="${0}" .preventScrimClose="${0}" .ariaLabelledBy="${0}" .ariaDescribedBy="${0}" .headerTitle="${0}" .headerSubtitle="${0}" .headerSubtitlePosition="${0}" .flexContent="${0}" .withoutHeader="${0}"> ${0} <slot name="headerTitle" slot="headerTitle"></slot> <slot name="headerSubtitle" slot="headerSubtitle"></slot> <slot name="headerActionItems" slot="headerActionItems"></slot> <slot></slot> <slot name="footer" slot="footer"></slot> </ha-dialog> `),this.open,this.type,this.width,this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this.headerTitle,this.headerSubtitle,this.headerSubtitlePosition,this.flexContent,this.withoutHeader,this._renderCloseButton("headerNavigationIcon"))}static get styles(){return[(0,s.AH)(k||(k=$`ha-bottom-sheet{--ha-bottom-sheet-border-radius:var(--ha-border-radius-2xl);--ha-bottom-sheet-surface-background:var( --ha-dialog-surface-background, var(--card-background-color, var(--ha-color-surface-default)) );--ha-bottom-sheet-padding:0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left);--ha-bottom-sheet-content-padding:var( --dialog-content-padding, 0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6) )}`))]}constructor(...e){super(...e),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.allowModeChange=!1,this.withoutHeader=!1,this.hideCloseButton=!1,this.flexContent=!1,this.mode="dialog",this._modeSet=!1}}(0,o.Cg)([(0,l.MZ)({attribute:"aria-labelledby"})],M.prototype,"ariaLabelledBy",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"aria-describedby"})],M.prototype,"ariaDescribedBy",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0})],M.prototype,"open",void 0),(0,o.Cg)([(0,l.MZ)({reflect:!0})],M.prototype,"type",void 0),(0,o.Cg)([(0,l.MZ)({type:String,reflect:!0,attribute:"width"})],M.prototype,"width",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],M.prototype,"preventScrimClose",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-title"})],M.prototype,"headerTitle",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-subtitle"})],M.prototype,"headerSubtitle",void 0),(0,o.Cg)([(0,l.MZ)({type:String,attribute:"header-subtitle-position"})],M.prototype,"headerSubtitlePosition",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,attribute:"allow-mode-change"})],M.prototype,"allowModeChange",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,attribute:"without-header"})],M.prototype,"withoutHeader",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,attribute:"hide-close-button"})],M.prototype,"hideCloseButton",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],M.prototype,"flexContent",void 0),(0,o.Cg)([(0,l.wk)()],M.prototype,"mode",void 0),(0,o.Cg)([(0,l.wk)(),(0,r.Fg)({context:d.D5,subscribe:!0})],M.prototype,"_i18n",void 0),M=(0,o.Cg)([(0,l.EM)("ha-adaptive-dialog")],M),i()}catch(g){i(g)}})},76538:function(e,t,a){a(62953);var i=a(40445),o=a(5124),r=a(67576);let s,l,n,d,h,c,p=e=>e;class u extends o.WF{render(){const e=(0,o.qy)(s||(s=p`<div class="header-title"> <slot name="title"></slot> </div>`)),t=(0,o.qy)(l||(l=p`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`));return(0,o.qy)(n||(n=p` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${0} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `),"above"===this.subtitlePosition?(0,o.qy)(d||(d=p`${0}${0}`),t,e):(0,o.qy)(h||(h=p`${0}${0}`),e,t))}static get styles(){return[(0,o.AH)(c||(c=p`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`))]}constructor(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,i.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],u.prototype,"subtitlePosition",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],u.prototype,"showBorder",void 0),u=(0,i.Cg)([(0,r.EM)("ha-dialog-header")],u)},72554:function(e,t,a){a.a(e,async function(e,t){try{a(3362),a(62953),a(49255);var i=a(40445),o=a(93900),r=a(35211),s=a(5124),l=a(67576),n=a(63672),d=a(1087),h=a(64481),c=a(22792),p=a(59992),u=a(14503),g=a(22348),v=(a(76538),a(26300)),f=e([o,v,p]);[o,v,p]=f.then?(await f)():f;let y,m,b,w,x,_,C,k=e=>e;const $="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";class S extends((0,p.V)(s.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(e){super.updated(e),e.has("open")&&(this._open=this.open)}render(){var e,t,a;return(0,s.qy)(y||(y=k` <wa-dialog .open="${0}" .lightDismiss="${0}" without-header aria-labelledby="${0}" aria-describedby="${0}" @keydown="${0}" @wa-hide="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-after-hide="${0}"> ${0} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${0}"> <slot></slot> </div> ${0} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `),this._open,!this.preventScrimClose,(0,n.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)),(0,n.J)(this.ariaDescribedBy),this._handleKeyDown,this._handleHide,this._handleShow,this._handleAfterShow,this._handleAfterHide,this.withoutHeader?s.s6:(0,s.qy)(m||(m=k`<slot name="header"> <ha-dialog-header .subtitlePosition="${0}" .showBorder="${0}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> </slot> ${0} ${0} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`),this.headerSubtitlePosition,this._bodyScrolled,null!==(e=null===(t=this._i18n)||void 0===t||null===(a=t.localize)||void 0===a?void 0:a.call(t,"ui.common.close"))&&void 0!==e?e:"Close",$,void 0!==this.headerTitle?(0,s.qy)(b||(b=k`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,s.qy)(w||(w=k`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,s.qy)(x||(x=k`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,s.qy)(_||(_=k`<slot name="headerSubtitle" slot="subtitle"></slot>`))),this._handleBodyScroll,this.renderScrollableFades())}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,h.J)(()=>{this._setFullscreen(e.detail)}):this._setFullscreen(e.detail)}_setFullscreen(e){this.toggleAttribute("fullscreen",e)}_handleBodyScroll(e){this._bodyScrolled=e.target.scrollTop>0}_handleKeyDown(e){"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)}_handleHide(e){var t;const a=(null===(t=e.detail)||void 0===t?void 0:t.source)===e.target.dialog;this.preventScrimClose&&this._escapePressed&&a&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,u.dp,(0,s.AH)(C||(C=k`wa-dialog{--full-width:var( --ha-dialog-width-full, min(95vw, var(--safe-width)) );--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var( --ha-dialog-surface-background, var(--card-background-color, var(--ha-color-surface-default)) );--wa-panel-border-radius:var( --ha-dialog-border-radius, var(--ha-border-radius-3xl) );max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-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));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var( --ha-dialog-header-title-font-size, var(--ha-font-size-2xl) );line-height:var( --ha-dialog-header-title-line-height, var(--ha-line-height-condensed) );font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}constructor(...e){super(...e),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var e,t;if(null!==(e=this._hassConfig)&&void 0!==e&&e.auth.external&&(0,g.V)(this._hassConfig.auth.external)){const e=this.querySelector("[autofocus]");return void(null!==e&&(e.id||(e.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})))}null===(t=this.querySelector("[autofocus]"))||void 0===t||t.focus()}))},this._handleAfterShow=e=>{e.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,i.Cg)([(0,l.MZ)({attribute:"aria-labelledby"})],S.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,l.MZ)({attribute:"aria-describedby"})],S.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,reflect:!0})],S.prototype,"open",void 0),(0,i.Cg)([(0,l.MZ)({reflect:!0})],S.prototype,"type",void 0),(0,i.Cg)([(0,l.MZ)({type:String,reflect:!0,attribute:"width"})],S.prototype,"width",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],S.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,l.MZ)({attribute:"header-title"})],S.prototype,"headerTitle",void 0),(0,i.Cg)([(0,l.MZ)({attribute:"header-subtitle"})],S.prototype,"headerSubtitle",void 0),(0,i.Cg)([(0,l.MZ)({type:String,attribute:"header-subtitle-position"})],S.prototype,"headerSubtitlePosition",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],S.prototype,"flexContent",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,attribute:"without-header"})],S.prototype,"withoutHeader",void 0),(0,i.Cg)([(0,l.wk)()],S.prototype,"_open",void 0),(0,i.Cg)([(0,l.P)(".body")],S.prototype,"bodyContainer",void 0),(0,i.Cg)([(0,l.wk)(),(0,r.Fg)({context:c.D5,subscribe:!0})],S.prototype,"_i18n",void 0),(0,i.Cg)([(0,l.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],S.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,l.wk)()],S.prototype,"_bodyScrolled",void 0),(0,i.Cg)([(0,l.Ls)({passive:!0})],S.prototype,"_handleBodyScroll",null),S=(0,i.Cg)([(0,l.EM)("ha-dialog")],S),t()}catch(y){t(y)}})},43661:function(e,t,a){a.r(t),a.d(t,{HaIconNext:function(){return l}});a(62953);var i=a(40445),o=a(67576),r=a(63091),s=a(67094);class l extends s.HaSvgIcon{constructor(...e){super(...e),this.path="rtl"===r.G.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"}}(0,i.Cg)([(0,o.MZ)()],l.prototype,"path",void 0),l=(0,i.Cg)([(0,o.EM)("ha-icon-next")],l)},25563:function(e,t,a){a.a(e,async function(e,i){try{a.r(t);a(18111),a(13579),a(3362),a(62953);var o=a(40445),r=a(5124),s=a(67576),l=a(22786),n=a(44537),d=a(1087),h=a(58594),c=a(6810),p=a(95311),u=a(14693),g=(a(76538),a(26300)),v=(a(43661),a(67094),a(50723),a(92288)),f=e([u,g,v]);[u,g,v]=f.then?(await f)():f;let y,m,b,w=e=>e;class x extends r.WF{showDialog(e){this._params=e,this._opened=!0}closeDialog(){return this._opened=!1,!0}_dialogClosed(){(0,d.r)(this,"dialog-closed",{dialog:this.localName}),this._params=void 0,this._entitySources=void 0,this._entitySourcesLoaded=!1}_hasIntegration(e){var t,a;return(null===(t=e.target)||void 0===t?void 0:t.entity)&&(0,n.e)(e.target.entity).some(e=>e.integration)||(null===(a=e.target)||void 0===a?void 0:a.device)&&(0,n.e)(e.target.device).some(e=>e.integration)}updated(e){var t;super.updated(e),e.has("_params")&&null!==(t=this._params)&&void 0!==t&&t.selector&&this._hasIntegration(this._params.selector)&&!this._entitySourcesLoaded&&this._loadEntitySources()}async _loadEntitySources(){try{this._entitySources=await(0,c.c)(this.hass)}catch(e){console.error("Failed to load entity sources for target details",e)}finally{this._entitySourcesLoaded=!0}}_selectorTarget(){var e;return(null===(e=this._params)||void 0===e||null===(e=e.selector)||void 0===e?void 0:e.target)||null}render(){if(!this._params)return r.s6;let e,t,a,i,o;var s;this._params.selector?(e=this._filterDevices,t=this._filterEntities,o=null===(s=this._params.selector.target)||void 0===s?void 0:s.primary_entities_only):(e=this._params.deviceFilter,t=this._params.entityFilter,a=this._params.includeDomains,i=this._params.includeDeviceClasses,o=this._params.primaryEntitiesOnly);const l=this._params.selector&&this._hasIntegration(this._params.selector)&&!this._entitySourcesLoaded;return(0,r.qy)(y||(y=w` <ha-adaptive-dialog .open="${0}" header-title="${0}" @closed="${0}"> <div class="type-wrapper"> <div class="type-label"> ${0} </div> <ha-list-base .ariaLabel="${0}" wrap-focus> ${0} </ha-list-base> </div> </ha-adaptive-dialog> `),this._opened,this.hass.localize("ui.components.target-picker.target_details"),this._dialogClosed,this.hass.localize(`ui.components.target-picker.type.${this._params.type}`),`${this.hass.localize(`ui.components.target-picker.type.${this._params.type}`)}: ${this._params.title}`,l?r.s6:(0,r.qy)(m||(m=w` <ha-target-picker-item-row .hass="${0}" .type="${0}" .itemId="${0}" .deviceFilter="${0}" .entityFilter="${0}" .includeDomains="${0}" .includeDeviceClasses="${0}" .primaryEntitiesOnly="${0}" expand></ha-target-picker-item-row> `),this.hass,this._params.type,this._params.itemId,e,t,a,i,o))}constructor(...e){super(...e),this._opened=!1,this._entitySourcesLoaded=!1,this._deviceIntegrationLookup=(0,l.A)(h.fk),this._filterEntities=e=>{const t=this._selectorTarget();return null==t||!t.entity||(0,n.e)(t.entity).some(t=>(0,p.Ru)(t,e,this._entitySources))},this._filterDevices=e=>{const t=this._selectorTarget();if(null==t||!t.device)return!0;const a=this._entitySources?this._deviceIntegrationLookup(this._entitySources,Object.values(this.hass.entities)):void 0;return(0,n.e)(t.device).some(t=>(0,p.vX)(t,e,a))}}}x.styles=(0,r.AH)(b||(b=w`.type-wrapper{display:flex;flex-direction:column;border-radius:var(--ha-border-radius-xl);border:var(--ha-border-width-sm) solid var(--ha-color-border-neutral-normal);overflow:hidden}.type-label{background-color:var(--ha-color-surface-low);padding:var(--ha-space-1) var(--ha-space-3);font-weight:var(--ha-font-weight-bold);display:flex;align-items:center;height:20px}`)),(0,o.Cg)([(0,s.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],x.prototype,"_params",void 0),(0,o.Cg)([(0,s.wk)()],x.prototype,"_opened",void 0),(0,o.Cg)([(0,s.wk)()],x.prototype,"_entitySources",void 0),(0,o.Cg)([(0,s.wk)()],x.prototype,"_entitySourcesLoaded",void 0),x=(0,o.Cg)([(0,s.EM)("ha-dialog-target-details")],x),i()}catch(y){i(y)}})},6810:function(e,t,a){a.d(t,{c:function(){return r}});a(3362),a(62953);const i=async(e,t,a,o,r,...s)=>{const l=r,n=l[e],d=n=>o&&o(r,n.result)!==n.cacheKey?(l[e]=void 0,i(e,t,a,o,r,...s)):n.result;if(n)return n instanceof Promise?n.then(d):d(n);const h=a(r,...s);return l[e]=h,h.then(a=>{l[e]={result:a,cacheKey:null==o?void 0:o(r,a)},setTimeout(()=>{l[e]=void 0},t)},()=>{l[e]=void 0}),h},o=e=>e.callWS({type:"entity/source"}),r=e=>i("_entitySources",3e4,o,e=>Object.keys(e.states).length,e)},93900:function(e,t,a){a.a(e,async function(e,t){try{a(3362),a(27495),a(62953);var i=a(5124),o=a(67576),r=a(6412),s=a(63672),l=a(17051),n=a(42462),d=a(28438),h=a(98779),c=a(27259),p=a(25877),u=a(31247),g=a(4444),v=a(92070),f=a(9395),y=a(717),m=a(17060),b=a(88496),w=a(91470),x=e([b,m]);[b,m]=x.then?(await x)():x;let $,S,L,M=e=>e;var _=Object.defineProperty,C=Object.getOwnPropertyDescriptor,k=(e,t,a,i)=>{for(var o,r=i>1?void 0:i?C(t,a):t,s=e.length-1;s>=0;s--)(o=e[s])&&(r=(i?o(t,a,r):o(r))||r);return i&&r&&_(t,a,r),r};let D=class extends y.A{firstUpdated(){this.open&&(this.addOpenListeners(),this.dialog.showModal(),(0,g.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,g.I7)(this),this.removeOpenListeners()}async requestClose(e){const t=new d.L({source:e});if(this.dispatchEvent(t),t.defaultPrevented)return this.open=!0,void(0,c.Ud)(this.dialog,"pulse");this.removeOpenListeners(),await(0,c.Ud)(this.dialog,"hide"),this.open=!1,this.dialog.close(),(0,g.I7)(this);const a=this.originalTrigger;"function"==typeof(null==a?void 0:a.focus)&&setTimeout(()=>a.focus()),this.dispatchEvent(new l.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,p.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,p.Fw)(this)}handleDialogCancel(e){e.preventDefault(),!this.dialog.classList.contains("hide")&&e.target===this.dialog&&(0,p.a0)(this)&&this.requestClose(this.dialog)}handleDialogClick(e){const t=e.target.closest('[data-dialog="close"]');t&&(e.stopPropagation(),this.requestClose(t))}async handleDialogPointerDown(e){e.target===this.dialog&&(this.lightDismiss?this.requestClose(this.dialog):await(0,c.Ud)(this.dialog,"pulse"))}handleOpenChange(){this.open&&!this.dialog.open?this.show():!this.open&&this.dialog.open&&(this.open=!0,this.requestClose(this.dialog))}async show(){const e=new h.k;this.dispatchEvent(e),e.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,g.JG)(this),requestAnimationFrame(()=>{const e=this.querySelector("[autofocus]");e&&"function"==typeof e.focus?e.focus():this.dialog.focus()}),await(0,c.Ud)(this.dialog,"show"),this.dispatchEvent(new n.q))}render(){var e;const t=!this.withoutHeader,a=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return(0,i.qy)($||($=M` <dialog aria-labelledby="${0}" aria-describedby="${0}" part="dialog" class="${0}" @cancel="${0}" @click="${0}" @pointerdown="${0}"> ${0} <div part="body" class="body"><slot></slot></div> ${0} </dialog> `),null!==(e=this.ariaLabelledby)&&void 0!==e?e:"title",(0,s.J)(this.ariaDescribedby),(0,r.H)({dialog:!0,open:this.open}),this.handleDialogCancel,this.handleDialogClick,this.handleDialogPointerDown,t?(0,i.qy)(S||(S=M` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${0} </slot> </h2> <div part="header-actions" class="header-actions"> <slot name="header-actions"></slot> <wa-button part="close-button" exportparts="base:close-button__base" class="close" appearance="plain" @click="${0}"> <wa-icon name="xmark" label="${0}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `),this.label.length>0?this.label:String.fromCharCode(8203),e=>this.requestClose(e.target),this.localize.term("close")):"",a?(0,i.qy)(L||(L=M` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `)):"")}constructor(){super(...arguments),this.localize=new m.c(this),this.hasSlotController=new v.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.withoutHeader=!1,this.lightDismiss=!1,this.withFooter=!1,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.open&&(0,p.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.dialog))}}};D.css=w.A,k([(0,o.P)(".dialog")],D.prototype,"dialog",2),k([(0,o.MZ)({type:Boolean,reflect:!0})],D.prototype,"open",2),k([(0,o.MZ)({reflect:!0})],D.prototype,"label",2),k([(0,o.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],D.prototype,"withoutHeader",2),k([(0,o.MZ)({attribute:"light-dismiss",type:Boolean})],D.prototype,"lightDismiss",2),k([(0,o.MZ)({attribute:"aria-labelledby"})],D.prototype,"ariaLabelledby",2),k([(0,o.MZ)({attribute:"aria-describedby"})],D.prototype,"ariaDescribedby",2),k([(0,o.MZ)({attribute:"with-footer",type:Boolean})],D.prototype,"withFooter",2),k([(0,f.w)("open",{waitUntilFirstUpdate:!0})],D.prototype,"handleOpenChange",1),D=k([(0,o.EM)("wa-dialog")],D),i.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-dialog]");if(t instanceof Element){const[e,a]=(0,u.v)(t.getAttribute("data-dialog")||"");if("open"===e&&null!=a&&a.length){const e=t.getRootNode().getElementById(a);"wa-dialog"===(null==e?void 0:e.localName)?e.open=!0:console.warn(`A dialog with an ID of "${a}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),t()}catch($){t($)}})},91470:function(e,t,a){a.d(t,{A:function(){return o}});let i;var o=(0,a(5124).AH)(i||(i=(e=>e)`:host{--width:31rem;--spacing:var(--wa-space-l);--backdrop-filter:none;--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.dialog{display:flex;flex-direction:column;top:0;right:0;bottom:0;left:0;width:var(--width);max-width:calc(100% - var(--wa-space-2xl));max-height:calc(100% - var(--wa-space-2xl));color:inherit;background-color:var(--wa-color-surface-raised);border-radius:var(--wa-panel-border-radius);border:none;box-shadow:var(--wa-shadow-l);padding:0;margin:auto}.dialog.show{animation:show-dialog var(--show-duration) ease}.dialog.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.dialog.hide{animation:show-dialog var(--hide-duration) ease reverse}.dialog.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.dialog.pulse{animation:pulse 250ms ease}.dialog:focus{outline:0}@media screen and (max-width:420px){.dialog{max-height:80vh}}.open{display:flex;opacity:1}.header{flex:0 0 auto;display:flex;flex-wrap:nowrap;padding-inline-start:var(--spacing);padding-block-end:0;padding-inline-end:calc(var(--spacing) - var(--wa-form-control-padding-block));padding-block-start:calc(var(--spacing) - var(--wa-form-control-padding-block))}.title{align-self:center;flex:1 1 auto;font-family:inherit;font-size:var(--wa-font-size-l);font-weight:var(--wa-font-weight-heading);line-height:var(--wa-line-height-condensed);margin:0}.header-actions{align-self:start;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:end;gap:var(--wa-space-2xs);padding-inline-start:var(--spacing)}.header-actions ::slotted(wa-button),.header-actions wa-button{flex:0 0 auto;display:flex;align-items:center}.body{flex:1 1 auto;display:block;padding:var(--spacing);overflow:auto;-webkit-overflow-scrolling:touch}.body:focus{outline:0}.body:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.footer{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:var(--wa-space-xs);justify-content:end;padding:var(--spacing);padding-block-start:0}.footer ::slotted(wa-button:not(:first-of-type)){margin-inline-start:var(--wa-spacing-xs)}.dialog::backdrop{background-color:var(--wa-color-overlay-modal,rgb(0 0 0 / .25));-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}@keyframes pulse{0%{scale:1}50%{scale:1.02}100%{scale:1}}@keyframes show-dialog{from{opacity:0;scale:0.8}to{opacity:1;scale:1}}@keyframes show-backdrop{from{opacity:0}to{opacity:1}}@media (forced-colors:active){.dialog{border:solid 1px #fff}}`))}}]);