UNPKG

iobroker.lovelace

Version:

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

2 lines 17.4 kB
/*! For license information please see 21658.b15ad64007a8bd5e.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[21658],{13611:function(e,t,o){var i=o(46518),n=o(44576),s=o(62106),a=o(43724),r=TypeError,l=Object.defineProperty,c=n.self!==n;try{if(a){var d=Object.getOwnPropertyDescriptor(n,"self");!c&&d&&d.get&&d.enumerable||s(n,"self",{get:function(){return n},set:function(e){if(this!==n)throw new r("Illegal invocation");l(n,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else i({global:!0,simple:!0,forced:c},{self:n})}catch(h){}},93900:function(e,t,o){o.a(e,async function(e,t){try{o(3362),o(27495),o(62953);var i=o(5124),n=o(67576),s=o(6412),a=o(63672),r=o(17051),l=o(42462),c=o(28438),d=o(98779),h=o(27259),u=o(25877),p=o(31247),f=o(4444),g=o(92070),v=o(9395),b=o(717),m=o(17060),w=o(88496),y=o(91470),k=e([w,m]);[w,m]=k.then?(await k)():k;let $,x,_,L=e=>e;var C=Object.defineProperty,E=Object.getOwnPropertyDescriptor,A=(e,t,o,i)=>{for(var n,s=i>1?void 0:i?E(t,o):t,a=e.length-1;a>=0;a--)(n=e[a])&&(s=(i?n(t,o,s):n(s))||s);return i&&s&&C(t,o,s),s};let O=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(e){const t=new c.L({source:e});if(this.dispatchEvent(t),t.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(e){e.preventDefault(),!this.dialog.classList.contains("hide")&&e.target===this.dialog&&(0,u.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,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 e=new d.k;this.dispatchEvent(e),e.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,f.JG)(this),requestAnimationFrame(()=>{const e=this.querySelector("[autofocus]");e&&"function"==typeof e.focus?e.focus():this.dialog.focus()}),await(0,h.Ud)(this.dialog,"show"),this.dispatchEvent(new l.q))}render(){var e;const t=!this.withoutHeader,o=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return(0,i.qy)($||($=L` <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,a.J)(this.ariaDescribedby),(0,s.H)({dialog:!0,open:this.open}),this.handleDialogCancel,this.handleDialogClick,this.handleDialogPointerDown,t?(0,i.qy)(x||(x=L` <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")):"",o?(0,i.qy)(_||(_=L` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `)):"")}constructor(){super(...arguments),this.localize=new m.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=e=>{"Escape"===e.key&&this.open&&(0,u.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.dialog))}}};O.css=y.A,A([(0,n.P)(".dialog")],O.prototype,"dialog",2),A([(0,n.MZ)({type:Boolean,reflect:!0})],O.prototype,"open",2),A([(0,n.MZ)({reflect:!0})],O.prototype,"label",2),A([(0,n.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],O.prototype,"withoutHeader",2),A([(0,n.MZ)({attribute:"light-dismiss",type:Boolean})],O.prototype,"lightDismiss",2),A([(0,n.MZ)({attribute:"aria-labelledby"})],O.prototype,"ariaLabelledby",2),A([(0,n.MZ)({attribute:"aria-describedby"})],O.prototype,"ariaDescribedby",2),A([(0,n.MZ)({attribute:"with-footer",type:Boolean})],O.prototype,"withFooter",2),A([(0,v.w)("open",{waitUntilFirstUpdate:!0})],O.prototype,"handleOpenChange",1),O=A([(0,n.EM)("wa-dialog")],O),i.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-dialog]");if(t instanceof Element){const[e,o]=(0,p.v)(t.getAttribute("data-dialog")||"");if("open"===e&&null!=o&&o.length){const e=t.getRootNode().getElementById(o);"wa-dialog"===(null==e?void 0:e.localName)?e.open=!0:console.warn(`A dialog with an ID of "${o}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),t()}catch($){t($)}})},91470:function(e,t,o){o.d(t,{A:function(){return n}});let i;var n=(0,o(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}}`))},31247:function(e,t,o){o.d(t,{v:function(){return i}});o(18111),o(22489),o(61701),o(42762);function i(e){return e.split(" ").map(e=>e.trim()).filter(e=>""!==e)}},4444:function(e,t,o){o.d(t,{JG:function(){return n},Rt:function(){return a},I7:function(){return s}});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 n(e){if(i.add(e),!document.documentElement.classList.contains("wa-scroll-lock")){const e=function(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}()+function(){const e=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(e)||!e?0:e}();let t=getComputedStyle(document.documentElement).scrollbarGutter;t&&"auto"!==t||(t="stable"),e<2&&(t=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",t),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${e}px`)}}function s(e){i.delete(e),0===i.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function a(e,t,o="vertical",i="smooth"){const n=function(e,t){return{top:Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top),left:Math.round(e.getBoundingClientRect().left-t.getBoundingClientRect().left)}}(e,t),s=n.top+t.scrollTop,a=n.left+t.scrollLeft,r=t.scrollLeft,l=t.scrollLeft+t.offsetWidth,c=t.scrollTop,d=t.scrollTop+t.offsetHeight;"horizontal"!==o&&"both"!==o||(a<r?t.scrollTo({left:a,behavior:i}):a+e.clientWidth>l&&t.scrollTo({left:a-t.offsetWidth+e.clientWidth,behavior:i})),"vertical"!==o&&"both"!==o||(s<c?t.scrollTo({top:s,behavior:i}):s+e.clientHeight>d&&t.scrollTo({top:s-t.offsetHeight+e.clientHeight,behavior:i}))}},88696:function(e,t,o){o.a(e,async function(e,i){try{o.d(t,{P:function(){return l}});var n=o(69235),s=(o(3362),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953),o(37540)),a=o(42017),r=e([n]);n=(r.then?(await r)():r)[0];class l{handleChanges(e){var t;this.value=null===(t=this.callback)||void 0===t?void 0:t.call(this,e,this.u)}hostConnected(){for(const e of this.t)this.observe(e)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(e){this.t.add(e),this.u.observe(e,this.l),this.i=!0,this.h.requestUpdate()}unobserve(e){this.t.delete(e),this.u.unobserve(e)}disconnect(){this.u.disconnect()}target(e){return c(this,e)}constructor(e,{target:t,config:o,callback:i,skipInitial:n}){this.t=new Set,this.o=!1,this.i=!1,this.h=e,null!==t&&this.t.add(null!=t?t:e),this.l=o,this.o=null!=n?n:this.o,this.callback=i,window.ResizeObserver?(this.u=new ResizeObserver(e=>{this.handleChanges(e),this.h.requestUpdate()}),e.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}}const c=(0,a.u$)(class extends s.Kq{render(e,t){}update(e,[t,o]){this.controller=t,this.part=e,this.observe=o,!1===o?(t.unobserve(e.element),this.observing=!1):!1===this.observing&&(t.observe(e.element),this.observing=!0)}disconnected(){var e;null!==(e=this.controller)&&void 0!==e&&e.unobserve(this.part.element),this.observing=!1}reconnected(){var e;!1!==this.observe&&!1===this.observing&&(null!==(e=this.controller)&&void 0!==e&&e.observe(this.part.element),this.observing=!0)}constructor(){super(...arguments),this.observing=!1}});i()}catch(l){i(l)}})},2209:function(e,t,o){o.d(t,{LV:function(){return u}});o(89463),o(16280),o(72712),o(55081),o(18111),o(61701),o(18237),o(45367),o(92731),o(3362),o(84864),o(57465),o(27495),o(88454),o(29452),o(62953);const i=Symbol("Comlink.proxy"),n=Symbol("Comlink.endpoint"),s=Symbol("Comlink.releaseProxy"),a=Symbol("Comlink.finalizer"),r=Symbol("Comlink.thrown"),l=e=>"object"==typeof e&&null!==e||"function"==typeof e,c=new Map([["proxy",{canHandle:e=>l(e)&&e[i],serialize(e){const{port1:t,port2:o}=new MessageChannel;return d(e,t),[o,[o]]},deserialize(e){return e.start(),u(e)}}],["throw",{canHandle:e=>l(e)&&r in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function d(e,t=globalThis,o=["*"]){t.addEventListener("message",function n(s){if(!s||!s.data)return;if(!function(e,t){for(const o of e){if(t===o||"*"===o)return!0;if(o instanceof RegExp&&o.test(t))return!0}return!1}(o,s.origin))return void console.warn(`Invalid origin '${s.origin}' for comlink proxy`);const{id:l,type:c,path:u}=Object.assign({path:[]},s.data),p=(s.data.argumentList||[]).map(k);let f;try{const t=u.slice(0,-1).reduce((e,t)=>e[t],e),o=u.reduce((e,t)=>e[t],e);switch(c){case"GET":f=o;break;case"SET":t[u.slice(-1)[0]]=k(s.data.value),f=!0;break;case"APPLY":f=o.apply(t,p);break;case"CONSTRUCT":f=function(e){return Object.assign(e,{[i]:!0})}(new o(...p));break;case"ENDPOINT":{const{port1:t,port2:o}=new MessageChannel;d(e,o),f=function(e,t){return w.set(e,t),e}(t,[t])}break;case"RELEASE":f=void 0;break;default:return}}catch(g){f={value:g,[r]:0}}Promise.resolve(f).catch(e=>({value:e,[r]:0})).then(o=>{const[i,s]=y(o);t.postMessage(Object.assign(Object.assign({},i),{id:l}),s),"RELEASE"===c&&(t.removeEventListener("message",n),h(t),a in e&&"function"==typeof e[a]&&e[a]())}).catch(e=>{const[o,i]=y({value:new TypeError("Unserializable return value"),[r]:0});t.postMessage(Object.assign(Object.assign({},o),{id:l}),i)})}),t.start&&t.start()}function h(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function u(e,t){const o=new Map;return e.addEventListener("message",function(e){const{data:t}=e;if(!t||!t.id)return;const i=o.get(t.id);if(i)try{i(t)}finally{o.delete(t.id)}}),b(e,o,[],t)}function p(e){if(e)throw new Error("Proxy has been released and is not useable")}function f(e){return C(e,new Map,{type:"RELEASE"}).then(()=>{h(e)})}const g=new WeakMap,v="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(g.get(e)||0)-1;g.set(e,t),0===t&&f(e)});function b(e,t,o=[],i=function(){}){let a=!1;const r=new Proxy(i,{get(i,n){if(p(a),n===s)return()=>{!function(e){v&&v.unregister(e)}(r),f(e),t.clear(),a=!0};if("then"===n){if(0===o.length)return{then:()=>r};const i=C(e,t,{type:"GET",path:o.map(e=>e.toString())}).then(k);return i.then.bind(i)}return b(e,t,[...o,n])},set(i,n,s){p(a);const[r,l]=y(s);return C(e,t,{type:"SET",path:[...o,n].map(e=>e.toString()),value:r},l).then(k)},apply(i,s,r){p(a);const l=o[o.length-1];if(l===n)return C(e,t,{type:"ENDPOINT"}).then(k);if("bind"===l)return b(e,t,o.slice(0,-1));const[c,d]=m(r);return C(e,t,{type:"APPLY",path:o.map(e=>e.toString()),argumentList:c},d).then(k)},construct(i,n){p(a);const[s,r]=m(n);return C(e,t,{type:"CONSTRUCT",path:o.map(e=>e.toString()),argumentList:s},r).then(k)}});return function(e,t){const o=(g.get(t)||0)+1;g.set(t,o),v&&v.register(e,t,e)}(r,e),r}function m(e){const t=e.map(y);return[t.map(e=>e[0]),(o=t.map(e=>e[1]),Array.prototype.concat.apply([],o))];var o}const w=new WeakMap;function y(e){for(const[t,o]of c)if(o.canHandle(e)){const[i,n]=o.serialize(e);return[{type:"HANDLER",name:t,value:i},n]}return[{type:"RAW",value:e},w.get(e)||[]]}function k(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function C(e,t,o,i){return new Promise(n=>{const s=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.set(s,n),e.start&&e.start(),e.postMessage(Object.assign({id:s},o),i)})}},37540:function(e,t,o){o.d(t,{Kq:function(){return h}});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953);var i=o(63937),n=o(42017);const s=(e,t)=>{const o=e._$AN;if(void 0===o)return!1;for(const n of o){var i;null!==(i=n._$AO)&&void 0!==i&&i.call(n,t,!1),s(n,t)}return!0},a=e=>{let t,o;do{var i;if(void 0===(t=e._$AM))break;o=t._$AN,o.delete(e),e=t}while(0===(null===(i=o)||void 0===i?void 0:i.size))},r=e=>{for(let t;t=e._$AM;e=t){let o=t._$AN;if(void 0===o)t._$AN=o=new Set;else if(o.has(e))break;o.add(e),d(t)}};function l(e){void 0!==this._$AN?(a(this),this._$AM=e,r(this)):this._$AM=e}function c(e,t=!1,o=0){const i=this._$AH,n=this._$AN;if(void 0!==n&&0!==n.size)if(t)if(Array.isArray(i))for(let r=o;r<i.length;r++)s(i[r],!1),a(i[r]);else null!=i&&(s(i,!1),a(i));else s(this,e)}const d=e=>{var t,o;e.type==n.OA.CHILD&&(null!==(t=e._$AP)&&void 0!==t||(e._$AP=c),null!==(o=e._$AQ)&&void 0!==o||(e._$AQ=l))};class h extends n.WL{_$AT(e,t,o){super._$AT(e,t,o),r(this),this.isConnected=e._$AU}_$AO(e,t=!0){var o,i;e!==this.isConnected&&(this.isConnected=e,e?null===(o=this.reconnected)||void 0===o||o.call(this):null===(i=this.disconnected)||void 0===i||i.call(this)),t&&(s(this,e),a(this))}setValue(e){if((0,i.Rt)(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}constructor(){super(...arguments),this._$AN=void 0}}}}]);