UNPKG

iobroker.lovelace

Version:

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

5 lines 37.6 kB
/*! For license information please see 47417.4ddad1b8a77413eb.js.LICENSE.txt */ export const __rspack_esm_id=47417;export const __rspack_esm_ids=[47417];export const __webpack_modules__={12451(t,e,i){i.d(e,{O:()=>a,i:()=>s.is});var o=i(5124),s=i(12130);class a extends o.WF{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}},12130(t,e,i){i.d(e,{SE:()=>c,U9:()=>l,hP:()=>o,is:()=>s});i(44114);const o=t=>t.nodeType===Node.ELEMENT_NODE;function s(t){return{addClass:e=>{t.classList.add(e)},removeClass:e=>{t.classList.remove(e)},hasClass:e=>t.classList.contains(e)}}let a=!1;const n=()=>{},r={get passive(){return a=!0,!1}};document.addEventListener("x",n,r),document.removeEventListener("x",n);const l=(t=window.document)=>{let e=t.activeElement;const i=[];if(!e)return i;for(;e&&(i.push(e),e.shadowRoot);)e=e.shadowRoot.activeElement;return i},c=t=>{const e=l();if(!e.length)return!1;const i=e[e.length-1],o=new Event("check-if-focused",{bubbles:!0,composed:!0});let s=[];const a=t=>{s=t.composedPath()};return document.body.addEventListener("check-if-focused",a),i.dispatchEvent(o),document.body.removeEventListener("check-if-focused",a),-1!==s.indexOf(t)}},77957(t,e,i){var o=i(76080),s=i(79504),a=i(47055),n=i(48981),r=i(56969),l=i(26198),c=i(2360),h=i(35370),d=Array,p=s([].push);t.exports=function(t,e,i,s){for(var u,v,f,b=n(t),w=a(b),g=o(e,i),m=c(null),y=l(w),k=0;y>k;k++)f=w[k],(v=r(g(f,k,b)))in m?p(m[v],f):m[v]=[f];if(s&&(u=s(b))!==d)for(v in m)m[v]=h(u,m[v]);return m}},46058(t,e,i){var o=i(46518),s=i(77957),a=i(6469);o({target:"Array",proto:!0},{group:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}}),a("group")},93900(t,e,i){i.a(t,async function(t,e){try{var o=i(5124),s=i(22441),a=i(6412),n=i(63672),r=i(17051),l=i(42462),c=i(28438),h=i(98779),d=i(27259),p=i(25877),u=i(31247),v=i(4444),f=i(92070),b=i(9395),w=i(717),g=i(17060),m=i(88496),y=i(91470),k=t([m,g]);[m,g]=k.then?(await k)():k;var C=Object.defineProperty,x=Object.getOwnPropertyDescriptor,A=(t,e,i,o)=>{for(var s,a=o>1?void 0:o?x(e,i):e,n=t.length-1;n>=0;n--)(s=t[n])&&(a=(o?s(e,i,a):s(a))||a);return o&&a&&C(e,i,a),a};let $=class extends w.A{firstUpdated(){this.open&&(this.addOpenListeners(),this.dialog.showModal(),(0,v.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,v.I7)(this),this.removeOpenListeners()}async requestClose(t){const e=new c.L({source:t});if(this.dispatchEvent(e),e.defaultPrevented)return this.open=!0,void(0,d.Ud)(this.dialog,"pulse");this.removeOpenListeners(),await(0,d.Ud)(this.dialog,"hide"),this.open=!1,this.dialog.close(),(0,v.I7)(this);const i=this.originalTrigger;"function"==typeof i?.focus&&setTimeout(()=>i.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(t){t.preventDefault(),!this.dialog.classList.contains("hide")&&t.target===this.dialog&&(0,p.a0)(this)&&this.requestClose(this.dialog)}handleDialogClick(t){const e=t.target.closest('[data-dialog="close"]');e&&(t.stopPropagation(),this.requestClose(e))}async handleDialogPointerDown(t){t.target===this.dialog&&(this.lightDismiss?this.requestClose(this.dialog):await(0,d.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 t=new h.k;this.dispatchEvent(t),t.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,v.JG)(this),requestAnimationFrame(()=>{const t=this.querySelector("[autofocus]");t&&"function"==typeof t.focus?t.focus():this.dialog.focus()}),await(0,d.Ud)(this.dialog,"show"),this.dispatchEvent(new l.q))}render(){const t=!this.withoutHeader,e=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return o.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,n.J)(this.ariaDescribedby)}" part="dialog" class="${(0,a.H)({dialog:!0,open:this.open})}" @cancel="${this.handleDialogCancel}" @click="${this.handleDialogClick}" @pointerdown="${this.handleDialogPointerDown}"> ${t?o.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="${t=>this.requestClose(t.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> ${e?o.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new g.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=t=>{"Escape"===t.key&&this.open&&(0,p.a0)(this)&&(t.preventDefault(),t.stopPropagation(),this.requestClose(this.dialog))}}};$.css=y.A,A([(0,s.P)(".dialog")],$.prototype,"dialog",2),A([(0,s.MZ)({type:Boolean,reflect:!0})],$.prototype,"open",2),A([(0,s.MZ)({reflect:!0})],$.prototype,"label",2),A([(0,s.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],$.prototype,"withoutHeader",2),A([(0,s.MZ)({attribute:"light-dismiss",type:Boolean})],$.prototype,"lightDismiss",2),A([(0,s.MZ)({attribute:"aria-labelledby"})],$.prototype,"ariaLabelledby",2),A([(0,s.MZ)({attribute:"aria-describedby"})],$.prototype,"ariaDescribedby",2),A([(0,s.MZ)({attribute:"with-footer",type:Boolean})],$.prototype,"withFooter",2),A([(0,b.w)("open",{waitUntilFirstUpdate:!0})],$.prototype,"handleOpenChange",1),$=A([(0,s.EM)("wa-dialog")],$),o.S$||(document.addEventListener("click",t=>{const e=t.target.closest("[data-dialog]");if(e instanceof Element){const[t,i]=(0,u.v)(e.getAttribute("data-dialog")||"");if("open"===t&&i?.length){const t=e.getRootNode().getElementById(i);"wa-dialog"===t?.localName?t.open=!0:console.warn(`A dialog with an ID of "${i}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),e()}catch(t){e(t)}})},91470(t,e,i){i.d(e,{A:()=>o});var o=i(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}}`},68825(t,e,i){var o=i(22441),s=i(9395),a=i(717),n=i(5124).AH`:host{--color:var(--wa-color-surface-border);--width:var(--wa-border-width-s);--spacing:var(--wa-space-m)}:host(:not([orientation=vertical])){display:block;border-top:solid var(--width) var(--color);margin:var(--spacing) 0}:host([orientation=vertical]){display:inline-block;height:100%;border-inline-start:solid var(--width) var(--color);margin:0 var(--spacing);min-block-size:1lh}`,r=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=(t,e,i,o)=>{for(var s,a=o>1?void 0:o?l(e,i):e,n=t.length-1;n>=0;n--)(s=t[n])&&(a=(o?s(e,i,a):s(a))||a);return o&&a&&r(e,i,a),a};let h=class extends a.A{connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}handleVerticalChange(){this.setAttribute("aria-orientation",this.orientation)}constructor(){super(...arguments),this.orientation="horizontal"}};h.css=n,c([(0,o.MZ)({reflect:!0})],h.prototype,"orientation",2),c([(0,s.w)("orientation")],h.prototype,"handleVerticalChange",1),h=c([(0,o.EM)("wa-divider")],h)},61366(t,e,i){i.a(t,async function(t,e){try{i(74423),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(5124),s=i(22441),a=i(6412),n=i(63672),r=i(17051),l=i(42462),c=i(28438),h=i(98779),d=i(27259),p=i(25877),u=i(984),v=i(95010),f=i(9395),b=i(717),w=i(40158),g=i(10416),m=t([w]);w=(m.then?(await m)():m)[0];var y=Object.defineProperty,k=Object.getOwnPropertyDescriptor,C=(t,e,i,o)=>{for(var s,a=o>1?void 0:o?k(e,i):e,n=t.length-1;n>=0;n--)(s=t[n])&&(a=(o?s(e,i,a):s(a))||a);return o&&a&&y(e,i,a),a};const x=new Set;let A=class extends b.A{connectedCallback(){super.connectedCallback(),this.id||(this.id=(0,v.N)("wa-popover-")),this.eventController.signal.aborted&&(this.eventController=new AbortController),this.for&&this.anchor&&(this.anchor=null,this.handleForChange())}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,p.Fw)(this),this.eventController.abort()}firstUpdated(){this.open&&this.handleOpenChange()}updated(t){t.has("open")&&this.customStates.set("open",this.open)}async handleOpenChange(){if(this.open){const t=new h.k;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);x.forEach(t=>t.open=!1),document.addEventListener("keydown",this.handleDocumentKeyDown,{signal:this.eventController.signal}),document.addEventListener("click",this.handleDocumentClick,{signal:this.eventController.signal}),this.trapFocus?this.dialog.showModal():this.dialog.show(),this.popup.active=!0,x.add(this),(0,p.AZ)(this),requestAnimationFrame(()=>{const t=this.querySelector("[autofocus]");t&&"function"==typeof t.focus?t.focus():this.dialog.focus()}),this.popup.popup||await this.popup.updateComplete,await(0,d.Ud)(this.popup.popup,"show-with-scale"),this.popup.reposition(),this.dispatchEvent(new l.q)}else{const t=new c.L;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!0);document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("click",this.handleDocumentClick),x.delete(this),(0,p.Fw)(this),await(0,d.Ud)(this.popup.popup,"hide-with-scale"),this.popup.active=!1,this.dialog.close(),this.dispatchEvent(new r.Z)}}handleForChange(){const t=this.getRootNode();if(!t)return;const e=this.for?t.getElementById(this.for):null,i=this.anchor;if(e===i)return;const{signal:o}=this.eventController;e&&e.addEventListener("click",this.handleAnchorClick,{signal:o}),i&&i.removeEventListener("click",this.handleAnchorClick),this.anchor=e,this.for&&!e&&console.warn(`A popover was assigned to an element with an ID of "${this.for}" but the element could not be found.`,this)}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}async show(){if(!this.open)return this.open=!0,(0,u.l)(this,"wa-after-show")}async hide(){if(this.open)return this.open=!1,(0,u.l)(this,"wa-after-hide")}handleDialogCancel(t){t.preventDefault(),this.dialog.classList.contains("hide")||(this.open=!1)}render(){return o.qy` <dialog aria-labelledby="${(0,n.J)(this.ariaLabelledby)}" aria-describedby="${(0,n.J)(this.ariaDescribedby)}" part="dialog" class="dialog" @cancel="${this.handleDialogCancel}"> <wa-popup part="popup" exportparts=" popup:popup__popup, arrow:popup__arrow " class="${(0,a.H)({popover:!0,"popover-open":this.open})}" placement="${this.placement}" distance="${this.distance}" skidding="${this.skidding}" flip shift ?arrow="${!this.withoutArrow}" .anchor="${this.anchor}" .autoSize="${this.autoSize}" .autoSizePadding="${this.autoSizePadding}"> <div part="body" class="body" @click="${this.handleBodyClick}"> <slot></slot> </div> </wa-popup> </dialog> `}constructor(){super(...arguments),this.anchor=null,this.placement="top",this.open=!1,this.distance=8,this.skidding=0,this.for=null,this.withoutArrow=!1,this.autoSizePadding=0,this.trapFocus=!1,this.eventController=new AbortController,this.handleAnchorClick=()=>{this.open=!this.open},this.handleBodyClick=t=>{t.stopPropagation();t.target.closest('[data-popover="close"]')&&(this.open=!1)},this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&(0,p.a0)(this)&&(t.preventDefault(),t.stopPropagation(),this.open=!1,this.anchor&&"function"==typeof this.anchor.focus&&this.anchor.focus())},this.handleDocumentClick=t=>{this.anchor&&t.composedPath().includes(this.anchor)||t.composedPath().includes(this)||(this.open=!1)}}};A.css=g.A,A.dependencies={"wa-popup":w.A},C([(0,s.P)("dialog")],A.prototype,"dialog",2),C([(0,s.P)(".body")],A.prototype,"body",2),C([(0,s.P)("wa-popup")],A.prototype,"popup",2),C([(0,s.wk)()],A.prototype,"anchor",2),C([(0,s.MZ)()],A.prototype,"placement",2),C([(0,s.MZ)({type:Boolean,reflect:!0})],A.prototype,"open",2),C([(0,s.MZ)({type:Number})],A.prototype,"distance",2),C([(0,s.MZ)({type:Number})],A.prototype,"skidding",2),C([(0,s.MZ)()],A.prototype,"for",2),C([(0,s.MZ)({attribute:"without-arrow",type:Boolean,reflect:!0})],A.prototype,"withoutArrow",2),C([(0,s.MZ)({attribute:"auto-size"})],A.prototype,"autoSize",2),C([(0,s.MZ)({attribute:"auto-size-padding",type:Number})],A.prototype,"autoSizePadding",2),C([(0,s.MZ)({attribute:"trap-focus",type:Boolean})],A.prototype,"trapFocus",2),C([(0,s.MZ)({attribute:"aria-labelledby"})],A.prototype,"ariaLabelledby",2),C([(0,s.MZ)({attribute:"aria-describedby"})],A.prototype,"ariaDescribedby",2),C([(0,f.w)("open",{waitUntilFirstUpdate:!0})],A.prototype,"handleOpenChange",1),C([(0,f.w)("for")],A.prototype,"handleForChange",1),C([(0,f.w)(["distance","placement","skidding"])],A.prototype,"handleOptionsChange",1),A=C([(0,s.EM)("wa-popover")],A),e()}catch(t){e(t)}})},10416(t,e,i){i.d(e,{A:()=>o});var o=i(5124).AH`:host{--arrow-size:0.375rem;--max-width:25rem;--show-duration:100ms;--hide-duration:100ms;display:contents;font-size:var(--wa-font-size-m);line-height:var(--wa-line-height-normal);text-align:start;white-space:normal}.dialog{display:none;position:fixed;inset:0;width:100%;height:100%;margin:0;padding:0;border:none;background:0 0;overflow:visible;pointer-events:none}.dialog:focus{outline:0}.dialog[open]{display:block}.popover{--arrow-size:inherit;--popup-border-width:var(--wa-panel-border-width);--show-duration:inherit;--hide-duration:inherit;pointer-events:auto}.popover::part(arrow){background-color:var(--wa-color-surface-default);border-top:none;border-left:none;border-bottom:solid var(--wa-panel-border-width) var(--wa-color-surface-border);border-right:solid var(--wa-panel-border-width) var(--wa-color-surface-border);box-shadow:none}.popover[placement^=top]::part(popup){transform-origin:bottom}.popover[placement^=bottom]::part(popup){transform-origin:top}.popover[placement^=left]::part(popup){transform-origin:right}.popover[placement^=right]::part(popup){transform-origin:left}.body{display:flex;flex-direction:column;width:auto;max-width:min(var(--max-width),100vw);padding:var(--wa-space-l);background-color:var(--wa-color-surface-default);border:var(--wa-panel-border-width) solid var(--wa-color-surface-border);border-radius:var(--wa-panel-border-radius);border-style:var(--wa-panel-border-style);box-shadow:var(--wa-shadow-l);color:var(--wa-color-text-normal);user-select:none;-webkit-user-select:none}.popover[data-current-placement^=bottom] .body,.popover[data-current-placement^=top] .body{max-width:min(var(--max-width),100vw - (var(--wa-space-m) * 2));margin-inline:var(--wa-space-m)}.popover[data-current-placement^=left] .body,.popover[data-current-placement^=right] .body{max-height:calc(100vh - (var(--wa-space-m) * 2));margin-block:var(--wa-space-m)}`},29344(t,e,i){i.a(t,async function(t,o){try{i.d(e,{A:()=>C});var s=i(5124),a=i(22441),n=i(6412),r=i(63672),l=i(34514),c=i(40991),h=i(92070),d=i(41268),p=i(9395),u=i(62676),v=i(15477),f=i(31896),b=i(17060),w=i(19978),g=t([b]);b=(g.then?(await g)():g)[0];var m=Object.defineProperty,y=Object.getOwnPropertyDescriptor,k=(t,e,i,o)=>{for(var s,a=o>1?void 0:o?y(e,i):e,n=t.length-1;n>=0;n--)(s=t[n])&&(a=(o?s(e,i,a):s(a))||a);return o&&a&&m(e,i,a),a};let C=class extends u.q{static get validators(){return[...super.validators,(0,d.i)()]}get value(){return this._value??"on"}set value(t){this._value=t}handleSizeChange(){(0,c.b)(this.localName,this.size)}get checked(){return this.valueHasChanged?Boolean(this._checked):this._checked??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(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 s.qy` <label part="base" class="${(0,n.H)({checked:this.checked,disabled:this.disabled})}"> <input class="input" type="checkbox" title="${this.title}" name="${(0,r.J)(this.name)}" value="${(0,r.J)(this.value)}" .checked="${(0,l.V)(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" role="switch" aria-checked="${this.checked?"true":"false"}" aria-describedby="hint" @click="${this.handleClick}" @keydown="${this.handleKeyDown}"> <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,n.H)({"has-slotted":e})}" aria-hidden="${e?"false":"true"}">${this.hint}</slot> `}constructor(){super(...arguments),this.hasSlotController=new h.X(this,"hint"),this.localize=new b.c(this),this.title="",this.name=null,this._value=this.getAttribute("value")??null,this.size="m",this.disabled=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint="",this.withHint=!1}};C.shadowRootOptions={...u.q.shadowRootOptions,delegatesFocus:!0},C.css=[v.A,f.A,w.A],k([(0,a.P)('input[type="checkbox"]')],C.prototype,"input",2),k([(0,a.MZ)()],C.prototype,"title",2),k([(0,a.MZ)({reflect:!0})],C.prototype,"name",2),k([(0,a.MZ)({reflect:!0})],C.prototype,"value",1),k([(0,a.MZ)({reflect:!0})],C.prototype,"size",2),k([(0,p.w)("size")],C.prototype,"handleSizeChange",1),k([(0,a.MZ)({type:Boolean})],C.prototype,"disabled",2),k([(0,a.MZ)({type:Boolean,attribute:!1})],C.prototype,"checked",1),k([(0,a.MZ)({type:Boolean,attribute:"checked",reflect:!0})],C.prototype,"defaultChecked",2),k([(0,a.MZ)({type:Boolean,reflect:!0})],C.prototype,"required",2),k([(0,a.MZ)({attribute:"hint"})],C.prototype,"hint",2),k([(0,a.MZ)({attribute:"with-hint",type:Boolean})],C.prototype,"withHint",2),k([(0,p.w)(["checked","defaultChecked"])],C.prototype,"handleStateChange",1),k([(0,p.w)("disabled",{waitUntilFirstUpdate:!0})],C.prototype,"handleDisabledChange",1),C=k([(0,a.EM)("wa-switch")],C),C.disableWarning?.("change-in-update"),o()}catch(t){o(t)}})},19978(t,e,i){i.d(e,{A:()=>o});var o=i(5124).AH`: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}}`},88696(t,e,i){i.d(e,{P:()=>a});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(37540),s=i(42017);class a{handleChanges(t){this.value=this.callback?.(t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}target(t){return n(this,t)}constructor(t,{target:e,config:i,callback:o,skipInitial:s}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,null!==e&&this.t.add(e??t),this.l=i,this.o=s??this.o,this.callback=o,window.ResizeObserver?(this.u=new ResizeObserver(t=>{this.handleChanges(t),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}}const n=(0,s.u$)(class extends o.Kq{render(t,e){}update(t,[e,i]){this.controller=e,this.part=t,this.observe=i,!1===i?(e.unobserve(t.element),this.observing=!1):!1===this.observing&&(e.observe(t.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}})},99731(t,e,i){i.d(e,{Y:()=>c});var o=i(62826),s=i(22441),a=(i(18111),i(22489),i(20116),i(5124)),n=i(99591);class r extends a.WF{get chips(){return this.childElements.filter(t=>t instanceof n.v)}render(){return a.qy`<slot @slotchange="${this.updateTabIndices}"></slot>`}handleKeyDown(t){const e="ArrowLeft"===t.key,i="ArrowRight"===t.key,o="Home"===t.key,s="End"===t.key;if(!(e||i||o||s))return;const{chips:a}=this;if(a.length<2)return;if(t.preventDefault(),o||s){return a[o?0:a.length-1].focus({trailing:s}),void this.updateTabIndices()}const n="rtl"===getComputedStyle(this).direction?e:i,r=a.find(t=>t.matches(":focus-within"));if(!r){return(n?a[0]:a[a.length-1]).focus({trailing:!n}),void this.updateTabIndices()}const l=a.indexOf(r);let c=n?l+1:l-1;for(;c!==l;){c>=a.length?c=0:c<0&&(c=a.length-1);const t=a[c];if(!t.disabled||t.alwaysFocusable){t.focus({trailing:!n}),this.updateTabIndices();break}n?c++:c--}}updateTabIndices(){const{chips:t}=this;let e;for(const i of t){const t=i.alwaysFocusable||!i.disabled;i.matches(":focus-within")&&t?e=i:(t&&!e&&(e=i),i.tabIndex=-1)}e&&(e.tabIndex=0)}constructor(){super(),this.internals=this.attachInternals(),a.S$||(this.addEventListener("focusin",this.updateTabIndices.bind(this)),this.addEventListener("update-focus",this.updateTabIndices.bind(this)),this.addEventListener("keydown",this.handleKeyDown.bind(this)),this.internals.role="toolbar")}}(0,o.Cg)([(0,s.KN)()],r.prototype,"childElements",void 0);const l=a.AH`:host{display:flex;flex-wrap:wrap;gap:8px}`;let c=class extends r{};c.styles=[l],c=(0,o.Cg)([(0,s.EM)("md-chip-set")],c)},25423(t,e,i){i.d(e,{U:()=>s,Z:()=>a});i(44114);var o=i(27525);const s={ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",Home:"Home",End:"End"};class a{get items(){const t=this.getPossibleItems(),e=[];for(const i of t){if(this.isItem(i)){e.push(i);continue}const t=i.item;t&&this.isItem(t)&&e.push(t)}return e}activateNextItem(){const t=this.items,e=(0,o.A6)(t,this.isActivatable);return e&&(e.item.tabIndex=-1),(0,o.wm)(t,e,this.isActivatable,this.wrapNavigation())}activatePreviousItem(){const t=this.items,e=(0,o.A6)(t,this.isActivatable);return e&&(e.item.tabIndex=-1),(0,o.u9)(t,e,this.isActivatable,this.wrapNavigation())}constructor(t){this.handleKeydown=t=>{const e=t.key;if(t.defaultPrevented||!this.isNavigableKey(e))return;const i=this.items;if(!i.length)return;const a=(0,o.A6)(i,this.isActivatable);t.preventDefault();const n=this.isRtl(),r=n?s.ArrowRight:s.ArrowLeft,l=n?s.ArrowLeft:s.ArrowRight;let c=null;switch(e){case s.ArrowDown:case l:c=(0,o.wm)(i,a,this.isActivatable,this.wrapNavigation());break;case s.ArrowUp:case r:c=(0,o.u9)(i,a,this.isActivatable,this.wrapNavigation());break;case s.Home:c=(0,o.zT)(i,this.isActivatable);break;case s.End:c=(0,o.RZ)(i,this.isActivatable)}c&&a&&a.item!==c&&(a.item.tabIndex=-1)},this.onDeactivateItems=()=>{const t=this.items;for(const e of t)this.deactivateItem(e)},this.onRequestActivation=t=>{this.onDeactivateItems();const e=t.target;this.activateItem(e),e.focus()},this.onSlotchange=()=>{const t=this.items;let e=!1;for(const i of t){!(!i.disabled&&i.tabIndex>-1)||e?i.tabIndex=-1:(e=!0,i.tabIndex=0)}if(e)return;const i=(0,o.c7)(t,this.isActivatable);i&&(i.tabIndex=0)};const{isItem:e,getPossibleItems:i,isRtl:a,deactivateItem:n,activateItem:r,isNavigableKey:l,isActivatable:c,wrapNavigation:h}=t;this.isItem=e,this.getPossibleItems=i,this.isRtl=a,this.deactivateItem=n,this.activateItem=r,this.isNavigableKey=l,this.isActivatable=c,this.wrapNavigation=h??(()=>!0)}}},27525(t,e,i){function o(t,e=u){const i=r(t,e);return i&&(i.tabIndex=0,i.focus()),i}function s(t,e=u){const i=l(t,e);return i&&(i.tabIndex=0,i.focus()),i}function a(t,e=u){const i=n(t,e);return i&&(i.item.tabIndex=-1),i}function n(t,e=u){for(let i=0;i<t.length;i++){const o=t[i];if(0===o.tabIndex&&e(o))return{item:o,index:i}}return null}function r(t,e=u){for(const i of t)if(e(i))return i;return null}function l(t,e=u){for(let i=t.length-1;i>=0;i--){const o=t[i];if(e(o))return o}return null}function c(t,e,i=u,s=!0){if(e){const o=function(t,e,i=u,o=!0){for(let s=1;s<t.length;s++){const a=(s+e)%t.length;if(a<e&&!o)return null;const n=t[a];if(i(n))return n}return t[e]?t[e]:null}(t,e.index,i,s);return o&&(o.tabIndex=0,o.focus()),o}return o(t,i)}function h(t,e,i=u,o=!0){if(e){const s=function(t,e,i=u,o=!0){for(let s=1;s<t.length;s++){const a=(e-s+t.length)%t.length;if(a>e&&!o)return null;const n=t[a];if(i(n))return n}return t[e]?t[e]:null}(t,e.index,i,o);return s&&(s.tabIndex=0,s.focus()),s}return s(t,i)}function d(){return new Event("deactivate-items",{bubbles:!0,composed:!0})}function p(){return new Event("request-activation",{bubbles:!0,composed:!0})}function u(t){return!t.disabled}i.d(e,{A6:()=>n,Ex:()=>l,RN:()=>d,RZ:()=>s,c7:()=>r,cG:()=>p,u9:()=>h,ub:()=>a,wm:()=>c,zT:()=>o})},11245(t,e,i){i.d(e,{R:()=>o});const o=i(5124).AH`:host{background:var(--md-list-container-color,var(--md-sys-color-surface,#fef7ff));color:unset;display:flex;flex-direction:column;outline:0;padding:8px 0;position:relative}`},49838(t,e,i){i.d(e,{B:()=>l});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(62826),s=i(5124),a=i(22441),n=i(25423);const r=new Set(Object.values(n.U));class l extends s.WF{get items(){return this.listController.items}render(){return s.qy` <slot @deactivate-items="${this.listController.onDeactivateItems}" @request-activation="${this.listController.onRequestActivation}" @slotchange="${this.listController.onSlotchange}"> </slot> `}activateNextItem(){return this.listController.activateNextItem()}activatePreviousItem(){return this.listController.activatePreviousItem()}constructor(){super(),this.listController=new n.Z({isItem:t=>t.hasAttribute("md-list-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:t=>{t.tabIndex=-1},activateItem:t=>{t.tabIndex=0},isNavigableKey:t=>r.has(t),isActivatable:t=>!t.disabled&&"text"!==t.type}),this.internals=this.attachInternals(),s.S$||(this.internals.role="list",this.addEventListener("keydown",this.listController.handleKeydown))}}(0,o.Cg)([(0,a.KN)({flatten:!0})],l.prototype,"slotItems",void 0)},95192(t,e,i){i.d(e,{IU:()=>c,Jt:()=>r,Yd:()=>o,hZ:()=>l,y$:()=>s});i(44114),i(18111),i(7588),i(61701);function o(t){return new Promise((e,i)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>i(t.error)})}function s(t,e){let i;return(s,a)=>(()=>{if(i)return i;const s=indexedDB.open(t);return s.onupgradeneeded=()=>s.result.createObjectStore(e),i=o(s),i.then(t=>{t.onclose=()=>i=void 0},()=>{}),i})().then(t=>a(t.transaction(e,s).objectStore(e)))}let a;function n(){return a||(a=s("keyval-store","keyval")),a}function r(t,e=n()){return e("readonly",e=>o(e.get(t)))}function l(t,e,i=n()){return i("readwrite",i=>(i.put(e,t),o(i.transaction)))}function c(t=n()){return t("readwrite",t=>(t.clear(),o(t.transaction)))}},37540(t,e,i){i.d(e,{Kq:()=>d});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(63937),s=i(42017);const a=(t,e)=>{const i=t._$AN;if(void 0===i)return!1;for(const t of i)t._$AO?.(e,!1),a(t,e);return!0},n=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===i?.size)},r=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),h(e)}};function l(t){void 0!==this._$AN?(n(this),this._$AM=t,r(this)):this._$AM=t}function c(t,e=!1,i=0){const o=this._$AH,s=this._$AN;if(void 0!==s&&0!==s.size)if(e)if(Array.isArray(o))for(let t=i;t<o.length;t++)a(o[t],!1),n(o[t]);else null!=o&&(a(o,!1),n(o));else a(this,t)}const h=t=>{t.type==s.OA.CHILD&&(t._$AP??=c,t._$AQ??=l)};class d extends s.WL{_$AT(t,e,i){super._$AT(t,e,i),r(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(a(this,t),n(this))}setValue(t){if((0,o.Rt)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}constructor(){super(...arguments),this._$AN=void 0}}},75751(t,e,i){i.d(e,{u:()=>r});i(45367),i(92731);var o=i(5055),s=i(42017),a=i(63937);const n=(t,e,i)=>{const o=new Map;for(let s=e;s<=i;s++)o.set(t[s],s);return o},r=(0,s.u$)(class extends s.WL{dt(t,e,i){let o;void 0===i?i=e:void 0!==e&&(o=e);const s=[],a=[];let n=0;for(const e of t)s[n]=o?o(e,n):n,a[n]=i(e,n),n++;return{values:a,keys:s}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,s]){const r=(0,a.cN)(t),{values:l,keys:c}=this.dt(e,i,s);if(!Array.isArray(r))return this.ut=c,l;const h=this.ut??=[],d=[];let p,u,v=0,f=r.length-1,b=0,w=l.length-1;for(;v<=f&&b<=w;)if(null===r[v])v++;else if(null===r[f])f--;else if(h[v]===c[b])d[b]=(0,a.lx)(r[v],l[b]),v++,b++;else if(h[f]===c[w])d[w]=(0,a.lx)(r[f],l[w]),f--,w--;else if(h[v]===c[w])d[w]=(0,a.lx)(r[v],l[w]),(0,a.Dx)(t,d[w+1],r[v]),v++,w--;else if(h[f]===c[b])d[b]=(0,a.lx)(r[f],l[b]),(0,a.Dx)(t,r[v],r[f]),f--,b++;else if(void 0===p&&(p=n(c,b,w),u=n(h,v,f)),p.has(h[v]))if(p.has(h[f])){const e=u.get(c[b]),i=void 0!==e?r[e]:null;if(null===i){const e=(0,a.Dx)(t,r[v]);(0,a.lx)(e,l[b]),d[b]=e}else d[b]=(0,a.lx)(i,l[b]),(0,a.Dx)(t,r[v],i),r[e]=null;b++}else(0,a.KO)(r[f]),f--;else(0,a.KO)(r[v]),v++;for(;b<=w;){const e=(0,a.Dx)(t,d[w+1]);(0,a.lx)(e,l[b]),d[b++]=e}for(;v<=f;){const t=r[v++];null!==t&&(0,a.KO)(t)}return this.ut=c,(0,a.mY)(t,d),o.c0}constructor(t){if(super(t),t.type!==s.OA.CHILD)throw Error("repeat() can only be used in text expressions")}})},89784(t,e,i){i.d(e,{W:()=>r});i(74423),i(18111),i(18237),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(5055),s=i(42017);const a="important",n=" !"+a,r=(0,s.u$)(class extends s.WL{render(t){return Object.keys(t).reduce((e,i)=>{const o=t[i];return null==o?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(const t in e){const o=e[t];if(null!=o){this.ft.add(t);const e="string"==typeof o&&o.endsWith(n);t.includes("-")||e?i.setProperty(t,e?o.slice(0,-11):o,e?a:""):i[t]=o}}return o.c0}constructor(t){if(super(t),t.type!==s.OA.ATTRIBUTE||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}})},91450(t,e,i){i.d(e,{T:()=>p});i(18111),i(20116);var o=i(5055),s=i(63937),a=i(37540);class n{disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}constructor(t){this.G=t}}class r{get(){return this.Y}pause(){this.Y??=new Promise(t=>this.Z=t)}resume(){this.Z?.(),this.Y=this.Z=void 0}constructor(){this.Y=void 0,this.Z=void 0}}var l=i(42017);const c=t=>!(0,s.sO)(t)&&"function"==typeof t.then,h=1073741823;class d extends a.Kq{render(...t){return t.find(t=>!c(t))??o.c0}update(t,e){const i=this._$Cbt;let s=i.length;this._$Cbt=e;const a=this._$CK,n=this._$CX;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cwt);t++){const o=e[t];if(!c(o))return this._$Cwt=t,o;t<s&&o===i[t]||(this._$Cwt=h,s=0,Promise.resolve(o).then(async t=>{for(;n.get();)await n.get();const e=a.deref();if(void 0!==e){const i=e._$Cbt.indexOf(o);i>-1&&i<e._$Cwt&&(e._$Cwt=i,e.setValue(t))}}))}return o.c0}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}constructor(){super(...arguments),this._$Cwt=h,this._$Cbt=[],this._$CK=new n(this),this._$CX=new r}}const p=(0,l.u$)(d)}};