UNPKG

iobroker.lovelace

Version:

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

2 lines 19.6 kB
/*! For license information please see 64006.b51cca9cdd03e4a2.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[64006],{68462:function(t,e,r){r.d(e,{M:function(){return g}});r(3362),r(62953);var i=r(40445),o=r(7658),n={ROOT:"mdc-form-field"},a={LABEL_SELECTOR:".mdc-form-field > label"},l=function(t){function e(r){var o=t.call(this,(0,i.Cl)((0,i.Cl)({},e.defaultAdapter),r))||this;return o.click=function(){o.handleClick()},o}return(0,i.C6)(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return n},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return a},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},e.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},e.prototype.handleClick=function(){var t=this;this.adapter.activateInputRipple(),requestAnimationFrame(function(){t.adapter.deactivateInputRipple()})},e}(o.I),s=r(12451),c=r(51324),d=r(56161),h=r(5124),u=r(67576),p=r(6412);let f,b=t=>t;class g extends s.O{createAdapter(){return{registerInteractionHandler:(t,e)=>{this.labelEl.addEventListener(t,e)},deregisterInteractionHandler:(t,e)=>{this.labelEl.removeEventListener(t,e)},activateInputRipple:async()=>{const t=this.input;if(t instanceof c.ZS){const e=await t.ripple;e&&e.startPress()}},deactivateInputRipple:async()=>{const t=this.input;if(t instanceof c.ZS){const e=await t.ripple;e&&e.endPress()}}}}get input(){var t,e;return null!==(e=null===(t=this.slottedInputs)||void 0===t?void 0:t[0])&&void 0!==e?e:null}render(){const t={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return(0,h.qy)(f||(f=b` <div class="mdc-form-field ${0}"> <slot></slot> <label class="mdc-label" @click="${0}">${0}</label> </div>`),(0,p.H)(t),this._labelClick,this.label)}click(){this._labelClick()}_labelClick(){const t=this.input;t&&(t.focus(),t.click())}constructor(){super(...arguments),this.alignEnd=!1,this.spaceBetween=!1,this.nowrap=!1,this.label="",this.mdcFoundationClass=l}}(0,i.Cg)([(0,u.MZ)({type:Boolean})],g.prototype,"alignEnd",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean})],g.prototype,"spaceBetween",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean})],g.prototype,"nowrap",void 0),(0,i.Cg)([(0,u.MZ)({type:String}),(0,d.P)(async function(t){var e;null===(e=this.input)||void 0===e||e.setAttribute("aria-label",t)})],g.prototype,"label",void 0),(0,i.Cg)([(0,u.P)(".mdc-form-field")],g.prototype,"mdcRoot",void 0),(0,i.Cg)([(0,u.KN)({slot:"",flatten:!0,selector:"*"})],g.prototype,"slottedInputs",void 0),(0,i.Cg)([(0,u.P)("label")],g.prototype,"labelEl",void 0)},38627:function(t,e,r){r.d(e,{R:function(){return o}});let i;const o=(0,r(5124).AH)(i||(i=(t=>t)`.mdc-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{margin-left:auto;margin-right:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{margin-left:0;margin-right:auto}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}.mdc-form-field--space-between>label[dir=rtl],[dir=rtl] .mdc-form-field--space-between>label{margin:0}:host{display:inline-flex}.mdc-form-field{width:100%}::slotted(*){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}::slotted(mwc-switch){margin-right:10px}::slotted(mwc-switch[dir=rtl]),[dir=rtl] ::slotted(mwc-switch){margin-left:10px}`))},71658:function(t,e,r){var i=r(46518),o=r(6469),n=r(96837),a=r(26198),l=r(35610),s=r(25397),c=r(91291),d=r(97040),h=Array,u=Math.max,p=Math.min;i({target:"Array",proto:!0},{toSpliced:function(t,e){var r,i,o,f,b=s(this),g=a(b),m=l(t,g),v=arguments.length,y=0;for(0===v?r=i=0:1===v?(r=0,i=g-m):(r=v-2,i=p(u(c(e),0),g-m)),o=n(g+r-i),f=h(o);y<m;y++)d(f,y,b[y]);for(;y<m+r;y++)d(f,y,arguments[y-m+2]);for(;y<o;y++)d(f,y,b[y+i-r]);return f}}),o("toSpliced")},122:function(t,e,r){var i=r(46518),o=r(44576),n=r(91955),a=r(79306),l=r(22812),s=r(79039),c=r(43724);i({global:!0,enumerable:!0,dontCallGetSet:!0,forced:s(function(){return c&&1!==Object.getOwnPropertyDescriptor(o,"queueMicrotask").value.length})},{queueMicrotask:function(t){l(arguments.length,1),n(a(t))}})},13611:function(t,e,r){var i=r(46518),o=r(44576),n=r(62106),a=r(43724),l=TypeError,s=Object.defineProperty,c=o.self!==o;try{if(a){var d=Object.getOwnPropertyDescriptor(o,"self");!c&&d&&d.get&&d.enumerable||n(o,"self",{get:function(){return o},set:function(t){if(this!==o)throw new l("Illegal invocation");s(o,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else i({global:!0,simple:!0,forced:c},{self:o})}catch(h){}},31886:function(t,e,r){r.a(t,async function(t,i){try{r.d(e,{BB:function(){return o.B}});r(38744);var o=r(88775),n=r(49232),a=r(78713),l=r(53834),s=r(35204),c=r(5806),d=t([o,n,a,l,s,c]);[o,n,a,l,s,c]=d.then?(await d)():d,i()}catch(h){i(h)}})},22395:function(t,e,r){r(62953);var i=r(5124),o=r(67576),n=r(717);let a;var l=(0,i.AH)(a||(a=(t=>t)`:host{display:inline-flex}.button-group{display:flex;position:relative;isolation:isolate;flex-wrap:wrap}@media (hover:hover){.button-group::slotted(:hover),.button-group>:hover{z-index:1}}.button-group::slotted(:focus),.button-group::slotted([aria-checked=true]),.button-group::slotted([checked]),.button-group>:focus,.button-group>[aria-checked=true],.button-group>[checked]{z-index:2!important}:host([orientation=horizontal]) .button-group{flex-direction:row}:host([orientation=vertical]) .button-group{flex-direction:column}:host([orientation=horizontal]){--_button-horizontal-indent:var(--wa-form-control-border-width);--_button-horizontal-indent-outlined:calc(var(--wa-form-control-border-width) * -1)}:host([orientation=vertical]){--_button-vertical-indent:var(--wa-form-control-border-width);--_button-vertical-indent-outlined:calc(var(--wa-form-control-border-width) * -1)}::slotted(:not(:first-child):not(:last-child)){--_button-start-start-radius:0;--_button-start-end-radius:0;--_button-end-start-radius:0;--_button-end-end-radius:0}:host([orientation=horizontal]) ::slotted(:first-child:not(:last-child)){--_button-start-end-radius:0;--_button-end-end-radius:0}:host([orientation=horizontal]) ::slotted(:last-child:not(:first-child)){--_button-start-start-radius:0;--_button-end-start-radius:0}:host([orientation=vertical]) ::slotted(:first-child:not(:last-child)){--_button-end-start-radius:0;--_button-end-end-radius:0}:host([orientation=vertical]) ::slotted(:last-child:not(:first-child)){--_button-start-start-radius:0;--_button-start-end-radius:0}`));let s,c=t=>t;var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u=(t,e,r,i)=>{for(var o,n=i>1?void 0:i?h(e,r):e,a=t.length-1;a>=0;a--)(o=t[a])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&d(e,r,n),n};let p=class extends n.A{updated(t){super.updated(t),t.has("orientation")&&this.setAttribute("aria-orientation",this.orientation)}handleFocus(t){const e=f(t.target,this.childSelector);null==e||e.classList.add("button-focus")}handleBlur(t){const e=f(t.target,this.childSelector);null==e||e.classList.remove("button-focus")}handleMouseOver(t){const e=f(t.target,this.childSelector);null==e||e.classList.add("button-hover")}handleMouseOut(t){const e=f(t.target,this.childSelector);null==e||e.classList.remove("button-hover")}render(){return(0,i.qy)(s||(s=c` <slot part="base" class="button-group" role="${0}" aria-label="${0}" aria-orientation="${0}" @focusout="${0}" @focusin="${0}" @mouseover="${0}" @mouseout="${0}"></slot> `),this.disableRole?"presentation":"group",this.label,this.orientation,this.handleBlur,this.handleFocus,this.handleMouseOver,this.handleMouseOut)}constructor(){super(...arguments),this.disableRole=!1,this.hasOutlined=!1,this.label="",this.orientation="horizontal",this.childSelector="wa-button, wa-radio-button"}};function f(t,e){var r;return null!==(r=t.closest(e))&&void 0!==r?r:t.querySelector(e)}p.css=[l],u([(0,o.P)("slot")],p.prototype,"defaultSlot",2),u([(0,o.wk)()],p.prototype,"disableRole",2),u([(0,o.wk)()],p.prototype,"hasOutlined",2),u([(0,o.MZ)()],p.prototype,"label",2),u([(0,o.MZ)({reflect:!0})],p.prototype,"orientation",2),u([(0,o.MZ)()],p.prototype,"childSelector",2),p=u([(0,o.EM)("wa-button-group")],p)},29344:function(t,e,r){r.a(t,async function(t,i){try{r.d(e,{A:function(){return A}});r(27495),r(62953);var o=r(5124),n=r(67576),a=r(6412),l=r(63672),s=r(34514),c=r(40991),d=r(92070),h=r(41268),u=r(9395),p=r(62676),f=r(15477),b=r(31896),g=r(17060),m=r(19978),v=t([g]);g=(v.then?(await v)():v)[0];let x,C,O,_=t=>t;var y=Object.defineProperty,w=Object.getOwnPropertyDescriptor,k=(t,e,r,i)=>{for(var o,n=i>1?void 0:i?w(e,r):e,a=t.length-1;a>=0;a--)(o=t[a])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&y(e,r,n),n};let A=class extends p.q{static get validators(){return[...super.validators,(0,h.i)()]}get value(){var t;return null!==(t=this._value)&&void 0!==t?t:"on"}set value(t){this._value=t}handleSizeChange(){(0,c.b)(this.localName,this.size)}get checked(){var t;return this.valueHasChanged?Boolean(this._checked):null!==(t=this._checked)&&void 0!==t?t:this.defaultChecked}set checked(t){this._checked=Boolean(t),this.valueHasChanged=!0}handleClick(){this.hasInteracted=!0,this.checked=!this.checked,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}handleKeyDown(t){const e="rtl"===this.localize.dir();"ArrowLeft"===t.key&&(t.preventDefault(),this.checked=e,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))})),"ArrowRight"===t.key&&(t.preventDefault(),this.checked=!e,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}))}willUpdate(t){super.willUpdate(t),(t.has("value")||t.has("checked")||t.has("defaultChecked"))&&this.handleValueOrCheckedChange()}handleValueOrCheckedChange(){this.setValue(this.checked?this.value:null,this._value),this.updateValidity()}handleStateChange(){this.hasUpdated&&(this.input.checked=this.checked),this.customStates.set("checked",this.checked),this.updateValidity()}handleDisabledChange(){this.updateValidity()}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}setValue(t,e){this.checked?this.internals.setFormValue(null!=t?t:"on",e):this.internals.setFormValue(null,null)}formResetCallback(){this._checked=null,super.formResetCallback(),this.handleValueOrCheckedChange()}render(){const t=this.hasUpdated?this.hasSlotController.test("hint"):this.withHint,e=!!this.hint||!!t;return(0,o.qy)(x||(x=_` <label part="base" class="${0}"> <input class="input" type="checkbox" title="${0}" name="${0}" value="${0}" .checked="${0}" .disabled="${0}" .required="${0}" role="switch" aria-checked="${0}" aria-describedby="hint" @click="${0}" @keydown="${0}"> <span part="control" class="switch"> <span part="thumb" class="thumb"></span> </span> <slot part="label" class="label"></slot> </label> <slot id="hint" name="hint" part="hint" class="${0}" aria-hidden="${0}">${0}</slot> `),(0,a.H)({checked:this.checked,disabled:this.disabled}),this.title,(0,l.J)(this.name),(0,l.J)(this.value),(0,s.V)(this.checked),this.disabled,this.required,this.checked?"true":"false",this.handleClick,this.handleKeyDown,(0,a.H)({"has-slotted":e}),e?"false":"true",this.hint)}constructor(){var t;super(...arguments),this.hasSlotController=new d.X(this,"hint"),this.localize=new g.c(this),this.title="",this.name=null,this._value=null!==(t=this.getAttribute("value"))&&void 0!==t?t:null,this.size="m",this.disabled=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint="",this.withHint=!1}};A.shadowRootOptions=Object.assign(Object.assign({},p.q.shadowRootOptions),{},{delegatesFocus:!0}),A.css=[f.A,b.A,m.A],k([(0,n.P)('input[type="checkbox"]')],A.prototype,"input",2),k([(0,n.MZ)()],A.prototype,"title",2),k([(0,n.MZ)({reflect:!0})],A.prototype,"name",2),k([(0,n.MZ)({reflect:!0})],A.prototype,"value",1),k([(0,n.MZ)({reflect:!0})],A.prototype,"size",2),k([(0,u.w)("size")],A.prototype,"handleSizeChange",1),k([(0,n.MZ)({type:Boolean})],A.prototype,"disabled",2),k([(0,n.MZ)({type:Boolean,attribute:!1})],A.prototype,"checked",1),k([(0,n.MZ)({type:Boolean,attribute:"checked",reflect:!0})],A.prototype,"defaultChecked",2),k([(0,n.MZ)({type:Boolean,reflect:!0})],A.prototype,"required",2),k([(0,n.MZ)({attribute:"hint"})],A.prototype,"hint",2),k([(0,n.MZ)({attribute:"with-hint",type:Boolean})],A.prototype,"withHint",2),k([(0,u.w)(["checked","defaultChecked"])],A.prototype,"handleStateChange",1),k([(0,u.w)("disabled",{waitUntilFirstUpdate:!0})],A.prototype,"handleDisabledChange",1),A=k([(0,n.EM)("wa-switch")],A),null===(C=(O=A).disableWarning)||void 0===C||C.call(O,"change-in-update"),i()}catch(x){i(x)}})},19978:function(t,e,r){r.d(e,{A:function(){return o}});let i;var o=(0,r(5124).AH)(i||(i=(t=>t)`:host{--height:var(--wa-form-control-toggle-size);--width:calc(var(--height) * 1.75);--thumb-size:0.75em;display:inline-flex;line-height:var(--wa-form-control-value-line-height)}label{position:relative;display:flex;align-items:center;font:inherit;color:var(--wa-form-control-value-color);vertical-align:middle;cursor:pointer}.switch{flex:0 0 auto;position:relative;display:flex;align-items:center;justify-content:center;width:var(--width);height:var(--height);background-color:var(--wa-form-control-background-color);border-color:var(--wa-form-control-border-color);border-radius:var(--height);border-style:var(--wa-form-control-border-style);border-width:var(--wa-form-control-border-width);transition-property:translate,background,border-color,box-shadow;transition-duration:var(--wa-transition-normal);transition-timing-function:var(--wa-transition-easing)}.switch .thumb{aspect-ratio:1/1;width:var(--thumb-size);height:var(--thumb-size);background-color:var(--wa-form-control-border-color);border-radius:50%;translate:calc((var(--width) - var(--height))/ -2);transition:inherit}.switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ 2)}.input{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}label:not(.disabled) .input:focus-visible~.switch .thumb{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.checked .switch{background-color:var(--wa-form-control-activated-color);border-color:var(--wa-form-control-activated-color)}.checked .switch .thumb{background-color:var(--wa-color-surface-default);translate:calc((var(--width) - var(--height))/ 2)}.checked .switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ -2)}label:has(> :disabled){opacity:.5;cursor:not-allowed}[part~=label]{display:inline-block;line-height:var(--height);margin-inline-start:.5em;user-select:none;-webkit-user-select:none}:host([required]) [part~=label]::after{content:var(--wa-form-control-required-content);color:var(--wa-form-control-required-content-color);margin-inline-start:var(--wa-form-control-required-content-offset)}@media (forced-colors:active){:checked+.switch .thumb,:checked:enabled+.switch:hover .thumb{background-color:ButtonText}}`))},88508:function(t,e,r){r.d(e,{a:function(){return a}});r(18111),r(81148),r(62953);var i=r(5055),o=r(42017);const n={},a=(0,o.u$)(class extends o.WL{render(t,e){return e()}update(t,[e,r]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every((t,e)=>t===this.ot[e]))return i.c0}else if(this.ot===e)return i.c0;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,r)}constructor(){super(...arguments),this.ot=n}})},75751:function(t,e,r){r.d(e,{u:function(){return l}});r(16280),r(45367),r(92731),r(62953);var i=r(5055),o=r(42017),n=r(63937);const a=(t,e,r)=>{const i=new Map;for(let o=e;o<=r;o++)i.set(t[o],o);return i},l=(0,o.u$)(class extends o.WL{dt(t,e,r){let i;void 0===r?r=e:void 0!==e&&(i=e);const o=[],n=[];let a=0;for(const l of t)o[a]=i?i(l,a):a,n[a]=r(l,a),a++;return{values:n,keys:o}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,o]){var l;const s=(0,n.cN)(t),{values:c,keys:d}=this.dt(e,r,o);if(!Array.isArray(s))return this.ut=d,c;const h=null!==(l=this.ut)&&void 0!==l?l:this.ut=[],u=[];let p,f,b=0,g=s.length-1,m=0,v=c.length-1;for(;b<=g&&m<=v;)if(null===s[b])b++;else if(null===s[g])g--;else if(h[b]===d[m])u[m]=(0,n.lx)(s[b],c[m]),b++,m++;else if(h[g]===d[v])u[v]=(0,n.lx)(s[g],c[v]),g--,v--;else if(h[b]===d[v])u[v]=(0,n.lx)(s[b],c[v]),(0,n.Dx)(t,u[v+1],s[b]),b++,v--;else if(h[g]===d[m])u[m]=(0,n.lx)(s[g],c[m]),(0,n.Dx)(t,s[b],s[g]),g--,m++;else if(void 0===p&&(p=a(d,m,v),f=a(h,b,g)),p.has(h[b]))if(p.has(h[g])){const e=f.get(d[m]),r=void 0!==e?s[e]:null;if(null===r){const e=(0,n.Dx)(t,s[b]);(0,n.lx)(e,c[m]),u[m]=e}else u[m]=(0,n.lx)(r,c[m]),(0,n.Dx)(t,s[b],r),s[e]=null;m++}else(0,n.KO)(s[g]),g--;else(0,n.KO)(s[b]),b++;for(;m<=v;){const e=(0,n.Dx)(t,u[v+1]);(0,n.lx)(e,c[m]),u[m++]=e}for(;b<=g;){const t=s[b++];null!==t&&(0,n.KO)(t)}return this.ut=d,(0,n.mY)(t,u),i.c0}constructor(t){if(super(t),t.type!==o.OA.CHILD)throw Error("repeat() can only be used in text expressions")}})}}]);