scb-wc-test 0.1.153 → 0.1.154

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{a as m,n as p,e as h,i as f,x as b,t as _}from"../../vendor/vendor.js";import"../scb-button/scb-button.js";import"../scb-menu/scb-menu.js";import"../../vendor/vendor-material.js";import"../scb-menu/scb-menu-item.js";import"../scb-divider/scb-divider.js";import"../scb-menu/scb-sub-menu.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(n,s,i){try{customElements.get(n)||t(n,s,i)}catch(d){var l=String(d||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var y=Object.defineProperty,g=Object.getOwnPropertyDescriptor,a=(e,t,n,s)=>{for(var i=s>1?void 0:s?g(t,n):t,l=e.length-1,d;l>=0;l--)(d=e[l])&&(i=(s?d(t,n,i):d(i))||i);return s&&i&&y(t,n,i),i};let r=class extends f{constructor(){super(...arguments),this.label="Dropdown",this.variant="filled",this.open=!1,this.disabled=!1,this.menuGap="3",this.width=null,this.maxWidth=null,this._slottedMenuEl=null,this._openSettledTimer=null,this._menuCloseTimer=null,this._panelResizeObserver=null,this._panelHeightSyncRaf=null,this._onDocumentClickBound=e=>{if(!this.open)return;const t=e.composedPath(),n=t.find(s=>s instanceof HTMLElement&&s.tagName.toLowerCase()==="scb-dropdown");if(n&&n!==this){this.open=!1;return}t.includes(this)||(this.open=!1)},this._onDocumentKeydownBound=e=>{this.open&&e.key==="Escape"&&(this.open=!1)},this._onSlottedMenuOpen=()=>{this.open||(this.open=!0)},this._onSlottedMenuClose=()=>{this.open&&(this.open=!1)},this._onSlotChange=()=>{this._syncSlottedMenu(),this._applyPanelSizing(),this._applyInertByOpen(),this.requestUpdate()},this._onTriggerClick=e=>{e.stopPropagation(),!this.disabled&&(this.open=!this.open)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onDocumentClickBound,!0),document.addEventListener("keydown",this._onDocumentKeydownBound)}disconnectedCallback(){document.removeEventListener("click",this._onDocumentClickBound,!0),document.removeEventListener("keydown",this._onDocumentKeydownBound),this._detachSlottedMenuListeners(),this._panelResizeObserver&&(this._panelResizeObserver.disconnect(),this._panelResizeObserver=null),this._panelHeightSyncRaf!==null&&(window.cancelAnimationFrame(this._panelHeightSyncRaf),this._panelHeightSyncRaf=null),this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),super.disconnectedCallback()}firstUpdated(e){super.firstUpdated(e),this._syncSlottedMenu(),this._applyPanelVars(),this._applyPanelSizing(),this._applyChevronState(),this._applyInertByOpen(),this._setupPanelResizeObserver(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen()}updated(e){super.updated(e),e.has("menuGap")&&this._applyPanelVars(),(e.has("width")||e.has("maxWidth"))&&this._applyPanelSizing(),e.has("open")&&(this.open||this._closeAllSubMenus(),this._syncSlottedMenuOpen(),this._applyChevronState(),this._applyInertByOpen(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen())}_applyPanelVars(){if(this.menuGap==null||String(this.menuGap).trim()===""){this.style.removeProperty("--scb-dropdown-panel-gap");return}this.style.setProperty("--scb-dropdown-panel-gap",this._mapSpacingToken(this.menuGap))}_applyPanelSizing(){const e=this.renderRoot.querySelector(".panel-surface");e&&(this.width&&String(this.width).trim()!==""?e.style.inlineSize=this.width:e.style.removeProperty("inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?e.style.maxInlineSize=this.maxWidth:e.style.removeProperty("max-inline-size")),this._slottedMenuEl&&(this.width&&String(this.width).trim()!==""?this._slottedMenuEl.style.inlineSize=this.width:this._slottedMenuEl.style.removeProperty("inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?this._slottedMenuEl.style.maxInlineSize=this.maxWidth:this._slottedMenuEl.style.removeProperty("max-inline-size")),this._schedulePanelHeightSync()}_setupPanelResizeObserver(){if(this._panelResizeObserver||typeof ResizeObserver>"u")return;const e=this._panelInnerEl;e&&(this._panelResizeObserver=new ResizeObserver(()=>{this._schedulePanelHeightSync()}),this._panelResizeObserver.observe(e))}_schedulePanelHeightSync(){this._panelHeightSyncRaf===null&&(this._panelHeightSyncRaf=window.requestAnimationFrame(()=>{this._panelHeightSyncRaf=null,this._syncPanelMaxHeightByOpen()}))}_syncPanelMaxHeightByOpen(){const e=this._panelSurfaceEl;if(!e)return;if(this._slottedMenuEl){e.style.removeProperty("--scb-dropdown-panel-current-max-height");return}if(!this.open){e.style.setProperty("--scb-dropdown-panel-current-max-height","0px");return}const t=this._panelInnerEl;if(!t)return;const n=`${Math.ceil(t.scrollHeight)}px`;e.style.getPropertyValue("--scb-dropdown-panel-current-max-height").trim()!==n&&e.style.setProperty("--scb-dropdown-panel-current-max-height",n)}_mapSpacingToken(e){const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_syncSlottedMenu(){const t=(this._slotEl?.assignedElements({flatten:!0})??[]).find(n=>n.tagName.toLowerCase()==="scb-menu");if(t===this._slottedMenuEl){this._syncSlottedMenuOpen();return}this._detachSlottedMenuListeners(),this._slottedMenuEl=t??null,this._slottedMenuEl&&(this._slottedMenuEl.addEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.addEventListener("close",this._onSlottedMenuClose),this._syncSlottedMenuOpen())}_detachSlottedMenuListeners(){this._slottedMenuEl&&(this._slottedMenuEl.removeEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.removeEventListener("close",this._onSlottedMenuClose))}_syncSlottedMenuOpen(){if(!this._slottedMenuEl)return;if(this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),this.open){this._slottedMenuEl.open=!0;return}const e=this._getPanelTransitionMs();if(e<=0){this._slottedMenuEl.open=!1;return}this._menuCloseTimer=window.setTimeout(()=>{this._menuCloseTimer=null,!this.open&&this._slottedMenuEl&&(this._slottedMenuEl.open=!1)},e)}_syncOverflowVisibilityByOpen(){if(this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this.removeAttribute("data-open-settled"),!this.open)return;const e=this.renderRoot.querySelector(".panel-surface");if(!e){this.setAttribute("data-open-settled","");return}const t=this._getTransitionMs(e);if(t<=0){this.setAttribute("data-open-settled","");return}this._openSettledTimer=window.setTimeout(()=>{this._openSettledTimer=null,this.open&&this.setAttribute("data-open-settled","")},t)}_getPanelTransitionMs(){const e=this.renderRoot.querySelector(".panel-surface");return e?this._getTransitionMs(e):0}_getTransitionMs(e){const t=getComputedStyle(e),n=t.transitionDuration.split(",").map(o=>o.trim()),s=t.transitionDelay.split(",").map(o=>o.trim()),i=o=>{const u=parseFloat(o);return Number.isFinite(u)?o.endsWith("ms")?u:o.endsWith("s")?u*1e3:u:0},l=Math.max(n.length,s.length);let d=0;for(let o=0;o<l;o+=1){const u=i(n[o]??n[n.length-1]??"0s"),c=i(s[o]??s[s.length-1]??"0s");d=Math.max(d,u+c)}return Math.ceil(d)}_applyInertByOpen(){const e=this.renderRoot.querySelector(".panel");e&&(this.open?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false"),this._restoreTabIndexesIfNeeded()):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true"),this._removeTabIndexesIfNeeded()))}_supportsInert(){return"inert"in HTMLElement.prototype}_collectFocusableFromSlot(){const e=this._slotEl;if(!e)return[];const t=e.assignedElements({flatten:!0}),n=[],s=i=>{i instanceof HTMLElement&&i.matches("a,button,input,select,textarea,[tabindex]")&&n.push(i)};return t.forEach(i=>{s(i),i.querySelectorAll?.("a,button,input,select,textarea,[tabindex]").forEach(l=>s(l))}),n}_removeTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("tabindex");n!==null&&t.setAttribute("data-scb-prev-tabindex",n),t.setAttribute("tabindex","-1")})}_restoreTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("data-scb-prev-tabindex");n!==null?(t.setAttribute("tabindex",n),t.removeAttribute("data-scb-prev-tabindex")):t.removeAttribute("tabindex")})}_closeAllSubMenus(){const e=this.querySelectorAll("scb-sub-menu");for(const t of e)t.removeAttribute("open")}_applyChevronState(){const e=this._getChevronIconEl();e&&(e.style.transition="transform var(--motion-duration-medium, 200ms) var(--motion-easing-standard, ease)",e.style.transformOrigin="center",e.style.transform=this.open?"rotate(180deg)":"rotate(0deg)")}_getChevronIconEl(){const t=this._triggerEl?.shadowRoot;return t?t.querySelector('md-icon[slot="icon"]')??t.querySelector("md-icon"):null}render(){const e=!!this._slottedMenuEl;return b`
1
+ import{a as m,n as p,e as u,i as f,x as b,t as _}from"../../vendor/vendor.js";import"../scb-button/scb-button.js";import"../scb-menu/scb-menu.js";import"../../vendor/vendor-material.js";import"../scb-menu/scb-menu-item.js";import"../scb-divider/scb-divider.js";import"../scb-menu/scb-sub-menu.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(n,s,i){try{customElements.get(n)||t(n,s,i)}catch(d){var l=String(d||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var y=Object.defineProperty,g=Object.getOwnPropertyDescriptor,o=(e,t,n,s)=>{for(var i=s>1?void 0:s?g(t,n):t,l=e.length-1,d;l>=0;l--)(d=e[l])&&(i=(s?d(t,n,i):d(i))||i);return s&&i&&y(t,n,i),i};let r=class extends f{constructor(){super(...arguments),this.label="Dropdown",this.variant="filled",this.open=!1,this.disabled=!1,this.menuGap="3",this.width=null,this.minWidth=null,this.maxWidth=null,this._slottedMenuEl=null,this._openSettledTimer=null,this._menuCloseTimer=null,this._panelResizeObserver=null,this._panelHeightSyncRaf=null,this._onDocumentClickBound=e=>{if(!this.open)return;const t=e.composedPath(),n=t.find(s=>s instanceof HTMLElement&&s.tagName.toLowerCase()==="scb-dropdown");if(n&&n!==this){this.open=!1;return}t.includes(this)||(this.open=!1)},this._onDocumentKeydownBound=e=>{this.open&&e.key==="Escape"&&(this.open=!1)},this._onSlottedMenuOpen=()=>{this.open||(this.open=!0)},this._onSlottedMenuClose=()=>{this.open&&(this.open=!1)},this._onSlotChange=()=>{this._syncSlottedMenu(),this._applyPanelSizing(),this._applyInertByOpen(),this.requestUpdate()},this._onTriggerClick=e=>{e.stopPropagation(),!this.disabled&&(this.open=!this.open)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onDocumentClickBound,!0),document.addEventListener("keydown",this._onDocumentKeydownBound)}disconnectedCallback(){document.removeEventListener("click",this._onDocumentClickBound,!0),document.removeEventListener("keydown",this._onDocumentKeydownBound),this._detachSlottedMenuListeners(),this._panelResizeObserver&&(this._panelResizeObserver.disconnect(),this._panelResizeObserver=null),this._panelHeightSyncRaf!==null&&(window.cancelAnimationFrame(this._panelHeightSyncRaf),this._panelHeightSyncRaf=null),this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),super.disconnectedCallback()}firstUpdated(e){super.firstUpdated(e),this._syncSlottedMenu(),this._applyPanelVars(),this._applyPanelSizing(),this._applyChevronState(),this._applyInertByOpen(),this._setupPanelResizeObserver(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen()}updated(e){super.updated(e),e.has("menuGap")&&this._applyPanelVars(),(e.has("width")||e.has("minWidth")||e.has("maxWidth"))&&this._applyPanelSizing(),e.has("open")&&(this.open||this._closeAllSubMenus(),this._syncSlottedMenuOpen(),this._applyChevronState(),this._applyInertByOpen(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen())}_applyPanelVars(){if(this.menuGap==null||String(this.menuGap).trim()===""){this.style.removeProperty("--scb-dropdown-panel-gap");return}this.style.setProperty("--scb-dropdown-panel-gap",this._mapSpacingToken(this.menuGap))}_applyPanelSizing(){const e=this.renderRoot.querySelector(".panel-surface");e&&(this.width&&String(this.width).trim()!==""?e.style.inlineSize=this.width:e.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?e.style.minInlineSize=this.minWidth:e.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?e.style.maxInlineSize=this.maxWidth:e.style.removeProperty("max-inline-size")),this._slottedMenuEl&&(this.width&&String(this.width).trim()!==""?this._slottedMenuEl.style.inlineSize=this.width:this._slottedMenuEl.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?this._slottedMenuEl.style.minInlineSize=this.minWidth:this._slottedMenuEl.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?this._slottedMenuEl.style.maxInlineSize=this.maxWidth:this._slottedMenuEl.style.removeProperty("max-inline-size")),this._schedulePanelHeightSync()}_setupPanelResizeObserver(){if(this._panelResizeObserver||typeof ResizeObserver>"u")return;const e=this._panelInnerEl;e&&(this._panelResizeObserver=new ResizeObserver(()=>{this._schedulePanelHeightSync()}),this._panelResizeObserver.observe(e))}_schedulePanelHeightSync(){this._panelHeightSyncRaf===null&&(this._panelHeightSyncRaf=window.requestAnimationFrame(()=>{this._panelHeightSyncRaf=null,this._syncPanelMaxHeightByOpen()}))}_syncPanelMaxHeightByOpen(){const e=this._panelSurfaceEl;if(!e)return;if(this._slottedMenuEl){e.style.removeProperty("--scb-dropdown-panel-current-max-height");return}if(!this.open){e.style.setProperty("--scb-dropdown-panel-current-max-height","0px");return}const t=this._panelInnerEl;if(!t)return;const n=`${Math.ceil(t.scrollHeight)}px`;e.style.getPropertyValue("--scb-dropdown-panel-current-max-height").trim()!==n&&e.style.setProperty("--scb-dropdown-panel-current-max-height",n)}_mapSpacingToken(e){const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_syncSlottedMenu(){const t=(this._slotEl?.assignedElements({flatten:!0})??[]).find(n=>n.tagName.toLowerCase()==="scb-menu");if(t===this._slottedMenuEl){this._syncSlottedMenuOpen();return}this._detachSlottedMenuListeners(),this._slottedMenuEl=t??null,this._slottedMenuEl&&(this._slottedMenuEl.addEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.addEventListener("close",this._onSlottedMenuClose),this._syncSlottedMenuOpen())}_detachSlottedMenuListeners(){this._slottedMenuEl&&(this._slottedMenuEl.removeEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.removeEventListener("close",this._onSlottedMenuClose))}_syncSlottedMenuOpen(){if(!this._slottedMenuEl)return;if(this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),this.open){this._slottedMenuEl.open=!0;return}const e=this._getPanelTransitionMs();if(e<=0){this._slottedMenuEl.open=!1;return}this._menuCloseTimer=window.setTimeout(()=>{this._menuCloseTimer=null,!this.open&&this._slottedMenuEl&&(this._slottedMenuEl.open=!1)},e)}_syncOverflowVisibilityByOpen(){if(this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this.removeAttribute("data-open-settled"),!this.open)return;const e=this.renderRoot.querySelector(".panel-surface");if(!e){this.setAttribute("data-open-settled","");return}const t=this._getTransitionMs(e);if(t<=0){this.setAttribute("data-open-settled","");return}this._openSettledTimer=window.setTimeout(()=>{this._openSettledTimer=null,this.open&&this.setAttribute("data-open-settled","")},t)}_getPanelTransitionMs(){const e=this.renderRoot.querySelector(".panel-surface");return e?this._getTransitionMs(e):0}_getTransitionMs(e){const t=getComputedStyle(e),n=t.transitionDuration.split(",").map(a=>a.trim()),s=t.transitionDelay.split(",").map(a=>a.trim()),i=a=>{const h=parseFloat(a);return Number.isFinite(h)?a.endsWith("ms")?h:a.endsWith("s")?h*1e3:h:0},l=Math.max(n.length,s.length);let d=0;for(let a=0;a<l;a+=1){const h=i(n[a]??n[n.length-1]??"0s"),c=i(s[a]??s[s.length-1]??"0s");d=Math.max(d,h+c)}return Math.ceil(d)}_applyInertByOpen(){const e=this.renderRoot.querySelector(".panel");e&&(this.open?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false"),this._restoreTabIndexesIfNeeded()):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true"),this._removeTabIndexesIfNeeded()))}_supportsInert(){return"inert"in HTMLElement.prototype}_collectFocusableFromSlot(){const e=this._slotEl;if(!e)return[];const t=e.assignedElements({flatten:!0}),n=[],s=i=>{i instanceof HTMLElement&&i.matches("a,button,input,select,textarea,[tabindex]")&&n.push(i)};return t.forEach(i=>{s(i),i.querySelectorAll?.("a,button,input,select,textarea,[tabindex]").forEach(l=>s(l))}),n}_removeTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("tabindex");n!==null&&t.setAttribute("data-scb-prev-tabindex",n),t.setAttribute("tabindex","-1")})}_restoreTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("data-scb-prev-tabindex");n!==null?(t.setAttribute("tabindex",n),t.removeAttribute("data-scb-prev-tabindex")):t.removeAttribute("tabindex")})}_closeAllSubMenus(){const e=this.querySelectorAll("scb-sub-menu");for(const t of e)t.removeAttribute("open")}_applyChevronState(){const e=this._getChevronIconEl();e&&(e.style.transition="transform var(--motion-duration-medium, 200ms) var(--motion-easing-standard, ease)",e.style.transformOrigin="center",e.style.transform=this.open?"rotate(180deg)":"rotate(0deg)")}_getChevronIconEl(){const t=this._triggerEl?.shadowRoot;return t?t.querySelector('md-icon[slot="icon"]')??t.querySelector("md-icon"):null}render(){const e=!!this._slottedMenuEl;return b`
2
2
  <scb-button
3
3
  label=${this.label}
4
4
  variant=${this.variant}
@@ -189,4 +189,4 @@ import{a as m,n as p,e as h,i as f,x as b,t as _}from"../../vendor/vendor.js";im
189
189
  transition: none;
190
190
  }
191
191
  }
192
- `;a([p({type:String})],r.prototype,"label",2);a([p({type:String})],r.prototype,"variant",2);a([p({type:Boolean,reflect:!0})],r.prototype,"open",2);a([p({type:Boolean,reflect:!0})],r.prototype,"disabled",2);a([p({type:String,attribute:"menu-gap"})],r.prototype,"menuGap",2);a([p({type:String})],r.prototype,"width",2);a([p({type:String,attribute:"max-width"})],r.prototype,"maxWidth",2);a([h("scb-button")],r.prototype,"_triggerEl",2);a([h("slot")],r.prototype,"_slotEl",2);a([h(".panel-surface")],r.prototype,"_panelSurfaceEl",2);a([h(".panel-inner")],r.prototype,"_panelInnerEl",2);r=a([_("scb-dropdown")],r);
192
+ `;o([p({type:String})],r.prototype,"label",2);o([p({type:String})],r.prototype,"variant",2);o([p({type:Boolean,reflect:!0})],r.prototype,"open",2);o([p({type:Boolean,reflect:!0})],r.prototype,"disabled",2);o([p({type:String,attribute:"menu-gap"})],r.prototype,"menuGap",2);o([p({type:String})],r.prototype,"width",2);o([p({type:String,attribute:"min-width"})],r.prototype,"minWidth",2);o([p({type:String,attribute:"max-width"})],r.prototype,"maxWidth",2);o([u("scb-button")],r.prototype,"_triggerEl",2);o([u("slot")],r.prototype,"_slotEl",2);o([u(".panel-surface")],r.prototype,"_panelSurfaceEl",2);o([u(".panel-inner")],r.prototype,"_panelInnerEl",2);r=o([_("scb-dropdown")],r);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc-test",
3
- "version": "0.1.153",
3
+ "version": "0.1.154",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -369,5 +369,5 @@
369
369
  },
370
370
  "./mvc/*": "./mvc/*"
371
371
  },
372
- "buildHash": "3339C632769BEB71CE51BC4892C293BABF70F30CDF7436089E0CBA44ECB3BEC2"
372
+ "buildHash": "8F2265D05CE112647490E37AE15B28D8FEFC821C6867A263F7B351300F5E3A9F"
373
373
  }
