UNPKG

iobroker.lovelace

Version:

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

5 lines 33.8 kB
/*! For license information please see 97187.ed7077d554909928.js.LICENSE.txt */ export const __rspack_esm_id=97187;export const __rspack_esm_ids=[97187];export const __webpack_modules__={1126(t,e,o){o.a(t,async function(t,e){try{var i=o(5124),r=o(22441),n=o(6412),s=o(63672),a=o(17051),l=o(42462),d=o(28438),h=o(98779),c=o(27259),p=o(25877),u=o(31247),f=o(4444),w=o(92070),m=o(9395),b=o(717),v=o(17060),g=o(88496),y=o(57024),C=t([g,v]);[g,v]=C.then?(await C)():C;var k=Object.defineProperty,A=Object.getOwnPropertyDescriptor,E=(t,e,o,i)=>{for(var r,n=i>1?void 0:i?A(e,o):e,s=t.length-1;s>=0;s--)(r=t[s])&&(n=(i?r(e,o,n):r(n))||n);return i&&n&&k(e,o,n),n};let x=class extends b.A{firstUpdated(){i.S$||this.open&&(this.addOpenListeners(),this.drawer.showModal(),(0,f.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,f.I7)(this),this.removeOpenListeners()}async requestClose(t){const e=new d.L({source:t});if(this.dispatchEvent(e),e.defaultPrevented)return this.open=!0,void(0,c.Ud)(this.drawer,"pulse");this.removeOpenListeners(),await(0,c.Ud)(this.drawer,"hide"),this.open=!1,this.drawer.close(),(0,f.I7)(this);const o=this.originalTrigger;"function"==typeof o?.focus&&setTimeout(()=>o.focus()),this.dispatchEvent(new a.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.drawer.classList.contains("hide")&&t.target===this.drawer&&(0,p.a0)(this)&&this.requestClose(this.drawer)}handleDialogClick(t){const e=t.target.closest('[data-drawer="close"]');e&&(t.stopPropagation(),this.requestClose(e))}async handleDialogPointerDown(t){t.target===this.drawer&&(this.lightDismiss?this.requestClose(this.drawer):await(0,c.Ud)(this.drawer,"pulse"))}handleOpenChange(){this.open&&!this.drawer.open?this.show():this.drawer.open&&(this.open=!0,this.requestClose(this.drawer))}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.drawer.showModal(),(0,f.JG)(this),requestAnimationFrame(()=>{const t=this.querySelector("[autofocus]");t&&"function"==typeof t.focus?t.focus():this.drawer.focus()}),await(0,c.Ud)(this.drawer,"show"),this.dispatchEvent(new l.q))}render(){const t=!this.withoutHeader,e=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return i.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,s.J)(this.ariaDescribedby)}" part="dialog" class="${(0,n.H)({drawer:!0,open:this.open,top:"top"===this.placement,end:"end"===this.placement,bottom:"bottom"===this.placement,start:"start"===this.placement})}" @cancel="${this.handleDialogCancel}" @click="${this.handleDialogClick}" @pointerdown="${this.handleDialogPointerDown}"> ${t?i.qy` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(8203)} </slot> </h2> <div part="header-actions" class="header-actions"> <slot name="header-actions"></slot> <wa-button part="close-button" exportparts="base:close-button__base" class="close" appearance="plain" @click="${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?i.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new v.c(this),this.hasSlotController=new w.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.placement="end",this.withoutHeader=!1,this.lightDismiss=!0,this.withFooter=!1,this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&(0,p.a0)(this)&&(t.preventDefault(),t.stopPropagation(),this.requestClose(this.drawer))}}};x.css=y.A,E([(0,r.P)(".drawer")],x.prototype,"drawer",2),E([(0,r.MZ)({type:Boolean,reflect:!0})],x.prototype,"open",2),E([(0,r.MZ)({reflect:!0})],x.prototype,"label",2),E([(0,r.MZ)({reflect:!0})],x.prototype,"placement",2),E([(0,r.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],x.prototype,"withoutHeader",2),E([(0,r.MZ)({attribute:"light-dismiss",type:Boolean})],x.prototype,"lightDismiss",2),E([(0,r.MZ)({attribute:"aria-labelledby"})],x.prototype,"ariaLabelledby",2),E([(0,r.MZ)({attribute:"aria-describedby"})],x.prototype,"ariaDescribedby",2),E([(0,r.MZ)({attribute:"with-footer",type:Boolean})],x.prototype,"withFooter",2),E([(0,m.w)("open",{waitUntilFirstUpdate:!0})],x.prototype,"handleOpenChange",1),x=E([(0,r.EM)("wa-drawer")],x),i.S$||(document.addEventListener("click",t=>{const e=t.target.closest("[data-drawer]");if(e instanceof Element){const[t,o]=(0,u.v)(e.getAttribute("data-drawer")||"");if("open"===t&&o?.length){const t=e.getRootNode().getElementById(o);"wa-drawer"===t?.localName?t.open=!0:console.warn(`A drawer with an ID of "${o}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),e()}catch(t){e(t)}})},57024(t,e,o){o.d(e,{A:()=>i});var i=o(5124).AH`:host{--size:25rem;--spacing:var(--wa-space-l);--backdrop-filter:none;--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.drawer{display:flex;flex-direction:column;top:0;inset-inline-start:0;width:100%;height:100%;max-width:100%;max-height:100%;overflow:hidden;color:inherit;background-color:var(--wa-color-surface-raised);border:none;box-shadow:var(--wa-shadow-l);overflow:auto;padding:0;margin:0;animation-duration:var(--show-duration);animation-timing-function:ease}.drawer.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.drawer.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.drawer.show.top{animation:show-drawer-from-top var(--show-duration) ease}.drawer.hide.top{animation:show-drawer-from-top var(--hide-duration) ease reverse}.drawer.show.end{animation:show-drawer-from-end var(--show-duration) ease}.drawer.show.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.hide.end{animation:show-drawer-from-end var(--hide-duration) ease reverse}.drawer.hide.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.show.bottom{animation:show-drawer-from-bottom var(--show-duration) ease}.drawer.hide.bottom{animation:show-drawer-from-bottom var(--hide-duration) ease reverse}.drawer.show.start{animation:show-drawer-from-start var(--show-duration) ease}.drawer.show.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.hide.start{animation:show-drawer-from-start var(--hide-duration) ease reverse}.drawer.hide.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.pulse{animation:pulse 250ms ease}.drawer:focus{outline:0}.top{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:100%;height:var(--size)}.end{top:0;inset-inline-end:0;bottom:auto;inset-inline-start:auto;width:var(--size);height:100%}.bottom{top:auto;inset-inline-end:auto;bottom:0;inset-inline-start:0;width:100%;height:var(--size)}.start{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:var(--size);height:100%}.header{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: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{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(:last-of-type)){margin-inline-end:var(--wa-spacing-xs)}.drawer::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.01}100%{scale:1}}@keyframes show-drawer{from{opacity:0;scale:0.8}to{opacity:1;scale:1}}@keyframes show-drawer-from-top{from{opacity:0;translate:0 -100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-end{from{opacity:0;translate:100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-bottom{from{opacity:0;translate:0 100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-start{from{opacity:0;translate:-100% 0}to{opacity:1;translate:0 0}}@keyframes show-backdrop{from{opacity:0}to{opacity:1}}@media (forced-colors:active){.drawer{border:solid 1px #fff}}`},61366(t,e,o){o.a(t,async function(t,e){try{o(74423),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var i=o(5124),r=o(22441),n=o(6412),s=o(63672),a=o(17051),l=o(42462),d=o(28438),h=o(98779),c=o(27259),p=o(25877),u=o(984),f=o(95010),w=o(9395),m=o(717),b=o(40158),v=o(10416),g=t([b]);b=(g.then?(await g)():g)[0];var y=Object.defineProperty,C=Object.getOwnPropertyDescriptor,k=(t,e,o,i)=>{for(var r,n=i>1?void 0:i?C(e,o):e,s=t.length-1;s>=0;s--)(r=t[s])&&(n=(i?r(e,o,n):r(n))||n);return i&&n&&y(e,o,n),n};const A=new Set;let E=class extends m.A{connectedCallback(){super.connectedCallback(),this.id||(this.id=(0,f.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);A.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,A.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,c.Ud)(this.popup.popup,"show-with-scale"),this.popup.reposition(),this.dispatchEvent(new l.q)}else{const t=new d.L;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!0);document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("click",this.handleDocumentClick),A.delete(this),(0,p.Fw)(this),await(0,c.Ud)(this.popup.popup,"hide-with-scale"),this.popup.active=!1,this.dialog.close(),this.dispatchEvent(new a.Z)}}handleForChange(){const t=this.getRootNode();if(!t)return;const e=this.for?t.getElementById(this.for):null,o=this.anchor;if(e===o)return;const{signal:i}=this.eventController;e&&e.addEventListener("click",this.handleAnchorClick,{signal:i}),o&&o.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 i.qy` <dialog aria-labelledby="${(0,s.J)(this.ariaLabelledby)}" aria-describedby="${(0,s.J)(this.ariaDescribedby)}" part="dialog" class="dialog" @cancel="${this.handleDialogCancel}"> <wa-popup part="popup" exportparts=" popup:popup__popup, arrow:popup__arrow " class="${(0,n.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)}}};E.css=v.A,E.dependencies={"wa-popup":b.A},k([(0,r.P)("dialog")],E.prototype,"dialog",2),k([(0,r.P)(".body")],E.prototype,"body",2),k([(0,r.P)("wa-popup")],E.prototype,"popup",2),k([(0,r.wk)()],E.prototype,"anchor",2),k([(0,r.MZ)()],E.prototype,"placement",2),k([(0,r.MZ)({type:Boolean,reflect:!0})],E.prototype,"open",2),k([(0,r.MZ)({type:Number})],E.prototype,"distance",2),k([(0,r.MZ)({type:Number})],E.prototype,"skidding",2),k([(0,r.MZ)()],E.prototype,"for",2),k([(0,r.MZ)({attribute:"without-arrow",type:Boolean,reflect:!0})],E.prototype,"withoutArrow",2),k([(0,r.MZ)({attribute:"auto-size"})],E.prototype,"autoSize",2),k([(0,r.MZ)({attribute:"auto-size-padding",type:Number})],E.prototype,"autoSizePadding",2),k([(0,r.MZ)({attribute:"trap-focus",type:Boolean})],E.prototype,"trapFocus",2),k([(0,r.MZ)({attribute:"aria-labelledby"})],E.prototype,"ariaLabelledby",2),k([(0,r.MZ)({attribute:"aria-describedby"})],E.prototype,"ariaDescribedby",2),k([(0,w.w)("open",{waitUntilFirstUpdate:!0})],E.prototype,"handleOpenChange",1),k([(0,w.w)("for")],E.prototype,"handleForChange",1),k([(0,w.w)(["distance","placement","skidding"])],E.prototype,"handleOptionsChange",1),E=k([(0,r.EM)("wa-popover")],E),e()}catch(t){e(t)}})},10416(t,e,o){o.d(e,{A:()=>i});var i=o(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)}`},31247(t,e,o){o.d(e,{v:()=>i});o(18111),o(22489),o(61701);function i(t){return t.split(" ").map(t=>t.trim()).filter(t=>""!==t)}},4444(t,e,o){o.d(e,{JG:()=>r,Rt:()=>s,I7:()=>n});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);const i=new Set;function r(t){if(i.add(t),!document.documentElement.classList.contains("wa-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let e=getComputedStyle(document.documentElement).scrollbarGutter;e&&"auto"!==e||(e="stable"),t<2&&(e=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",e),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${t}px`)}}function n(t){i.delete(t),0===i.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function s(t,e,o="vertical",i="smooth"){const r=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),n=r.top+e.scrollTop,s=r.left+e.scrollLeft,a=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,d=e.scrollTop,h=e.scrollTop+e.offsetHeight;"horizontal"!==o&&"both"!==o||(s<a?e.scrollTo({left:s,behavior:i}):s+t.clientWidth>l&&e.scrollTo({left:s-e.offsetWidth+t.clientWidth,behavior:i})),"vertical"!==o&&"both"!==o||(n<d?e.scrollTo({top:n,behavior:i}):n+t.clientHeight>h&&e.scrollTo({top:n-e.offsetHeight+t.clientHeight,behavior:i}))}},88696(t,e,o){o.d(e,{P:()=>n});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var i=o(37540),r=o(42017);class n{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 s(this,t)}constructor(t,{target:e,config:o,callback:i,skipInitial:r}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,null!==e&&this.t.add(e??t),this.l=o,this.o=r??this.o,this.callback=i,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 s=(0,r.u$)(class extends i.Kq{render(t,e){}update(t,[e,o]){this.controller=e,this.part=t,this.observe=o,!1===o?(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,o){o.d(e,{Y:()=>d});var i=o(62826),r=o(22441),n=(o(18111),o(22489),o(20116),o(5124)),s=o(99591);class a extends n.WF{get chips(){return this.childElements.filter(t=>t instanceof s.v)}render(){return n.qy`<slot @slotchange="${this.updateTabIndices}"></slot>`}handleKeyDown(t){const e="ArrowLeft"===t.key,o="ArrowRight"===t.key,i="Home"===t.key,r="End"===t.key;if(!(e||o||i||r))return;const{chips:n}=this;if(n.length<2)return;if(t.preventDefault(),i||r){return n[i?0:n.length-1].focus({trailing:r}),void this.updateTabIndices()}const s="rtl"===getComputedStyle(this).direction?e:o,a=n.find(t=>t.matches(":focus-within"));if(!a){return(s?n[0]:n[n.length-1]).focus({trailing:!s}),void this.updateTabIndices()}const l=n.indexOf(a);let d=s?l+1:l-1;for(;d!==l;){d>=n.length?d=0:d<0&&(d=n.length-1);const t=n[d];if(!t.disabled||t.alwaysFocusable){t.focus({trailing:!s}),this.updateTabIndices();break}s?d++:d--}}updateTabIndices(){const{chips:t}=this;let e;for(const o of t){const t=o.alwaysFocusable||!o.disabled;o.matches(":focus-within")&&t?e=o:(t&&!e&&(e=o),o.tabIndex=-1)}e&&(e.tabIndex=0)}constructor(){super(),this.internals=this.attachInternals(),n.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,i.Cg)([(0,r.KN)()],a.prototype,"childElements",void 0);const l=n.AH`:host{display:flex;flex-wrap:wrap;gap:8px}`;let d=class extends a{};d.styles=[l],d=(0,i.Cg)([(0,r.EM)("md-chip-set")],d)},76482(t,e,o){o.d(e,{i:()=>s});var i=o(5124);const r=Symbol("attachableController");let n;i.S$||(n=new MutationObserver(t=>{for(const e of t)e.target[r]?.hostConnected()}));class s{get htmlFor(){return this.host.getAttribute("for")}set htmlFor(t){null===t?this.host.removeAttribute("for"):this.host.setAttribute("for",t)}get control(){return this.host.hasAttribute("for")?this.htmlFor&&this.host.isConnected?this.host.getRootNode().querySelector(`#${this.htmlFor}`):null:this.currentControl||this.host.parentElement}set control(t){t?this.attach(t):this.detach()}attach(t){t!==this.currentControl&&(this.setCurrentControl(t),this.host.removeAttribute("for"))}detach(){this.setCurrentControl(null),this.host.setAttribute("for","")}hostConnected(){this.setCurrentControl(this.control)}hostDisconnected(){this.setCurrentControl(null)}setCurrentControl(t){this.onControlChange(this.currentControl,t),this.currentControl=t}constructor(t,e){this.host=t,this.onControlChange=e,this.currentControl=null,t.addController(this),t[r]=this,n?.observe(t,{attributeFilter:["for"]})}}},76610(t,e,o){o.d(e,{Ux:()=>i});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);const i={STANDARD:"cubic-bezier(0.2, 0, 0, 1)",STANDARD_ACCELERATE:"cubic-bezier(.3,0,1,1)",STANDARD_DECELERATE:"cubic-bezier(0,0,0,1)",EMPHASIZED:"cubic-bezier(.3,0,0,1)",EMPHASIZED_ACCELERATE:"cubic-bezier(.3,0,.8,.15)",EMPHASIZED_DECELERATE:"cubic-bezier(.05,.7,.1,1)"}},27525(t,e,o){function i(t,e=h){const o=s(t,e);return o&&(o.tabIndex=0,o.focus()),o}function r(t,e=h){const o=function(t,e=h){for(let o=t.length-1;o>=0;o--){const i=t[o];if(e(i))return i}return null}(t,e);return o&&(o.tabIndex=0,o.focus()),o}function n(t,e=h){for(let o=0;o<t.length;o++){const i=t[o];if(0===i.tabIndex&&e(i))return{item:i,index:o}}return null}function s(t,e=h){for(const o of t)if(e(o))return o;return null}function a(t,e,o=h,r=!0){if(e){const i=function(t,e,o=h,i=!0){for(let r=1;r<t.length;r++){const n=(r+e)%t.length;if(n<e&&!i)return null;const s=t[n];if(o(s))return s}return t[e]?t[e]:null}(t,e.index,o,r);return i&&(i.tabIndex=0,i.focus()),i}return i(t,o)}function l(t,e,o=h,i=!0){if(e){const r=function(t,e,o=h,i=!0){for(let r=1;r<t.length;r++){const n=(e-r+t.length)%t.length;if(n>e&&!i)return null;const s=t[n];if(o(s))return s}return t[e]?t[e]:null}(t,e.index,o,i);return r&&(r.tabIndex=0,r.focus()),r}return r(t,o)}function d(){return new Event("request-activation",{bubbles:!0,composed:!0})}function h(t){return!t.disabled}o.d(e,{A6:()=>n,RZ:()=>r,c7:()=>s,cG:()=>d,u9:()=>l,wm:()=>a,zT:()=>i})},96245(t,e,o){o.d(e,{R:()=>i});const i=o(5124).AH`:host{display:flex;margin:auto;pointer-events:none}:host([disabled]){display:none}@media(forced-colors:active){:host{display:none}}.surface,:host{border-radius:inherit;position:absolute;inset:0;overflow:hidden}.surface{-webkit-tap-highlight-color:transparent}.surface::after,.surface::before{content:"";opacity:0;position:absolute}.surface::before{background-color:var(--md-ripple-hover-color,var(--md-sys-color-on-surface,#1d1b20));inset:0;transition:opacity 15ms linear,background-color 15ms linear}.surface::after{background:radial-gradient(closest-side,var(--md-ripple-pressed-color,var(--md-sys-color-on-surface,#1d1b20)) max(100% - 70px,65%),transparent 100%);transform-origin:center center;transition:opacity 375ms linear}.hovered::before{background-color:var(--md-ripple-hover-color,var(--md-sys-color-on-surface,#1d1b20));opacity:var(--md-ripple-hover-opacity, .08)}.pressed::after{opacity:var(--md-ripple-pressed-opacity, .12);transition-duration:105ms}`},91382(t,e,o){o.d(e,{n:()=>p});var i=o(62826),r=o(5124),n=o(22441),s=o(6412),a=o(76482),l=o(76610);var d;!function(t){t[t.INACTIVE=0]="INACTIVE",t[t.TOUCH_DELAY=1]="TOUCH_DELAY",t[t.HOLDING=2]="HOLDING",t[t.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"}(d||(d={}));const h=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],c=r.S$?null:window.matchMedia("(forced-colors: active)");class p extends r.WF{get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){const t={hovered:this.hovered,pressed:this.pressed};return r.qy`<div class="surface ${(0,s.H)(t)}"></div>`}update(t){t.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),super.update(t)}handlePointerenter(t){this.shouldReactToEvent(t)&&(this.hovered=!0)}handlePointerleave(t){this.shouldReactToEvent(t)&&(this.hovered=!1,this.state!==d.INACTIVE&&this.endPressAnimation())}handlePointerup(t){if(this.shouldReactToEvent(t)){if(this.state!==d.HOLDING)return this.state===d.TOUCH_DELAY?(this.state=d.WAITING_FOR_CLICK,void this.startPressAnimation(this.rippleStartEvent)):void 0;this.state=d.WAITING_FOR_CLICK}}async handlePointerdown(t){if(this.shouldReactToEvent(t)){if(this.rippleStartEvent=t,!this.isTouch(t))return this.state=d.WAITING_FOR_CLICK,void this.startPressAnimation(t);this.state=d.TOUCH_DELAY,await new Promise(t=>{setTimeout(t,150)}),this.state===d.TOUCH_DELAY&&(this.state=d.HOLDING,this.startPressAnimation(t))}}handleClick(){this.disabled||(this.state!==d.WAITING_FOR_CLICK?this.state===d.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation()):this.endPressAnimation())}handlePointercancel(t){this.shouldReactToEvent(t)&&this.endPressAnimation()}handleContextmenu(){this.disabled||this.endPressAnimation()}determineRippleSize(){const{height:t,width:e}=this.getBoundingClientRect(),o=Math.max(t,e),i=Math.max(.35*o,75),r=this.currentCSSZoom??1,n=Math.floor(.2*o/r),s=Math.sqrt(e**2+t**2)+10;this.initialSize=n;const a=(s+i)/n;this.rippleScale=""+a/r,this.rippleSize=`${n}px`}getNormalizedPointerEventCoords(t){const{scrollX:e,scrollY:o}=window,{left:i,top:r}=this.getBoundingClientRect(),n=e+i,s=o+r,{pageX:a,pageY:l}=t,d=this.currentCSSZoom??1;return{x:(a-n)/d,y:(l-s)/d}}getTranslationCoordinates(t){const{height:e,width:o}=this.getBoundingClientRect(),i=this.currentCSSZoom??1,r={x:(o/i-this.initialSize)/2,y:(e/i-this.initialSize)/2};let n;return n=t instanceof PointerEvent?this.getNormalizedPointerEventCoords(t):{x:o/i/2,y:e/i/2},n={x:n.x-this.initialSize/2,y:n.y-this.initialSize/2},{startPoint:n,endPoint:r}}startPressAnimation(t){if(!this.mdRoot)return;this.pressed=!0,this.growAnimation?.cancel(),this.determineRippleSize();const{startPoint:e,endPoint:o}=this.getTranslationCoordinates(t),i=`${e.x}px, ${e.y}px`,r=`${o.x}px, ${o.y}px`;this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:[`translate(${i}) scale(1)`,`translate(${r}) scale(${this.rippleScale})`]},{pseudoElement:"::after",duration:450,easing:l.Ux.STANDARD,fill:"forwards"})}async endPressAnimation(){this.rippleStartEvent=void 0,this.state=d.INACTIVE;const t=this.growAnimation;let e=1/0;"number"==typeof t?.currentTime?e=t.currentTime:t?.currentTime&&(e=t.currentTime.to("ms").value),e>=225?this.pressed=!1:(await new Promise(t=>{setTimeout(t,225-e)}),this.growAnimation===t&&(this.pressed=!1))}shouldReactToEvent(t){if(this.disabled||!t.isPrimary)return!1;if(this.rippleStartEvent&&this.rippleStartEvent.pointerId!==t.pointerId)return!1;if("pointerenter"===t.type||"pointerleave"===t.type)return!this.isTouch(t);const e=1===t.buttons;return this.isTouch(t)||e}isTouch({pointerType:t}){return"touch"===t}async handleEvent(t){if(!c?.matches)switch(t.type){case"click":this.handleClick();break;case"contextmenu":this.handleContextmenu();break;case"pointercancel":this.handlePointercancel(t);break;case"pointerdown":await this.handlePointerdown(t);break;case"pointerenter":this.handlePointerenter(t);break;case"pointerleave":this.handlePointerleave(t);break;case"pointerup":this.handlePointerup(t)}}onControlChange(t,e){if(!r.S$)for(const o of h)t?.removeEventListener(o,this),e?.addEventListener(o,this)}constructor(){super(...arguments),this.disabled=!1,this.hovered=!1,this.pressed=!1,this.rippleSize="",this.rippleScale="",this.initialSize=0,this.state=d.INACTIVE,this.attachableController=new a.i(this,this.onControlChange.bind(this))}}(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),(0,i.Cg)([(0,n.wk)()],p.prototype,"hovered",void 0),(0,i.Cg)([(0,n.wk)()],p.prototype,"pressed",void 0),(0,i.Cg)([(0,n.P)(".surface")],p.prototype,"mdRoot",void 0)},95192(t,e,o){o.d(e,{IU:()=>d,Jt:()=>a,Yd:()=>i,hZ:()=>l,y$:()=>r});o(44114),o(18111),o(7588),o(61701);function i(t){return new Promise((e,o)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>o(t.error)})}function r(t,e){let o;return(r,n)=>(()=>{if(o)return o;const r=indexedDB.open(t);return r.onupgradeneeded=()=>r.result.createObjectStore(e),o=i(r),o.then(t=>{t.onclose=()=>o=void 0},()=>{}),o})().then(t=>n(t.transaction(e,r).objectStore(e)))}let n;function s(){return n||(n=r("keyval-store","keyval")),n}function a(t,e=s()){return e("readonly",e=>i(e.get(t)))}function l(t,e,o=s()){return o("readwrite",o=>(o.put(e,t),i(o.transaction)))}function d(t=s()){return t("readwrite",t=>(t.clear(),i(t.transaction)))}},37540(t,e,o){o.d(e,{Kq:()=>c});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var i=o(63937),r=o(42017);const n=(t,e)=>{const o=t._$AN;if(void 0===o)return!1;for(const t of o)t._$AO?.(e,!1),n(t,e);return!0},s=t=>{let e,o;do{if(void 0===(e=t._$AM))break;o=e._$AN,o.delete(t),t=e}while(0===o?.size)},a=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(void 0===o)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),h(e)}};function l(t){void 0!==this._$AN?(s(this),this._$AM=t,a(this)):this._$AM=t}function d(t,e=!1,o=0){const i=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(i))for(let t=o;t<i.length;t++)n(i[t],!1),s(i[t]);else null!=i&&(n(i,!1),s(i));else n(this,t)}const h=t=>{t.type==r.OA.CHILD&&(t._$AP??=d,t._$AQ??=l)};class c extends r.WL{_$AT(t,e,o){super._$AT(t,e,o),a(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(n(this,t),s(this))}setValue(t){if((0,i.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}}},91335(t,e,o){o.d(e,{Tc:()=>h});o(74423),o(44114),o(18111),o(20116),o(61701),o(45367),o(92731);let i=["Shift","Meta","Alt","Control"],r="object"==typeof navigator?navigator.platform:"",n=/Mac|iPod|iPhone|iPad/.test(r)?"Meta":"Control",s="Win32"===r?["Control","Alt"]:["Alt"];function a(t){let e=t.target;return t.repeat||t.isComposing||e!==t.currentTarget&&e.matches("[contenteditable],input,select,textarea")}function l(t,e){return"function"==typeof t.getModifierState&&(t.getModifierState(e)||s.includes(e)&&t.getModifierState("AltGraph"))}function d(t,[e,o,r]){const n=e.includes("AltGraph");return!((r instanceof RegExp?!r.test(t.key)&&!r.test(t.code):r.toUpperCase()!==t.key.toUpperCase()&&r!==t.code)||e.find(e=>!l(t,e))||i.find(i=>!e.includes(i)&&!o.includes(i)&&r!==i&&l(t,i)&&!(n&&s.includes(i))))}function h(t,e,o={}){let i=o.event??"keydown",r=function(t,e={}){let o=e.timeout??1e3,i=e.ignore??a,r=Object.keys(t).map(e=>{return[e,(o=e,o.trim().split(" ").map(t=>{let e=function(t){let e=[],o=0;for(let i=0;i<t.length;i++)"+"===t[i]&&/[\w\]]/.test(t[i-1]||"")&&(e.push(t.slice(o,i)),o=i+1);return e.push(t.slice(o)),e}(t),o=e.pop(),i=o.match(/^\((.+)\)$/),r=i?new RegExp(`^(?:${i[1]})$`,"i"):o,s=[],a=[];for(const t of e){let e=t.match(/^\[(.*)\]$/),o=e?.[1]??t;o="$mod"===o?n:o,e?a.push(o):s.push(o)}return[s,a,r]})),t[e]];var o}),s=new Map,h=null;return t=>{if(!function(t){return!!(t.key&&t.code&&t.getModifierState)}(t)||i(t))return;let e=[];for(let[o,i,n]of r){let r=s.get(o),[a,...h]=r||i;if(d(t,a))if(h.length>0)s.set(o,h),e.push(o);else{if(s.delete(o),!e.length){n(t);break}console.warn(`tinykeys: Conflict found, "${o}" did not fire, waiting for:`,e)}else l(t,t.key)||s.delete(o)}h&&clearTimeout(h),h=setTimeout(()=>s.clear(),o)}}(e,o);return t.addEventListener(i,r,o.capture),()=>{t.removeEventListener(i,r,o.capture)}}}};