UNPKG

iobroker.lovelace

Version:

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

2 lines 15.4 kB
/*! For license information please see 87192.1d1cd7cffdbd4aa4.js.LICENSE.txt */ export const __rspack_esm_id=87192;export const __rspack_esm_ids=[87192];export const __webpack_modules__={77957(e,t,a){var r=a(76080),o=a(79504),i=a(47055),s=a(48981),n=a(56969),l=a(26198),d=a(2360),c=a(35370),h=Array,u=o([].push);e.exports=function(e,t,a,o){for(var p,f,g,v=s(e),m=i(v),w=r(t,a),b=d(null),y=l(m),x=0;y>x;x++)g=m[x],(f=n(w(g,x,v)))in b?u(b[f],g):b[f]=[g];if(o&&(p=o(v))!==h)for(f in b)b[f]=c(p,b[f]);return b}},46058(e,t,a){var r=a(46518),o=a(77957),i=a(6469);r({target:"Array",proto:!0},{group:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("group")},93900(e,t,a){a.a(e,async function(e,t){try{var r=a(5124),o=a(22441),i=a(6412),s=a(63672),n=a(17051),l=a(42462),d=a(28438),c=a(98779),h=a(27259),u=a(25877),p=a(31247),f=a(4444),g=a(92070),v=a(9395),m=a(717),w=a(17060),b=a(88496),y=a(91470),x=e([b,w]);[b,w]=x.then?(await x)():x;var k=Object.defineProperty,C=Object.getOwnPropertyDescriptor,D=(e,t,a,r)=>{for(var o,i=r>1?void 0:r?C(t,a):t,s=e.length-1;s>=0;s--)(o=e[s])&&(i=(r?o(t,a,i):o(i))||i);return r&&i&&k(t,a,i),i};let A=class extends m.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 d.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 a=this.originalTrigger;"function"==typeof a?.focus&&setTimeout(()=>a.focus()),this.dispatchEvent(new n.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 c.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(){const e=!this.withoutHeader,t=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return r.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,s.J)(this.ariaDescribedby)}" part="dialog" class="${(0,i.H)({dialog:!0,open:this.open})}" @cancel="${this.handleDialogCancel}" @click="${this.handleDialogClick}" @pointerdown="${this.handleDialogPointerDown}"> ${e?r.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?r.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}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=e=>{"Escape"===e.key&&this.open&&(0,u.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.dialog))}}};A.css=y.A,D([(0,o.P)(".dialog")],A.prototype,"dialog",2),D([(0,o.MZ)({type:Boolean,reflect:!0})],A.prototype,"open",2),D([(0,o.MZ)({reflect:!0})],A.prototype,"label",2),D([(0,o.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],A.prototype,"withoutHeader",2),D([(0,o.MZ)({attribute:"light-dismiss",type:Boolean})],A.prototype,"lightDismiss",2),D([(0,o.MZ)({attribute:"aria-labelledby"})],A.prototype,"ariaLabelledby",2),D([(0,o.MZ)({attribute:"aria-describedby"})],A.prototype,"ariaDescribedby",2),D([(0,o.MZ)({attribute:"with-footer",type:Boolean})],A.prototype,"withFooter",2),D([(0,v.w)("open",{waitUntilFirstUpdate:!0})],A.prototype,"handleOpenChange",1),A=D([(0,o.EM)("wa-dialog")],A),r.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-dialog]");if(t instanceof Element){const[e,a]=(0,p.v)(t.getAttribute("data-dialog")||"");if("open"===e&&a?.length){const e=t.getRootNode().getElementById(a);"wa-dialog"===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(e){t(e)}})},91470(e,t,a){a.d(t,{A:()=>r});var r=a(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}}`},75275(e,t,a){var r=a(62826),o=a(22441),i=a(5124),s=a(76482);const n=["focusin","focusout","pointerdown"];class l extends i.WF{get htmlFor(){return this.attachableController.htmlFor}set htmlFor(e){this.attachableController.htmlFor=e}get control(){return this.attachableController.control}set control(e){this.attachableController.control=e}attach(e){this.attachableController.attach(e)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}handleEvent(e){if(!e[d]){switch(e.type){default:return;case"focusin":this.visible=this.control?.matches(":focus-visible")??!1;break;case"focusout":case"pointerdown":this.visible=!1}e[d]=!0}}onControlChange(e,t){if(!i.S$)for(const a of n)e?.removeEventListener(a,this),t?.addEventListener(a,this)}update(e){e.has("visible")&&this.dispatchEvent(new Event("visibility-changed")),super.update(e)}constructor(){super(...arguments),this.visible=!1,this.inward=!1,this.attachableController=new s.i(this,this.onControlChange.bind(this))}}(0,r.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],l.prototype,"visible",void 0),(0,r.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],l.prototype,"inward",void 0);const d=Symbol("handledByFocusRing"),c=i.AH`:host{animation-delay:0s,calc(var(--md-focus-ring-duration, 600ms)*.25);animation-duration:calc(var(--md-focus-ring-duration, 600ms)*.25),calc(var(--md-focus-ring-duration, 600ms)*.75);animation-timing-function:cubic-bezier(0.2,0,0,1);box-sizing:border-box;color:var(--md-focus-ring-color,var(--md-sys-color-secondary,#625b71));display:none;pointer-events:none;position:absolute}:host([visible]){display:flex}:host(:not([inward])){animation-name:outward-grow,outward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end,var(--md-focus-ring-shape,var(--md-sys-shape-corner-full,9999px))) + var(--md-focus-ring-outward-offset,2px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start,var(--md-focus-ring-shape,var(--md-sys-shape-corner-full,9999px))) + var(--md-focus-ring-outward-offset,2px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end,var(--md-focus-ring-shape,var(--md-sys-shape-corner-full,9999px))) + var(--md-focus-ring-outward-offset,2px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start,var(--md-focus-ring-shape,var(--md-sys-shape-corner-full,9999px))) + var(--md-focus-ring-outward-offset,2px));inset:calc(-1*var(--md-focus-ring-outward-offset,2px));outline:var(--md-focus-ring-width,3px) solid currentColor}:host([inward]){animation-name:inward-grow,inward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end,var(--md-focus-ring-shape,var(--md-sys-shape-corner-full,9999px))) - var(--md-focus-ring-inward-offset,0px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start,var(--md-focus-ring-shape,var(--md-sys-shape-corner-full,9999px))) - var(--md-focus-ring-inward-offset,0px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end,var(--md-focus-ring-shape,var(--md-sys-shape-corner-full,9999px))) - var(--md-focus-ring-inward-offset,0px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start,var(--md-focus-ring-shape,var(--md-sys-shape-corner-full,9999px))) - var(--md-focus-ring-inward-offset,0px));border:var(--md-focus-ring-width,3px) solid currentColor;inset:var(--md-focus-ring-inward-offset,0px)}@keyframes outward-grow{from{outline-width:0}to{outline-width:var(--md-focus-ring-active-width,8px)}}@keyframes outward-shrink{from{outline-width:var(--md-focus-ring-active-width,8px)}}@keyframes inward-grow{from{border-width:0}to{border-width:var(--md-focus-ring-active-width,8px)}}@keyframes inward-shrink{from{border-width:var(--md-focus-ring-active-width,8px)}}@media(prefers-reduced-motion){:host{animation:none}}`;let h=class extends l{};h.styles=[c],h=(0,r.Cg)([(0,o.EM)("md-focus-ring")],h)},1024(e,t,a){a.d(t,{n:()=>d});a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var r=a(5124);a(74423);const o=["role","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"],i=o.map(n);function s(e){return i.includes(e)}function n(e){return e.replace("aria","aria-").replace(/Elements?/g,"").toLowerCase()}const l=Symbol("privateIgnoreAttributeChangesFor");function d(e){var t;if(r.S$)return e;class a extends e{attributeChangedCallback(e,t,a){if(!s(e))return void super.attributeChangedCallback(e,t,a);if(this[l].has(e))return;this[l].add(e),this.removeAttribute(e),this[l].delete(e);const r=h(e);null===a?delete this.dataset[r]:this.dataset[r]=a,this.requestUpdate(h(e),t)}getAttribute(e){return s(e)?super.getAttribute(c(e)):super.getAttribute(e)}removeAttribute(e){super.removeAttribute(e),s(e)&&(super.removeAttribute(c(e)),this.requestUpdate())}constructor(){super(...arguments),this[t]=new Set}}return t=l,function(e){for(const t of o){const a=n(t),r=c(a),o=h(a);e.createProperty(t,{attribute:a,noAccessor:!0}),e.createProperty(Symbol(r),{attribute:r,noAccessor:!0}),Object.defineProperty(e.prototype,t,{configurable:!0,enumerable:!0,get(){return this.dataset[o]??null},set(e){const a=this.dataset[o]??null;e!==a&&(null===e?delete this.dataset[o]:this.dataset[o]=e,this.requestUpdate(t,a))}})}}(a),a}function c(e){return`data-${e}`}function h(e){return e.replace(/-\w/,e=>e[1].toUpperCase())}},71970(e,t,a){var r=a(62826),o=a(22441),i=a(91382),s=a(96245);let n=class extends i.n{};n.styles=[s.R],n=(0,r.Cg)([(0,o.EM)("md-ripple")],n)},75751(e,t,a){a.d(t,{u:()=>n});a(45367),a(92731);var r=a(5055),o=a(42017),i=a(63937);const s=(e,t,a)=>{const r=new Map;for(let o=t;o<=a;o++)r.set(e[o],o);return r},n=(0,o.u$)(class extends o.WL{dt(e,t,a){let r;void 0===a?a=t:void 0!==t&&(r=t);const o=[],i=[];let s=0;for(const t of e)o[s]=r?r(t,s):s,i[s]=a(t,s),s++;return{values:i,keys:o}}render(e,t,a){return this.dt(e,t,a).values}update(e,[t,a,o]){const n=(0,i.cN)(e),{values:l,keys:d}=this.dt(t,a,o);if(!Array.isArray(n))return this.ut=d,l;const c=this.ut??=[],h=[];let u,p,f=0,g=n.length-1,v=0,m=l.length-1;for(;f<=g&&v<=m;)if(null===n[f])f++;else if(null===n[g])g--;else if(c[f]===d[v])h[v]=(0,i.lx)(n[f],l[v]),f++,v++;else if(c[g]===d[m])h[m]=(0,i.lx)(n[g],l[m]),g--,m--;else if(c[f]===d[m])h[m]=(0,i.lx)(n[f],l[m]),(0,i.Dx)(e,h[m+1],n[f]),f++,m--;else if(c[g]===d[v])h[v]=(0,i.lx)(n[g],l[v]),(0,i.Dx)(e,n[f],n[g]),g--,v++;else if(void 0===u&&(u=s(d,v,m),p=s(c,f,g)),u.has(c[f]))if(u.has(c[g])){const t=p.get(d[v]),a=void 0!==t?n[t]:null;if(null===a){const t=(0,i.Dx)(e,n[f]);(0,i.lx)(t,l[v]),h[v]=t}else h[v]=(0,i.lx)(a,l[v]),(0,i.Dx)(e,n[f],a),n[t]=null;v++}else(0,i.KO)(n[g]),g--;else(0,i.KO)(n[f]),f++;for(;v<=m;){const t=(0,i.Dx)(e,h[m+1]);(0,i.lx)(t,l[v]),h[v++]=t}for(;f<=g;){const e=n[f++];null!==e&&(0,i.KO)(e)}return this.ut=d,(0,i.mY)(e,h),r.c0}constructor(e){if(super(e),e.type!==o.OA.CHILD)throw Error("repeat() can only be used in text expressions")}})}};