@@ -8,6 +8,7 @@ export declare class ScbDropdown extends LitElement {
8
8
  disabled: boolean;
9
9
  menuGap: string | null;
10
10
  width: string | null;
11
+ minWidth: string | null;
11
12
  maxWidth: string | null;
12
13
  private _triggerEl;
13
14
  private _slotEl;
@@ -2,17 +2,17 @@ import { css as m, LitElement as f, html as b } from "lit";
2
2
  import { property as d, query as u, customElement as y } from "lit/decorators.js";
3
3
  import "../scb-button/scb-button.js";
4
4
  import "../scb-menu/scb-menu.js";
5
- var _ = Object.defineProperty, g = Object.getOwnPropertyDescriptor, a = (e, t, n, i) => {
6
- for (var s = i > 1 ? void 0 : i ? g(t, n) : t, p = e.length - 1, l; p >= 0; p--)
7
- (l = e[p]) && (s = (i ? l(t, n, s) : l(s)) || s);
8
- return i && s && _(t, n, s), s;
5
+ var _ = Object.defineProperty, g = Object.getOwnPropertyDescriptor, o = (e, t, n, s) => {
6
+ for (var i = s > 1 ? void 0 : s ? g(t, n) : t, p = e.length - 1, l; p >= 0; p--)
7
+ (l = e[p]) && (i = (s ? l(t, n, i) : l(i)) || i);
8
+ return s && i && _(t, n, i), i;
9
9
  };
10
10
  let r = class extends f {
11
11
  constructor() {
12
- super(...arguments), this.label = "Dropdown", this.variant = "filled", this.open = !1, this.disabled = !1, this.menuGap = "3", this.width = null, this.maxWidth = null, this._slottedMenuEl = null, this._openSettledTimer = null, this._menuCloseTimer = null, this._panelResizeObserver = null, this._panelHeightSyncRaf = null, this._onDocumentClickBound = (e) => {
12
+ super(...arguments), this.label = "Dropdown", this.variant = "filled", this.open = !1, this.disabled = !1, this.menuGap = "3", this.width = null, this.minWidth = null, this.maxWidth = null, this._slottedMenuEl = null, this._openSettledTimer = null, this._menuCloseTimer = null, this._panelResizeObserver = null, this._panelHeightSyncRaf = null, this._onDocumentClickBound = (e) => {
13
13
  if (!this.open) return;
14
14
  const t = e.composedPath(), n = t.find(
15
- (i) => i instanceof HTMLElement && i.tagName.toLowerCase() === "scb-dropdown"
15
+ (s) => s instanceof HTMLElement && s.tagName.toLowerCase() === "scb-dropdown"
16
16
  );
17
17
  if (n && n !== this) {
18
18
  this.open = !1;
@@ -41,7 +41,7 @@ let r = class extends f {
41
41
  super.firstUpdated(e), this._syncSlottedMenu(), this._applyPanelVars(), this._applyPanelSizing(), this._applyChevronState(), this._applyInertByOpen(), this._setupPanelResizeObserver(), this._syncPanelMaxHeightByOpen(), this._syncOverflowVisibilityByOpen();
42
42
  }
43
43
  updated(e) {
44
- super.updated(e), e.has("menuGap") && this._applyPanelVars(), (e.has("width") || e.has("maxWidth")) && this._applyPanelSizing(), e.has("open") && (this.open || this._closeAllSubMenus(), this._syncSlottedMenuOpen(), this._applyChevronState(), this._applyInertByOpen(), this._syncPanelMaxHeightByOpen(), this._syncOverflowVisibilityByOpen());
44
+ super.updated(e), e.has("menuGap") && this._applyPanelVars(), (e.has("width") || e.has("minWidth") || e.has("maxWidth")) && this._applyPanelSizing(), e.has("open") && (this.open || this._closeAllSubMenus(), this._syncSlottedMenuOpen(), this._applyChevronState(), this._applyInertByOpen(), this._syncPanelMaxHeightByOpen(), this._syncOverflowVisibilityByOpen());
45
45
  }
46
46
  _applyPanelVars() {
47
47
  if (this.menuGap == null || String(this.menuGap).trim() === "") {
@@ -52,7 +52,7 @@ let r = class extends f {
52
52
  }
53
53
  _applyPanelSizing() {
54
54
  const e = this.renderRoot.querySelector(".panel-surface");
55
- e && (this.width && String(this.width).trim() !== "" ? e.style.inlineSize = this.width : e.style.removeProperty("inline-size"), this.maxWidth && String(this.maxWidth).trim() !== "" ? e.style.maxInlineSize = this.maxWidth : e.style.removeProperty("max-inline-size")), this._slottedMenuEl && (this.width && String(this.width).trim() !== "" ? this._slottedMenuEl.style.inlineSize = this.width : this._slottedMenuEl.style.removeProperty("inline-size"), this.maxWidth && String(this.maxWidth).trim() !== "" ? this._slottedMenuEl.style.maxInlineSize = this.maxWidth : this._slottedMenuEl.style.removeProperty("max-inline-size")), this._schedulePanelHeightSync();
55
+ e && (this.width && String(this.width).trim() !== "" ? e.style.inlineSize = this.width : e.style.removeProperty("inline-size"), this.minWidth && String(this.minWidth).trim() !== "" ? e.style.minInlineSize = this.minWidth : e.style.removeProperty("min-inline-size"), this.maxWidth && String(this.maxWidth).trim() !== "" ? e.style.maxInlineSize = this.maxWidth : e.style.removeProperty("max-inline-size")), this._slottedMenuEl && (this.width && String(this.width).trim() !== "" ? this._slottedMenuEl.style.inlineSize = this.width : this._slottedMenuEl.style.removeProperty("inline-size"), this.minWidth && String(this.minWidth).trim() !== "" ? this._slottedMenuEl.style.minInlineSize = this.minWidth : this._slottedMenuEl.style.removeProperty("min-inline-size"), this.maxWidth && String(this.maxWidth).trim() !== "" ? this._slottedMenuEl.style.maxInlineSize = this.maxWidth : this._slottedMenuEl.style.removeProperty("max-inline-size")), this._schedulePanelHeightSync();
56
56
  }
57
57
  _setupPanelResizeObserver() {
58
58
  if (this._panelResizeObserver || typeof ResizeObserver > "u") return;
@@ -88,7 +88,7 @@ let r = class extends f {
88
88
  }
89
89
  _syncSlottedMenu() {
90
90
  var n;
91
- const t = (((n = this._slotEl) == null ? void 0 : n.assignedElements({ flatten: !0 })) ?? []).find((i) => i.tagName.toLowerCase() === "scb-menu");
91
+ const t = (((n = this._slotEl) == null ? void 0 : n.assignedElements({ flatten: !0 })) ?? []).find((s) => s.tagName.toLowerCase() === "scb-menu");
92
92
  if (t === this._slottedMenuEl) {
93
93
  this._syncSlottedMenuOpen();
94
94
  return;
@@ -134,13 +134,13 @@ let r = class extends f {
134
134
  return e ? this._getTransitionMs(e) : 0;
135
135
  }
136
136
  _getTransitionMs(e) {
137
- const t = getComputedStyle(e), n = t.transitionDuration.split(",").map((o) => o.trim()), i = t.transitionDelay.split(",").map((o) => o.trim()), s = (o) => {
138
- const h = parseFloat(o);
139
- return Number.isFinite(h) ? o.endsWith("ms") ? h : o.endsWith("s") ? h * 1e3 : h : 0;
140
- }, p = Math.max(n.length, i.length);
137
+ const t = getComputedStyle(e), n = t.transitionDuration.split(",").map((a) => a.trim()), s = t.transitionDelay.split(",").map((a) => a.trim()), i = (a) => {
138
+ const h = parseFloat(a);
139
+ return Number.isFinite(h) ? a.endsWith("ms") ? h : a.endsWith("s") ? h * 1e3 : h : 0;
140
+ }, p = Math.max(n.length, s.length);
141
141
  let l = 0;
142
- for (let o = 0; o < p; o += 1) {
143
- const h = s(n[o] ?? n[n.length - 1] ?? "0s"), c = s(i[o] ?? i[i.length - 1] ?? "0s");
142
+ for (let a = 0; a < p; a += 1) {
143
+ const h = i(n[a] ?? n[n.length - 1] ?? "0s"), c = i(s[a] ?? s[s.length - 1] ?? "0s");
144
144
  l = Math.max(l, h + c);
145
145
  }
146
146
  return Math.ceil(l);
@@ -155,12 +155,12 @@ let r = class extends f {
155
155
  _collectFocusableFromSlot() {
156
156
  const e = this._slotEl;
157
157
  if (!e) return [];
158
- const t = e.assignedElements({ flatten: !0 }), n = [], i = (s) => {
159
- s instanceof HTMLElement && s.matches("a,button,input,select,textarea,[tabindex]") && n.push(s);
158
+ const t = e.assignedElements({ flatten: !0 }), n = [], s = (i) => {
159
+ i instanceof HTMLElement && i.matches("a,button,input,select,textarea,[tabindex]") && n.push(i);
160
160
  };
161
- return t.forEach((s) => {
161
+ return t.forEach((i) => {
162
162
  var p;
163
- i(s), (p = s.querySelectorAll) == null || p.call(s, "a,button,input,select,textarea,[tabindex]").forEach((l) => i(l));
163
+ s(i), (p = i.querySelectorAll) == null || p.call(i, "a,button,input,select,textarea,[tabindex]").forEach((l) => s(l));
164
164
  }), n;
165
165
  }
166
166
  _removeTabIndexesIfNeeded() {
@@ -387,40 +387,43 @@ r.styles = m`
387
387
  }
388
388
  }
389
389
  `;
390
- a([
390
+ o([
391
391
  d({ type: String })
392
392
  ], r.prototype, "label", 2);
393
- a([
393
+ o([
394
394
  d({ type: String })
395
395
  ], r.prototype, "variant", 2);
396
- a([
396
+ o([
397
397
  d({ type: Boolean, reflect: !0 })
398
398
  ], r.prototype, "open", 2);
399
- a([
399
+ o([
400
400
  d({ type: Boolean, reflect: !0 })
401
401
  ], r.prototype, "disabled", 2);
402
- a([
402
+ o([
403
403
  d({ type: String, attribute: "menu-gap" })
404
404
  ], r.prototype, "menuGap", 2);
405
- a([
405
+ o([
406
406
  d({ type: String })
407
407
  ], r.prototype, "width", 2);
408
- a([
408
+ o([
409
+ d({ type: String, attribute: "min-width" })
410
+ ], r.prototype, "minWidth", 2);
411
+ o([
409
412
  d({ type: String, attribute: "max-width" })
410
413
  ], r.prototype, "maxWidth", 2);
411
- a([
414
+ o([
412
415
  u("scb-button")
413
416
  ], r.prototype, "_triggerEl", 2);
414
- a([
417
+ o([
415
418
  u("slot")
416
419
  ], r.prototype, "_slotEl", 2);
417
- a([
420
+ o([
418
421
  u(".panel-surface")
419
422
  ], r.prototype, "_panelSurfaceEl", 2);
420
- a([
423
+ o([
421
424
  u(".panel-inner")
422
425
  ], r.prototype, "_panelInnerEl", 2);
423
- r = a([
426
+ r = o([
424
427
  y("scb-dropdown")
425
428
  ], r);
426
429
  export {
@@ -48,11 +48,11 @@ var ScbWcTest=function(a){"use strict";var Bl;function p(o,e,t,i){var r=argument
48
48
  * SPDX-License-Identifier: BSD-3-Clause
49
49
  */const gi=globalThis,lr=gi.trustedTypes,Es=lr?lr.createPolicy("lit-html",{createHTML:o=>o}):void 0,Ts="$lit$",dt=`lit$${Math.random().toFixed(9).slice(2)}$`,As="?"+dt,Jl=`<${As}>`,wt=document,yi=()=>wt.createComment(""),_i=o=>o===null||typeof o!="object"&&typeof o!="function",Oo=Array.isArray,Ql=o=>Oo(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",Do=`[
50
50
  \f\r]`,xi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Is=/-->/g,zs=/>/g,St=RegExp(`>|${Do}(?:([^\\s"'>=/]+)(${Do}*=${Do}*(?:[^
51
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Os=/'/g,Ds=/"/g,Ps=/^(?:script|style|textarea|title)$/i,ec=o=>(e,...t)=>({_$litType$:o,strings:e,values:t}),c=ec(1),we=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),Ls=new WeakMap,kt=wt.createTreeWalker(wt,129);function Rs(o,e){if(!Oo(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Es!==void 0?Es.createHTML(e):e}const tc=(o,e)=>{const t=o.length-1,i=[];let r,s=e===2?"<svg>":e===3?"<math>":"",n=xi;for(let d=0;d<t;d++){const h=o[d];let u,m,b=-1,x=0;for(;x<h.length&&(n.lastIndex=x,m=n.exec(h),m!==null);)x=n.lastIndex,n===xi?m[1]==="!--"?n=Is:m[1]!==void 0?n=zs:m[2]!==void 0?(Ps.test(m[2])&&(r=RegExp("</"+m[2],"g")),n=St):m[3]!==void 0&&(n=St):n===St?m[0]===">"?(n=r??xi,b=-1):m[1]===void 0?b=-2:(b=n.lastIndex-m[2].length,u=m[1],n=m[3]===void 0?St:m[3]==='"'?Ds:Os):n===Ds||n===Os?n=St:n===Is||n===zs?n=xi:(n=St,r=void 0);const g=n===St&&o[d+1].startsWith("/>")?" ":"";s+=n===xi?h+Jl:b>=0?(i.push(u),h.slice(0,b)+Ts+h.slice(b)+dt+g):h+dt+(b===-2?d:g)}return[Rs(o,s+(o[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class wi{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,n=0;const d=e.length-1,h=this.parts,[u,m]=tc(e,t);if(this.el=wi.createElement(u,i),kt.currentNode=this.el.content,t===2||t===3){const b=this.el.content.firstChild;b.replaceWith(...b.childNodes)}for(;(r=kt.nextNode())!==null&&h.length<d;){if(r.nodeType===1){if(r.hasAttributes())for(const b of r.getAttributeNames())if(b.endsWith(Ts)){const x=m[n++],g=r.getAttribute(b).split(dt),w=/([.?@])?(.*)/.exec(x);h.push({type:1,index:s,name:w[2],strings:g,ctor:w[1]==="."?rc:w[1]==="?"?oc:w[1]==="@"?ac:cr}),r.removeAttribute(b)}else b.startsWith(dt)&&(h.push({type:6,index:s}),r.removeAttribute(b));if(Ps.test(r.tagName)){const b=r.textContent.split(dt),x=b.length-1;if(x>0){r.textContent=lr?lr.emptyScript:"";for(let g=0;g<x;g++)r.append(b[g],yi()),kt.nextNode(),h.push({type:2,index:++s});r.append(b[x],yi())}}}else if(r.nodeType===8)if(r.data===As)h.push({type:2,index:s});else{let b=-1;for(;(b=r.data.indexOf(dt,b+1))!==-1;)h.push({type:7,index:s}),b+=dt.length-1}s++}}static createElement(e,t){const i=wt.createElement("template");return i.innerHTML=e,i}}function Zt(o,e,t=o,i){var n,d;if(e===we)return e;let r=i!==void 0?(n=t._$Co)==null?void 0:n[i]:t._$Cl;const s=_i(e)?void 0:e._$litDirective$;return(r==null?void 0:r.constructor)!==s&&((d=r==null?void 0:r._$AO)==null||d.call(r,!1),s===void 0?r=void 0:(r=new s(o),r._$AT(o,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=r:t._$Cl=r),r!==void 0&&(e=Zt(o,r._$AS(o,e.values),r,i)),e}class ic{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,r=((e==null?void 0:e.creationScope)??wt).importNode(t,!0);kt.currentNode=r;let s=kt.nextNode(),n=0,d=0,h=i[0];for(;h!==void 0;){if(n===h.index){let u;h.type===2?u=new Si(s,s.nextSibling,this,e):h.type===1?u=new h.ctor(s,h.name,h.strings,this,e):h.type===6&&(u=new sc(s,this,e)),this._$AV.push(u),h=i[++d]}n!==(h==null?void 0:h.index)&&(s=kt.nextNode(),n++)}return kt.currentNode=wt,r}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Si{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=v,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Zt(this,e,t),_i(e)?e===v||e==null||e===""?(this._$AH!==v&&this._$AR(),this._$AH=v):e!==this._$AH&&e!==we&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ql(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==v&&_i(this._$AH)?this._$AA.nextSibling.data=e:this.T(wt.createTextNode(e)),this._$AH=e}$(e){var s;const{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=wi.createElement(Rs(i.h,i.h[0]),this.options)),i);if(((s=this._$AH)==null?void 0:s._$AD)===r)this._$AH.p(t);else{const n=new ic(r,this),d=n.u(this.options);n.p(t),this.T(d),this._$AH=n}}_$AC(e){let t=Ls.get(e.strings);return t===void 0&&Ls.set(e.strings,t=new wi(e)),t}k(e){Oo(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,r=0;for(const s of e)r===t.length?t.push(i=new Si(this.O(yi()),this.O(yi()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class cr{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=v,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=v}_$AI(e,t=this,i,r){const s=this.strings;let n=!1;if(s===void 0)e=Zt(this,e,t,0),n=!_i(e)||e!==this._$AH&&e!==we,n&&(this._$AH=e);else{const d=e;let h,u;for(e=s[0],h=0;h<s.length-1;h++)u=Zt(this,d[i+h],t,h),u===we&&(u=this._$AH[h]),n||(n=!_i(u)||u!==this._$AH[h]),u===v?e=v:e!==v&&(e+=(u??"")+s[h+1]),this._$AH[h]=u}n&&!r&&this.j(e)}j(e){e===v?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class rc extends cr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===v?void 0:e}}class oc extends cr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==v)}}class ac extends cr{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Zt(this,e,t,0)??v)===we)return;const i=this._$AH,r=e===v&&i!==v||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==v&&(i===v||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class sc{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Zt(this,e)}}const Po=gi.litHtmlPolyfillSupport;Po==null||Po(wi,Si),(gi.litHtmlVersions??(gi.litHtmlVersions=[])).push("3.3.1");const Lo=(o,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let r=i._$litPart$;if(r===void 0){const s=(t==null?void 0:t.renderBefore)??null;i._$litPart$=r=new Si(e.insertBefore(yi(),s),s,void 0,t??{})}return r._$AI(o),r};/**
51
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Os=/'/g,Ds=/"/g,Ps=/^(?:script|style|textarea|title)$/i,ec=o=>(e,...t)=>({_$litType$:o,strings:e,values:t}),c=ec(1),Se=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),Ls=new WeakMap,kt=wt.createTreeWalker(wt,129);function Rs(o,e){if(!Oo(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Es!==void 0?Es.createHTML(e):e}const tc=(o,e)=>{const t=o.length-1,i=[];let r,s=e===2?"<svg>":e===3?"<math>":"",n=xi;for(let d=0;d<t;d++){const h=o[d];let u,m,b=-1,x=0;for(;x<h.length&&(n.lastIndex=x,m=n.exec(h),m!==null);)x=n.lastIndex,n===xi?m[1]==="!--"?n=Is:m[1]!==void 0?n=zs:m[2]!==void 0?(Ps.test(m[2])&&(r=RegExp("</"+m[2],"g")),n=St):m[3]!==void 0&&(n=St):n===St?m[0]===">"?(n=r??xi,b=-1):m[1]===void 0?b=-2:(b=n.lastIndex-m[2].length,u=m[1],n=m[3]===void 0?St:m[3]==='"'?Ds:Os):n===Ds||n===Os?n=St:n===Is||n===zs?n=xi:(n=St,r=void 0);const g=n===St&&o[d+1].startsWith("/>")?" ":"";s+=n===xi?h+Jl:b>=0?(i.push(u),h.slice(0,b)+Ts+h.slice(b)+dt+g):h+dt+(b===-2?d:g)}return[Rs(o,s+(o[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class wi{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,n=0;const d=e.length-1,h=this.parts,[u,m]=tc(e,t);if(this.el=wi.createElement(u,i),kt.currentNode=this.el.content,t===2||t===3){const b=this.el.content.firstChild;b.replaceWith(...b.childNodes)}for(;(r=kt.nextNode())!==null&&h.length<d;){if(r.nodeType===1){if(r.hasAttributes())for(const b of r.getAttributeNames())if(b.endsWith(Ts)){const x=m[n++],g=r.getAttribute(b).split(dt),w=/([.?@])?(.*)/.exec(x);h.push({type:1,index:s,name:w[2],strings:g,ctor:w[1]==="."?rc:w[1]==="?"?oc:w[1]==="@"?ac:cr}),r.removeAttribute(b)}else b.startsWith(dt)&&(h.push({type:6,index:s}),r.removeAttribute(b));if(Ps.test(r.tagName)){const b=r.textContent.split(dt),x=b.length-1;if(x>0){r.textContent=lr?lr.emptyScript:"";for(let g=0;g<x;g++)r.append(b[g],yi()),kt.nextNode(),h.push({type:2,index:++s});r.append(b[x],yi())}}}else if(r.nodeType===8)if(r.data===As)h.push({type:2,index:s});else{let b=-1;for(;(b=r.data.indexOf(dt,b+1))!==-1;)h.push({type:7,index:s}),b+=dt.length-1}s++}}static createElement(e,t){const i=wt.createElement("template");return i.innerHTML=e,i}}function Zt(o,e,t=o,i){var n,d;if(e===Se)return e;let r=i!==void 0?(n=t._$Co)==null?void 0:n[i]:t._$Cl;const s=_i(e)?void 0:e._$litDirective$;return(r==null?void 0:r.constructor)!==s&&((d=r==null?void 0:r._$AO)==null||d.call(r,!1),s===void 0?r=void 0:(r=new s(o),r._$AT(o,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=r:t._$Cl=r),r!==void 0&&(e=Zt(o,r._$AS(o,e.values),r,i)),e}class ic{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,r=((e==null?void 0:e.creationScope)??wt).importNode(t,!0);kt.currentNode=r;let s=kt.nextNode(),n=0,d=0,h=i[0];for(;h!==void 0;){if(n===h.index){let u;h.type===2?u=new Si(s,s.nextSibling,this,e):h.type===1?u=new h.ctor(s,h.name,h.strings,this,e):h.type===6&&(u=new sc(s,this,e)),this._$AV.push(u),h=i[++d]}n!==(h==null?void 0:h.index)&&(s=kt.nextNode(),n++)}return kt.currentNode=wt,r}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Si{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=v,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Zt(this,e,t),_i(e)?e===v||e==null||e===""?(this._$AH!==v&&this._$AR(),this._$AH=v):e!==this._$AH&&e!==Se&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ql(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==v&&_i(this._$AH)?this._$AA.nextSibling.data=e:this.T(wt.createTextNode(e)),this._$AH=e}$(e){var s;const{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=wi.createElement(Rs(i.h,i.h[0]),this.options)),i);if(((s=this._$AH)==null?void 0:s._$AD)===r)this._$AH.p(t);else{const n=new ic(r,this),d=n.u(this.options);n.p(t),this.T(d),this._$AH=n}}_$AC(e){let t=Ls.get(e.strings);return t===void 0&&Ls.set(e.strings,t=new wi(e)),t}k(e){Oo(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,r=0;for(const s of e)r===t.length?t.push(i=new Si(this.O(yi()),this.O(yi()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class cr{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=v,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=v}_$AI(e,t=this,i,r){const s=this.strings;let n=!1;if(s===void 0)e=Zt(this,e,t,0),n=!_i(e)||e!==this._$AH&&e!==Se,n&&(this._$AH=e);else{const d=e;let h,u;for(e=s[0],h=0;h<s.length-1;h++)u=Zt(this,d[i+h],t,h),u===Se&&(u=this._$AH[h]),n||(n=!_i(u)||u!==this._$AH[h]),u===v?e=v:e!==v&&(e+=(u??"")+s[h+1]),this._$AH[h]=u}n&&!r&&this.j(e)}j(e){e===v?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class rc extends cr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===v?void 0:e}}class oc extends cr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==v)}}class ac extends cr{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Zt(this,e,t,0)??v)===Se)return;const i=this._$AH,r=e===v&&i!==v||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==v&&(i===v||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class sc{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Zt(this,e)}}const Po=gi.litHtmlPolyfillSupport;Po==null||Po(wi,Si),(gi.litHtmlVersions??(gi.litHtmlVersions=[])).push("3.3.1");const Lo=(o,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let r=i._$litPart$;if(r===void 0){const s=(t==null?void 0:t.renderBefore)??null;i._$litPart$=r=new Si(e.insertBefore(yi(),s),s,void 0,t??{})}return r._$AI(o),r};/**
52
52
  * @license
53
53
  * Copyright 2017 Google LLC
54
54
  * SPDX-License-Identifier: BSD-3-Clause
55
- */const $t=globalThis;let _=class extends Xt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Lo(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return we}};_._$litElement$=!0,_.finalized=!0,(Bl=$t.litElementHydrateSupport)==null||Bl.call($t,{LitElement:_});const Ro=$t.litElementPolyfillSupport;Ro==null||Ro({LitElement:_}),($t.litElementVersions??($t.litElementVersions=[])).push("4.2.1");/**
55
+ */const $t=globalThis;let _=class extends Xt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Lo(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Se}};_._$litElement$=!0,_.finalized=!0,(Bl=$t.litElementHydrateSupport)==null||Bl.call($t,{LitElement:_});const Ro=$t.litElementPolyfillSupport;Ro==null||Ro({LitElement:_}),($t.litElementVersions??($t.litElementVersions=[])).push("4.2.1");/**
56
56
  * @license
57
57
  * Copyright 2022 Google LLC
58
58
  * SPDX-License-Identifier: Apache-2.0
@@ -90,7 +90,7 @@ var ScbWcTest=function(a){"use strict";var Bl;function p(o,e,t,i){var r=argument
90
90
  * @license
91
91
  * Copyright 2018 Google LLC
92
92
  * SPDX-License-Identifier: BSD-3-Clause
93
- */const F=Fo(class extends Ho{constructor(o){var e;if(super(o),o.type!==ht.ATTRIBUTE||o.name!=="class"||((e=o.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(e=>o[e]).join(" ")+" "}update(o,[e]){var i,r;if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!((i=this.nt)!=null&&i.has(s))&&this.st.add(s);return this.render(e)}const t=o.element.classList;for(const s of this.st)s in e||(t.remove(s),this.st.delete(s));for(const s in e){const n=!!e[s];n===this.st.has(s)||(r=this.nt)!=null&&r.has(s)||(n?(t.add(s),this.st.add(s)):(t.remove(s),this.st.delete(s)))}return we}});/**
93
+ */const F=Fo(class extends Ho{constructor(o){var e;if(super(o),o.type!==ht.ATTRIBUTE||o.name!=="class"||((e=o.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(e=>o[e]).join(" ")+" "}update(o,[e]){var i,r;if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!((i=this.nt)!=null&&i.has(s))&&this.st.add(s);return this.render(e)}const t=o.element.classList;for(const s of this.st)s in e||(t.remove(s),this.st.delete(s));for(const s in e){const n=!!e[s];n===this.st.has(s)||(r=this.nt)!=null&&r.has(s)||(n?(t.add(s),this.st.add(s)):(t.remove(s),this.st.delete(s)))}return Se}});/**
94
94
  * @license
95
95
  * Copyright 2021 Google LLC
96
96
  * SPDX-License-Identifier: Apache-2.0
@@ -901,7 +901,7 @@ var ScbWcTest=function(a){"use strict";var Bl;function p(o,e,t,i){var r=argument
901
901
  * @license
902
902
  * Copyright 2018 Google LLC
903
903
  * SPDX-License-Identifier: BSD-3-Clause
904
- */const hn="important",Ed=" !"+hn,It=Fo(class extends Ho{constructor(o){var e;if(super(o),o.type!==ht.ATTRIBUTE||o.name!=="style"||((e=o.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((e,t)=>{const i=o[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[e]){const{style:t}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const r=e[i];if(r!=null){this.ft.add(i);const s=typeof r=="string"&&r.endsWith(Ed);i.includes("-")||s?t.setProperty(i,s?r.slice(0,-11):r,s?hn:""):t[i]=r}}return we}});/**
904
+ */const hn="important",Ed=" !"+hn,It=Fo(class extends Ho{constructor(o){var e;if(super(o),o.type!==ht.ATTRIBUTE||o.name!=="style"||((e=o.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((e,t)=>{const i=o[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[e]){const{style:t}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const r=e[i];if(r!=null){this.ft.add(i);const s=typeof r=="string"&&r.endsWith(Ed);i.includes("-")||s?t.setProperty(i,s?r.slice(0,-11):r,s?hn:""):t[i]=r}}return Se}});/**
905
905
  * @license
906
906
  * Copyright 2023 Google LLC
907
907
  * SPDX-License-Identifier: Apache-2.0
@@ -909,11 +909,11 @@ var ScbWcTest=function(a){"use strict";var Bl;function p(o,e,t,i){var r=argument
909
909
  * @license
910
910
  * Copyright 2023 Google LLC
911
911
  * SPDX-License-Identifier: Apache-2.0
912
- */const Or={END_START:"end-start",START_START:"start-start",START_END:"start-end"};class zd{constructor(e,t){this.host=e,this.getProperties=t,this.surfaceStylesInternal={display:"none"},this.lastValues={isOpen:!1},this.host.addController(this)}get surfaceStyles(){return this.surfaceStylesInternal}async position(){const{surfaceEl:e,anchorEl:t,anchorCorner:i,surfaceCorner:r,positioning:s,xOffset:n,yOffset:d,repositionStrategy:h}=this.getProperties(),u=i.toLowerCase().trim(),m=r.toLowerCase().trim();if(!e||!t)return;const b=window.innerWidth,x=window.innerHeight,g=document.createElement("div");g.style.opacity="0",g.style.position="fixed",g.style.display="block",g.style.inset="0",document.body.appendChild(g);const w=g.getBoundingClientRect();g.remove();const S=window.innerHeight-w.bottom,k=window.innerWidth-w.right;this.surfaceStylesInternal={display:"block",opacity:"0"},this.host.requestUpdate(),await this.host.updateComplete,e.popover&&e.isConnected&&e.showPopover();const $=e.getSurfacePositionClientRect?e.getSurfacePositionClientRect():e.getBoundingClientRect(),C=t.getSurfacePositionClientRect?t.getSurfacePositionClientRect():t.getBoundingClientRect(),[D,P]=m.split("-"),[O,ye]=u.split("-"),Ie=getComputedStyle(e).direction==="ltr";let{blockInset:j,blockOutOfBoundsCorrection:L,surfaceBlockProperty:lt}=this.calculateBlock({surfaceRect:$,anchorRect:C,anchorBlock:O,surfaceBlock:D,yOffset:d,positioning:s,windowInnerHeight:x,blockScrollbarHeight:S});if(L){const _e=D==="start"?"end":"start",Ne=O==="start"?"end":"start",be=this.calculateBlock({surfaceRect:$,anchorRect:C,anchorBlock:Ne,surfaceBlock:_e,yOffset:d,positioning:s,windowInnerHeight:x,blockScrollbarHeight:S});L>be.blockOutOfBoundsCorrection&&(j=be.blockInset,L=be.blockOutOfBoundsCorrection,lt=be.surfaceBlockProperty)}let{inlineInset:T,inlineOutOfBoundsCorrection:N,surfaceInlineProperty:ze}=this.calculateInline({surfaceRect:$,anchorRect:C,anchorInline:ye,surfaceInline:P,xOffset:n,positioning:s,isLTR:Ie,windowInnerWidth:b,inlineScrollbarWidth:k});if(N){const _e=P==="start"?"end":"start",Ne=ye==="start"?"end":"start",be=this.calculateInline({surfaceRect:$,anchorRect:C,anchorInline:Ne,surfaceInline:_e,xOffset:n,positioning:s,isLTR:Ie,windowInnerWidth:b,inlineScrollbarWidth:k});Math.abs(N)>Math.abs(be.inlineOutOfBoundsCorrection)&&(T=be.inlineInset,N=be.inlineOutOfBoundsCorrection,ze=be.surfaceInlineProperty)}h==="move"&&(j=j-L,T=T-N),this.surfaceStylesInternal={display:"block",opacity:"1",[lt]:`${j}px`,[ze]:`${T}px`},h==="resize"&&(L&&(this.surfaceStylesInternal.height=`${$.height-L}px`),N&&(this.surfaceStylesInternal.width=`${$.width-N}px`)),this.host.requestUpdate()}calculateBlock(e){const{surfaceRect:t,anchorRect:i,anchorBlock:r,surfaceBlock:s,yOffset:n,positioning:d,windowInnerHeight:h,blockScrollbarHeight:u}=e,m=d==="fixed"||d==="document"?1:0,b=d==="document"?1:0,x=s==="start"?1:0,g=s==="end"?1:0,S=(r!==s?1:0)*i.height+n,k=x*i.top+g*(h-i.bottom-u),$=x*window.scrollY-g*window.scrollY,C=Math.abs(Math.min(0,h-k-S-t.height));return{blockInset:m*k+b*$+S,blockOutOfBoundsCorrection:C,surfaceBlockProperty:s==="start"?"inset-block-start":"inset-block-end"}}calculateInline(e){const{isLTR:t,surfaceInline:i,anchorInline:r,anchorRect:s,surfaceRect:n,xOffset:d,positioning:h,windowInnerWidth:u,inlineScrollbarWidth:m}=e,b=h==="fixed"||h==="document"?1:0,x=h==="document"?1:0,g=t?1:0,w=t?0:1,S=i==="start"?1:0,k=i==="end"?1:0,C=(r!==i?1:0)*s.width+d,D=S*s.left+k*(u-s.right-m),P=S*(u-s.right-m)+k*s.left,O=g*D+w*P,ye=S*window.scrollX-k*window.scrollX,Ie=k*window.scrollX-S*window.scrollX,j=g*ye+w*Ie,L=Math.abs(Math.min(0,u-O-C-n.width)),lt=b*O+C+x*j;let T=i==="start"?"inset-inline-start":"inset-inline-end";return(h==="document"||h==="fixed")&&(i==="start"&&t||i==="end"&&!t?T="left":T="right"),{inlineInset:lt,inlineOutOfBoundsCorrection:L,surfaceInlineProperty:T}}hostUpdate(){this.onUpdate()}hostUpdated(){this.onUpdate()}async onUpdate(){const e=this.getProperties();let t=!1;for(const[n,d]of Object.entries(e))if(t=t||d!==this.lastValues[n],t)break;const i=this.lastValues.isOpen!==e.isOpen,r=!!e.anchorEl,s=!!e.surfaceEl;t&&r&&s&&(this.lastValues.isOpen=e.isOpen,e.isOpen?(this.lastValues=e,await this.position(),e.onOpen()):i&&(await e.beforeClose(),this.close(),e.onClose()))}close(){this.surfaceStylesInternal={display:"none"},this.host.requestUpdate();const e=this.getProperties().surfaceEl;e!=null&&e.popover&&(e!=null&&e.isConnected)&&e.hidePopover()}}/**
912
+ */const Or={END_START:"end-start",START_START:"start-start",START_END:"start-end"};class zd{constructor(e,t){this.host=e,this.getProperties=t,this.surfaceStylesInternal={display:"none"},this.lastValues={isOpen:!1},this.host.addController(this)}get surfaceStyles(){return this.surfaceStylesInternal}async position(){const{surfaceEl:e,anchorEl:t,anchorCorner:i,surfaceCorner:r,positioning:s,xOffset:n,yOffset:d,repositionStrategy:h}=this.getProperties(),u=i.toLowerCase().trim(),m=r.toLowerCase().trim();if(!e||!t)return;const b=window.innerWidth,x=window.innerHeight,g=document.createElement("div");g.style.opacity="0",g.style.position="fixed",g.style.display="block",g.style.inset="0",document.body.appendChild(g);const w=g.getBoundingClientRect();g.remove();const S=window.innerHeight-w.bottom,k=window.innerWidth-w.right;this.surfaceStylesInternal={display:"block",opacity:"0"},this.host.requestUpdate(),await this.host.updateComplete,e.popover&&e.isConnected&&e.showPopover();const $=e.getSurfacePositionClientRect?e.getSurfacePositionClientRect():e.getBoundingClientRect(),C=t.getSurfacePositionClientRect?t.getSurfacePositionClientRect():t.getBoundingClientRect(),[D,P]=m.split("-"),[O,_e]=u.split("-"),Ie=getComputedStyle(e).direction==="ltr";let{blockInset:j,blockOutOfBoundsCorrection:L,surfaceBlockProperty:lt}=this.calculateBlock({surfaceRect:$,anchorRect:C,anchorBlock:O,surfaceBlock:D,yOffset:d,positioning:s,windowInnerHeight:x,blockScrollbarHeight:S});if(L){const xe=D==="start"?"end":"start",Ne=O==="start"?"end":"start",be=this.calculateBlock({surfaceRect:$,anchorRect:C,anchorBlock:Ne,surfaceBlock:xe,yOffset:d,positioning:s,windowInnerHeight:x,blockScrollbarHeight:S});L>be.blockOutOfBoundsCorrection&&(j=be.blockInset,L=be.blockOutOfBoundsCorrection,lt=be.surfaceBlockProperty)}let{inlineInset:T,inlineOutOfBoundsCorrection:N,surfaceInlineProperty:ze}=this.calculateInline({surfaceRect:$,anchorRect:C,anchorInline:_e,surfaceInline:P,xOffset:n,positioning:s,isLTR:Ie,windowInnerWidth:b,inlineScrollbarWidth:k});if(N){const xe=P==="start"?"end":"start",Ne=_e==="start"?"end":"start",be=this.calculateInline({surfaceRect:$,anchorRect:C,anchorInline:Ne,surfaceInline:xe,xOffset:n,positioning:s,isLTR:Ie,windowInnerWidth:b,inlineScrollbarWidth:k});Math.abs(N)>Math.abs(be.inlineOutOfBoundsCorrection)&&(T=be.inlineInset,N=be.inlineOutOfBoundsCorrection,ze=be.surfaceInlineProperty)}h==="move"&&(j=j-L,T=T-N),this.surfaceStylesInternal={display:"block",opacity:"1",[lt]:`${j}px`,[ze]:`${T}px`},h==="resize"&&(L&&(this.surfaceStylesInternal.height=`${$.height-L}px`),N&&(this.surfaceStylesInternal.width=`${$.width-N}px`)),this.host.requestUpdate()}calculateBlock(e){const{surfaceRect:t,anchorRect:i,anchorBlock:r,surfaceBlock:s,yOffset:n,positioning:d,windowInnerHeight:h,blockScrollbarHeight:u}=e,m=d==="fixed"||d==="document"?1:0,b=d==="document"?1:0,x=s==="start"?1:0,g=s==="end"?1:0,S=(r!==s?1:0)*i.height+n,k=x*i.top+g*(h-i.bottom-u),$=x*window.scrollY-g*window.scrollY,C=Math.abs(Math.min(0,h-k-S-t.height));return{blockInset:m*k+b*$+S,blockOutOfBoundsCorrection:C,surfaceBlockProperty:s==="start"?"inset-block-start":"inset-block-end"}}calculateInline(e){const{isLTR:t,surfaceInline:i,anchorInline:r,anchorRect:s,surfaceRect:n,xOffset:d,positioning:h,windowInnerWidth:u,inlineScrollbarWidth:m}=e,b=h==="fixed"||h==="document"?1:0,x=h==="document"?1:0,g=t?1:0,w=t?0:1,S=i==="start"?1:0,k=i==="end"?1:0,C=(r!==i?1:0)*s.width+d,D=S*s.left+k*(u-s.right-m),P=S*(u-s.right-m)+k*s.left,O=g*D+w*P,_e=S*window.scrollX-k*window.scrollX,Ie=k*window.scrollX-S*window.scrollX,j=g*_e+w*Ie,L=Math.abs(Math.min(0,u-O-C-n.width)),lt=b*O+C+x*j;let T=i==="start"?"inset-inline-start":"inset-inline-end";return(h==="document"||h==="fixed")&&(i==="start"&&t||i==="end"&&!t?T="left":T="right"),{inlineInset:lt,inlineOutOfBoundsCorrection:L,surfaceInlineProperty:T}}hostUpdate(){this.onUpdate()}hostUpdated(){this.onUpdate()}async onUpdate(){const e=this.getProperties();let t=!1;for(const[n,d]of Object.entries(e))if(t=t||d!==this.lastValues[n],t)break;const i=this.lastValues.isOpen!==e.isOpen,r=!!e.anchorEl,s=!!e.surfaceEl;t&&r&&s&&(this.lastValues.isOpen=e.isOpen,e.isOpen?(this.lastValues=e,await this.position(),e.onOpen()):i&&(await e.beforeClose(),this.close(),e.onClose()))}close(){this.surfaceStylesInternal={display:"none"},this.host.requestUpdate();const e=this.getProperties().surfaceEl;e!=null&&e.popover&&(e!=null&&e.isConnected)&&e.hidePopover()}}/**
913
913
  * @license
914
914
  * Copyright 2023 Google LLC
915
915
  * SPDX-License-Identifier: Apache-2.0
916
- */const Se={INDEX:0,ITEM:1,TEXT:2};class Od{constructor(e){this.getProperties=e,this.typeaheadRecords=[],this.typaheadBuffer="",this.cancelTypeaheadTimeout=0,this.isTypingAhead=!1,this.lastActiveRecord=null,this.onKeydown=t=>{this.isTypingAhead?this.typeahead(t):this.beginTypeahead(t)},this.endTypeahead=()=>{this.isTypingAhead=!1,this.typaheadBuffer="",this.typeaheadRecords=[]}}get items(){return this.getProperties().getItems()}get active(){return this.getProperties().active}beginTypeahead(e){this.active&&(e.code==="Space"||e.code==="Enter"||e.code.startsWith("Arrow")||e.code==="Escape"||(this.isTypingAhead=!0,this.typeaheadRecords=this.items.map((t,i)=>[i,t,t.typeaheadText.trim().toLowerCase()]),this.lastActiveRecord=this.typeaheadRecords.find(t=>t[Se.ITEM].tabIndex===0)??null,this.lastActiveRecord&&(this.lastActiveRecord[Se.ITEM].tabIndex=-1),this.typeahead(e)))}typeahead(e){if(e.defaultPrevented)return;if(clearTimeout(this.cancelTypeaheadTimeout),e.code==="Enter"||e.code.startsWith("Arrow")||e.code==="Escape"){this.endTypeahead(),this.lastActiveRecord&&(this.lastActiveRecord[Se.ITEM].tabIndex=-1);return}e.code==="Space"&&e.preventDefault(),this.cancelTypeaheadTimeout=setTimeout(this.endTypeahead,this.getProperties().typeaheadBufferTime),this.typaheadBuffer+=e.key.toLowerCase();const t=this.lastActiveRecord?this.lastActiveRecord[Se.INDEX]:-1,i=this.typeaheadRecords.length,r=h=>(h[Se.INDEX]+i-t)%i,s=this.typeaheadRecords.filter(h=>!h[Se.ITEM].disabled&&h[Se.TEXT].startsWith(this.typaheadBuffer)).sort((h,u)=>r(h)-r(u));if(s.length===0){clearTimeout(this.cancelTypeaheadTimeout),this.lastActiveRecord&&(this.lastActiveRecord[Se.ITEM].tabIndex=-1),this.endTypeahead();return}const n=this.typaheadBuffer.length===1;let d;this.lastActiveRecord===s[0]&&n?d=s[1]??s[0]:d=s[0],this.lastActiveRecord&&(this.lastActiveRecord[Se.ITEM].tabIndex=-1),this.lastActiveRecord=d,d[Se.ITEM].tabIndex=0,d[Se.ITEM].focus()}}/**
916
+ */const ke={INDEX:0,ITEM:1,TEXT:2};class Od{constructor(e){this.getProperties=e,this.typeaheadRecords=[],this.typaheadBuffer="",this.cancelTypeaheadTimeout=0,this.isTypingAhead=!1,this.lastActiveRecord=null,this.onKeydown=t=>{this.isTypingAhead?this.typeahead(t):this.beginTypeahead(t)},this.endTypeahead=()=>{this.isTypingAhead=!1,this.typaheadBuffer="",this.typeaheadRecords=[]}}get items(){return this.getProperties().getItems()}get active(){return this.getProperties().active}beginTypeahead(e){this.active&&(e.code==="Space"||e.code==="Enter"||e.code.startsWith("Arrow")||e.code==="Escape"||(this.isTypingAhead=!0,this.typeaheadRecords=this.items.map((t,i)=>[i,t,t.typeaheadText.trim().toLowerCase()]),this.lastActiveRecord=this.typeaheadRecords.find(t=>t[ke.ITEM].tabIndex===0)??null,this.lastActiveRecord&&(this.lastActiveRecord[ke.ITEM].tabIndex=-1),this.typeahead(e)))}typeahead(e){if(e.defaultPrevented)return;if(clearTimeout(this.cancelTypeaheadTimeout),e.code==="Enter"||e.code.startsWith("Arrow")||e.code==="Escape"){this.endTypeahead(),this.lastActiveRecord&&(this.lastActiveRecord[ke.ITEM].tabIndex=-1);return}e.code==="Space"&&e.preventDefault(),this.cancelTypeaheadTimeout=setTimeout(this.endTypeahead,this.getProperties().typeaheadBufferTime),this.typaheadBuffer+=e.key.toLowerCase();const t=this.lastActiveRecord?this.lastActiveRecord[ke.INDEX]:-1,i=this.typeaheadRecords.length,r=h=>(h[ke.INDEX]+i-t)%i,s=this.typeaheadRecords.filter(h=>!h[ke.ITEM].disabled&&h[ke.TEXT].startsWith(this.typaheadBuffer)).sort((h,u)=>r(h)-r(u));if(s.length===0){clearTimeout(this.cancelTypeaheadTimeout),this.lastActiveRecord&&(this.lastActiveRecord[ke.ITEM].tabIndex=-1),this.endTypeahead();return}const n=this.typaheadBuffer.length===1;let d;this.lastActiveRecord===s[0]&&n?d=s[1]??s[0]:d=s[0],this.lastActiveRecord&&(this.lastActiveRecord[ke.ITEM].tabIndex=-1),this.lastActiveRecord=d,d[ke.ITEM].tabIndex=0,d[ke.ITEM].focus()}}/**
917
917
  * @license
918
918
  * Copyright 2023 Google LLC
919
919
  * SPDX-License-Identifier: Apache-2.0
@@ -935,7 +935,7 @@ var ScbWcTest=function(a){"use strict";var Bl;function p(o,e,t,i){var r=argument
935
935
  @activate-typeahead=${this.handleActivateTypeahead}
936
936
  @stay-open-on-focusout=${this.handleStayOpenOnFocusout}
937
937
  @close-on-focusout=${this.handleCloseOnFocusout}
938
- @slotchange=${this.listController.onSlotchange}></slot>`}renderElevation(){return c`<md-elevation part="elevation"></md-elevation>`}getSurfaceClasses(){return{open:this.open,fixed:this.positioning==="fixed","has-overflow":this.hasOverflow}}captureKeydown(e){e.target===this&&!e.defaultPrevented&&un(e.code)&&(e.preventDefault(),this.close()),this.typeaheadController.onKeydown(e)}async animateOpen(){const e=this.surfaceEl,t=this.slotEl;if(!e||!t)return!0;const i=this.openDirection;this.dispatchEvent(new Event("opening")),e.classList.toggle("animating",!0);const r=this.openCloseAnimationSignal.start(),s=e.offsetHeight,n=i==="UP",d=this.items,h=500,u=50,m=250,b=(h-m)/d.length,x=e.animate([{height:"0px"},{height:`${s}px`}],{duration:h,easing:Oe.EMPHASIZED}),g=t.animate([{transform:n?`translateY(-${s}px)`:""},{transform:""}],{duration:h,easing:Oe.EMPHASIZED}),w=e.animate([{opacity:0},{opacity:1}],u),S=[];for(let C=0;C<d.length;C++){const D=n?d.length-1-C:C,P=d[D],O=P.animate([{opacity:0},{opacity:1}],{duration:m,delay:b*C});P.classList.toggle("md-menu-hidden",!0),O.addEventListener("finish",()=>{P.classList.toggle("md-menu-hidden",!1)}),S.push([P,O])}let k=C=>{};const $=new Promise(C=>{k=C});return r.addEventListener("abort",()=>{x.cancel(),g.cancel(),w.cancel(),S.forEach(([C,D])=>{C.classList.toggle("md-menu-hidden",!1),D.cancel()}),k(!0)}),x.addEventListener("finish",()=>{e.classList.toggle("animating",!1),this.openCloseAnimationSignal.finish(),k(!1)}),await $}animateClose(){let e;const t=new Promise(O=>{e=O}),i=this.surfaceEl,r=this.slotEl;if(!i||!r)return e(!1),t;const n=this.openDirection==="UP";this.dispatchEvent(new Event("closing")),i.classList.toggle("animating",!0);const d=this.openCloseAnimationSignal.start(),h=i.offsetHeight,u=this.items,m=150,b=50,x=m-b,g=50,w=50,S=.35,k=(m-w-g)/u.length,$=i.animate([{height:`${h}px`},{height:`${h*S}px`}],{duration:m,easing:Oe.EMPHASIZED_ACCELERATE}),C=r.animate([{transform:""},{transform:n?`translateY(-${h*(1-S)}px)`:""}],{duration:m,easing:Oe.EMPHASIZED_ACCELERATE}),D=i.animate([{opacity:1},{opacity:0}],{duration:b,delay:x}),P=[];for(let O=0;O<u.length;O++){const ye=n?O:u.length-1-O,Ie=u[ye],j=Ie.animate([{opacity:1},{opacity:0}],{duration:g,delay:w+k*O});j.addEventListener("finish",()=>{Ie.classList.toggle("md-menu-hidden",!0)}),P.push([Ie,j])}return d.addEventListener("abort",()=>{$.cancel(),C.cancel(),D.cancel(),P.forEach(([O,ye])=>{ye.cancel(),O.classList.toggle("md-menu-hidden",!1)}),e(!1)}),$.addEventListener("finish",()=>{i.classList.toggle("animating",!1),P.forEach(([O])=>{O.classList.toggle("md-menu-hidden",!1)}),this.openCloseAnimationSignal.finish(),this.dispatchEvent(new Event("closed")),e(!0)}),t}handleKeydown(e){this.pointerPath=[],this.listController.handleKeydown(e)}setUpGlobalEventListeners(){document.addEventListener("click",this.onDocumentClick,{capture:!0}),window.addEventListener("pointerdown",this.onWindowPointerdown),document.addEventListener("resize",this.onWindowResize,{passive:!0}),window.addEventListener("resize",this.onWindowResize,{passive:!0})}cleanUpGlobalEventListeners(){document.removeEventListener("click",this.onDocumentClick,{capture:!0}),window.removeEventListener("pointerdown",this.onWindowPointerdown),document.removeEventListener("resize",this.onWindowResize),window.removeEventListener("resize",this.onWindowResize)}onCloseMenu(){this.close()}onDeactivateItems(e){e.stopPropagation(),this.listController.onDeactivateItems()}onRequestActivation(e){e.stopPropagation(),this.listController.onRequestActivation(e)}handleDeactivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!1}handleActivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!0}handleStayOpenOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!0}handleCloseOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!1}close(){this.open=!1,this.slotItems.forEach(t=>{var i;(i=t.close)==null||i.call(t)})}show(){this.open=!0}activateNextItem(){return this.listController.activateNextItem()??null}activatePreviousItem(){return this.listController.activatePreviousItem()??null}reposition(){this.open&&this.menuPositionController.position()}}p([A(".menu")],K.prototype,"surfaceEl",void 0),p([A("slot")],K.prototype,"slotEl",void 0),p([l()],K.prototype,"anchor",void 0),p([l()],K.prototype,"positioning",void 0),p([l({type:Boolean})],K.prototype,"quick",void 0),p([l({type:Boolean,attribute:"has-overflow"})],K.prototype,"hasOverflow",void 0),p([l({type:Boolean,reflect:!0})],K.prototype,"open",void 0),p([l({type:Number,attribute:"x-offset"})],K.prototype,"xOffset",void 0),p([l({type:Number,attribute:"y-offset"})],K.prototype,"yOffset",void 0),p([l({type:Number,attribute:"typeahead-delay"})],K.prototype,"typeaheadDelay",void 0),p([l({attribute:"anchor-corner"})],K.prototype,"anchorCorner",void 0),p([l({attribute:"menu-corner"})],K.prototype,"menuCorner",void 0),p([l({type:Boolean,attribute:"stay-open-on-outside-click"})],K.prototype,"stayOpenOnOutsideClick",void 0),p([l({type:Boolean,attribute:"stay-open-on-focusout"})],K.prototype,"stayOpenOnFocusout",void 0),p([l({type:Boolean,attribute:"skip-restore-focus"})],K.prototype,"skipRestoreFocus",void 0),p([l({attribute:"default-focus"})],K.prototype,"defaultFocus",void 0),p([l({type:Boolean,attribute:"no-navigation-wrap"})],K.prototype,"noNavigationWrap",void 0),p([re({flatten:!0})],K.prototype,"slotItems",void 0),p([E()],K.prototype,"typeaheadActive",void 0);/**
938
+ @slotchange=${this.listController.onSlotchange}></slot>`}renderElevation(){return c`<md-elevation part="elevation"></md-elevation>`}getSurfaceClasses(){return{open:this.open,fixed:this.positioning==="fixed","has-overflow":this.hasOverflow}}captureKeydown(e){e.target===this&&!e.defaultPrevented&&un(e.code)&&(e.preventDefault(),this.close()),this.typeaheadController.onKeydown(e)}async animateOpen(){const e=this.surfaceEl,t=this.slotEl;if(!e||!t)return!0;const i=this.openDirection;this.dispatchEvent(new Event("opening")),e.classList.toggle("animating",!0);const r=this.openCloseAnimationSignal.start(),s=e.offsetHeight,n=i==="UP",d=this.items,h=500,u=50,m=250,b=(h-m)/d.length,x=e.animate([{height:"0px"},{height:`${s}px`}],{duration:h,easing:Oe.EMPHASIZED}),g=t.animate([{transform:n?`translateY(-${s}px)`:""},{transform:""}],{duration:h,easing:Oe.EMPHASIZED}),w=e.animate([{opacity:0},{opacity:1}],u),S=[];for(let C=0;C<d.length;C++){const D=n?d.length-1-C:C,P=d[D],O=P.animate([{opacity:0},{opacity:1}],{duration:m,delay:b*C});P.classList.toggle("md-menu-hidden",!0),O.addEventListener("finish",()=>{P.classList.toggle("md-menu-hidden",!1)}),S.push([P,O])}let k=C=>{};const $=new Promise(C=>{k=C});return r.addEventListener("abort",()=>{x.cancel(),g.cancel(),w.cancel(),S.forEach(([C,D])=>{C.classList.toggle("md-menu-hidden",!1),D.cancel()}),k(!0)}),x.addEventListener("finish",()=>{e.classList.toggle("animating",!1),this.openCloseAnimationSignal.finish(),k(!1)}),await $}animateClose(){let e;const t=new Promise(O=>{e=O}),i=this.surfaceEl,r=this.slotEl;if(!i||!r)return e(!1),t;const n=this.openDirection==="UP";this.dispatchEvent(new Event("closing")),i.classList.toggle("animating",!0);const d=this.openCloseAnimationSignal.start(),h=i.offsetHeight,u=this.items,m=150,b=50,x=m-b,g=50,w=50,S=.35,k=(m-w-g)/u.length,$=i.animate([{height:`${h}px`},{height:`${h*S}px`}],{duration:m,easing:Oe.EMPHASIZED_ACCELERATE}),C=r.animate([{transform:""},{transform:n?`translateY(-${h*(1-S)}px)`:""}],{duration:m,easing:Oe.EMPHASIZED_ACCELERATE}),D=i.animate([{opacity:1},{opacity:0}],{duration:b,delay:x}),P=[];for(let O=0;O<u.length;O++){const _e=n?O:u.length-1-O,Ie=u[_e],j=Ie.animate([{opacity:1},{opacity:0}],{duration:g,delay:w+k*O});j.addEventListener("finish",()=>{Ie.classList.toggle("md-menu-hidden",!0)}),P.push([Ie,j])}return d.addEventListener("abort",()=>{$.cancel(),C.cancel(),D.cancel(),P.forEach(([O,_e])=>{_e.cancel(),O.classList.toggle("md-menu-hidden",!1)}),e(!1)}),$.addEventListener("finish",()=>{i.classList.toggle("animating",!1),P.forEach(([O])=>{O.classList.toggle("md-menu-hidden",!1)}),this.openCloseAnimationSignal.finish(),this.dispatchEvent(new Event("closed")),e(!0)}),t}handleKeydown(e){this.pointerPath=[],this.listController.handleKeydown(e)}setUpGlobalEventListeners(){document.addEventListener("click",this.onDocumentClick,{capture:!0}),window.addEventListener("pointerdown",this.onWindowPointerdown),document.addEventListener("resize",this.onWindowResize,{passive:!0}),window.addEventListener("resize",this.onWindowResize,{passive:!0})}cleanUpGlobalEventListeners(){document.removeEventListener("click",this.onDocumentClick,{capture:!0}),window.removeEventListener("pointerdown",this.onWindowPointerdown),document.removeEventListener("resize",this.onWindowResize),window.removeEventListener("resize",this.onWindowResize)}onCloseMenu(){this.close()}onDeactivateItems(e){e.stopPropagation(),this.listController.onDeactivateItems()}onRequestActivation(e){e.stopPropagation(),this.listController.onRequestActivation(e)}handleDeactivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!1}handleActivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!0}handleStayOpenOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!0}handleCloseOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!1}close(){this.open=!1,this.slotItems.forEach(t=>{var i;(i=t.close)==null||i.call(t)})}show(){this.open=!0}activateNextItem(){return this.listController.activateNextItem()??null}activatePreviousItem(){return this.listController.activatePreviousItem()??null}reposition(){this.open&&this.menuPositionController.position()}}p([A(".menu")],K.prototype,"surfaceEl",void 0),p([A("slot")],K.prototype,"slotEl",void 0),p([l()],K.prototype,"anchor",void 0),p([l()],K.prototype,"positioning",void 0),p([l({type:Boolean})],K.prototype,"quick",void 0),p([l({type:Boolean,attribute:"has-overflow"})],K.prototype,"hasOverflow",void 0),p([l({type:Boolean,reflect:!0})],K.prototype,"open",void 0),p([l({type:Number,attribute:"x-offset"})],K.prototype,"xOffset",void 0),p([l({type:Number,attribute:"y-offset"})],K.prototype,"yOffset",void 0),p([l({type:Number,attribute:"typeahead-delay"})],K.prototype,"typeaheadDelay",void 0),p([l({attribute:"anchor-corner"})],K.prototype,"anchorCorner",void 0),p([l({attribute:"menu-corner"})],K.prototype,"menuCorner",void 0),p([l({type:Boolean,attribute:"stay-open-on-outside-click"})],K.prototype,"stayOpenOnOutsideClick",void 0),p([l({type:Boolean,attribute:"stay-open-on-focusout"})],K.prototype,"stayOpenOnFocusout",void 0),p([l({type:Boolean,attribute:"skip-restore-focus"})],K.prototype,"skipRestoreFocus",void 0),p([l({attribute:"default-focus"})],K.prototype,"defaultFocus",void 0),p([l({type:Boolean,attribute:"no-navigation-wrap"})],K.prototype,"noNavigationWrap",void 0),p([re({flatten:!0})],K.prototype,"slotItems",void 0),p([E()],K.prototype,"typeaheadActive",void 0);/**
939
939
  * @license
940
940
  * Copyright 2024 Google LLC
941
941
  * SPDX-License-Identifier: Apache-2.0
@@ -1242,7 +1242,7 @@ var ScbWcTest=function(a){"use strict";var Bl;function p(o,e,t,i){var r=argument
1242
1242
  @request-deselection=${this.handleRequestDeselection}>
1243
1243
  ${this.renderMenuContent()}
1244
1244
  </md-menu>
1245
- </div>`}renderMenuContent(){return c`<slot></slot>`}handleKeydown(e){var s,n;if(this.open||this.disabled||!this.menu)return;const t=this.menu.typeaheadController,i=e.code==="Space"||e.code==="ArrowDown"||e.code==="ArrowUp"||e.code==="End"||e.code==="Home"||e.code==="Enter";if(!t.isTypingAhead&&i){switch(e.preventDefault(),this.open=!0,e.code){case"Space":case"ArrowDown":case"Enter":this.defaultFocus=Pe.NONE;break;case"End":this.defaultFocus=Pe.LAST_ITEM;break;case"ArrowUp":case"Home":this.defaultFocus=Pe.FIRST_ITEM;break}return}if(e.key.length===1){t.onKeydown(e),e.preventDefault();const{lastActiveRecord:d}=t;if(!d)return;(n=(s=this.labelEl)==null?void 0:s.setAttribute)==null||n.call(s,"aria-live","polite"),this.selectItem(d[Se.ITEM])&&this.dispatchInteractionEvents()}}handleClick(){this.open=!this.open}handleFocus(){this.focused=!0}handleBlur(){this.focused=!1}handleFocusout(e){e.relatedTarget&&va(e.relatedTarget,this)||(this.open=!1)}getSelectedOptions(){if(!this.menu)return this.lastSelectedOptionRecords=[],null;const e=this.menu.items;return this.lastSelectedOptionRecords=Yd(e),this.lastSelectedOptionRecords}async getUpdateComplete(){var e;return await((e=this.menu)==null?void 0:e.updateComplete),super.getUpdateComplete()}updateValueAndDisplayText(){const e=this.getSelectedOptions()??[];let t=!1;if(e.length){const[i]=e[0];t=this.lastSelectedOption!==i,this.lastSelectedOption=i,this[Vr]=i.value,this.displayText=i.displayText}else t=this.lastSelectedOption!==null,this.lastSelectedOption=null,this[Vr]="",this.displayText="";return t}async handleOpening(e){var s,n,d;if((n=(s=this.labelEl)==null?void 0:s.removeAttribute)==null||n.call(s,"aria-live"),this.redispatchEvent(e),this.defaultFocus!==Pe.NONE)return;const t=this.menu.items,i=(d=ei(t))==null?void 0:d.item;let[r]=this.lastSelectedOptionRecords[0]??[null];i&&i!==r&&(i.tabIndex=-1),r=r??t[0],r&&(r.tabIndex=0,r.focus())}redispatchEvent(e){ut(this,e)}handleClosed(e){this.open=!1,this.redispatchEvent(e)}handleCloseMenu(e){const t=e.detail.reason,i=e.detail.itemPath[0];this.open=!1;let r=!1;t.kind==="click-selection"?r=this.selectItem(i):t.kind==="keydown"&&Id(t.key)?r=this.selectItem(i):(i.tabIndex=-1,i.blur()),r&&this.dispatchInteractionEvents()}selectItem(e){return(this.getSelectedOptions()??[]).forEach(([i])=>{e!==i&&(i.selected=!1)}),e.selected=!0,this.updateValueAndDisplayText()}handleRequestSelection(e){const t=e.target;this.lastSelectedOptionRecords.some(([i])=>i===t)||this.selectItem(t)}handleRequestDeselection(e){const t=e.target;this.lastSelectedOptionRecords.some(([i])=>i===t)&&this.updateValueAndDisplayText()}initUserSelection(){this.lastUserSetValue&&!this.lastSelectedOptionRecords.length?this.select(this.lastUserSetValue):this.lastUserSetSelectedIndex!==null&&!this.lastSelectedOptionRecords.length?this.selectIndex(this.lastUserSetSelectedIndex):this.updateValueAndDisplayText()}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0}dispatchInteractionEvents(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0}))}getErrorText(){return this.error?this.errorText:this.nativeErrorText}[Xe](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(e){this.value=e}click(){var e;(e=this.field)==null||e.click()}[Ct](){return new Gd(()=>this)}[Et](){return this.field}}he(B),B.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},p([l({type:Boolean})],B.prototype,"quick",void 0),p([l({type:Boolean})],B.prototype,"required",void 0),p([l({type:String,attribute:"error-text"})],B.prototype,"errorText",void 0),p([l()],B.prototype,"label",void 0),p([l({type:Boolean,attribute:"no-asterisk"})],B.prototype,"noAsterisk",void 0),p([l({type:String,attribute:"supporting-text"})],B.prototype,"supportingText",void 0),p([l({type:Boolean,reflect:!0})],B.prototype,"error",void 0),p([l({attribute:"menu-positioning"})],B.prototype,"menuPositioning",void 0),p([l({type:Boolean,attribute:"clamp-menu-width"})],B.prototype,"clampMenuWidth",void 0),p([l({type:Number,attribute:"typeahead-delay"})],B.prototype,"typeaheadDelay",void 0),p([l({type:Boolean,attribute:"has-leading-icon"})],B.prototype,"hasLeadingIcon",void 0),p([l({attribute:"display-text"})],B.prototype,"displayText",void 0),p([l({attribute:"menu-align"})],B.prototype,"menuAlign",void 0),p([l()],B.prototype,"value",null),p([l({type:Number,attribute:"selected-index"})],B.prototype,"selectedIndex",null),p([E()],B.prototype,"nativeError",void 0),p([E()],B.prototype,"nativeErrorText",void 0),p([E()],B.prototype,"focused",void 0),p([E()],B.prototype,"open",void 0),p([E()],B.prototype,"defaultFocus",void 0),p([A(".field")],B.prototype,"field",void 0),p([A("md-menu")],B.prototype,"menu",void 0),p([A("#label")],B.prototype,"labelEl",void 0),p([re({slot:"leading-icon",flatten:!0})],B.prototype,"leadingIcons",void 0);/**
1245
+ </div>`}renderMenuContent(){return c`<slot></slot>`}handleKeydown(e){var s,n;if(this.open||this.disabled||!this.menu)return;const t=this.menu.typeaheadController,i=e.code==="Space"||e.code==="ArrowDown"||e.code==="ArrowUp"||e.code==="End"||e.code==="Home"||e.code==="Enter";if(!t.isTypingAhead&&i){switch(e.preventDefault(),this.open=!0,e.code){case"Space":case"ArrowDown":case"Enter":this.defaultFocus=Pe.NONE;break;case"End":this.defaultFocus=Pe.LAST_ITEM;break;case"ArrowUp":case"Home":this.defaultFocus=Pe.FIRST_ITEM;break}return}if(e.key.length===1){t.onKeydown(e),e.preventDefault();const{lastActiveRecord:d}=t;if(!d)return;(n=(s=this.labelEl)==null?void 0:s.setAttribute)==null||n.call(s,"aria-live","polite"),this.selectItem(d[ke.ITEM])&&this.dispatchInteractionEvents()}}handleClick(){this.open=!this.open}handleFocus(){this.focused=!0}handleBlur(){this.focused=!1}handleFocusout(e){e.relatedTarget&&va(e.relatedTarget,this)||(this.open=!1)}getSelectedOptions(){if(!this.menu)return this.lastSelectedOptionRecords=[],null;const e=this.menu.items;return this.lastSelectedOptionRecords=Yd(e),this.lastSelectedOptionRecords}async getUpdateComplete(){var e;return await((e=this.menu)==null?void 0:e.updateComplete),super.getUpdateComplete()}updateValueAndDisplayText(){const e=this.getSelectedOptions()??[];let t=!1;if(e.length){const[i]=e[0];t=this.lastSelectedOption!==i,this.lastSelectedOption=i,this[Vr]=i.value,this.displayText=i.displayText}else t=this.lastSelectedOption!==null,this.lastSelectedOption=null,this[Vr]="",this.displayText="";return t}async handleOpening(e){var s,n,d;if((n=(s=this.labelEl)==null?void 0:s.removeAttribute)==null||n.call(s,"aria-live"),this.redispatchEvent(e),this.defaultFocus!==Pe.NONE)return;const t=this.menu.items,i=(d=ei(t))==null?void 0:d.item;let[r]=this.lastSelectedOptionRecords[0]??[null];i&&i!==r&&(i.tabIndex=-1),r=r??t[0],r&&(r.tabIndex=0,r.focus())}redispatchEvent(e){ut(this,e)}handleClosed(e){this.open=!1,this.redispatchEvent(e)}handleCloseMenu(e){const t=e.detail.reason,i=e.detail.itemPath[0];this.open=!1;let r=!1;t.kind==="click-selection"?r=this.selectItem(i):t.kind==="keydown"&&Id(t.key)?r=this.selectItem(i):(i.tabIndex=-1,i.blur()),r&&this.dispatchInteractionEvents()}selectItem(e){return(this.getSelectedOptions()??[]).forEach(([i])=>{e!==i&&(i.selected=!1)}),e.selected=!0,this.updateValueAndDisplayText()}handleRequestSelection(e){const t=e.target;this.lastSelectedOptionRecords.some(([i])=>i===t)||this.selectItem(t)}handleRequestDeselection(e){const t=e.target;this.lastSelectedOptionRecords.some(([i])=>i===t)&&this.updateValueAndDisplayText()}initUserSelection(){this.lastUserSetValue&&!this.lastSelectedOptionRecords.length?this.select(this.lastUserSetValue):this.lastUserSetSelectedIndex!==null&&!this.lastSelectedOptionRecords.length?this.selectIndex(this.lastUserSetSelectedIndex):this.updateValueAndDisplayText()}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0}dispatchInteractionEvents(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0}))}getErrorText(){return this.error?this.errorText:this.nativeErrorText}[Xe](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(e){this.value=e}click(){var e;(e=this.field)==null||e.click()}[Ct](){return new Gd(()=>this)}[Et](){return this.field}}he(B),B.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},p([l({type:Boolean})],B.prototype,"quick",void 0),p([l({type:Boolean})],B.prototype,"required",void 0),p([l({type:String,attribute:"error-text"})],B.prototype,"errorText",void 0),p([l()],B.prototype,"label",void 0),p([l({type:Boolean,attribute:"no-asterisk"})],B.prototype,"noAsterisk",void 0),p([l({type:String,attribute:"supporting-text"})],B.prototype,"supportingText",void 0),p([l({type:Boolean,reflect:!0})],B.prototype,"error",void 0),p([l({attribute:"menu-positioning"})],B.prototype,"menuPositioning",void 0),p([l({type:Boolean,attribute:"clamp-menu-width"})],B.prototype,"clampMenuWidth",void 0),p([l({type:Number,attribute:"typeahead-delay"})],B.prototype,"typeaheadDelay",void 0),p([l({type:Boolean,attribute:"has-leading-icon"})],B.prototype,"hasLeadingIcon",void 0),p([l({attribute:"display-text"})],B.prototype,"displayText",void 0),p([l({attribute:"menu-align"})],B.prototype,"menuAlign",void 0),p([l()],B.prototype,"value",null),p([l({type:Number,attribute:"selected-index"})],B.prototype,"selectedIndex",null),p([E()],B.prototype,"nativeError",void 0),p([E()],B.prototype,"nativeErrorText",void 0),p([E()],B.prototype,"focused",void 0),p([E()],B.prototype,"open",void 0),p([E()],B.prototype,"defaultFocus",void 0),p([A(".field")],B.prototype,"field",void 0),p([A("md-menu")],B.prototype,"menu",void 0),p([A("#label")],B.prototype,"labelEl",void 0),p([re({slot:"leading-icon",flatten:!0})],B.prototype,"leadingIcons",void 0);/**
1246
1246
  * @license
1247
1247
  * Copyright 2023 Google LLC
1248
1248
  * SPDX-License-Identifier: Apache-2.0
@@ -1541,7 +1541,7 @@ var ScbWcTest=function(a){"use strict";var Bl;function p(o,e,t,i){var r=argument
1541
1541
  * @license
1542
1542
  * Copyright 2020 Google LLC
1543
1543
  * SPDX-License-Identifier: BSD-3-Clause
1544
- */const zn=Fo(class extends Ho{constructor(o){if(super(o),o.type!==ht.PROPERTY&&o.type!==ht.ATTRIBUTE&&o.type!==ht.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!_h(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[e]){if(e===we||e===v)return e;const t=o.element,i=o.name;if(o.type===ht.PROPERTY){if(e===t[i])return we}else if(o.type===ht.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(i))return we}else if(o.type===ht.ATTRIBUTE&&t.getAttribute(i)===e+"")return we;return wh(o),e}});/**
1544
+ */const zn=Fo(class extends Ho{constructor(o){if(super(o),o.type!==ht.PROPERTY&&o.type!==ht.ATTRIBUTE&&o.type!==ht.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!_h(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[e]){if(e===Se||e===v)return e;const t=o.element,i=o.name;if(o.type===ht.PROPERTY){if(e===t[i])return Se}else if(o.type===ht.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(i))return Se}else if(o.type===ht.ATTRIBUTE&&t.getAttribute(i)===e+"")return Se;return wh(o),e}});/**
1545
1545
  * @license
1546
1546
  * Copyright 2022 Google LLC
1547
1547
  * SPDX-License-Identifier: Apache-2.0
@@ -4103,7 +4103,7 @@ ${this.value}</textarea
4103
4103
  .lbl { color: var(--md-sys-color-on-surface); }
4104
4104
  .supporting-text { color: var(--md-sys-color-on-surface-variant); }
4105
4105
  }
4106
- `,Bt([l({type:Boolean,reflect:!0})],a.ScbRadioButton.prototype,"disabled",2),Bt([l({type:Boolean,reflect:!0})],a.ScbRadioButton.prototype,"checked",2),Bt([l({type:String,reflect:!0})],a.ScbRadioButton.prototype,"name",2),Bt([l({type:String,reflect:!0})],a.ScbRadioButton.prototype,"value",2),Bt([l({type:String})],a.ScbRadioButton.prototype,"label",2),Bt([l({type:String,attribute:"supporting-text"})],a.ScbRadioButton.prototype,"supportingText",2),a.ScbRadioButton=Bt([y("scb-radio-button")],a.ScbRadioButton);var Hp=Object.defineProperty,Np=Object.getOwnPropertyDescriptor,al=o=>{throw TypeError(o)},ke=(o,e,t,i)=>{for(var r=i>1?void 0:i?Np(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Hp(e,t,r),r},Vp=(o,e,t)=>e.has(o)||al("Cannot "+t),qp=(o,e,t)=>e.has(o)?al("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),Wi=(o,e,t)=>(Vp(o,e,"access private method"),t),Ft,Ja,so;a.ScbSwitch=class extends _{constructor(){super(),qp(this,Ft),this._internals=null,this.label="",this.ariaLabel="",this.icons=!1,this.selected=!1,this.disabled=!1,this.fullWidth=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this.name="",this.value="on",this._form=null,this._formResetHandler=null,this._initialSelected=!1,"attachInternals"in this&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this._initialSelected=this.selected,this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.selected=this._initialSelected,this.__syncFormValue()},this._form.addEventListener("reset",this._formResetHandler,!0)),this.__syncFormValue()}disconnectedCallback(){this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),super.disconnectedCallback()}firstUpdated(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("md-switch");e==null||e.addEventListener("change",i=>{this.selected=i.target.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))}),Wi(this,Ft,Ja).call(this)}updated(e){super.updated(e),e.has("disabled")&&this.toggleAttribute("aria-disabled",this.disabled),(e.has("selected")||e.has("disabled")||e.has("value"))&&this.__syncFormValue(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&Wi(this,Ft,Ja).call(this)}formDisabledCallback(e){this.disabled=e}__syncFormValue(){if(!this._internals)return;const e=this.disabled||!this.selected?null:this.value;this._internals.setFormValue(e)}render(){const e=this.label.trim().length>0,t=e?v:this.ariaLabel||v,i=c`
4106
+ `,Bt([l({type:Boolean,reflect:!0})],a.ScbRadioButton.prototype,"disabled",2),Bt([l({type:Boolean,reflect:!0})],a.ScbRadioButton.prototype,"checked",2),Bt([l({type:String,reflect:!0})],a.ScbRadioButton.prototype,"name",2),Bt([l({type:String,reflect:!0})],a.ScbRadioButton.prototype,"value",2),Bt([l({type:String})],a.ScbRadioButton.prototype,"label",2),Bt([l({type:String,attribute:"supporting-text"})],a.ScbRadioButton.prototype,"supportingText",2),a.ScbRadioButton=Bt([y("scb-radio-button")],a.ScbRadioButton);var Hp=Object.defineProperty,Np=Object.getOwnPropertyDescriptor,al=o=>{throw TypeError(o)},$e=(o,e,t,i)=>{for(var r=i>1?void 0:i?Np(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Hp(e,t,r),r},Vp=(o,e,t)=>e.has(o)||al("Cannot "+t),qp=(o,e,t)=>e.has(o)?al("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),Wi=(o,e,t)=>(Vp(o,e,"access private method"),t),Ft,Ja,so;a.ScbSwitch=class extends _{constructor(){super(),qp(this,Ft),this._internals=null,this.label="",this.ariaLabel="",this.icons=!1,this.selected=!1,this.disabled=!1,this.fullWidth=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this.name="",this.value="on",this._form=null,this._formResetHandler=null,this._initialSelected=!1,"attachInternals"in this&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this._initialSelected=this.selected,this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.selected=this._initialSelected,this.__syncFormValue()},this._form.addEventListener("reset",this._formResetHandler,!0)),this.__syncFormValue()}disconnectedCallback(){this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),super.disconnectedCallback()}firstUpdated(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("md-switch");e==null||e.addEventListener("change",i=>{this.selected=i.target.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))}),Wi(this,Ft,Ja).call(this)}updated(e){super.updated(e),e.has("disabled")&&this.toggleAttribute("aria-disabled",this.disabled),(e.has("selected")||e.has("disabled")||e.has("value"))&&this.__syncFormValue(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&Wi(this,Ft,Ja).call(this)}formDisabledCallback(e){this.disabled=e}__syncFormValue(){if(!this._internals)return;const e=this.disabled||!this.selected?null:this.value;this._internals.setFormValue(e)}render(){const e=this.label.trim().length>0,t=e?v:this.ariaLabel||v,i=c`
4107
4107
  <md-switch
4108
4108
  ?icons=${this.icons}
4109
4109
  ?selected=${this.selected}
@@ -4158,7 +4158,7 @@ ${this.value}</textarea
4158
4158
  /* Ärver färg från container */
4159
4159
  color: var(--scb-switch-label-color, inherit);
4160
4160
  }
4161
- `,ke([l({type:String})],a.ScbSwitch.prototype,"label",2),ke([l({type:String,reflect:!0,attribute:"aria-label"})],a.ScbSwitch.prototype,"ariaLabel",2),ke([l({type:Boolean,reflect:!0})],a.ScbSwitch.prototype,"icons",2),ke([l({type:Boolean,reflect:!0})],a.ScbSwitch.prototype,"selected",2),ke([l({type:Boolean,reflect:!0})],a.ScbSwitch.prototype,"disabled",2),ke([l({type:Boolean,reflect:!0,attribute:"full-width"})],a.ScbSwitch.prototype,"fullWidth",2),ke([l({type:String,reflect:!0})],a.ScbSwitch.prototype,"spacing",2),ke([l({type:String,attribute:"spacing-top",reflect:!0})],a.ScbSwitch.prototype,"spacingTop",2),ke([l({type:String,attribute:"spacing-bottom",reflect:!0})],a.ScbSwitch.prototype,"spacingBottom",2),ke([l({type:String})],a.ScbSwitch.prototype,"name",2),ke([l({type:String})],a.ScbSwitch.prototype,"value",2),a.ScbSwitch=ke([y("scb-switch")],a.ScbSwitch);const Up=Object.freeze(Object.defineProperty({__proto__:null,get ScbSwitch(){return a.ScbSwitch}},Symbol.toStringTag,{value:"Module"}));var Wp=Object.defineProperty,jp=Object.getOwnPropertyDescriptor,sl=o=>{throw TypeError(o)},ae=(o,e,t,i)=>{for(var r=i>1?void 0:i?jp(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Wp(e,t,r),r},Kp=(o,e,t)=>e.has(o)||sl("Cannot "+t),Gp=(o,e,t)=>e.has(o)?sl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),nl=(o,e,t)=>(Kp(o,e,"access private method"),t),no,Qa;a.ScbChip=class extends _{constructor(){super(),Gp(this,no),this.variant="assist",this.label="",this.icon="",this.disabled=!1,this.elevated=!1,this.removable=!1,this.selected=!1,this.href="",this.target="",this.name="",this.value="",this.spacing="",this.spacingTop="",this.spacingBottom="",this.size="",this._internals=null,this.__loadedVariants=new Set,this.__chipSetLoaded=!1,this.__iconLoaded=!1,"attachInternals"in this&&(this._internals=this.attachInternals())}updated(e){super.updated(e),(e.has("variant")||e.has("icon"))&&this.__ensureDepsLoaded(),e.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.dispatchEvent(new CustomEvent("disabled-changed",{detail:{disabled:this.disabled},bubbles:!0,composed:!0}))),e.has("variant")&&this.dispatchEvent(new CustomEvent("variant-changed",{detail:{variant:this.variant},bubbles:!0,composed:!0})),e.has("label")&&this.dispatchEvent(new CustomEvent("label-changed",{detail:{label:this.label},bubbles:!0,composed:!0})),e.has("elevated")&&this.dispatchEvent(new CustomEvent("elevated-changed",{detail:{elevated:this.elevated},bubbles:!0,composed:!0})),e.has("icon")&&this.dispatchEvent(new CustomEvent("icon-changed",{detail:{icon:this.icon},bubbles:!0,composed:!0})),e.has("size")&&this.dispatchEvent(new CustomEvent("size-changed",{detail:{size:this.size},bubbles:!0,composed:!0})),(e.has("selected")||e.has("disabled")||e.has("variant")||e.has("value")||e.has("name"))&&this._updateFormValue(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&nl(this,no,Qa).call(this)}firstUpdated(){this.__ensureDepsLoaded(),nl(this,no,Qa).call(this),this._updateFormValue()}async __ensureDepsLoaded(){if(!this.__loadedVariants.has(this.variant)){switch(this.variant){case"assist":await Promise.resolve().then(()=>Fc);break;case"filter":await Promise.resolve().then(()=>Uc);break}this.__loadedVariants.add(this.variant)}!this._insideChipSet&&!this.__chipSetLoaded&&(await Promise.resolve().then(()=>Nc),this.__chipSetLoaded=!0),this.icon&&!this.__iconLoaded&&(await Promise.resolve().then(()=>qe),this.__iconLoaded=!0)}get _insideChipSet(){return!!this.closest("md-chip-set")}render(){const e=this._renderChip();return this._insideChipSet?e:c`<md-chip-set>${e}</md-chip-set>`}_renderChip(){const e=this.icon?c`<md-icon slot="icon">${this.icon}</md-icon>`:null;switch(this.variant){case"assist":{const t=this.target==="_blank"?"noopener noreferrer":void 0;return c`
4161
+ `,$e([l({type:String})],a.ScbSwitch.prototype,"label",2),$e([l({type:String,reflect:!0,attribute:"aria-label"})],a.ScbSwitch.prototype,"ariaLabel",2),$e([l({type:Boolean,reflect:!0})],a.ScbSwitch.prototype,"icons",2),$e([l({type:Boolean,reflect:!0})],a.ScbSwitch.prototype,"selected",2),$e([l({type:Boolean,reflect:!0})],a.ScbSwitch.prototype,"disabled",2),$e([l({type:Boolean,reflect:!0,attribute:"full-width"})],a.ScbSwitch.prototype,"fullWidth",2),$e([l({type:String,reflect:!0})],a.ScbSwitch.prototype,"spacing",2),$e([l({type:String,attribute:"spacing-top",reflect:!0})],a.ScbSwitch.prototype,"spacingTop",2),$e([l({type:String,attribute:"spacing-bottom",reflect:!0})],a.ScbSwitch.prototype,"spacingBottom",2),$e([l({type:String})],a.ScbSwitch.prototype,"name",2),$e([l({type:String})],a.ScbSwitch.prototype,"value",2),a.ScbSwitch=$e([y("scb-switch")],a.ScbSwitch);const Up=Object.freeze(Object.defineProperty({__proto__:null,get ScbSwitch(){return a.ScbSwitch}},Symbol.toStringTag,{value:"Module"}));var Wp=Object.defineProperty,jp=Object.getOwnPropertyDescriptor,sl=o=>{throw TypeError(o)},ae=(o,e,t,i)=>{for(var r=i>1?void 0:i?jp(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Wp(e,t,r),r},Kp=(o,e,t)=>e.has(o)||sl("Cannot "+t),Gp=(o,e,t)=>e.has(o)?sl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),nl=(o,e,t)=>(Kp(o,e,"access private method"),t),no,Qa;a.ScbChip=class extends _{constructor(){super(),Gp(this,no),this.variant="assist",this.label="",this.icon="",this.disabled=!1,this.elevated=!1,this.removable=!1,this.selected=!1,this.href="",this.target="",this.name="",this.value="",this.spacing="",this.spacingTop="",this.spacingBottom="",this.size="",this._internals=null,this.__loadedVariants=new Set,this.__chipSetLoaded=!1,this.__iconLoaded=!1,"attachInternals"in this&&(this._internals=this.attachInternals())}updated(e){super.updated(e),(e.has("variant")||e.has("icon"))&&this.__ensureDepsLoaded(),e.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.dispatchEvent(new CustomEvent("disabled-changed",{detail:{disabled:this.disabled},bubbles:!0,composed:!0}))),e.has("variant")&&this.dispatchEvent(new CustomEvent("variant-changed",{detail:{variant:this.variant},bubbles:!0,composed:!0})),e.has("label")&&this.dispatchEvent(new CustomEvent("label-changed",{detail:{label:this.label},bubbles:!0,composed:!0})),e.has("elevated")&&this.dispatchEvent(new CustomEvent("elevated-changed",{detail:{elevated:this.elevated},bubbles:!0,composed:!0})),e.has("icon")&&this.dispatchEvent(new CustomEvent("icon-changed",{detail:{icon:this.icon},bubbles:!0,composed:!0})),e.has("size")&&this.dispatchEvent(new CustomEvent("size-changed",{detail:{size:this.size},bubbles:!0,composed:!0})),(e.has("selected")||e.has("disabled")||e.has("variant")||e.has("value")||e.has("name"))&&this._updateFormValue(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&nl(this,no,Qa).call(this)}firstUpdated(){this.__ensureDepsLoaded(),nl(this,no,Qa).call(this),this._updateFormValue()}async __ensureDepsLoaded(){if(!this.__loadedVariants.has(this.variant)){switch(this.variant){case"assist":await Promise.resolve().then(()=>Fc);break;case"filter":await Promise.resolve().then(()=>Uc);break}this.__loadedVariants.add(this.variant)}!this._insideChipSet&&!this.__chipSetLoaded&&(await Promise.resolve().then(()=>Nc),this.__chipSetLoaded=!0),this.icon&&!this.__iconLoaded&&(await Promise.resolve().then(()=>qe),this.__iconLoaded=!0)}get _insideChipSet(){return!!this.closest("md-chip-set")}render(){const e=this._renderChip();return this._insideChipSet?e:c`<md-chip-set>${e}</md-chip-set>`}_renderChip(){const e=this.icon?c`<md-icon slot="icon">${this.icon}</md-icon>`:null;switch(this.variant){case"assist":{const t=this.target==="_blank"?"noopener noreferrer":void 0;return c`
4162
4162
  <md-assist-chip
4163
4163
  label=${this.label}
4164
4164
  ?disabled=${this.disabled}
@@ -4410,11 +4410,11 @@ ${this.value}</textarea
4410
4410
  to { opacity: 0; }
4411
4411
  }
4412
4412
 
4413
- `,Q([l({type:Boolean,reflect:!0})],a.ScbDialog.prototype,"open",2),Q([l({type:Boolean,attribute:!1})],a.ScbDialog.prototype,"inSb",2),Q([l({type:Boolean,attribute:"scrim-close"})],a.ScbDialog.prototype,"scrimClose",2),Q([l({type:String})],a.ScbDialog.prototype,"variant",2),Q([l({type:String})],a.ScbDialog.prototype,"label",2),Q([l({type:String})],a.ScbDialog.prototype,"icon",2),Q([l({type:String,attribute:"supporting-text"})],a.ScbDialog.prototype,"supportingText",2),Q([l({type:String,attribute:"ok-button"})],a.ScbDialog.prototype,"okButton",2),Q([l({type:String,attribute:"cancel-button"})],a.ScbDialog.prototype,"cancelButton",2),Q([l({type:String,attribute:"delete-button"})],a.ScbDialog.prototype,"deleteButton",2),Q([l({type:String,attribute:"confirm-button"})],a.ScbDialog.prototype,"confirmButton",2),Q([l({type:String,attribute:"deny-button"})],a.ScbDialog.prototype,"denyButton",2),Q([l({type:String,attribute:"reset-button"})],a.ScbDialog.prototype,"resetButton",2),Q([l({type:String,attribute:"submit-button"})],a.ScbDialog.prototype,"submitButton",2),Q([l({type:String,attribute:"form-id"})],a.ScbDialog.prototype,"formId",2),Q([l({type:String,attribute:"form-action"})],a.ScbDialog.prototype,"formAction",2),Q([l({type:String,attribute:"form-method"})],a.ScbDialog.prototype,"formMethod",2),a.ScbDialog=Q([y("scb-dialog")],a.ScbDialog);var Zp=Object.defineProperty,Jp=Object.getOwnPropertyDescriptor,Ht=(o,e,t,i)=>{for(var r=i>1?void 0:i?Jp(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Zp(e,t,r),r};a.ScbCalendar=class extends _{constructor(){super(...arguments),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=e=>{var u,m;const i=Array.from(((u=this.shadowRoot)==null?void 0:u.querySelectorAll(".calendar-day.has-event"))??[]),r=(m=this.shadowRoot)==null?void 0:m.activeElement,s=r&&i.includes(r)?r:document.activeElement,n=i.indexOf(s);if(n===-1)return;let d=n;const h=this.disableWeekend?5:7;switch(e.key){case"ArrowRight":d=n+1<i.length?n+1:n;break;case"ArrowLeft":d=n-1>=0?n-1:n;break;case"ArrowDown":d=n+h<i.length?n+h:n;break;case"ArrowUp":d=n-h>=0?n-h:n;break;default:return}d!==n&&(e.preventDefault(),i[d].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{var e;(e=this._lastActiveDay)==null||e.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}connectedCallback(){super.connectedCallback();const e=Number(this.displayYear),t=Number(this.displayMonth);!Number.isNaN(e)&&!Number.isNaN(t)&&t>=1&&t<=12&&(this._current=new Date(e,t-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}updated(e){var t;if((t=super.updated)==null||t.call(this,e),!this._syncingDisplay&&(e.has("displayYear")||e.has("displayMonth"))){const i=Number(this.displayYear),r=Number(this.displayMonth);if(!Number.isNaN(i)&&!Number.isNaN(r)&&r>=1&&r<=12){const s=this._current.getFullYear(),n=this._current.getMonth()+1;(s!==i||n!==r)&&(this._current=new Date(i,r-1,1),this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:i,displayMonth:r}})),this.requestUpdate())}}}_syncDisplayFromCurrent(e=!0){const t=this._current.getFullYear(),i=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=t,this.displayMonth=i}finally{this._syncingDisplay=!1}e&&this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:t,displayMonth:i}}))}_daysInMonth(e,t){return new Date(e,t+1,0).getDate()}_firstDayOfWeek(e,t){const i=new Date(e,t,1).getDay();return i===0?6:i-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(e){var t;this._popupEvent=e,this.selectedDate=e.date,this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:{selectedDate:e.date}})),this._lastActiveDay=((t=this.shadowRoot)==null?void 0:t.activeElement)||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{var s;const i=(s=this.shadowRoot)==null?void 0:s.querySelector("scb-dialog");i&&(document.activeElement&&(i.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.open=!0})}),i.addEventListener("close",this._restoreDayFocus,{once:!0}));const r=n=>{var d;(d=n.target)!=null&&d.closest(".event-popup")||this._closePopup()};window.addEventListener("mousedown",r,{once:!0})})}_closePopup(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("scb-dialog");e&&e.removeAttribute("open"),this._popupEvent=null,this.requestUpdate()}_addDays(e,t){const i=new Date(e.valueOf());return i.setDate(i.getDate()+t),i}_easterDay(e){if(typeof this._easterDateCalculated["Ar"+e]<"u")return new Date(this._easterDateCalculated["Ar"+e]);let t=e;t<100&&(t=t+1900),t<1950&&(t=t+100);const i=t%19,r=t%4,s=t%7,n=(19*i+24)%30,d=(2*r+4*s+6*n+5)%7;let h=22+n+d,u=0;h==57&&(h-=7),h==56&&n==28&&d==6&&i>10&&(h-=7),h>31?(h-=31,u=4):u=3;const m=new Date(t,u-1,h);return this._easterDateCalculated["Ar"+e]=m,new Date(this._easterDateCalculated["Ar"+e])}_swedishHolidayName(e){const t=e.getMonth();if(t===1||t===6||t===7||t===8)return null;const i=e.getMonth()+1,r=e.getDate(),s=e.getFullYear(),n=this._easterDay(s),d=this.lang==="en",h=[["Nyårsdagen","New Year's Day",i===1&&r===1],["Trettondedag jul","Epiphany",i===1&&r===6],["Långfredag","Good Friday",+e==+this._addDays(n,-2)],["Påskdagen","Easter Sunday",+e==+n],["Annandag påsk","Easter Monday",+e==+this._addDays(n,1)],["Kristi himmelsfärdsdag","Ascension Day",+e==+this._addDays(n,39)],["Pingstdagen","Pentecost",+e==+this._addDays(n,50)&&s<2005],["Första maj","May Day",i===5&&r===1],["Nationaldagen","National Day",i===6&&r===6&&s>=2005],["Midsommarafton","Midsummer's Eve",i===6&&r>=19&&r<=25&&e.getDay()===5],["Midsommardagen","Midsummer's Day",i===6&&r>=20&&r<=26&&e.getDay()===6],["Julafton","Christmas Eve",i===12&&r===24],["Juldagen","Christmas Day",i===12&&r===25],["Annandag jul","Boxing Day",i===12&&r===26],["Alla helgons dag","All Saints' Day",i===10&&r>=31&&e.getDay()===6||i===11&&r<=6&&e.getDay()===6]];for(const u of h){const[m,b,x]=u;if(x)return d?b:m}return null}render(){const e=this._current.getFullYear(),t=this._current.getMonth(),i=this._daysInMonth(e,t),r=this._firstDayOfWeek(e,t),s=this._today,n=this.lang==="en",d=n?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let h=n?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(h=h.slice(0,5));const u=Array.from(this.querySelectorAll("scb-calendar-event")),m=new Map;for(const g of u){const w=g.getAttribute("start-date")||"",S=g.getAttribute("end-date")||"";if(w&&S){const k=new Date(w),$=new Date(S);for(let C=new Date(k);C<=$;C.setDate(C.getDate()+1)){const D=C.toISOString().split("T")[0],P=m.get(D)||[];P.push({title:g.title,description:g.description,start:w,end:S}),m.set(D,P)}}else if(w&&g.title){const k=w.split("T")[0],$=m.get(k)||[];$.push({title:g.title,description:g.description,start:w}),m.set(k,$)}}const b=[];let x=1;for(let g=0;g<6;g++){const w=[],S=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let k=x;for(let $=0;$<S.length;$++){const C=S[$];if(g===0&&C<r){if(!this.disableWeekend||C<5){const D=t===0?11:t-1,P=t===0?e-1:e,ye=this._daysInMonth(P,D)-(r-C-1);w.push(c`
4413
+ `,Q([l({type:Boolean,reflect:!0})],a.ScbDialog.prototype,"open",2),Q([l({type:Boolean,attribute:!1})],a.ScbDialog.prototype,"inSb",2),Q([l({type:Boolean,attribute:"scrim-close"})],a.ScbDialog.prototype,"scrimClose",2),Q([l({type:String})],a.ScbDialog.prototype,"variant",2),Q([l({type:String})],a.ScbDialog.prototype,"label",2),Q([l({type:String})],a.ScbDialog.prototype,"icon",2),Q([l({type:String,attribute:"supporting-text"})],a.ScbDialog.prototype,"supportingText",2),Q([l({type:String,attribute:"ok-button"})],a.ScbDialog.prototype,"okButton",2),Q([l({type:String,attribute:"cancel-button"})],a.ScbDialog.prototype,"cancelButton",2),Q([l({type:String,attribute:"delete-button"})],a.ScbDialog.prototype,"deleteButton",2),Q([l({type:String,attribute:"confirm-button"})],a.ScbDialog.prototype,"confirmButton",2),Q([l({type:String,attribute:"deny-button"})],a.ScbDialog.prototype,"denyButton",2),Q([l({type:String,attribute:"reset-button"})],a.ScbDialog.prototype,"resetButton",2),Q([l({type:String,attribute:"submit-button"})],a.ScbDialog.prototype,"submitButton",2),Q([l({type:String,attribute:"form-id"})],a.ScbDialog.prototype,"formId",2),Q([l({type:String,attribute:"form-action"})],a.ScbDialog.prototype,"formAction",2),Q([l({type:String,attribute:"form-method"})],a.ScbDialog.prototype,"formMethod",2),a.ScbDialog=Q([y("scb-dialog")],a.ScbDialog);var Zp=Object.defineProperty,Jp=Object.getOwnPropertyDescriptor,Ht=(o,e,t,i)=>{for(var r=i>1?void 0:i?Jp(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Zp(e,t,r),r};a.ScbCalendar=class extends _{constructor(){super(...arguments),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=e=>{var u,m;const i=Array.from(((u=this.shadowRoot)==null?void 0:u.querySelectorAll(".calendar-day.has-event"))??[]),r=(m=this.shadowRoot)==null?void 0:m.activeElement,s=r&&i.includes(r)?r:document.activeElement,n=i.indexOf(s);if(n===-1)return;let d=n;const h=this.disableWeekend?5:7;switch(e.key){case"ArrowRight":d=n+1<i.length?n+1:n;break;case"ArrowLeft":d=n-1>=0?n-1:n;break;case"ArrowDown":d=n+h<i.length?n+h:n;break;case"ArrowUp":d=n-h>=0?n-h:n;break;default:return}d!==n&&(e.preventDefault(),i[d].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{var e;(e=this._lastActiveDay)==null||e.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}connectedCallback(){super.connectedCallback();const e=Number(this.displayYear),t=Number(this.displayMonth);!Number.isNaN(e)&&!Number.isNaN(t)&&t>=1&&t<=12&&(this._current=new Date(e,t-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}updated(e){var t;if((t=super.updated)==null||t.call(this,e),!this._syncingDisplay&&(e.has("displayYear")||e.has("displayMonth"))){const i=Number(this.displayYear),r=Number(this.displayMonth);if(!Number.isNaN(i)&&!Number.isNaN(r)&&r>=1&&r<=12){const s=this._current.getFullYear(),n=this._current.getMonth()+1;(s!==i||n!==r)&&(this._current=new Date(i,r-1,1),this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:i,displayMonth:r}})),this.requestUpdate())}}}_syncDisplayFromCurrent(e=!0){const t=this._current.getFullYear(),i=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=t,this.displayMonth=i}finally{this._syncingDisplay=!1}e&&this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:t,displayMonth:i}}))}_daysInMonth(e,t){return new Date(e,t+1,0).getDate()}_firstDayOfWeek(e,t){const i=new Date(e,t,1).getDay();return i===0?6:i-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(e){var t;this._popupEvent=e,this.selectedDate=e.date,this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:{selectedDate:e.date}})),this._lastActiveDay=((t=this.shadowRoot)==null?void 0:t.activeElement)||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{var s;const i=(s=this.shadowRoot)==null?void 0:s.querySelector("scb-dialog");i&&(document.activeElement&&(i.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.open=!0})}),i.addEventListener("close",this._restoreDayFocus,{once:!0}));const r=n=>{var d;(d=n.target)!=null&&d.closest(".event-popup")||this._closePopup()};window.addEventListener("mousedown",r,{once:!0})})}_closePopup(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("scb-dialog");e&&e.removeAttribute("open"),this._popupEvent=null,this.requestUpdate()}_addDays(e,t){const i=new Date(e.valueOf());return i.setDate(i.getDate()+t),i}_easterDay(e){if(typeof this._easterDateCalculated["Ar"+e]<"u")return new Date(this._easterDateCalculated["Ar"+e]);let t=e;t<100&&(t=t+1900),t<1950&&(t=t+100);const i=t%19,r=t%4,s=t%7,n=(19*i+24)%30,d=(2*r+4*s+6*n+5)%7;let h=22+n+d,u=0;h==57&&(h-=7),h==56&&n==28&&d==6&&i>10&&(h-=7),h>31?(h-=31,u=4):u=3;const m=new Date(t,u-1,h);return this._easterDateCalculated["Ar"+e]=m,new Date(this._easterDateCalculated["Ar"+e])}_swedishHolidayName(e){const t=e.getMonth();if(t===1||t===6||t===7||t===8)return null;const i=e.getMonth()+1,r=e.getDate(),s=e.getFullYear(),n=this._easterDay(s),d=this.lang==="en",h=[["Nyårsdagen","New Year's Day",i===1&&r===1],["Trettondedag jul","Epiphany",i===1&&r===6],["Långfredag","Good Friday",+e==+this._addDays(n,-2)],["Påskdagen","Easter Sunday",+e==+n],["Annandag påsk","Easter Monday",+e==+this._addDays(n,1)],["Kristi himmelsfärdsdag","Ascension Day",+e==+this._addDays(n,39)],["Pingstdagen","Pentecost",+e==+this._addDays(n,50)&&s<2005],["Första maj","May Day",i===5&&r===1],["Nationaldagen","National Day",i===6&&r===6&&s>=2005],["Midsommarafton","Midsummer's Eve",i===6&&r>=19&&r<=25&&e.getDay()===5],["Midsommardagen","Midsummer's Day",i===6&&r>=20&&r<=26&&e.getDay()===6],["Julafton","Christmas Eve",i===12&&r===24],["Juldagen","Christmas Day",i===12&&r===25],["Annandag jul","Boxing Day",i===12&&r===26],["Alla helgons dag","All Saints' Day",i===10&&r>=31&&e.getDay()===6||i===11&&r<=6&&e.getDay()===6]];for(const u of h){const[m,b,x]=u;if(x)return d?b:m}return null}render(){const e=this._current.getFullYear(),t=this._current.getMonth(),i=this._daysInMonth(e,t),r=this._firstDayOfWeek(e,t),s=this._today,n=this.lang==="en",d=n?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let h=n?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(h=h.slice(0,5));const u=Array.from(this.querySelectorAll("scb-calendar-event")),m=new Map;for(const g of u){const w=g.getAttribute("start-date")||"",S=g.getAttribute("end-date")||"";if(w&&S){const k=new Date(w),$=new Date(S);for(let C=new Date(k);C<=$;C.setDate(C.getDate()+1)){const D=C.toISOString().split("T")[0],P=m.get(D)||[];P.push({title:g.title,description:g.description,start:w,end:S}),m.set(D,P)}}else if(w&&g.title){const k=w.split("T")[0],$=m.get(k)||[];$.push({title:g.title,description:g.description,start:w}),m.set(k,$)}}const b=[];let x=1;for(let g=0;g<6;g++){const w=[],S=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let k=x;for(let $=0;$<S.length;$++){const C=S[$];if(g===0&&C<r){if(!this.disableWeekend||C<5){const D=t===0?11:t-1,P=t===0?e-1:e,_e=this._daysInMonth(P,D)-(r-C-1);w.push(c`
4414
4414
  <div class="calendar-day calendar-day--other">
4415
- <span class="calendar-day-number">${ye}</span>
4415
+ <span class="calendar-day-number">${_e}</span>
4416
4416
  </div>
4417
- `)}}else if(k>i)w.push(c`<div></div>`);else{let D=new Date(e,t,k);if(this.disableWeekend)for(;D.getDay()===0||D.getDay()===6;)k++,D=new Date(e,t,k);if(k>i){w.push(c`<div></div>`);continue}const P=s.getFullYear()===e&&s.getMonth()===t&&s.getDate()===k,O=`${e}-${String(t+1).padStart(2,"0")}-${String(k).padStart(2,"0")}`,ye=new Date(e,t,k);let Ie=!1,j=null;this.publicHolidays&&(j=this._swedishHolidayName(ye),Ie=!!j);let L=m.get(O)||[];L=[...L].sort((T,N)=>{const ze=T.start&&O===T.start.split("T")[0]?T.start:T.end&&O===T.end.split("T")[0]?T.end:"",_e=N.start&&O===N.start.split("T")[0]?N.start:N.end&&N.end.split("T")[0]?N.end:"",Ne=ze&&ze.includes("T"),be=_e&&_e.includes("T");return Ne&&be?ze.localeCompare(_e):Ne?-1:be?1:T.title.localeCompare(N.title)});const lt=[...L].map(T=>{let N="",ze="";if(T.start&&T.end){const _e=T.start.split("T")[0],Ne=T.end.split("T")[0];O===_e&&O===Ne&&T.start.includes("T")&&T.end.includes("T")?N=T.start.split("T")[1].substring(0,5)+"–"+T.end.split("T")[1].substring(0,5):O===_e&&T.start.includes("T")?N=T.start.split("T")[1].substring(0,5):O===Ne&&T.end.includes("T")?(N=T.end.split("T")[1].substring(0,5),ze=n?"cont. ":"fort. "):O!==_e&&(N="",ze=n?"cont. ":"fort. ")}else T.start&&T.start.includes("T")&&(N=T.start.split("T")[1].substring(0,5));return{...T,time:N,prefix:ze}});w.push(c`
4417
+ `)}}else if(k>i)w.push(c`<div></div>`);else{let D=new Date(e,t,k);if(this.disableWeekend)for(;D.getDay()===0||D.getDay()===6;)k++,D=new Date(e,t,k);if(k>i){w.push(c`<div></div>`);continue}const P=s.getFullYear()===e&&s.getMonth()===t&&s.getDate()===k,O=`${e}-${String(t+1).padStart(2,"0")}-${String(k).padStart(2,"0")}`,_e=new Date(e,t,k);let Ie=!1,j=null;this.publicHolidays&&(j=this._swedishHolidayName(_e),Ie=!!j);let L=m.get(O)||[];L=[...L].sort((T,N)=>{const ze=T.start&&O===T.start.split("T")[0]?T.start:T.end&&O===T.end.split("T")[0]?T.end:"",xe=N.start&&O===N.start.split("T")[0]?N.start:N.end&&N.end.split("T")[0]?N.end:"",Ne=ze&&ze.includes("T"),be=xe&&xe.includes("T");return Ne&&be?ze.localeCompare(xe):Ne?-1:be?1:T.title.localeCompare(N.title)});const lt=[...L].map(T=>{let N="",ze="";if(T.start&&T.end){const xe=T.start.split("T")[0],Ne=T.end.split("T")[0];O===xe&&O===Ne&&T.start.includes("T")&&T.end.includes("T")?N=T.start.split("T")[1].substring(0,5)+"–"+T.end.split("T")[1].substring(0,5):O===xe&&T.start.includes("T")?N=T.start.split("T")[1].substring(0,5):O===Ne&&T.end.includes("T")?(N=T.end.split("T")[1].substring(0,5),ze=n?"cont. ":"fort. "):O!==xe&&(N="",ze=n?"cont. ":"fort. ")}else T.start&&T.start.includes("T")&&(N=T.start.split("T")[1].substring(0,5));return{...T,time:N,prefix:ze}});w.push(c`
4418
4418
  <div
4419
4419
  class="calendar-day${P?" today":""}${L.length?" has-event":""}${Ie?" calendar-day--holiday":""}"
4420
4420
  tabindex=${L.length?"0":void 0}
@@ -5943,7 +5943,7 @@ ${this.value}</textarea
5943
5943
  opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1),
5944
5944
  transform 0.32s cubic-bezier(0.23, 1, 0.32, 1);
5945
5945
  }
5946
- `,is([l({type:Boolean,reflect:!0})],a.ScbMenu.prototype,"open",2),is([l({type:Boolean,attribute:!1})],a.ScbMenu.prototype,"inSb",2),a.ScbMenu=is([y("scb-menu")],a.ScbMenu);var Tu=Object.defineProperty,Au=Object.getOwnPropertyDescriptor,$e=(o,e,t,i)=>{for(var r=i>1?void 0:i?Au(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Tu(e,t,r),r};a.ScbDropdown=class extends _{constructor(){super(...arguments),this.label="Dropdown",this.variant="filled",this.open=!1,this.disabled=!1,this.menuGap="3",this.width=null,this.maxWidth=null,this._slottedMenuEl=null,this._openSettledTimer=null,this._menuCloseTimer=null,this._panelResizeObserver=null,this._panelHeightSyncRaf=null,this._onDocumentClickBound=e=>{if(!this.open)return;const t=e.composedPath(),i=t.find(r=>r instanceof HTMLElement&&r.tagName.toLowerCase()==="scb-dropdown");if(i&&i!==this){this.open=!1;return}t.includes(this)||(this.open=!1)},this._onDocumentKeydownBound=e=>{this.open&&e.key==="Escape"&&(this.open=!1)},this._onSlottedMenuOpen=()=>{this.open||(this.open=!0)},this._onSlottedMenuClose=()=>{this.open&&(this.open=!1)},this._onSlotChange=()=>{this._syncSlottedMenu(),this._applyPanelSizing(),this._applyInertByOpen(),this.requestUpdate()},this._onTriggerClick=e=>{e.stopPropagation(),!this.disabled&&(this.open=!this.open)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onDocumentClickBound,!0),document.addEventListener("keydown",this._onDocumentKeydownBound)}disconnectedCallback(){document.removeEventListener("click",this._onDocumentClickBound,!0),document.removeEventListener("keydown",this._onDocumentKeydownBound),this._detachSlottedMenuListeners(),this._panelResizeObserver&&(this._panelResizeObserver.disconnect(),this._panelResizeObserver=null),this._panelHeightSyncRaf!==null&&(window.cancelAnimationFrame(this._panelHeightSyncRaf),this._panelHeightSyncRaf=null),this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),super.disconnectedCallback()}firstUpdated(e){super.firstUpdated(e),this._syncSlottedMenu(),this._applyPanelVars(),this._applyPanelSizing(),this._applyChevronState(),this._applyInertByOpen(),this._setupPanelResizeObserver(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen()}updated(e){super.updated(e),e.has("menuGap")&&this._applyPanelVars(),(e.has("width")||e.has("maxWidth"))&&this._applyPanelSizing(),e.has("open")&&(this.open||this._closeAllSubMenus(),this._syncSlottedMenuOpen(),this._applyChevronState(),this._applyInertByOpen(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen())}_applyPanelVars(){if(this.menuGap==null||String(this.menuGap).trim()===""){this.style.removeProperty("--scb-dropdown-panel-gap");return}this.style.setProperty("--scb-dropdown-panel-gap",this._mapSpacingToken(this.menuGap))}_applyPanelSizing(){const e=this.renderRoot.querySelector(".panel-surface");e&&(this.width&&String(this.width).trim()!==""?e.style.inlineSize=this.width:e.style.removeProperty("inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?e.style.maxInlineSize=this.maxWidth:e.style.removeProperty("max-inline-size")),this._slottedMenuEl&&(this.width&&String(this.width).trim()!==""?this._slottedMenuEl.style.inlineSize=this.width:this._slottedMenuEl.style.removeProperty("inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?this._slottedMenuEl.style.maxInlineSize=this.maxWidth:this._slottedMenuEl.style.removeProperty("max-inline-size")),this._schedulePanelHeightSync()}_setupPanelResizeObserver(){if(this._panelResizeObserver||typeof ResizeObserver>"u")return;const e=this._panelInnerEl;e&&(this._panelResizeObserver=new ResizeObserver(()=>{this._schedulePanelHeightSync()}),this._panelResizeObserver.observe(e))}_schedulePanelHeightSync(){this._panelHeightSyncRaf===null&&(this._panelHeightSyncRaf=window.requestAnimationFrame(()=>{this._panelHeightSyncRaf=null,this._syncPanelMaxHeightByOpen()}))}_syncPanelMaxHeightByOpen(){const e=this._panelSurfaceEl;if(!e)return;if(this._slottedMenuEl){e.style.removeProperty("--scb-dropdown-panel-current-max-height");return}if(!this.open){e.style.setProperty("--scb-dropdown-panel-current-max-height","0px");return}const t=this._panelInnerEl;if(!t)return;const i=`${Math.ceil(t.scrollHeight)}px`;e.style.getPropertyValue("--scb-dropdown-panel-current-max-height").trim()!==i&&e.style.setProperty("--scb-dropdown-panel-current-max-height",i)}_mapSpacingToken(e){const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_syncSlottedMenu(){var i;const t=(((i=this._slotEl)==null?void 0:i.assignedElements({flatten:!0}))??[]).find(r=>r.tagName.toLowerCase()==="scb-menu");if(t===this._slottedMenuEl){this._syncSlottedMenuOpen();return}this._detachSlottedMenuListeners(),this._slottedMenuEl=t??null,this._slottedMenuEl&&(this._slottedMenuEl.addEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.addEventListener("close",this._onSlottedMenuClose),this._syncSlottedMenuOpen())}_detachSlottedMenuListeners(){this._slottedMenuEl&&(this._slottedMenuEl.removeEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.removeEventListener("close",this._onSlottedMenuClose))}_syncSlottedMenuOpen(){if(!this._slottedMenuEl)return;if(this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),this.open){this._slottedMenuEl.open=!0;return}const e=this._getPanelTransitionMs();if(e<=0){this._slottedMenuEl.open=!1;return}this._menuCloseTimer=window.setTimeout(()=>{this._menuCloseTimer=null,!this.open&&this._slottedMenuEl&&(this._slottedMenuEl.open=!1)},e)}_syncOverflowVisibilityByOpen(){if(this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this.removeAttribute("data-open-settled"),!this.open)return;const e=this.renderRoot.querySelector(".panel-surface");if(!e){this.setAttribute("data-open-settled","");return}const t=this._getTransitionMs(e);if(t<=0){this.setAttribute("data-open-settled","");return}this._openSettledTimer=window.setTimeout(()=>{this._openSettledTimer=null,this.open&&this.setAttribute("data-open-settled","")},t)}_getPanelTransitionMs(){const e=this.renderRoot.querySelector(".panel-surface");return e?this._getTransitionMs(e):0}_getTransitionMs(e){const t=getComputedStyle(e),i=t.transitionDuration.split(",").map(h=>h.trim()),r=t.transitionDelay.split(",").map(h=>h.trim()),s=h=>{const u=parseFloat(h);return Number.isFinite(u)?h.endsWith("ms")?u:h.endsWith("s")?u*1e3:u:0},n=Math.max(i.length,r.length);let d=0;for(let h=0;h<n;h+=1){const u=s(i[h]??i[i.length-1]??"0s"),m=s(r[h]??r[r.length-1]??"0s");d=Math.max(d,u+m)}return Math.ceil(d)}_applyInertByOpen(){const e=this.renderRoot.querySelector(".panel");e&&(this.open?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false"),this._restoreTabIndexesIfNeeded()):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true"),this._removeTabIndexesIfNeeded()))}_supportsInert(){return"inert"in HTMLElement.prototype}_collectFocusableFromSlot(){const e=this._slotEl;if(!e)return[];const t=e.assignedElements({flatten:!0}),i=[],r=s=>{s instanceof HTMLElement&&s.matches("a,button,input,select,textarea,[tabindex]")&&i.push(s)};return t.forEach(s=>{var n;r(s),(n=s.querySelectorAll)==null||n.call(s,"a,button,input,select,textarea,[tabindex]").forEach(d=>r(d))}),i}_removeTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const i=t.getAttribute("tabindex");i!==null&&t.setAttribute("data-scb-prev-tabindex",i),t.setAttribute("tabindex","-1")})}_restoreTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const i=t.getAttribute("data-scb-prev-tabindex");i!==null?(t.setAttribute("tabindex",i),t.removeAttribute("data-scb-prev-tabindex")):t.removeAttribute("tabindex")})}_closeAllSubMenus(){const e=this.querySelectorAll("scb-sub-menu");for(const t of e)t.removeAttribute("open")}_applyChevronState(){const e=this._getChevronIconEl();e&&(e.style.transition="transform var(--motion-duration-medium, 200ms) var(--motion-easing-standard, ease)",e.style.transformOrigin="center",e.style.transform=this.open?"rotate(180deg)":"rotate(0deg)")}_getChevronIconEl(){const e=this._triggerEl,t=e==null?void 0:e.shadowRoot;return t?t.querySelector('md-icon[slot="icon"]')??t.querySelector("md-icon"):null}render(){const e=!!this._slottedMenuEl;return c`
5946
+ `,is([l({type:Boolean,reflect:!0})],a.ScbMenu.prototype,"open",2),is([l({type:Boolean,attribute:!1})],a.ScbMenu.prototype,"inSb",2),a.ScbMenu=is([y("scb-menu")],a.ScbMenu);var Tu=Object.defineProperty,Au=Object.getOwnPropertyDescriptor,ge=(o,e,t,i)=>{for(var r=i>1?void 0:i?Au(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Tu(e,t,r),r};a.ScbDropdown=class extends _{constructor(){super(...arguments),this.label="Dropdown",this.variant="filled",this.open=!1,this.disabled=!1,this.menuGap="3",this.width=null,this.minWidth=null,this.maxWidth=null,this._slottedMenuEl=null,this._openSettledTimer=null,this._menuCloseTimer=null,this._panelResizeObserver=null,this._panelHeightSyncRaf=null,this._onDocumentClickBound=e=>{if(!this.open)return;const t=e.composedPath(),i=t.find(r=>r instanceof HTMLElement&&r.tagName.toLowerCase()==="scb-dropdown");if(i&&i!==this){this.open=!1;return}t.includes(this)||(this.open=!1)},this._onDocumentKeydownBound=e=>{this.open&&e.key==="Escape"&&(this.open=!1)},this._onSlottedMenuOpen=()=>{this.open||(this.open=!0)},this._onSlottedMenuClose=()=>{this.open&&(this.open=!1)},this._onSlotChange=()=>{this._syncSlottedMenu(),this._applyPanelSizing(),this._applyInertByOpen(),this.requestUpdate()},this._onTriggerClick=e=>{e.stopPropagation(),!this.disabled&&(this.open=!this.open)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onDocumentClickBound,!0),document.addEventListener("keydown",this._onDocumentKeydownBound)}disconnectedCallback(){document.removeEventListener("click",this._onDocumentClickBound,!0),document.removeEventListener("keydown",this._onDocumentKeydownBound),this._detachSlottedMenuListeners(),this._panelResizeObserver&&(this._panelResizeObserver.disconnect(),this._panelResizeObserver=null),this._panelHeightSyncRaf!==null&&(window.cancelAnimationFrame(this._panelHeightSyncRaf),this._panelHeightSyncRaf=null),this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),super.disconnectedCallback()}firstUpdated(e){super.firstUpdated(e),this._syncSlottedMenu(),this._applyPanelVars(),this._applyPanelSizing(),this._applyChevronState(),this._applyInertByOpen(),this._setupPanelResizeObserver(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen()}updated(e){super.updated(e),e.has("menuGap")&&this._applyPanelVars(),(e.has("width")||e.has("minWidth")||e.has("maxWidth"))&&this._applyPanelSizing(),e.has("open")&&(this.open||this._closeAllSubMenus(),this._syncSlottedMenuOpen(),this._applyChevronState(),this._applyInertByOpen(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen())}_applyPanelVars(){if(this.menuGap==null||String(this.menuGap).trim()===""){this.style.removeProperty("--scb-dropdown-panel-gap");return}this.style.setProperty("--scb-dropdown-panel-gap",this._mapSpacingToken(this.menuGap))}_applyPanelSizing(){const e=this.renderRoot.querySelector(".panel-surface");e&&(this.width&&String(this.width).trim()!==""?e.style.inlineSize=this.width:e.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?e.style.minInlineSize=this.minWidth:e.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?e.style.maxInlineSize=this.maxWidth:e.style.removeProperty("max-inline-size")),this._slottedMenuEl&&(this.width&&String(this.width).trim()!==""?this._slottedMenuEl.style.inlineSize=this.width:this._slottedMenuEl.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?this._slottedMenuEl.style.minInlineSize=this.minWidth:this._slottedMenuEl.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?this._slottedMenuEl.style.maxInlineSize=this.maxWidth:this._slottedMenuEl.style.removeProperty("max-inline-size")),this._schedulePanelHeightSync()}_setupPanelResizeObserver(){if(this._panelResizeObserver||typeof ResizeObserver>"u")return;const e=this._panelInnerEl;e&&(this._panelResizeObserver=new ResizeObserver(()=>{this._schedulePanelHeightSync()}),this._panelResizeObserver.observe(e))}_schedulePanelHeightSync(){this._panelHeightSyncRaf===null&&(this._panelHeightSyncRaf=window.requestAnimationFrame(()=>{this._panelHeightSyncRaf=null,this._syncPanelMaxHeightByOpen()}))}_syncPanelMaxHeightByOpen(){const e=this._panelSurfaceEl;if(!e)return;if(this._slottedMenuEl){e.style.removeProperty("--scb-dropdown-panel-current-max-height");return}if(!this.open){e.style.setProperty("--scb-dropdown-panel-current-max-height","0px");return}const t=this._panelInnerEl;if(!t)return;const i=`${Math.ceil(t.scrollHeight)}px`;e.style.getPropertyValue("--scb-dropdown-panel-current-max-height").trim()!==i&&e.style.setProperty("--scb-dropdown-panel-current-max-height",i)}_mapSpacingToken(e){const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_syncSlottedMenu(){var i;const t=(((i=this._slotEl)==null?void 0:i.assignedElements({flatten:!0}))??[]).find(r=>r.tagName.toLowerCase()==="scb-menu");if(t===this._slottedMenuEl){this._syncSlottedMenuOpen();return}this._detachSlottedMenuListeners(),this._slottedMenuEl=t??null,this._slottedMenuEl&&(this._slottedMenuEl.addEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.addEventListener("close",this._onSlottedMenuClose),this._syncSlottedMenuOpen())}_detachSlottedMenuListeners(){this._slottedMenuEl&&(this._slottedMenuEl.removeEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.removeEventListener("close",this._onSlottedMenuClose))}_syncSlottedMenuOpen(){if(!this._slottedMenuEl)return;if(this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),this.open){this._slottedMenuEl.open=!0;return}const e=this._getPanelTransitionMs();if(e<=0){this._slottedMenuEl.open=!1;return}this._menuCloseTimer=window.setTimeout(()=>{this._menuCloseTimer=null,!this.open&&this._slottedMenuEl&&(this._slottedMenuEl.open=!1)},e)}_syncOverflowVisibilityByOpen(){if(this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this.removeAttribute("data-open-settled"),!this.open)return;const e=this.renderRoot.querySelector(".panel-surface");if(!e){this.setAttribute("data-open-settled","");return}const t=this._getTransitionMs(e);if(t<=0){this.setAttribute("data-open-settled","");return}this._openSettledTimer=window.setTimeout(()=>{this._openSettledTimer=null,this.open&&this.setAttribute("data-open-settled","")},t)}_getPanelTransitionMs(){const e=this.renderRoot.querySelector(".panel-surface");return e?this._getTransitionMs(e):0}_getTransitionMs(e){const t=getComputedStyle(e),i=t.transitionDuration.split(",").map(h=>h.trim()),r=t.transitionDelay.split(",").map(h=>h.trim()),s=h=>{const u=parseFloat(h);return Number.isFinite(u)?h.endsWith("ms")?u:h.endsWith("s")?u*1e3:u:0},n=Math.max(i.length,r.length);let d=0;for(let h=0;h<n;h+=1){const u=s(i[h]??i[i.length-1]??"0s"),m=s(r[h]??r[r.length-1]??"0s");d=Math.max(d,u+m)}return Math.ceil(d)}_applyInertByOpen(){const e=this.renderRoot.querySelector(".panel");e&&(this.open?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false"),this._restoreTabIndexesIfNeeded()):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true"),this._removeTabIndexesIfNeeded()))}_supportsInert(){return"inert"in HTMLElement.prototype}_collectFocusableFromSlot(){const e=this._slotEl;if(!e)return[];const t=e.assignedElements({flatten:!0}),i=[],r=s=>{s instanceof HTMLElement&&s.matches("a,button,input,select,textarea,[tabindex]")&&i.push(s)};return t.forEach(s=>{var n;r(s),(n=s.querySelectorAll)==null||n.call(s,"a,button,input,select,textarea,[tabindex]").forEach(d=>r(d))}),i}_removeTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const i=t.getAttribute("tabindex");i!==null&&t.setAttribute("data-scb-prev-tabindex",i),t.setAttribute("tabindex","-1")})}_restoreTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const i=t.getAttribute("data-scb-prev-tabindex");i!==null?(t.setAttribute("tabindex",i),t.removeAttribute("data-scb-prev-tabindex")):t.removeAttribute("tabindex")})}_closeAllSubMenus(){const e=this.querySelectorAll("scb-sub-menu");for(const t of e)t.removeAttribute("open")}_applyChevronState(){const e=this._getChevronIconEl();e&&(e.style.transition="transform var(--motion-duration-medium, 200ms) var(--motion-easing-standard, ease)",e.style.transformOrigin="center",e.style.transform=this.open?"rotate(180deg)":"rotate(0deg)")}_getChevronIconEl(){const e=this._triggerEl,t=e==null?void 0:e.shadowRoot;return t?t.querySelector('md-icon[slot="icon"]')??t.querySelector("md-icon"):null}render(){const e=!!this._slottedMenuEl;return c`
5947
5947
  <scb-button
5948
5948
  label=${this.label}
5949
5949
  variant=${this.variant}
@@ -6134,7 +6134,7 @@ ${this.value}</textarea
6134
6134
  transition: none;
6135
6135
  }
6136
6136
  }
6137
- `,$e([l({type:String})],a.ScbDropdown.prototype,"label",2),$e([l({type:String})],a.ScbDropdown.prototype,"variant",2),$e([l({type:Boolean,reflect:!0})],a.ScbDropdown.prototype,"open",2),$e([l({type:Boolean,reflect:!0})],a.ScbDropdown.prototype,"disabled",2),$e([l({type:String,attribute:"menu-gap"})],a.ScbDropdown.prototype,"menuGap",2),$e([l({type:String})],a.ScbDropdown.prototype,"width",2),$e([l({type:String,attribute:"max-width"})],a.ScbDropdown.prototype,"maxWidth",2),$e([A("scb-button")],a.ScbDropdown.prototype,"_triggerEl",2),$e([A("slot")],a.ScbDropdown.prototype,"_slotEl",2),$e([A(".panel-surface")],a.ScbDropdown.prototype,"_panelSurfaceEl",2),$e([A(".panel-inner")],a.ScbDropdown.prototype,"_panelInnerEl",2),a.ScbDropdown=$e([y("scb-dropdown")],a.ScbDropdown);var Iu=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,ho=(o,e,t,i)=>{for(var r=i>1?void 0:i?zu(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Iu(e,t,r),r};a.ScbFactCardContent=class extends _{constructor(){super(...arguments),this.title="",this.subtitle="",this.supportingText=""}render(){return c`
6137
+ `,ge([l({type:String})],a.ScbDropdown.prototype,"label",2),ge([l({type:String})],a.ScbDropdown.prototype,"variant",2),ge([l({type:Boolean,reflect:!0})],a.ScbDropdown.prototype,"open",2),ge([l({type:Boolean,reflect:!0})],a.ScbDropdown.prototype,"disabled",2),ge([l({type:String,attribute:"menu-gap"})],a.ScbDropdown.prototype,"menuGap",2),ge([l({type:String})],a.ScbDropdown.prototype,"width",2),ge([l({type:String,attribute:"min-width"})],a.ScbDropdown.prototype,"minWidth",2),ge([l({type:String,attribute:"max-width"})],a.ScbDropdown.prototype,"maxWidth",2),ge([A("scb-button")],a.ScbDropdown.prototype,"_triggerEl",2),ge([A("slot")],a.ScbDropdown.prototype,"_slotEl",2),ge([A(".panel-surface")],a.ScbDropdown.prototype,"_panelSurfaceEl",2),ge([A(".panel-inner")],a.ScbDropdown.prototype,"_panelInnerEl",2),a.ScbDropdown=ge([y("scb-dropdown")],a.ScbDropdown);var Iu=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,ho=(o,e,t,i)=>{for(var r=i>1?void 0:i?zu(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Iu(e,t,r),r};a.ScbFactCardContent=class extends _{constructor(){super(...arguments),this.title="",this.subtitle="",this.supportingText=""}render(){return c`
6138
6138
  ${this.title?c`<div class="label">${this.title}</div>`:""}
6139
6139
  ${this.subtitle?c`<div class="sub-label">${this.subtitle}</div>`:""}
6140
6140
  ${this.supportingText?c`<div class="supporting-text">${this.supportingText}</div>`:""}
@@ -6373,7 +6373,7 @@ ${this.value}</textarea
6373
6373
  :host([direction="row"]) ::slotted(*) {
6374
6374
  flex: var(--scb-stack-item-flex, 0 0 auto);
6375
6375
  }
6376
- `,ot([l({type:String,reflect:!0})],a.ScbStack.prototype,"direction",2),ot([l({type:String,reflect:!0})],a.ScbStack.prototype,"gap",2),ot([l({type:String,attribute:"row-gap",reflect:!0})],a.ScbStack.prototype,"rowGap",2),ot([l({type:String,attribute:"column-gap",reflect:!0})],a.ScbStack.prototype,"columnGap",2),ot([l({type:String,reflect:!0})],a.ScbStack.prototype,"align",2),ot([l({type:String,reflect:!0})],a.ScbStack.prototype,"justify",2),ot([l({type:Boolean,reflect:!0})],a.ScbStack.prototype,"wrap",2),ot([l({type:Boolean,reflect:!0})],a.ScbStack.prototype,"inline",2),a.ScbStack=ot([y("scb-stack")],a.ScbStack);var ju=Object.defineProperty,Ku=Object.getOwnPropertyDescriptor,xl=o=>{throw TypeError(o)},ge=(o,e,t,i)=>{for(var r=i>1?void 0:i?Ku(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&ju(e,t,r),r},Gu=(o,e,t)=>e.has(o)||xl("Cannot "+t),Yu=(o,e,t)=>e.has(o)?xl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),li=(o,e,t)=>(Gu(o,e,"access private method"),t),gt,ss,Ki;a.ScbGrid=class extends _{constructor(){super(...arguments),Yu(this,gt),this.colsCompact=4,this.colsMedium=8,this.colsExpanded=12,this.gap="",this.rowGap="",this.columnGap="",this.alignItems="stretch",this.justifyItems="stretch",this.paddingInline="",this.paddingBlock="",this.maxWidth="",this.autoRows=""}firstUpdated(){li(this,gt,ss).call(this)}updated(){li(this,gt,ss).call(this)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}parseGapShorthand(e){if(!e)return{};const t=e.trim().split(/\s+/);if(t.length===1){const i=this.mapSpacingToken(t[0]);return{row:i,col:i}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}render(){return c`<div class="grid"><slot></slot></div>`}},gt=new WeakSet,ss=function(){this.style.setProperty("--scb-grid-cols-compact",String(this.colsCompact)),this.style.setProperty("--scb-grid-cols-medium",String(this.colsMedium)),this.style.setProperty("--scb-grid-cols-expanded",String(this.colsExpanded));const o="var(--spacing-7, 24px)",e=this.parseGapShorthand(this.gap),t=this.mapSpacingToken(this.rowGap)??e.row??o,i=this.mapSpacingToken(this.columnGap)??e.col??o;this.style.setProperty("--scb-grid-row-gap",t),this.style.setProperty("--scb-grid-column-gap",i),this.style.setProperty("--scb-grid-gap",`${t} ${i}`),this.style.setProperty("--scb-grid-align-items",this.alignItems),this.style.setProperty("--scb-grid-justify-items",this.justifyItems);const r=this.mapSpacingToken(this.paddingInline),s=this.mapSpacingToken(this.paddingBlock);li(this,gt,Ki).call(this,"--scb-grid-max-width",this.maxWidth),li(this,gt,Ki).call(this,"--scb-grid-padding-inline",r??""),li(this,gt,Ki).call(this,"--scb-grid-padding-block",s??""),li(this,gt,Ki).call(this,"--scb-grid-auto-rows",this.autoRows)},Ki=function(o,e){e?this.style.setProperty(o,e):this.style.removeProperty(o)},a.ScbGrid.styles=f`
6376
+ `,ot([l({type:String,reflect:!0})],a.ScbStack.prototype,"direction",2),ot([l({type:String,reflect:!0})],a.ScbStack.prototype,"gap",2),ot([l({type:String,attribute:"row-gap",reflect:!0})],a.ScbStack.prototype,"rowGap",2),ot([l({type:String,attribute:"column-gap",reflect:!0})],a.ScbStack.prototype,"columnGap",2),ot([l({type:String,reflect:!0})],a.ScbStack.prototype,"align",2),ot([l({type:String,reflect:!0})],a.ScbStack.prototype,"justify",2),ot([l({type:Boolean,reflect:!0})],a.ScbStack.prototype,"wrap",2),ot([l({type:Boolean,reflect:!0})],a.ScbStack.prototype,"inline",2),a.ScbStack=ot([y("scb-stack")],a.ScbStack);var ju=Object.defineProperty,Ku=Object.getOwnPropertyDescriptor,xl=o=>{throw TypeError(o)},ye=(o,e,t,i)=>{for(var r=i>1?void 0:i?Ku(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&ju(e,t,r),r},Gu=(o,e,t)=>e.has(o)||xl("Cannot "+t),Yu=(o,e,t)=>e.has(o)?xl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),li=(o,e,t)=>(Gu(o,e,"access private method"),t),gt,ss,Ki;a.ScbGrid=class extends _{constructor(){super(...arguments),Yu(this,gt),this.colsCompact=4,this.colsMedium=8,this.colsExpanded=12,this.gap="",this.rowGap="",this.columnGap="",this.alignItems="stretch",this.justifyItems="stretch",this.paddingInline="",this.paddingBlock="",this.maxWidth="",this.autoRows=""}firstUpdated(){li(this,gt,ss).call(this)}updated(){li(this,gt,ss).call(this)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}parseGapShorthand(e){if(!e)return{};const t=e.trim().split(/\s+/);if(t.length===1){const i=this.mapSpacingToken(t[0]);return{row:i,col:i}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}render(){return c`<div class="grid"><slot></slot></div>`}},gt=new WeakSet,ss=function(){this.style.setProperty("--scb-grid-cols-compact",String(this.colsCompact)),this.style.setProperty("--scb-grid-cols-medium",String(this.colsMedium)),this.style.setProperty("--scb-grid-cols-expanded",String(this.colsExpanded));const o="var(--spacing-7, 24px)",e=this.parseGapShorthand(this.gap),t=this.mapSpacingToken(this.rowGap)??e.row??o,i=this.mapSpacingToken(this.columnGap)??e.col??o;this.style.setProperty("--scb-grid-row-gap",t),this.style.setProperty("--scb-grid-column-gap",i),this.style.setProperty("--scb-grid-gap",`${t} ${i}`),this.style.setProperty("--scb-grid-align-items",this.alignItems),this.style.setProperty("--scb-grid-justify-items",this.justifyItems);const r=this.mapSpacingToken(this.paddingInline),s=this.mapSpacingToken(this.paddingBlock);li(this,gt,Ki).call(this,"--scb-grid-max-width",this.maxWidth),li(this,gt,Ki).call(this,"--scb-grid-padding-inline",r??""),li(this,gt,Ki).call(this,"--scb-grid-padding-block",s??""),li(this,gt,Ki).call(this,"--scb-grid-auto-rows",this.autoRows)},Ki=function(o,e){e?this.style.setProperty(o,e):this.style.removeProperty(o)},a.ScbGrid.styles=f`
6377
6377
  :host {
6378
6378
  box-sizing: border-box;
6379
6379
  display: block;
@@ -6470,7 +6470,7 @@ ${this.value}</textarea
6470
6470
  }
6471
6471
  }
6472
6472
  }
6473
- `,ge([l({type:Number,attribute:"cols-compact",reflect:!0})],a.ScbGrid.prototype,"colsCompact",2),ge([l({type:Number,attribute:"cols-medium",reflect:!0})],a.ScbGrid.prototype,"colsMedium",2),ge([l({type:Number,attribute:"cols-expanded",reflect:!0})],a.ScbGrid.prototype,"colsExpanded",2),ge([l({type:String,reflect:!0})],a.ScbGrid.prototype,"gap",2),ge([l({type:String,attribute:"row-gap",reflect:!0})],a.ScbGrid.prototype,"rowGap",2),ge([l({type:String,attribute:"column-gap",reflect:!0})],a.ScbGrid.prototype,"columnGap",2),ge([l({type:String,attribute:"align-items",reflect:!0})],a.ScbGrid.prototype,"alignItems",2),ge([l({type:String,attribute:"justify-items",reflect:!0})],a.ScbGrid.prototype,"justifyItems",2),ge([l({type:String,attribute:"padding-inline",reflect:!0})],a.ScbGrid.prototype,"paddingInline",2),ge([l({type:String,attribute:"padding-block",reflect:!0})],a.ScbGrid.prototype,"paddingBlock",2),ge([l({type:String,attribute:"max-width",reflect:!0})],a.ScbGrid.prototype,"maxWidth",2),ge([l({type:String,attribute:"auto-rows",reflect:!0})],a.ScbGrid.prototype,"autoRows",2),a.ScbGrid=ge([y("scb-grid")],a.ScbGrid);var Xu=Object.defineProperty,Zu=Object.getOwnPropertyDescriptor,wl=o=>{throw TypeError(o)},Gi=(o,e,t,i)=>{for(var r=i>1?void 0:i?Zu(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Xu(e,t,r),r},ns=(o,e,t)=>e.has(o)||wl("Cannot "+t),at=(o,e,t)=>(ns(o,e,"read from private field"),t?t.call(o):e.get(o)),ci=(o,e,t)=>e.has(o)?wl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),qt=(o,e,t,i)=>(ns(o,e,"write to private field"),e.set(o,t),t),st=(o,e,t)=>(ns(o,e,"access private method"),t),di,Yi,hi,Xi,Te,Sl,ls,kl,cs,ds,$l,Cl,hs;a.ScbFooter=class extends _{constructor(){super(...arguments),ci(this,Te),this.maxWidth="1440px",this.deferPaint=!1,this.sections=[],this.description="Statistikmyndigheten SCB förser samhället med statistik för beslutsfattande, debatt och forskning.",ci(this,di,null),ci(this,Yi,""),ci(this,hi),ci(this,Xi,!1),ci(this,ds,8)}connectedCallback(){super.connectedCallback(),this.style.setProperty("--scb-footer-max-width",this.maxWidth),st(this,Te,cs).call(this,!0),st(this,Te,Sl).call(this)}updated(e){e.has("maxWidth")&&this.style.setProperty("--scb-footer-max-width",this.maxWidth)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=at(this,hi))==null||e.disconnect()}render(){const e=at(this,Te,kl);return c`
6473
+ `,ye([l({type:Number,attribute:"cols-compact",reflect:!0})],a.ScbGrid.prototype,"colsCompact",2),ye([l({type:Number,attribute:"cols-medium",reflect:!0})],a.ScbGrid.prototype,"colsMedium",2),ye([l({type:Number,attribute:"cols-expanded",reflect:!0})],a.ScbGrid.prototype,"colsExpanded",2),ye([l({type:String,reflect:!0})],a.ScbGrid.prototype,"gap",2),ye([l({type:String,attribute:"row-gap",reflect:!0})],a.ScbGrid.prototype,"rowGap",2),ye([l({type:String,attribute:"column-gap",reflect:!0})],a.ScbGrid.prototype,"columnGap",2),ye([l({type:String,attribute:"align-items",reflect:!0})],a.ScbGrid.prototype,"alignItems",2),ye([l({type:String,attribute:"justify-items",reflect:!0})],a.ScbGrid.prototype,"justifyItems",2),ye([l({type:String,attribute:"padding-inline",reflect:!0})],a.ScbGrid.prototype,"paddingInline",2),ye([l({type:String,attribute:"padding-block",reflect:!0})],a.ScbGrid.prototype,"paddingBlock",2),ye([l({type:String,attribute:"max-width",reflect:!0})],a.ScbGrid.prototype,"maxWidth",2),ye([l({type:String,attribute:"auto-rows",reflect:!0})],a.ScbGrid.prototype,"autoRows",2),a.ScbGrid=ye([y("scb-grid")],a.ScbGrid);var Xu=Object.defineProperty,Zu=Object.getOwnPropertyDescriptor,wl=o=>{throw TypeError(o)},Gi=(o,e,t,i)=>{for(var r=i>1?void 0:i?Zu(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Xu(e,t,r),r},ns=(o,e,t)=>e.has(o)||wl("Cannot "+t),at=(o,e,t)=>(ns(o,e,"read from private field"),t?t.call(o):e.get(o)),ci=(o,e,t)=>e.has(o)?wl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),qt=(o,e,t,i)=>(ns(o,e,"write to private field"),e.set(o,t),t),st=(o,e,t)=>(ns(o,e,"access private method"),t),di,Yi,hi,Xi,Te,Sl,ls,kl,cs,ds,$l,Cl,hs;a.ScbFooter=class extends _{constructor(){super(...arguments),ci(this,Te),this.maxWidth="1440px",this.deferPaint=!1,this.sections=[],this.description="Statistikmyndigheten SCB förser samhället med statistik för beslutsfattande, debatt och forskning.",ci(this,di,null),ci(this,Yi,""),ci(this,hi),ci(this,Xi,!1),ci(this,ds,8)}connectedCallback(){super.connectedCallback(),this.style.setProperty("--scb-footer-max-width",this.maxWidth),st(this,Te,cs).call(this,!0),st(this,Te,Sl).call(this)}updated(e){e.has("maxWidth")&&this.style.setProperty("--scb-footer-max-width",this.maxWidth)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=at(this,hi))==null||e.disconnect()}render(){const e=at(this,Te,kl);return c`
6474
6474
  <footer class="outer" role="contentinfo">
6475
6475
  <nav aria-label="Sidfot med länkar">
6476
6476
  <scb-grid
@@ -9509,7 +9509,7 @@ ${this.value}</textarea
9509
9509
  .scb-toc-list {
9510
9510
  display: block;
9511
9511
  }
9512
- `],ir([l({type:Boolean,reflect:!0})],a.ScbToc.prototype,"detached",2),ir([l({type:String,reflect:!0})],a.ScbToc.prototype,"spacing",2),ir([l({type:String,attribute:"spacing-top",reflect:!0})],a.ScbToc.prototype,"spacingTop",2),ir([l({type:String,attribute:"spacing-bottom",reflect:!0})],a.ScbToc.prototype,"spacingBottom",2),a.ScbToc=ir([y("scb-toc")],a.ScbToc);var lb=Object.defineProperty,cb=Object.getOwnPropertyDescriptor,Ge=(o,e,t,i)=>{for(var r=i>1?void 0:i?cb(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&lb(e,t,r),r};let db=0;a.ScbTooltip=class extends _{constructor(){super(...arguments),this.variant="plain",this.arrow=null,this.supportingtext="",this.label="",this.trigger="hover",this.position="top",this.open=!1,this.delay=.25,this.offset=0,this._hoverActive=!1,this._clickActive=!1,this._hideTimeout=null,this._triggerEl=null,this._originalPosition="top",this._tooltipId=`scb-tooltip-${++db}`,this._onTriggerMouseEnter=()=>{this._hoverActive=!0,this.open=!0},this._onTriggerMouseLeave=()=>{this._hoverActive=!1,this._clickActive||(this.open=!1)},this._onTriggerFocus=()=>{this._hoverActive=!0,this.open=!0},this._onTriggerBlur=()=>{this._hoverActive=!1,this._clickActive||(this.open=!1)},this._onTooltipMouseEnter=()=>{(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!0,this.open=!0)},this._onTooltipMouseLeave=()=>{(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!1,this._clickActive||(this.open=!1))},this._onTriggerClick=()=>{this._clickActive=!this._clickActive,this._clickActive?this.open=!0:this._hoverActive||(this.open=!1)}}firstUpdated(){if(this._originalPosition=this.position,this._updateDelayCss(),this._updateTriggerElement(),this._updateTooltipHoverListeners(),this.open){const e=this._getTooltipElement();e&&this._showTooltip(e)}}updated(e){if(e.has("trigger")&&(this._updateTriggerElement(),this._updateTooltipHoverListeners()),e.has("delay")&&this._updateDelayCss(),e.has("open")){const t=this._getTooltipElement();if(!t)return;this.open?this._showTooltip(t):this._hideTooltip(t)}}disconnectedCallback(){super.disconnectedCallback(),this._detachTriggerListeners();const e=this._getTooltipElement();e&&(e.removeEventListener("mouseenter",this._onTooltipMouseEnter),e.removeEventListener("mouseleave",this._onTooltipMouseLeave)),this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null)}_getTooltipElement(){return this.renderRoot.querySelector(".scb-tooltip")}_updateDelayCss(){const e=Number.isFinite(this.delay)?this.delay:.25;this.style.setProperty("--delay",`${e}s`)}_findTriggerElement(){const e=this.querySelector("[scb-tooltip-anchor]:not([slot])");return e||(Array.from(this.children).find(i=>i.nodeType===Node.ELEMENT_NODE)??null)}_updateTriggerElement(){const e=this._triggerEl;e&&(this._detachTriggerListeners(),e.removeAttribute("aria-describedby"));const t=this._findTriggerElement();this._triggerEl=t,t&&(t.setAttribute("aria-describedby",this._tooltipId),(this.trigger==="click"||this.trigger==="hover-click")&&t.addEventListener("click",this._onTriggerClick),(this.trigger==="hover"||this.trigger==="hover-click")&&(t.addEventListener("mouseenter",this._onTriggerMouseEnter),t.addEventListener("mouseleave",this._onTriggerMouseLeave),t.addEventListener("focus",this._onTriggerFocus),t.addEventListener("blur",this._onTriggerBlur)))}_updateTooltipHoverListeners(){const e=this._getTooltipElement();e&&(e.removeEventListener("mouseenter",this._onTooltipMouseEnter),e.removeEventListener("mouseleave",this._onTooltipMouseLeave),(this.trigger==="hover"||this.trigger==="hover-click")&&(e.addEventListener("mouseenter",this._onTooltipMouseEnter),e.addEventListener("mouseleave",this._onTooltipMouseLeave)))}_detachTriggerListeners(){const e=this._triggerEl;e&&(e.removeEventListener("click",this._onTriggerClick),e.removeEventListener("mouseenter",this._onTriggerMouseEnter),e.removeEventListener("mouseleave",this._onTriggerMouseLeave),e.removeEventListener("focus",this._onTriggerFocus),e.removeEventListener("blur",this._onTriggerBlur))}_showTooltip(e){this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null);const t=this._triggerEl;this._resetPosition(),e.classList.remove("hidden"),e.setAttribute("aria-hidden","false"),requestAnimationFrame(()=>{t&&this._positionTooltip(e,t),e.setAttribute("open","")})}_hideTooltip(e){e.removeAttribute("open"),e.setAttribute("aria-hidden","true"),this._scheduleHidden(e)}_scheduleHidden(e){const t=(Number.isFinite(this.delay)?this.delay:.25)*1e3;if(t<=0){e.classList.add("hidden");return}this._hideTimeout=window.setTimeout(()=>{e.classList.add("hidden"),this._hideTimeout=null},t)}_resetPosition(){this.position=this._originalPosition}_positionTooltip(e,t){const i=t.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.getBoundingClientRect(),h=(this.offset??0)+8,u=8,m=u,b=window.innerHeight-u,x=u,g=window.innerWidth-u,w=G=>G>=m&&G+r.height<=b,S=G=>G>=x&&G+r.width<=g,k=(G,xe,Ve,ar)=>{let bi=0;G<Ve&&(bi+=Ve-G);const Co=G+xe;return Co>ar&&(bi+=Co-ar),bi},$=G=>{let xe=0,Ve=0;switch(G){case"top":xe=i.top-s.top-r.height-h,Ve=i.left-s.left+(i.width-r.width)/2;break;case"bottom":xe=i.bottom-s.top+h,Ve=i.left-s.left+(i.width-r.width)/2;break;case"left":Ve=i.left-s.left-r.width-h,xe=i.top-s.top+(i.height-r.height)/2;break;case"right":Ve=i.right-s.left+h,xe=i.top-s.top+(i.height-r.height)/2;break}const ar=xe+s.top,bi=Ve+s.left,Co=k(ar,r.height,m,b),bb=k(bi,r.width,x,g);return{pos:G,top:xe,left:Ve,fitsV:w(ar),fitsH:S(bi),totalOverflow:Co+bb}},C=this.position==="top"||this.position==="bottom",D=this.position,P=this._getOppositePosition(D),j=[D,P,C?"left":"top",C?"right":"bottom"].map($);let L=j.find(G=>G.fitsV&&G.fitsH)??j.reduce((G,xe)=>xe.totalOverflow<G.totalOverflow?xe:G);const lt=(G,xe,Ve)=>Math.min(Math.max(G,xe),Ve),T=m-s.top,N=b-r.height-s.top,ze=x-s.left,_e=g-r.width-s.left,Ne=lt(L.top,T,N),be=lt(L.left,ze,_e);e.style.top=`${Ne}px`,e.style.left=`${be}px`,this.position!==L.pos&&(this.position=L.pos)}_getOppositePosition(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}_onDefaultSlotChange(){this._updateTriggerElement()}render(){const e=this.arrow?c`<svg
9512
+ `],ir([l({type:Boolean,reflect:!0})],a.ScbToc.prototype,"detached",2),ir([l({type:String,reflect:!0})],a.ScbToc.prototype,"spacing",2),ir([l({type:String,attribute:"spacing-top",reflect:!0})],a.ScbToc.prototype,"spacingTop",2),ir([l({type:String,attribute:"spacing-bottom",reflect:!0})],a.ScbToc.prototype,"spacingBottom",2),a.ScbToc=ir([y("scb-toc")],a.ScbToc);var lb=Object.defineProperty,cb=Object.getOwnPropertyDescriptor,Ge=(o,e,t,i)=>{for(var r=i>1?void 0:i?cb(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&lb(e,t,r),r};let db=0;a.ScbTooltip=class extends _{constructor(){super(...arguments),this.variant="plain",this.arrow=null,this.supportingtext="",this.label="",this.trigger="hover",this.position="top",this.open=!1,this.delay=.25,this.offset=0,this._hoverActive=!1,this._clickActive=!1,this._hideTimeout=null,this._triggerEl=null,this._originalPosition="top",this._tooltipId=`scb-tooltip-${++db}`,this._onTriggerMouseEnter=()=>{this._hoverActive=!0,this.open=!0},this._onTriggerMouseLeave=()=>{this._hoverActive=!1,this._clickActive||(this.open=!1)},this._onTriggerFocus=()=>{this._hoverActive=!0,this.open=!0},this._onTriggerBlur=()=>{this._hoverActive=!1,this._clickActive||(this.open=!1)},this._onTooltipMouseEnter=()=>{(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!0,this.open=!0)},this._onTooltipMouseLeave=()=>{(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!1,this._clickActive||(this.open=!1))},this._onTriggerClick=()=>{this._clickActive=!this._clickActive,this._clickActive?this.open=!0:this._hoverActive||(this.open=!1)}}firstUpdated(){if(this._originalPosition=this.position,this._updateDelayCss(),this._updateTriggerElement(),this._updateTooltipHoverListeners(),this.open){const e=this._getTooltipElement();e&&this._showTooltip(e)}}updated(e){if(e.has("trigger")&&(this._updateTriggerElement(),this._updateTooltipHoverListeners()),e.has("delay")&&this._updateDelayCss(),e.has("open")){const t=this._getTooltipElement();if(!t)return;this.open?this._showTooltip(t):this._hideTooltip(t)}}disconnectedCallback(){super.disconnectedCallback(),this._detachTriggerListeners();const e=this._getTooltipElement();e&&(e.removeEventListener("mouseenter",this._onTooltipMouseEnter),e.removeEventListener("mouseleave",this._onTooltipMouseLeave)),this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null)}_getTooltipElement(){return this.renderRoot.querySelector(".scb-tooltip")}_updateDelayCss(){const e=Number.isFinite(this.delay)?this.delay:.25;this.style.setProperty("--delay",`${e}s`)}_findTriggerElement(){const e=this.querySelector("[scb-tooltip-anchor]:not([slot])");return e||(Array.from(this.children).find(i=>i.nodeType===Node.ELEMENT_NODE)??null)}_updateTriggerElement(){const e=this._triggerEl;e&&(this._detachTriggerListeners(),e.removeAttribute("aria-describedby"));const t=this._findTriggerElement();this._triggerEl=t,t&&(t.setAttribute("aria-describedby",this._tooltipId),(this.trigger==="click"||this.trigger==="hover-click")&&t.addEventListener("click",this._onTriggerClick),(this.trigger==="hover"||this.trigger==="hover-click")&&(t.addEventListener("mouseenter",this._onTriggerMouseEnter),t.addEventListener("mouseleave",this._onTriggerMouseLeave),t.addEventListener("focus",this._onTriggerFocus),t.addEventListener("blur",this._onTriggerBlur)))}_updateTooltipHoverListeners(){const e=this._getTooltipElement();e&&(e.removeEventListener("mouseenter",this._onTooltipMouseEnter),e.removeEventListener("mouseleave",this._onTooltipMouseLeave),(this.trigger==="hover"||this.trigger==="hover-click")&&(e.addEventListener("mouseenter",this._onTooltipMouseEnter),e.addEventListener("mouseleave",this._onTooltipMouseLeave)))}_detachTriggerListeners(){const e=this._triggerEl;e&&(e.removeEventListener("click",this._onTriggerClick),e.removeEventListener("mouseenter",this._onTriggerMouseEnter),e.removeEventListener("mouseleave",this._onTriggerMouseLeave),e.removeEventListener("focus",this._onTriggerFocus),e.removeEventListener("blur",this._onTriggerBlur))}_showTooltip(e){this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null);const t=this._triggerEl;this._resetPosition(),e.classList.remove("hidden"),e.setAttribute("aria-hidden","false"),requestAnimationFrame(()=>{t&&this._positionTooltip(e,t),e.setAttribute("open","")})}_hideTooltip(e){e.removeAttribute("open"),e.setAttribute("aria-hidden","true"),this._scheduleHidden(e)}_scheduleHidden(e){const t=(Number.isFinite(this.delay)?this.delay:.25)*1e3;if(t<=0){e.classList.add("hidden");return}this._hideTimeout=window.setTimeout(()=>{e.classList.add("hidden"),this._hideTimeout=null},t)}_resetPosition(){this.position=this._originalPosition}_positionTooltip(e,t){const i=t.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.getBoundingClientRect(),h=(this.offset??0)+8,u=8,m=u,b=window.innerHeight-u,x=u,g=window.innerWidth-u,w=G=>G>=m&&G+r.height<=b,S=G=>G>=x&&G+r.width<=g,k=(G,we,Ve,ar)=>{let bi=0;G<Ve&&(bi+=Ve-G);const Co=G+we;return Co>ar&&(bi+=Co-ar),bi},$=G=>{let we=0,Ve=0;switch(G){case"top":we=i.top-s.top-r.height-h,Ve=i.left-s.left+(i.width-r.width)/2;break;case"bottom":we=i.bottom-s.top+h,Ve=i.left-s.left+(i.width-r.width)/2;break;case"left":Ve=i.left-s.left-r.width-h,we=i.top-s.top+(i.height-r.height)/2;break;case"right":Ve=i.right-s.left+h,we=i.top-s.top+(i.height-r.height)/2;break}const ar=we+s.top,bi=Ve+s.left,Co=k(ar,r.height,m,b),bb=k(bi,r.width,x,g);return{pos:G,top:we,left:Ve,fitsV:w(ar),fitsH:S(bi),totalOverflow:Co+bb}},C=this.position==="top"||this.position==="bottom",D=this.position,P=this._getOppositePosition(D),j=[D,P,C?"left":"top",C?"right":"bottom"].map($);let L=j.find(G=>G.fitsV&&G.fitsH)??j.reduce((G,we)=>we.totalOverflow<G.totalOverflow?we:G);const lt=(G,we,Ve)=>Math.min(Math.max(G,we),Ve),T=m-s.top,N=b-r.height-s.top,ze=x-s.left,xe=g-r.width-s.left,Ne=lt(L.top,T,N),be=lt(L.left,ze,xe);e.style.top=`${Ne}px`,e.style.left=`${be}px`,this.position!==L.pos&&(this.position=L.pos)}_getOppositePosition(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}_onDefaultSlotChange(){this._updateTriggerElement()}render(){const e=this.arrow?c`<svg
9513
9513
  class="scb-tooltip-arrow"
9514
9514
  xmlns="http://www.w3.org/2000/svg"
9515
9515
  width="13"