UNPKG

iobroker.lovelace

Version:

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

17 lines 20 kB
/*! For license information please see 59304.9407419e3b175791.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[59304],{29344:function(t,e,i){i.a(t,async function(t,s){try{i.d(e,{A:function(){return R}});i(27495),i(62953);var r=i(5124),o=i(67576),l=i(6412),n=i(63672),a=i(34514),d=i(40991),c=i(92070),h=i(41268),u=i(9395),p=i(62676),m=i(15477),f=i(31896),v=i(17060),g=i(19978),y=t([v]);v=(y.then?(await y)():y)[0];let k,C,$,z=t=>t;var b=Object.defineProperty,w=Object.getOwnPropertyDescriptor,x=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?w(e,i):e,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&b(e,i,o),o};let R=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,d.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,r.qy)(k||(k=z` <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,l.H)({checked:this.checked,disabled:this.disabled}),this.title,(0,n.J)(this.name),(0,n.J)(this.value),(0,a.V)(this.checked),this.disabled,this.required,this.checked?"true":"false",this.handleClick,this.handleKeyDown,(0,l.H)({"has-slotted":e}),e?"false":"true",this.hint)}constructor(){var t;super(...arguments),this.hasSlotController=new c.X(this,"hint"),this.localize=new v.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}};R.shadowRootOptions=Object.assign(Object.assign({},p.q.shadowRootOptions),{},{delegatesFocus:!0}),R.css=[m.A,f.A,g.A],x([(0,o.P)('input[type="checkbox"]')],R.prototype,"input",2),x([(0,o.MZ)()],R.prototype,"title",2),x([(0,o.MZ)({reflect:!0})],R.prototype,"name",2),x([(0,o.MZ)({reflect:!0})],R.prototype,"value",1),x([(0,o.MZ)({reflect:!0})],R.prototype,"size",2),x([(0,u.w)("size")],R.prototype,"handleSizeChange",1),x([(0,o.MZ)({type:Boolean})],R.prototype,"disabled",2),x([(0,o.MZ)({type:Boolean,attribute:!1})],R.prototype,"checked",1),x([(0,o.MZ)({type:Boolean,attribute:"checked",reflect:!0})],R.prototype,"defaultChecked",2),x([(0,o.MZ)({type:Boolean,reflect:!0})],R.prototype,"required",2),x([(0,o.MZ)({attribute:"hint"})],R.prototype,"hint",2),x([(0,o.MZ)({attribute:"with-hint",type:Boolean})],R.prototype,"withHint",2),x([(0,u.w)(["checked","defaultChecked"])],R.prototype,"handleStateChange",1),x([(0,u.w)("disabled",{waitUntilFirstUpdate:!0})],R.prototype,"handleDisabledChange",1),R=x([(0,o.EM)("wa-switch")],R),null===(C=($=R).disableWarning)||void 0===C||C.call($,"change-in-update"),s()}catch(k){s(k)}})},19978:function(t,e,i){i.d(e,{A:function(){return r}});let s;var r=(0,i(5124).AH)(s||(s=(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}}`))},27525:function(t,e,i){i.d(e,{A6:function(){return l},Ex:function(){return a},RN:function(){return h},RZ:function(){return r},c7:function(){return n},cG:function(){return u},u9:function(){return c},ub:function(){return o},wm:function(){return d},zT:function(){return s}});i(62953);function s(t,e=p){const i=n(t,e);return i&&(i.tabIndex=0,i.focus()),i}function r(t,e=p){const i=a(t,e);return i&&(i.tabIndex=0,i.focus()),i}function o(t,e=p){const i=l(t,e);return i&&(i.item.tabIndex=-1),i}function l(t,e=p){for(let i=0;i<t.length;i++){const s=t[i];if(0===s.tabIndex&&e(s))return{item:s,index:i}}return null}function n(t,e=p){for(const i of t)if(e(i))return i;return null}function a(t,e=p){for(let i=t.length-1;i>=0;i--){const s=t[i];if(e(s))return s}return null}function d(t,e,i=p,r=!0){if(e){const s=function(t,e,i=p,s=!0){for(let r=1;r<t.length;r++){const o=(r+e)%t.length;if(o<e&&!s)return null;const l=t[o];if(i(l))return l}return t[e]?t[e]:null}(t,e.index,i,r);return s&&(s.tabIndex=0,s.focus()),s}return s(t,i)}function c(t,e,i=p,s=!0){if(e){const r=function(t,e,i=p,s=!0){for(let r=1;r<t.length;r++){const o=(e-r+t.length)%t.length;if(o>e&&!s)return null;const l=t[o];if(i(l))return l}return t[e]?t[e]:null}(t,e.index,i,s);return r&&(r.tabIndex=0,r.focus()),r}return r(t,i)}function h(){return new Event("deactivate-items",{bubbles:!0,composed:!0})}function u(){return new Event("request-activation",{bubbles:!0,composed:!0})}function p(t){return!t.disabled}},82553:function(t,e,i){i.d(e,{R:function(){return r}});let s;const r=(0,i(5124).AH)(s||(s=(t=>t)`:host{display:flex;-webkit-tap-highlight-color:transparent;--md-ripple-hover-color:var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity:var(--md-list-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color:var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity:var(--md-list-item-pressed-state-layer-opacity, 0.12)}:host(:is([type=button]:not([disabled]),[type=link])){cursor:pointer}md-focus-ring{z-index:1;--md-focus-ring-shape:8px}a,button,li{background:0 0;border:none;cursor:inherit;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:0;-webkit-tap-highlight-color:transparent;width:100%}.list-item.interactive{cursor:pointer}.list-item.disabled{opacity:var(--md-list-item-disabled-opacity, .3);pointer-events:none}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;height:100%;color:var(--md-list-item-label-text-color,var(--md-sys-color-on-surface,#1d1b20));font-family:var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-list-item-label-text-weight,var(--md-sys-typescale-body-large-weight,var(--md-ref-typeface-weight-regular,400)));min-height:var(--md-list-item-one-line-container-height,56px);padding-top:var(--md-list-item-top-space,12px);padding-bottom:var(--md-list-item-bottom-space,12px);padding-inline-start:var(--md-list-item-leading-space,16px);padding-inline-end:var(--md-list-item-trailing-space,16px)}md-item[multiline]{min-height:var(--md-list-item-two-line-container-height,72px)}[slot=supporting-text]{color:var(--md-list-item-supporting-text-color,var(--md-sys-color-on-surface-variant,#49454f));font-family:var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, .875rem));line-height:var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-list-item-supporting-text-weight,var(--md-sys-typescale-body-medium-weight,var(--md-ref-typeface-weight-regular,400)))}[slot=trailing-supporting-text]{color:var(--md-list-item-trailing-supporting-text-color,var(--md-sys-color-on-surface-variant,#49454f));font-family:var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, .6875rem));line-height:var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-list-item-trailing-supporting-text-weight,var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-list-item-leading-icon-color,var(--md-sys-color-on-surface-variant,#49454f))}[slot=end]{color:var(--md-list-item-trailing-icon-color,var(--md-sys-color-on-surface-variant,#49454f))}@media(forced-colors:active){.disabled slot{color:GrayText}.list-item.disabled{color:GrayText;opacity:1}}`))},58168:function(t,e,i){i.d(e,{n:function(){return E}});i(62953);var s=i(40445),r=(i(75275),i(67576)),o=(i(27495),i(5124));let l,n=t=>t;class a extends o.WF{render(){return(0,o.qy)(l||(l=n` <slot name="container"></slot> <slot class="non-text" name="start"></slot> <div class="text"> <slot name="overline" @slotchange="${0}"></slot> <slot class="default-slot" @slotchange="${0}"></slot> <slot name="headline" @slotchange="${0}"></slot> <slot name="supporting-text" @slotchange="${0}"></slot> </div> <slot class="non-text" name="trailing-supporting-text"></slot> <slot class="non-text" name="end"></slot> `),this.handleTextSlotChange,this.handleTextSlotChange,this.handleTextSlotChange,this.handleTextSlotChange)}handleTextSlotChange(){let t=!1,e=0;for(const i of this.textSlots)if(d(i)&&(e+=1),e>1){t=!0;break}this.multiline=t}constructor(){super(...arguments),this.multiline=!1}}function d(t){for(const i of t.assignedNodes({flatten:!0})){var e;const t=i.nodeType===Node.ELEMENT_NODE,s=i.nodeType===Node.TEXT_NODE&&(null===(e=i.textContent)||void 0===e?void 0:e.match(/\S/));if(t||s)return!0}return!1}(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],a.prototype,"multiline",void 0),(0,s.Cg)([(0,r.YG)(".text slot")],a.prototype,"textSlots",void 0);let c;const h=(0,o.AH)(c||(c=(t=>t)`:host{color:var(--md-sys-color-on-surface,#1d1b20);font-family:var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-large-size, 1rem);font-weight:var(--md-sys-typescale-body-large-weight,var(--md-ref-typeface-weight-regular,400));line-height:var(--md-sys-typescale-body-large-line-height, 1.5rem);align-items:center;box-sizing:border-box;display:flex;gap:16px;min-height:56px;overflow:hidden;padding:12px 16px;position:relative;text-overflow:ellipsis}:host([multiline]){min-height:72px}[name=overline]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, .6875rem);font-weight:var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=supporting-text]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-medium-size, .875rem);font-weight:var(--md-sys-typescale-body-medium-weight,var(--md-ref-typeface-weight-regular,400));line-height:var(--md-sys-typescale-body-medium-line-height, 1.25rem)}[name=trailing-supporting-text]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, .6875rem);font-weight:var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=container]::slotted(*){inset:0;position:absolute}.default-slot{display:inline}.default-slot,.text ::slotted(*){overflow:hidden;text-overflow:ellipsis}.text{display:flex;flex:1;flex-direction:column;overflow:hidden}`));let u=class extends a{};u.styles=[h],u=(0,s.Cg)([(0,r.EM)("md-item")],u);i(71970);var p=i(6412),m=i(7872),f=i(1024),v=i(27525);let g,y,b,w,x,k,C,$,z=t=>t;const R=(0,f.n)(o.WF);class E extends R{get isDisabled(){return this.disabled&&"link"!==this.type}willUpdate(t){this.href&&(this.type="link"),super.willUpdate(t)}render(){return this.renderListItem((0,o.qy)(g||(g=z` <md-item> <div slot="container"> ${0} ${0} </div> <slot name="start" slot="start"></slot> <slot name="end" slot="end"></slot> ${0} </md-item> `),this.renderRipple(),this.renderFocusRing(),this.renderBody()))}renderListItem(t){const e="link"===this.type;let i;switch(this.type){case"link":i=(0,m.eu)(y||(y=z`a`));break;case"button":i=(0,m.eu)(b||(b=z`button`));break;default:i=(0,m.eu)(w||(w=z`li`))}const s="text"!==this.type,r=e&&this.target?this.target:o.s6;return(0,m.qy)(x||(x=z` <${0} id="item" tabindex="${0}" ?disabled=${0} role="listitem" aria-selected=${0} aria-checked=${0} aria-expanded=${0} aria-haspopup=${0} class="list-item ${0}" href=${0} target=${0} @focus=${0} >${0}</${0}> `),i,this.isDisabled||!s?-1:0,this.isDisabled,this.ariaSelected||o.s6,this.ariaChecked||o.s6,this.ariaExpanded||o.s6,this.ariaHasPopup||o.s6,(0,p.H)(this.getRenderClasses()),this.href||o.s6,r,this.onFocus,t,i)}renderRipple(){return"text"===this.type?o.s6:(0,o.qy)(k||(k=z` <md-ripple part="ripple" for="item" ?disabled="${0}"></md-ripple>`),this.isDisabled)}renderFocusRing(){return"text"===this.type?o.s6:(0,o.qy)(C||(C=z` <md-focus-ring @visibility-changed="${0}" part="focus-ring" for="item" inward></md-focus-ring>`),this.onFocusRingVisibilityChanged)}onFocusRingVisibilityChanged(t){}getRenderClasses(){return{disabled:this.isDisabled}}renderBody(){return(0,o.qy)($||($=z` <slot></slot> <slot name="overline" slot="overline"></slot> <slot name="headline" slot="headline"></slot> <slot name="supporting-text" slot="supporting-text"></slot> <slot name="trailing-supporting-text" slot="trailing-supporting-text"></slot> `))}onFocus(){-1===this.tabIndex&&this.dispatchEvent((0,v.cG)())}focus(){var t;null===(t=this.listItemRoot)||void 0===t||t.focus()}click(){this.listItemRoot?this.listItemRoot.click():super.click()}constructor(){super(...arguments),this.disabled=!1,this.type="text",this.isListItem=!0,this.href="",this.target=""}}E.shadowRootOptions=Object.assign(Object.assign({},o.WF.shadowRootOptions),{},{delegatesFocus:!0}),(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],E.prototype,"disabled",void 0),(0,s.Cg)([(0,r.MZ)({reflect:!0})],E.prototype,"type",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,attribute:"md-list-item",reflect:!0})],E.prototype,"isListItem",void 0),(0,s.Cg)([(0,r.MZ)()],E.prototype,"href",void 0),(0,s.Cg)([(0,r.MZ)()],E.prototype,"target",void 0),(0,s.Cg)([(0,r.P)(".list-item")],E.prototype,"listItemRoot",void 0)},75751:function(t,e,i){i.d(e,{u:function(){return n}});i(16280),i(45367),i(92731),i(62953);var s=i(5055),r=i(42017),o=i(63937);const l=(t,e,i)=>{const s=new Map;for(let r=e;r<=i;r++)s.set(t[r],r);return s},n=(0,r.u$)(class extends r.WL{dt(t,e,i){let s;void 0===i?i=e:void 0!==e&&(s=e);const r=[],o=[];let l=0;for(const n of t)r[l]=s?s(n,l):l,o[l]=i(n,l),l++;return{values:o,keys:r}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,r]){var n;const a=(0,o.cN)(t),{values:d,keys:c}=this.dt(e,i,r);if(!Array.isArray(a))return this.ut=c,d;const h=null!==(n=this.ut)&&void 0!==n?n:this.ut=[],u=[];let p,m,f=0,v=a.length-1,g=0,y=d.length-1;for(;f<=v&&g<=y;)if(null===a[f])f++;else if(null===a[v])v--;else if(h[f]===c[g])u[g]=(0,o.lx)(a[f],d[g]),f++,g++;else if(h[v]===c[y])u[y]=(0,o.lx)(a[v],d[y]),v--,y--;else if(h[f]===c[y])u[y]=(0,o.lx)(a[f],d[y]),(0,o.Dx)(t,u[y+1],a[f]),f++,y--;else if(h[v]===c[g])u[g]=(0,o.lx)(a[v],d[g]),(0,o.Dx)(t,a[f],a[v]),v--,g++;else if(void 0===p&&(p=l(c,g,y),m=l(h,f,v)),p.has(h[f]))if(p.has(h[v])){const e=m.get(c[g]),i=void 0!==e?a[e]:null;if(null===i){const e=(0,o.Dx)(t,a[f]);(0,o.lx)(e,d[g]),u[g]=e}else u[g]=(0,o.lx)(i,d[g]),(0,o.Dx)(t,a[f],i),a[e]=null;g++}else(0,o.KO)(a[v]),v--;else(0,o.KO)(a[f]),f++;for(;g<=y;){const e=(0,o.Dx)(t,u[y+1]);(0,o.lx)(e,d[g]),u[g++]=e}for(;f<=v;){const t=a[f++];null!==t&&(0,o.KO)(t)}return this.ut=c,(0,o.mY)(t,u),s.c0}constructor(t){if(super(t),t.type!==r.OA.CHILD)throw Error("repeat() can only be used in text expressions")}})}}]);