UNPKG

iobroker.lovelace

Version:

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

2 lines 15.9 kB
/*! For license information please see 89764.f6a34da53aa6481a.js.LICENSE.txt */ export const __rspack_esm_id=89764;export const __rspack_esm_ids=[89764];export const __webpack_modules__={93900(e,t,o){o.a(e,async function(e,t){try{var i=o(5124),s=o(22441),n=o(6412),a=o(63672),r=o(17051),l=o(42462),c=o(28438),d=o(98779),h=o(27259),p=o(25877),u=o(31247),g=o(4444),f=o(92070),b=o(9395),m=o(717),w=o(17060),v=o(88496),y=o(91470),k=e([v,w]);[v,w]=k.then?(await k)():k;var E=Object.defineProperty,C=Object.getOwnPropertyDescriptor,A=(e,t,o,i)=>{for(var s,n=i>1?void 0:i?C(t,o):t,a=e.length-1;a>=0;a--)(s=e[a])&&(n=(i?s(t,o,n):s(n))||n);return i&&n&&E(t,o,n),n};let x=class extends m.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 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,g.I7)(this);const o=this.originalTrigger;"function"==typeof o?.focus&&setTimeout(()=>o.focus()),this.dispatchEvent(new r.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,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,g.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(){const e=!this.withoutHeader,t=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return i.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,a.J)(this.ariaDescribedby)}" part="dialog" class="${(0,n.H)({dialog:!0,open:this.open})}" @cancel="${this.handleDialogCancel}" @click="${this.handleDialogClick}" @pointerdown="${this.handleDialogPointerDown}"> ${e?i.qy` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(8203)} </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="${e=>this.requestClose(e.target)}"> <wa-icon name="xmark" label="${this.localize.term("close")}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `:""} <div part="body" class="body"><slot></slot></div> ${t?i.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new w.c(this),this.hasSlotController=new f.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))}}};x.css=y.A,A([(0,s.P)(".dialog")],x.prototype,"dialog",2),A([(0,s.MZ)({type:Boolean,reflect:!0})],x.prototype,"open",2),A([(0,s.MZ)({reflect:!0})],x.prototype,"label",2),A([(0,s.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],x.prototype,"withoutHeader",2),A([(0,s.MZ)({attribute:"light-dismiss",type:Boolean})],x.prototype,"lightDismiss",2),A([(0,s.MZ)({attribute:"aria-labelledby"})],x.prototype,"ariaLabelledby",2),A([(0,s.MZ)({attribute:"aria-describedby"})],x.prototype,"ariaDescribedby",2),A([(0,s.MZ)({attribute:"with-footer",type:Boolean})],x.prototype,"withFooter",2),A([(0,b.w)("open",{waitUntilFirstUpdate:!0})],x.prototype,"handleOpenChange",1),x=A([(0,s.EM)("wa-dialog")],x),i.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-dialog]");if(t instanceof Element){const[e,o]=(0,u.v)(t.getAttribute("data-dialog")||"");if("open"===e&&o?.length){const e=t.getRootNode().getElementById(o);"wa-dialog"===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(e){t(e)}})},91470(e,t,o){o.d(t,{A:()=>i});var i=o(5124).AH`: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(e,t,o){o.d(t,{v:()=>i});o(18111),o(22489),o(61701);function i(e){return e.split(" ").map(e=>e.trim()).filter(e=>""!==e)}},4444(e,t,o){o.d(t,{JG:()=>s,Rt:()=>a,I7:()=>n});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);const i=new Set;function s(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 n(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 s=function(e,t){return{top:Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top),left:Math.round(e.getBoundingClientRect().left-t.getBoundingClientRect().left)}}(e,t),n=s.top+t.scrollTop,a=s.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||(n<c?t.scrollTo({top:n,behavior:i}):n+e.clientHeight>d&&t.scrollTo({top:n-t.offsetHeight+e.clientHeight,behavior:i}))}},88696(e,t,o){o.d(t,{P:()=>n});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var i=o(37540),s=o(42017);class n{handleChanges(e){this.value=this.callback?.(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 a(this,e)}constructor(e,{target:t,config:o,callback:i,skipInitial:s}){this.t=new Set,this.o=!1,this.i=!1,this.h=e,null!==t&&this.t.add(t??e),this.l=o,this.o=s??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 a=(0,s.u$)(class extends i.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(){this.controller?.unobserve(this.part.element),this.observing=!1}reconnected(){!1!==this.observe&&!1===this.observing&&(this.controller?.observe(this.part.element),this.observing=!0)}constructor(){super(...arguments),this.observing=!1}})},2209(e,t,o){o.d(t,{LV:()=>p});o(18111),o(61701),o(18237),o(45367),o(92731),o(88454),o(29452);const i=Symbol("Comlink.proxy"),s=Symbol("Comlink.endpoint"),n=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=>(e.start(),p(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 s(n){if(!n||!n.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,n.origin))return void console.warn(`Invalid origin '${n.origin}' for comlink proxy`);const{id:l,type:c,path:p}=Object.assign({path:[]},n.data),u=(n.data.argumentList||[]).map(k);let g;try{const t=p.slice(0,-1).reduce((e,t)=>e[t],e),o=p.reduce((e,t)=>e[t],e);switch(c){case"GET":g=o;break;case"SET":t[p.slice(-1)[0]]=k(n.data.value),g=!0;break;case"APPLY":g=o.apply(t,u);break;case"CONSTRUCT":g=function(e){return Object.assign(e,{[i]:!0})}(new o(...u));break;case"ENDPOINT":{const{port1:t,port2:o}=new MessageChannel;d(e,o),g=function(e,t){return v.set(e,t),e}(t,[t])}break;case"RELEASE":g=void 0;break;default:return}}catch(e){g={value:e,[r]:0}}Promise.resolve(g).catch(e=>({value:e,[r]:0})).then(o=>{const[i,n]=y(o);t.postMessage(Object.assign(Object.assign({},i),{id:l}),n),"RELEASE"===c&&(t.removeEventListener("message",s),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 p(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)}}),m(e,o,[],t)}function u(e){if(e)throw new Error("Proxy has been released and is not useable")}function g(e){return E(e,new Map,{type:"RELEASE"}).then(()=>{h(e)})}const f=new WeakMap,b="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(f.get(e)||0)-1;f.set(e,t),0===t&&g(e)});function m(e,t,o=[],i=function(){}){let a=!1;const r=new Proxy(i,{get(i,s){if(u(a),s===n)return()=>{!function(e){b&&b.unregister(e)}(r),g(e),t.clear(),a=!0};if("then"===s){if(0===o.length)return{then:()=>r};const i=E(e,t,{type:"GET",path:o.map(e=>e.toString())}).then(k);return i.then.bind(i)}return m(e,t,[...o,s])},set(i,s,n){u(a);const[r,l]=y(n);return E(e,t,{type:"SET",path:[...o,s].map(e=>e.toString()),value:r},l).then(k)},apply(i,n,r){u(a);const l=o[o.length-1];if(l===s)return E(e,t,{type:"ENDPOINT"}).then(k);if("bind"===l)return m(e,t,o.slice(0,-1));const[c,d]=w(r);return E(e,t,{type:"APPLY",path:o.map(e=>e.toString()),argumentList:c},d).then(k)},construct(i,s){u(a);const[n,r]=w(s);return E(e,t,{type:"CONSTRUCT",path:o.map(e=>e.toString()),argumentList:n},r).then(k)}});return function(e,t){const o=(f.get(t)||0)+1;f.set(t,o),b&&b.register(e,t,e)}(r,e),r}function w(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 v=new WeakMap;function y(e){for(const[t,o]of c)if(o.canHandle(e)){const[i,s]=o.serialize(e);return[{type:"HANDLER",name:t,value:i},s]}return[{type:"RAW",value:e},v.get(e)||[]]}function k(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function E(e,t,o,i){return new Promise(s=>{const n=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.set(n,s),e.start&&e.start(),e.postMessage(Object.assign({id:n},o),i)})}},37540(e,t,o){o.d(t,{Kq:()=>h});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var i=o(63937),s=o(42017);const n=(e,t)=>{const o=e._$AN;if(void 0===o)return!1;for(const e of o)e._$AO?.(t,!1),n(e,t);return!0},a=e=>{let t,o;do{if(void 0===(t=e._$AM))break;o=t._$AN,o.delete(e),e=t}while(0===o?.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,s=this._$AN;if(void 0!==s&&0!==s.size)if(t)if(Array.isArray(i))for(let e=o;e<i.length;e++)n(i[e],!1),a(i[e]);else null!=i&&(n(i,!1),a(i));else n(this,e)}const d=e=>{e.type==s.OA.CHILD&&(e._$AP??=c,e._$AQ??=l)};class h extends s.WL{_$AT(e,t,o){super._$AT(e,t,o),r(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(n(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}}}};