UNPKG

iobroker.lovelace

Version:

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

2 lines 13 kB
/*! For license information please see 4158.53bff0f487144d22.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[4158],{34271:function(t,e,o){o.d(e,{A:function(){return i}});o(18111),o(7588),o(61701);function i(t){if(!t||"object"!=typeof t)return t;if("[object Date]"==Object.prototype.toString.call(t))return new Date(t.getTime());if(Array.isArray(t))return t.map(i);var e={};return Object.keys(t).forEach(function(o){e[o]=i(t[o])}),e}},93900:function(t,e,o){o.a(t,async function(t,e){try{o(3362),o(27495),o(62953);var i=o(5124),s=o(67576),a=o(6412),n=o(63672),r=o(17051),l=o(42462),d=o(28438),c=o(98779),h=o(27259),u=o(25877),p=o(31247),f=o(4444),g=o(92070),v=o(9395),b=o(717),w=o(17060),m=o(88496),y=o(91470),k=t([m,w]);[m,w]=k.then?(await k)():k;let x,_,D,E=t=>t;var $=Object.defineProperty,C=Object.getOwnPropertyDescriptor,A=(t,e,o,i)=>{for(var s,a=i>1?void 0:i?C(e,o):e,n=t.length-1;n>=0;n--)(s=t[n])&&(a=(i?s(e,o,a):s(a))||a);return i&&a&&$(e,o,a),a};let L=class extends b.A{firstUpdated(){this.open&&(this.addOpenListeners(),this.dialog.showModal(),(0,f.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,f.I7)(this),this.removeOpenListeners()}async requestClose(t){const e=new d.L({source:t});if(this.dispatchEvent(e),e.defaultPrevented)return this.open=!0,void(0,h.Ud)(this.dialog,"pulse");this.removeOpenListeners(),await(0,h.Ud)(this.dialog,"hide"),this.open=!1,this.dialog.close(),(0,f.I7)(this);const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout(()=>o.focus()),this.dispatchEvent(new r.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,u.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,u.Fw)(this)}handleDialogCancel(t){t.preventDefault(),!this.dialog.classList.contains("hide")&&t.target===this.dialog&&(0,u.a0)(this)&&this.requestClose(this.dialog)}handleDialogClick(t){const e=t.target.closest('[data-dialog="close"]');e&&(t.stopPropagation(),this.requestClose(e))}async handleDialogPointerDown(t){t.target===this.dialog&&(this.lightDismiss?this.requestClose(this.dialog):await(0,h.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 t=new c.k;this.dispatchEvent(t),t.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,f.JG)(this),requestAnimationFrame(()=>{const t=this.querySelector("[autofocus]");t&&"function"==typeof t.focus?t.focus():this.dialog.focus()}),await(0,h.Ud)(this.dialog,"show"),this.dispatchEvent(new l.q))}render(){var t;const e=!this.withoutHeader,o=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return(0,i.qy)(x||(x=E` <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!==(t=this.ariaLabelledby)&&void 0!==t?t:"title",(0,n.J)(this.ariaDescribedby),(0,a.H)({dialog:!0,open:this.open}),this.handleDialogCancel,this.handleDialogClick,this.handleDialogPointerDown,e?(0,i.qy)(_||(_=E` <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),t=>this.requestClose(t.target),this.localize.term("close")):"",o?(0,i.qy)(D||(D=E` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `)):"")}constructor(){super(...arguments),this.localize=new w.c(this),this.hasSlotController=new g.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.withoutHeader=!1,this.lightDismiss=!1,this.withFooter=!1,this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&(0,u.a0)(this)&&(t.preventDefault(),t.stopPropagation(),this.requestClose(this.dialog))}}};L.css=y.A,A([(0,s.P)(".dialog")],L.prototype,"dialog",2),A([(0,s.MZ)({type:Boolean,reflect:!0})],L.prototype,"open",2),A([(0,s.MZ)({reflect:!0})],L.prototype,"label",2),A([(0,s.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],L.prototype,"withoutHeader",2),A([(0,s.MZ)({attribute:"light-dismiss",type:Boolean})],L.prototype,"lightDismiss",2),A([(0,s.MZ)({attribute:"aria-labelledby"})],L.prototype,"ariaLabelledby",2),A([(0,s.MZ)({attribute:"aria-describedby"})],L.prototype,"ariaDescribedby",2),A([(0,s.MZ)({attribute:"with-footer",type:Boolean})],L.prototype,"withFooter",2),A([(0,v.w)("open",{waitUntilFirstUpdate:!0})],L.prototype,"handleOpenChange",1),L=A([(0,s.EM)("wa-dialog")],L),i.S$||(document.addEventListener("click",t=>{const e=t.target.closest("[data-dialog]");if(e instanceof Element){const[t,o]=(0,p.v)(e.getAttribute("data-dialog")||"");if("open"===t&&null!=o&&o.length){const t=e.getRootNode().getElementById(o);"wa-dialog"===(null==t?void 0:t.localName)?t.open=!0:console.warn(`A dialog with an ID of "${o}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),e()}catch(x){e(x)}})},91470:function(t,e,o){o.d(e,{A:function(){return s}});let i;var s=(0,o(5124).AH)(i||(i=(t=>t)`: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}}`))},31247:function(t,e,o){o.d(e,{v:function(){return i}});o(18111),o(22489),o(61701),o(42762);function i(t){return t.split(" ").map(t=>t.trim()).filter(t=>""!==t)}},4444:function(t,e,o){o.d(e,{JG:function(){return s},Rt:function(){return n},I7:function(){return a}});o(27495),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(25440),o(62953);const i=new Set;function s(t){if(i.add(t),!document.documentElement.classList.contains("wa-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let e=getComputedStyle(document.documentElement).scrollbarGutter;e&&"auto"!==e||(e="stable"),t<2&&(e=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",e),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${t}px`)}}function a(t){i.delete(t),0===i.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function n(t,e,o="vertical",i="smooth"){const s=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),a=s.top+e.scrollTop,n=s.left+e.scrollLeft,r=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,d=e.scrollTop,c=e.scrollTop+e.offsetHeight;"horizontal"!==o&&"both"!==o||(n<r?e.scrollTo({left:n,behavior:i}):n+t.clientWidth>l&&e.scrollTo({left:n-e.offsetWidth+t.clientWidth,behavior:i})),"vertical"!==o&&"both"!==o||(a<d?e.scrollTo({top:a,behavior:i}):a+t.clientHeight>c&&e.scrollTo({top:a-e.offsetHeight+t.clientHeight,behavior:i}))}},88696:function(t,e,o){o.a(t,async function(t,i){try{o.d(e,{P:function(){return l}});var s=o(69235),a=(o(3362),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953),o(37540)),n=o(42017),r=t([s]);s=(r.then?(await r)():r)[0];class l{handleChanges(t){var e;this.value=null===(e=this.callback)||void 0===e?void 0:e.call(this,t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}target(t){return d(this,t)}constructor(t,{target:e,config:o,callback:i,skipInitial:s}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,null!==e&&this.t.add(null!=e?e:t),this.l=o,this.o=null!=s?s:this.o,this.callback=i,window.ResizeObserver?(this.u=new ResizeObserver(t=>{this.handleChanges(t),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}}const d=(0,n.u$)(class extends a.Kq{render(t,e){}update(t,[e,o]){this.controller=e,this.part=t,this.observe=o,!1===o?(e.unobserve(t.element),this.observing=!1):!1===this.observing&&(e.observe(t.element),this.observing=!0)}disconnected(){var t;null!==(t=this.controller)&&void 0!==t&&t.unobserve(this.part.element),this.observing=!1}reconnected(){var t;!1!==this.observe&&!1===this.observing&&(null!==(t=this.controller)&&void 0!==t&&t.observe(this.part.element),this.observing=!0)}constructor(){super(...arguments),this.observing=!1}});i()}catch(l){i(l)}})},37540:function(t,e,o){o.d(e,{Kq:function(){return h}});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953);var i=o(63937),s=o(42017);const a=(t,e)=>{const o=t._$AN;if(void 0===o)return!1;for(const s of o){var i;null!==(i=s._$AO)&&void 0!==i&&i.call(s,e,!1),a(s,e)}return!0},n=t=>{let e,o;do{var i;if(void 0===(e=t._$AM))break;o=e._$AN,o.delete(t),t=e}while(0===(null===(i=o)||void 0===i?void 0:i.size))},r=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(void 0===o)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),c(e)}};function l(t){void 0!==this._$AN?(n(this),this._$AM=t,r(this)):this._$AM=t}function d(t,e=!1,o=0){const i=this._$AH,s=this._$AN;if(void 0!==s&&0!==s.size)if(e)if(Array.isArray(i))for(let r=o;r<i.length;r++)a(i[r],!1),n(i[r]);else null!=i&&(a(i,!1),n(i));else a(this,t)}const c=t=>{var e,o;t.type==s.OA.CHILD&&(null!==(e=t._$AP)&&void 0!==e||(t._$AP=d),null!==(o=t._$AQ)&&void 0!==o||(t._$AQ=l))};class h extends s.WL{_$AT(t,e,o){super._$AT(t,e,o),r(this),this.isConnected=t._$AU}_$AO(t,e=!0){var o,i;t!==this.isConnected&&(this.isConnected=t,t?null===(o=this.reconnected)||void 0===o||o.call(this):null===(i=this.disconnected)||void 0===i||i.call(this)),e&&(a(this,t),n(this))}setValue(t){if((0,i.Rt)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}constructor(){super(...arguments),this._$AN=void 0}}}}]);