@digdir/designsystemet-web 1.19.0 → 1.20.0

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.
Files changed (35) hide show
  1. package/dist/cjs/_vendors/@oddbird/popover-polyfill/dist/popover-fn.cjs +2 -2
  2. package/dist/cjs/_vendors/@oddbird/popover-polyfill/dist/popover-fn.cjs.map +1 -1
  3. package/dist/cjs/clickdelegatefor/clickdelegatefor.cjs +1 -1
  4. package/dist/cjs/clickdelegatefor/clickdelegatefor.cjs.map +1 -1
  5. package/dist/cjs/field/field.cjs +1 -1
  6. package/dist/cjs/field/field.cjs.map +1 -1
  7. package/dist/cjs/fieldset/fieldset.cjs +1 -1
  8. package/dist/cjs/fieldset/fieldset.cjs.map +1 -1
  9. package/dist/cjs/packages/web/package.cjs +1 -1
  10. package/dist/cjs/popover/popover.cjs +1 -1
  11. package/dist/cjs/popover/popover.cjs.map +1 -1
  12. package/dist/cjs/suggestion/suggestion.cjs +1 -1
  13. package/dist/cjs/suggestion/suggestion.cjs.map +1 -1
  14. package/dist/cjs/tooltip/tooltip.cjs +1 -1
  15. package/dist/cjs/tooltip/tooltip.cjs.map +1 -1
  16. package/dist/custom-elements.json +2 -2
  17. package/dist/esm/_vendors/@oddbird/popover-polyfill/dist/popover-fn.js +2 -2
  18. package/dist/esm/_vendors/@oddbird/popover-polyfill/dist/popover-fn.js.map +1 -1
  19. package/dist/esm/clickdelegatefor/clickdelegatefor.js +1 -1
  20. package/dist/esm/clickdelegatefor/clickdelegatefor.js.map +1 -1
  21. package/dist/esm/field/field.js +1 -1
  22. package/dist/esm/field/field.js.map +1 -1
  23. package/dist/esm/fieldset/fieldset.js +1 -1
  24. package/dist/esm/fieldset/fieldset.js.map +1 -1
  25. package/dist/esm/packages/web/package.js +1 -1
  26. package/dist/esm/popover/popover.js +1 -1
  27. package/dist/esm/popover/popover.js.map +1 -1
  28. package/dist/esm/suggestion/suggestion.js +1 -1
  29. package/dist/esm/suggestion/suggestion.js.map +1 -1
  30. package/dist/esm/tooltip/tooltip.js +1 -1
  31. package/dist/esm/tooltip/tooltip.js.map +1 -1
  32. package/dist/index.js +95 -52
  33. package/dist/umd/index.js +8 -7
  34. package/dist/umd/index.js.map +1 -1
  35. package/package.json +8 -5
package/dist/umd/index.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Designsystemet={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=`1.19.0`;let n=`aria-label`,r=`aria-labelledby`,i={passive:!0,capture:!0},a=()=>typeof window<`u`&&typeof document<`u`,o=()=>a()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),s=typeof HTMLElement>`u`?class{}:HTMLElement;function c(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}let l=(e,...t)=>!a()||window.dsWarnings===!1||console.log(`\x1B[1mDesignsystemet:\x1B[m ${e}`,...t),u=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),d=(e,t)=>getComputedStyle(e).getPropertyValue(t).trim(),f=/^["']|["']$/g,p=(e,t)=>{let n=u(e,t);return n||=d(e,`--_ds-${t}`).replace(f,``).trim(),n||null},m=e=>{let t=e?.getRootNode?.()||e?.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:e?.ownerDocument||document},h=e=>{let t=e.target?.shadowRoot&&e.composedPath()[0]||e.target;return t?.nodeType===1?t:null},g=e=>{let t=new Set;for(;e;)t.add(e),e=e.nodeType===11?e.host:e.assignedSlot||e.parentNode;return t},_=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>v(e,...t)},v=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},y=`_dsHotReloadCleanup${t}`,b=(e,t)=>{if(a()){window[y]||(window[y]=new Map);for(let t of window[y]?.get(e)||[])t();window[y]?.set(e,t())}},x=(e,t,n)=>{let r=()=>i.disconnect(),i=new MutationObserver(n=>{if(!a()||!e.isConnected)return r();t(e,n)});return t(e),i.observe(e,n),r},ee=(e,t)=>{let n=document.createElement(e);if(t)for(let[e,r]of Object.entries(t))u(n,e,r);return n},S={define:(e,t)=>!a()||window.customElements.get(e)||window.customElements.define(e,t)},C=0;function w(e){return a()?(window.dsUseId||(window.dsUseId=0),e&&!e.id&&(e.id=`:ds:${++window.dsUseId}`),e?.id||``):`:ds:${++C}`}let T,te=0,ne=0,re=e=>{clearTimeout(ne),T&&(T.textContent=`${e}${te++%2?`\xA0`:``}`),e&&(ne=setTimeout(re,2e3,``))},ie=()=>{document.readyState===`complete`&&(T||(T=ee(`div`,{"aria-live":`assertive`}),T.style.overflow=`hidden`,T.style.position=`fixed`,T.style.whiteSpace=`nowrap`,T.style.width=`1px`),T.isConnected||document.body.appendChild(T))};b(`announce`,()=>[_(document,`focus mouseover`,ie,i)]);let ae=`:click-delegate-hover`,oe=new Set([`A`,`BUTTON`,`DETAILS`,`DIALOG`,`INPUT`,`LABEL`,`SELECT`,`TEXTAREA`]),se=e=>{let t=e.button===1||e.metaKey||e.ctrlKey,n=h(e),r=e.button<2&&de(e);if(!(!r||r.contains(n))){if(t&&r instanceof HTMLAnchorElement)return window.open(r.href,void 0,r.rel);e.stopImmediatePropagation(),r.nodeName!==`LABEL`&&r.click()}},ce,le,ue=e=>{let t=h(e);if(!t||t===le)return;le=t;let n=de(e);ce!==n&&(ce&&ce.classList.remove(ae),n&&n.classList.add(ae),ce=n)},de=e=>{let t;for(let n of e.composedPath()){if(n.nodeType!==1)continue;n.nodeName===`LABEL`&&(n=n.control||n);let e=n.getAttribute(`data-clickdelegatefor`);if(e){let r=m(n).getElementById(e);return r&&!(t&&t!==r)&&!r.disabled&&!r.readOnly?r:void 0}!t&&fe(n)&&(t=n)}},fe=e=>e.isContentEditable||e.popover||oe.has(e.nodeName)||u(e,`role`)===`button`;b(`clickdelegatefor`,()=>[_(window,`click auxclick`,se,!0),_(document,`mousemove`,ue,i)]);var pe=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,me=pe(),he=me?navigator.userAgent:``,ge=/android/i.test(he),_e=/firefox/i.test(he);me&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var ve=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),ye=(e,t,n)=>{let r=new MutationObserver(n=>{if(!pe()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},be=`__uDetailsPolyfillSummarys`;if(pe()&&ge&&_e&&!window[be]){let e=document.getElementsByTagName(`summary`);window[be]=ye(document,()=>{for(let t of e){let e=t.parentElement;ve(t,`role`,`button`),ve(t,`aria-expanded`,`${!!e?.open}`)}},{attributeFilter:[`open`],attributes:!0,childList:!0,subtree:!0})}let xe=!1,Se=e=>{let{type:t,clientX:n=0,clientY:r=0}=e,i=h(e);if(i&&t===`pointerdown`)for(let e of g(i)){if(e.nodeName!==`DIALOG`)continue;let t=e.getBoundingClientRect();xe=t.top<=r&&r<=t.bottom&&t.left<=n&&n<=t.right;return}else{let e=i?.nodeName===`DIALOG`&&!xe&&u(i,`closedby`)===`any`;xe=!1,e&&setTimeout(Ce,0,i)}},Ce=e=>e.open&&e.close(),we=`--show-non-modal`,Te=e=>{for(let t of e.composedPath()){let e=t.nodeType===1&&u(t,`command`);if(e===`show-modal`||e===we)return u(t,`aria-haspopup`,`dialog`)}},Ee=({command:e,target:t})=>e===we&&t instanceof HTMLDialogElement&&t.show();b(`dialog`,()=>[_(document,`command`,Ee,i),_(document,`focus`,Te,i),_(document,`pointerdown pointerup`,Se,i)]);let De=a()?document.getElementsByTagName(`fieldset`):[],Oe=()=>{for(let e of De){if(e.hasAttribute(`aria-labelledby`))continue;let t=`${w(e.querySelector(`legend`))} ${w(e.querySelector(`:scope > :is([data-field="description"],legend + p)`))}`;u(e,r,t.trim()||null)}};b(`fieldset`,()=>[x(document,Oe,{childList:!0,subtree:!0})]);let ke=`focusgroup`,Ae=`${ke}start`,je=new WeakMap,Me=new Map,Ne={listbox:{block:!0,wrap:!1,items:`option`},menu:{block:!0,wrap:!0,items:`menuitem`},menubar:{block:!1,wrap:!0,items:`menuitem`},radiogroup:{block:null,wrap:!0,items:`radio`},tablist:{block:!1,wrap:!0,items:`tab`},toolbar:{block:!1,wrap:!1,items:null}},Pe=!1,Fe=new Set([`AUDIO`,`VIDEO`,`TEXTAREA`,`SELECT`,`date`,`datetime-local`,`email`,`month`,`number`,`password`,`range`,`search`,`tel`,`text`,`time`,`url`,`week`]),Ie=a()&&(ke in HTMLElement.prototype||`focusGroup`in HTMLElement.prototype),Le=e=>Pe=e,Re=e=>{if(e.defaultPrevented||e.altKey||e.metaKey||e.ctrlKey)return;let t=e.key===`Tab`,n=e.key===`ArrowUp`||e.key===`ArrowDown`,r=n||e.key===`ArrowLeft`||e.key===`ArrowRight`;if(!t&&!r&&e.key!==`Home`&&e.key!==`End`)return;t&&(Le(!0),setTimeout(Le,100,!1));let i=h(e);if(!i||Je(i))return;let a=Be(g(i));if(a?.role&&a?.el===i&&(a=Be(g(a.el.parentNode))),!a?.role)return;let o=He(a.el,i),s=0;if(t)return setTimeout(Ye,0,o,Ye(o));if(e.key===`Home`)s=0;else if(e.key===`End`)s=o.length-1;else{let{direction:t,writingMode:r}=getComputedStyle(i),c=r.startsWith(`vertical`),l=c?r===`vertical-rl`:t===`rtl`,u=e.key===`ArrowDown`||e.key===`ArrowRight`,d=n!==c,f=u!==(!n&&l);if((a.block??d)!==d)return;s=o.indexOf(i)+(f?1:-1),s=a.wrap?(o.length+s)%o.length:Math.max(0,Math.min(s,o.length-1))}o[s]!==i&&e.preventDefault(),o[s]?.focus?.()},ze=e=>{let t=h(e),n=g(t);for(let[e,t]of Me)!n.has(e)&&Me.delete(e)&&t();for(let e of n)e.nodeType===11&&!Me.has(e)&&Me.set(e,_(e,`focus`,ze,i));if(e.target?.shadowRoot)return;let r=Be(n);if(r?.role){if(Pe&&!Je(r.focus)){let e=Ue(He(r.el,null),t),n=r.memory&&e.includes(r.focus)&&r.focus||e.find(e=>e?.hasAttribute(Ae))||e[0];if(n!==t)return n?.focus?.()}r.focus=t}},Be=e=>{for(let t of e){if(t.nodeType!==Node.ELEMENT_NODE)continue;let e=t.getAttribute(ke);if(e!==null){let n=je.get(t);if(n?.key===e)return n;n=Ve(t,e),je.set(t,n);for(let e of He(t))e&&!e.hasAttribute(`role`)&&u(e,`role`,n.items);return t.hasAttribute(`role`)||u(t,`role`,n.role),n}if(Ge(t))return}},Ve=(e,t)=>{let n=new Set(t.toLowerCase().split(` `)),r=[...n].find(e=>e in Ne),i=Ne[r],a=n.has(`inline`),o=n.has(`block`);return{key:t,el:e,role:r,block:a&&o?null:o||!a&&i?.block,focus:null,items:i?.items,memory:!n.has(`nomemory`),wrap:n.has(`wrap`)||!n.has(`nowrap`)&&i?.wrap}},He=(e,t,n=[],r=!1)=>{let i=e?.nodeName===`SLOT`?e.assignedElements({flatten:!0}):(e?.shadowRoot||e)?.children;for(let e=0,a=i?.length||e;i&&e<a;e++){let a=i[e];if(a.nodeName===`SLOT`)He(a,t,n,r);else if(We(a)&&!Ge(a)&&Ke(a)){let e=a.getAttribute(ke);a===t||!r&&e!==`none`&&qe(a)?n.push(a):e!==null&&t===null?n.push(null):He(a,t,n,r||e!==null)}}return n},Ue=(e,t)=>{let n=e.indexOf(t),r=e.indexOf(null,n);return e.slice(e.lastIndexOf(null,n)+1,r===-1?void 0:r)},We=e=>!e.inert&&!e.hidden&&!e.disabled,Ge=e=>e?.nodeName===`DIALOG`||e?.hasAttribute(`popover`),Ke=a()&&typeof Element.prototype.checkVisibility==`function`?e=>e.checkVisibility():e=>e.offsetParent!==null,qe=e=>e.isContentEditable||e.tabIndex>=0&&!e.disabled,Je=e=>e?.isContentEditable||Fe.has(e?.nodeName)||e?.nodeName===`INPUT`&&Fe.has(e.type),Ye=(e,t)=>Array.from(e,(e,n)=>{let r=e?.getAttribute(`tabindex`);return e&&u(e,`tabindex`,t?t[n]:`-1`),r});Ie||b(ke,()=>[_(document,`keydown`,Re),_(document,`focus`,ze,i),()=>{for(let[,e]of Me)e();Me.clear()}]);function Xe(){return typeof HTMLButtonElement<`u`&&`command`in HTMLButtonElement.prototype&&`source`in((globalThis.CommandEvent||{}).prototype||{})}function Ze(){document.addEventListener(`invoke`,e=>{e.type==`invoke`&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())},!0),document.addEventListener(`command`,e=>{e.type==`command`&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())},!0);function e(e,t,n=!0){Object.defineProperty(e,t,{...Object.getOwnPropertyDescriptor(e,t),enumerable:n})}function t(e){return e&&typeof e.getRootNode==`function`?e.getRootNode():e&&e.parentNode?t(e.parentNode):e}let n=new WeakMap,r=new WeakMap;class i extends Event{constructor(e,t={}){super(e,t);let{source:i,command:a}=t;if(i!=null&&!(i instanceof Element))throw TypeError(`source must be an element`);n.set(this,i||null),r.set(this,a===void 0?``:String(a))}get[Symbol.toStringTag](){return`CommandEvent`}get source(){if(!n.has(this))throw TypeError(`illegal invocation`);let e=n.get(this);if(!(e instanceof Element))return null;let r=t(e);return r===t(this.target||document)?e:r.host}get command(){if(!r.has(this))throw TypeError(`illegal invocation`);return r.get(this)}}e(i.prototype,`source`),e(i.prototype,`command`);let a=new WeakMap;function o(e){Object.defineProperties(e.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(e){if(e===null)this.removeAttribute(`commandfor`),a.delete(this);else if(e instanceof Element){this.setAttribute(`commandfor`,``);let n=t(e);t(this)===n||n===this.ownerDocument?a.set(this,e):a.delete(this)}else throw TypeError(`commandForElement must be an element or null`)},get(){if(this.localName!==`button`||this.disabled)return null;if(this.form&&this.getAttribute(`type`)!==`button`)return console.warn("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work"),null;let e=a.get(this);if(e)return e.isConnected?e:(a.delete(this),null);let n=t(this),r=this.getAttribute(`commandfor`);return(n instanceof Document||n instanceof ShadowRoot)&&r&&n.getElementById(r)||null}},command:{enumerable:!0,configurable:!0,get(){let e=this.getAttribute(`command`)||``;if(e.startsWith(`--`))return e;let t=e.toLowerCase();switch(t){case`show-modal`:case`request-close`:case`close`:case`toggle-popover`:case`hide-popover`:case`show-popover`:return t}return``},set(e){this.setAttribute(`command`,e)}}})}let s=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return l.takeRecords(),s.get(this)||null},set(e){let t=s.get(this)||null;t&&this.removeEventListener(`command`,t),s.set(this,typeof e==`object`||typeof e==`function`?e:null),typeof e==`function`&&this.addEventListener(`command`,e)}}});function c(e){for(let t of e)t.oncommand=Function(`event`,t.getAttribute(`oncommand`))}let l=new MutationObserver(e=>{for(let t of e){let{target:e}=t;t.type===`childList`?c(e.querySelectorAll(`[oncommand]`)):c([e])}});l.observe(document,{subtree:!0,childList:!0,attributeFilter:[`oncommand`]}),c(document.querySelectorAll(`[oncommand]`));let u=new WeakSet;function d(e){if(u.has(e)||(u.add(e),e.defaultPrevented)||e.type!==`click`)return;let t=e.composedPath().find(e=>e.matches?.(`button[commandfor], button[command]`));if(!t)return;if(t.form&&t.getAttribute(`type`)!==`button`)throw e.preventDefault(),Error("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes");if(t.hasAttribute(`command`)!==t.hasAttribute(`commandfor`)){let e=t.hasAttribute(`command`)?`command`:`commandfor`,n=t.hasAttribute(`command`)?`commandfor`:`command`;throw Error(`Element with ${e} attribute must also have a ${n} attribute to function.`)}if(t.command!==`show-popover`&&t.command!==`hide-popover`&&t.command!==`toggle-popover`&&t.command!==`show-modal`&&t.command!==`request-close`&&t.command!==`close`&&!t.command.startsWith(`--`)){console.warn(`"${t.command}" is not a valid command value. Custom commands must begin with --`);return}let n=t.commandForElement;if(!n)return;let r=new i(`command`,{command:t.command,source:t,cancelable:!0});if(n.dispatchEvent(r),r.defaultPrevented)return;let a=r.command.toLowerCase();if(n.popover){let e=!n.matches(`:popover-open`);e&&(a===`toggle-popover`||a===`show-popover`)?n.showPopover({source:t}):!e&&a===`hide-popover`&&n.hidePopover()}else if(n.localName===`dialog`){let e=!n.hasAttribute(`open`);e&&a==`show-modal`?n.showModal():!e&&a==`close`?n.close(t.value?t.value:void 0):!e&&a==`request-close`&&(HTMLDialogElement.prototype.requestClose||(HTMLDialogElement.prototype.requestClose=function(){let e=new Event(`cancel`,{cancelable:!0});this.dispatchEvent(e),e.defaultPrevented||this.close()}),n.requestClose(t.value?t.value:void 0))}}function f(e){e.addEventListener(`click`,d,!0)}function p(e,t){let n=e.prototype.attachShadow;e.prototype.attachShadow=function(e){let r=n.call(this,e);return t(r),r};let r=e.prototype.attachInternals;e.prototype.attachInternals=function(){let e=r.call(this);return e.shadowRoot&&t(e.shadowRoot),e}}o(HTMLButtonElement),p(HTMLElement,e=>{f(e),l.observe(e,{attributeFilter:[`oncommand`]}),c(e.querySelectorAll(`[oncommand]`))}),f(document),Object.assign(globalThis,{CommandEvent:i})}a()&&!Xe()&&Ze();let Qe=Math.min,E=Math.max,$e=Math.round,et=Math.floor,D=e=>({x:e,y:e}),tt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function nt(e,t,n){return E(e,Qe(t,n))}function O(e,t){return typeof e==`function`?e(t):e}function k(e){return e.split(`-`)[0]}function rt(e){return e.split(`-`)[1]}function it(e){return e===`x`?`y`:`x`}function at(e){return e===`y`?`height`:`width`}function A(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ot(e){return it(A(e))}function st(e,t,n){n===void 0&&(n=!1);let r=rt(e),i=ot(e),a=at(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=gt(o)),[o,gt(o)]}function ct(e){let t=gt(e);return[lt(e),t,lt(t)]}function lt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}let ut=[`left`,`right`],dt=[`right`,`left`],ft=[`top`,`bottom`],pt=[`bottom`,`top`];function mt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?dt:ut:t?ut:dt;case`left`:case`right`:return t?ft:pt;default:return[]}}function ht(e,t,n,r){let i=rt(e),a=mt(k(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(lt)))),a}function gt(e){let t=k(e);return tt[t]+e.slice(t.length)}function _t(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function vt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_t(e)}function yt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function bt(e,t,n){let{reference:r,floating:i}=e,a=A(t),o=ot(t),s=at(o),c=k(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=rt(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function xt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=O(t,e),p=vt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=yt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=yt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}let St=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:xt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=bt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<50&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=bt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ct=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=O(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=k(r),_=A(o),v=k(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[gt(o)]:ct(o)),x=p!==`none`;!d&&x&&b.push(...ht(o,m,p,y));let ee=[o,...b],S=await s.detectOverflow(t,h),C=[],w=i.flip?.overflows||[];if(l&&C.push(S[g]),u){let e=st(r,a,y);C.push(S[e[0]],S[e[1]])}if(w=[...w,{placement:r,overflows:C}],!C.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=ee[e];if(t&&(u!==`alignment`||_===A(t)||w.every(e=>A(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:w},reset:{placement:t}};let n=w.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=w.filter(e=>{if(x){let t=A(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},wt=new Set([`left`,`top`]);async function Tt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=k(n),s=rt(n),c=A(n)===`y`,l=wt.has(o)?-1:1,u=a&&c?-1:1,d=O(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}let Et=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Tt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Dt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=O(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=A(i),p=it(f),m=u[p],h=u[f],g=(e,t)=>nt(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ot=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=O(e,t),u={x:n,y:r},d=A(i),f=it(d),p=u[f],m=u[d],h=O(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=wt.has(k(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},kt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=O(e,t),c=await i.detectOverflow(t,s),l=k(n),u=rt(n),d=A(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Qe(p-c[m],g),y=Qe(f-c[h],_),b=t.middlewareData.shift,x=!b,ee=v,S=y;b!=null&&b.enabled.x&&(S=_),b!=null&&b.enabled.y&&(ee=g),x&&!u&&(d?S=f-2*E(c.left,c.right):ee=p-2*E(c.top,c.bottom)),await o({...t,availableWidth:S,availableHeight:ee});let C=await i.getDimensions(a.floating);return f!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function At(){return typeof window<`u`}function jt(e){return Mt(e)?(e.nodeName||``).toLowerCase():`#document`}function j(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function M(e){return((Mt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Mt(e){return At()?e instanceof Node||e instanceof j(e).Node:!1}function N(e){return At()?e instanceof Element||e instanceof j(e).Element:!1}function P(e){return At()?e instanceof HTMLElement||e instanceof j(e).HTMLElement:!1}function Nt(e){return!At()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof j(e).ShadowRoot}function Pt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=I(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ft(e){return/^(table|td|th)$/.test(jt(e))}function It(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}let Lt=/transform|translate|scale|rotate|perspective|filter/,Rt=/paint|layout|strict|content/,F=e=>!!e&&e!==`none`,zt;function Bt(e){let t=N(e)?I(e):e;return F(t.transform)||F(t.translate)||F(t.scale)||F(t.rotate)||F(t.perspective)||!Ht()&&(F(t.backdropFilter)||F(t.filter))||Lt.test(t.willChange||``)||Rt.test(t.contain||``)}function Vt(e){let t=L(e);for(;P(t)&&!Ut(t);){if(Bt(t))return t;if(It(t))return null;t=L(t)}return null}function Ht(){return zt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),zt}function Ut(e){return/^(html|body|#document)$/.test(jt(e))}function I(e){return j(e).getComputedStyle(e)}function Wt(e){return N(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function L(e){if(jt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Nt(e)&&e.host||M(e);return Nt(t)?t.host:t}function Gt(e){let t=L(e);return Ut(t)?(e.ownerDocument||e).body:P(t)&&Pt(t)?t:Gt(t)}function Kt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Gt(e),i=r===e.ownerDocument?.body,a=j(r);if(i){let e=qt(a);return t.concat(a,a.visualViewport||[],Pt(r)?r:[],e&&n?Kt(e):[])}return t.concat(r,Kt(r,[],n))}function qt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jt(e){let t=I(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=P(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=$e(n)!==a||$e(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Yt(e){return N(e)?e:e.contextElement}function Xt(e){let t=Yt(e);if(!P(t))return D(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Jt(t),o=(a?$e(n.width):n.width)/r,s=(a?$e(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let Zt=D(0);function Qt(e){let t=j(e);return!Ht()||!t.visualViewport?Zt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $t(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===j(e)}function R(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Yt(e),o=D(1);t&&(r?N(r)&&(o=Xt(r)):o=Xt(e));let s=$t(a,n,r)?Qt(a):D(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=j(a),t=N(r)?j(r):r,n=e,i=qt(n);for(;i&&t!==n;){let e=Xt(i),t=i.getBoundingClientRect(),r=I(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=j(i),i=qt(n)}}return yt({width:u,height:d,x:c,y:l})}function en(e,t){let n=Wt(e).scrollLeft;return t?t.left+n:R(M(e)).left+n}function tn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-en(e,n),y:n.top+t.scrollTop}}function nn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=M(r),s=t?It(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=D(1),u=D(0),d=P(r);if((d||!a)&&((jt(r)!==`body`||Pt(o))&&(c=Wt(r)),d)){let e=R(r);l=Xt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?tn(o,c):D(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function rn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function an(e){let t=Wt(e),n=e.ownerDocument.body,r=E(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=E(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+en(e),o=-t.scrollTop;return I(n).direction===`rtl`&&(a+=E(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}function on(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=j(e),a=M(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ht()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(en(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=25&&(s-=o)}return{width:s,height:c,x:l,y:u}}function sn(e,t){let n=R(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Xt(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function cn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=on(e,n,t);else if(t===`document`)r=an(M(e));else if(N(t))r=sn(t,n);else{let n=Qt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yt(r)}function ln(e,t){let n=t.get(e);if(n)return n;let r=Kt(e,[],!1).filter(e=>N(e)&&jt(e)!==`body`),i=null,a=I(e).position===`fixed`,o=a?L(e):e;for(;N(o)&&!Ut(o);){let e=I(o),t=Bt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=L(o)}return t.set(e,r),r}function un(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?It(t)?[]:ln(t,this._c):[].concat(n),r],o=cn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=cn(t,a[e],i);s=E(n.top,s),c=Qe(n.right,c),l=Qe(n.bottom,l),u=E(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function dn(e){let{width:t,height:n}=Jt(e);return{width:t,height:n}}function fn(e,t,n){let r=P(t),i=M(t),a=n===`fixed`,o=R(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=D(0);if((r||!a)&&((jt(t)!==`body`||Pt(i))&&(s=Wt(t)),r)){let e=R(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=en(i));let l=i&&!r&&!a?tn(i,s):D(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function pn(e){return I(e).position===`static`}function mn(e,t){if(!P(e)||I(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return M(e)===n&&(n=n.ownerDocument.body),n}function hn(e,t){let n=j(e);if(It(e))return n;if(!P(e)){let t=L(e);for(;t&&!Ut(t);){if(N(t)&&!pn(t))return t;t=L(t)}return n}let r=mn(e,t);for(;r&&Ft(r)&&pn(r);)r=mn(r,t);return r&&Ut(r)&&pn(r)&&!Bt(r)?n:r||Vt(e)||n}let gn=async function(e){let t=this.getOffsetParent||hn,n=this.getDimensions,r=await n(e.floating);return{reference:fn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _n(e){return I(e).direction===`rtl`}let vn={convertOffsetParentRelativeRectToViewportRelativeRect:nn,getDocumentElement:M,getClippingRect:un,getOffsetParent:hn,getElementRects:gn,getClientRects:rn,getDimensions:dn,getScale:Xt,isElement:N,isRTL:_n};function yn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bn(e,t,n){let r=null,i,a=M(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=et(d),h=et(a.clientWidth-(u+f)),g=et(a.clientHeight-(d+p)),_=et(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:E(0,Qe(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!yn(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=j(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function xn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Yt(e),u=i||a?[...l?Kt(l):[],...t?Kt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?bn(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?R(e):null;c&&g();function g(){let t=R(e);h&&!yn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}let Sn=Et,Cn=Dt,wn=Ct,Tn=kt,En=Ot,Dn=(e,t,n)=>{let r=new Map,i=n??{},a={...vn,...i.platform,_c:r};return St(e,t,{...i,platform:a})};var On=class extends Event{oldState;newState;constructor(e,t={}){let n=Object.assign({},t);delete n.oldState,delete n.newState,super(e,n),this.oldState=String(t.oldState||``),this.newState=String(t.newState||``)}},kn=new WeakMap;function An(e,t,n){kn.set(e,setTimeout(()=>{kn.has(e)&&e.dispatchEvent(new On(`toggle`,{cancelable:!1,oldState:t,newState:n}))},0))}var jn=globalThis.ShadowRoot||function(){},Mn=globalThis.HTMLDialogElement||function(){},Nn=new WeakMap,z=new WeakMap,B=new WeakMap,Pn=new WeakMap;function Fn(e){return Pn.get(e)||`hidden`}var In=new WeakMap;function Ln(e){return[...e].pop()}function Rn(e){let t=e.popoverTargetElement;if(!(t instanceof HTMLElement))return;let n=Fn(t);(e.popoverTargetAction!==`show`||n!==`showing`)&&(e.popoverTargetAction!==`hide`||n!==`hidden`)&&(n===`showing`?Qn(t,!0,!0):V(t,!1)&&(In.set(t,e),Zn(t)))}function V(e,t){return!(e.popover!==`auto`&&e.popover!==`manual`&&e.popover!==`hint`||!e.isConnected||t&&Fn(e)!==`showing`||!t&&Fn(e)!==`hidden`||e instanceof Mn&&e.hasAttribute(`open`)||document.fullscreenElement===e)}function zn(e){if(!e)return 0;let t=z.get(document)||new Set,n=B.get(document)||new Set;return n.has(e)?[...n].indexOf(e)+t.size+1:t.has(e)?[...t].indexOf(e)+1:0}function Bn(e){let t=Wn(e),n=Gn(e);return zn(t)>zn(n)?t:n}function Vn(e){let t,n=B.get(e)||new Set,r=z.get(e)||new Set,i=n.size>0?n:r.size>0?r:null;return i?(t=Ln(i),t.isConnected?t:(i.delete(t),Vn(e))):null}function Hn(e){for(let t of e||[])if(!t.isConnected)e.delete(t);else return t;return null}function Un(e){return typeof e.getRootNode==`function`?e.getRootNode():e.parentNode?Un(e.parentNode):e}function Wn(e){for(;e;){if(e instanceof HTMLElement&&e.popover===`auto`&&Pn.get(e)===`showing`)return e;if(e=e instanceof Element&&e.assignedSlot||e.parentElement||Un(e),e instanceof jn&&(e=e.host),e instanceof Document)return}}function Gn(e){for(;e;){let t=e.popoverTargetElement;if(t instanceof HTMLElement)return t;if(e=e.parentElement||Un(e),e instanceof jn&&(e=e.host),e instanceof Document)return}}function Kn(e,t){let n=new Map,r=0;for(let e of t||[])n.set(e,r),r+=1;n.set(e,r),r+=1;let i=null;function a(t){if(!t)return;let r=!1,a=null;for(;!r;){if(a=Wn(t)||null,a===null||!n.has(a))return;(e.popover===`hint`||a.popover===`auto`)&&(r=!0),r||(t=a.parentElement)}let o=n.get(a)??null;(i===null||n.get(i)<o)&&(i=a)}return a(e.parentElement||Un(e)),i}function qn(e){return e.hidden||e instanceof jn||(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement||e instanceof HTMLFieldSetElement)&&e.disabled||e instanceof HTMLInputElement&&e.type===`hidden`||e instanceof HTMLAnchorElement&&e.href===``?!1:typeof e.tabIndex==`number`&&e.tabIndex!==-1}function Jn(e){if(e.shadowRoot&&e.shadowRoot.delegatesFocus!==!0)return null;let t=e;t.shadowRoot&&(t=t.shadowRoot);let n=t.querySelector(`[autofocus]`);if(n)return n;{let e=t.querySelectorAll(`slot`);for(let t of e){let e=t.assignedElements({flatten:!0});for(let t of e)if(t.hasAttribute(`autofocus`))return t;else if(n=t.querySelector(`[autofocus]`),n)return n}}let r=e.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),i=r.currentNode;for(;i;){if(qn(i))return i;i=r.nextNode()}}function Yn(e){var t;(t=Jn(e))==null||t.focus()}var Xn=new WeakMap;function Zn(e){if(!V(e,!1))return;let t=e.ownerDocument;if(!e.dispatchEvent(new On(`beforetoggle`,{cancelable:!0,oldState:`closed`,newState:`open`}))||!V(e,!1))return;let n=!1,r=e.popover,i=null,a=Kn(e,z.get(t)||new Set),o=Kn(e,B.get(t)||new Set);if(r===`auto`&&(er(B.get(t)||new Set,n,!0),H(a||t,n,!0),i=`auto`),r===`hint`&&(o?(H(o,n,!0),i=`hint`):(er(B.get(t)||new Set,n,!0),a?(H(a,n,!0),i=`auto`):i=`hint`)),r===`auto`||r===`hint`){if(r!==e.popover||!V(e,!1))return;Vn(t)||(n=!0),i===`auto`?(z.has(t)||z.set(t,new Set),z.get(t).add(e)):i===`hint`&&(B.has(t)||B.set(t,new Set),B.get(t).add(e))}Xn.delete(e);let s=t.activeElement;e.classList.add(`:popover-open`),Pn.set(e,`showing`),Nn.has(t)||Nn.set(t,new Set),Nn.get(t).add(e),ar(In.get(e),!0),Yn(e),n&&s&&e.popover===`auto`&&Xn.set(e,s),An(e,`closed`,`open`)}function Qn(e,t=!1,n=!1){var r,i;if(!V(e,!0))return;let a=e.ownerDocument;if([`auto`,`hint`].includes(e.popover)&&(H(e,t,n),!V(e,!0)))return;let o=z.get(a)||new Set,s=o.has(e)&&Ln(o)===e;if(ar(In.get(e),!1),In.delete(e),n&&(e.dispatchEvent(new On(`beforetoggle`,{oldState:`open`,newState:`closed`})),s&&Ln(o)!==e&&H(e,t,n),!V(e,!0)))return;(r=Nn.get(a))==null||r.delete(e),o.delete(e),(i=B.get(a))==null||i.delete(e),e.classList.remove(`:popover-open`),Pn.set(e,`hidden`),n&&An(e,`open`,`closed`);let c=Xn.get(e);c&&(Xn.delete(e),t&&c.focus())}function $n(e,t=!1,n=!1){let r=Vn(e);for(;r;)Qn(r,t,n),r=Vn(e)}function er(e,t=!1,n=!1){let r=Hn(e);for(;r;)Qn(r,t,n),r=Hn(e)}function tr(e,t,n,r){let i=!1,a=!1;for(;i||!a;){a=!0;let o=null,s=!1;for(let n of t)if(n===e)s=!0;else if(s){o=n;break}if(!o)return;for(;Fn(o)===`showing`&&t.size;)Qn(Ln(t),n,r);t.has(e)&&Ln(t)!==e&&(i=!0),i&&(r=!1)}}function H(e,t,n){let r=e.ownerDocument||e;if(e instanceof Document)return $n(r,t,n);if(B.get(r)?.has(e)){tr(e,B.get(r),t,n);return}er(B.get(r)||new Set,t,n),z.get(r)?.has(e)&&tr(e,z.get(r),t,n)}var nr=new WeakMap;function rr(e){if(!e.isTrusted)return;let t=e.composedPath()[0];if(!t)return;let n=t.ownerDocument;if(!Vn(n))return;let r=Bn(t);if(r&&e.type===`pointerdown`)nr.set(n,r);else if(e.type===`pointerup`){let e=nr.get(n)===r;nr.delete(n),e&&H(r||n,!1,!0)}}var ir=new WeakMap;function ar(e,t=!1){if(!e)return;ir.has(e)||ir.set(e,e.getAttribute(`aria-expanded`));let n=e.popoverTargetElement;if(n instanceof HTMLElement&&n.popover===`auto`)e.setAttribute(`aria-expanded`,String(t));else{let t=ir.get(e);t?e.setAttribute(`aria-expanded`,t):e.removeAttribute(`aria-expanded`)}}var or=globalThis.ShadowRoot||function(){},sr=`popover-polyfill`;function cr(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype==`object`&&`popover`in HTMLElement.prototype}function lr(){return!!(document.body?.showPopover&&!/native code/i.test(document.body.showPopover.toString()))}function U(e,t,n){let r=e[t];Object.defineProperty(e,t,{value(e){return r.call(this,n(e))}})}var ur=/(^|[^\\]):popover-open\b/g;function dr(){return typeof globalThis.CSSLayerBlockRule==`function`}function fr(e){let t=dr(),n=(e??window.POPOVER_POLYFILL_OPTIONS?.layerName??sr).split(`.`).map(CSS.escape).join(`.`);return`
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Designsystemet={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=`1.20.0`;let n=`aria-label`,r=`aria-labelledby`,i={passive:!0,capture:!0},a=()=>typeof window<`u`&&typeof document<`u`,o=()=>a()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),s=typeof HTMLElement>`u`?class{}:HTMLElement;function c(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}let l=(e,...t)=>!a()||window.dsWarnings===!1||console.log(`\x1B[1mDesignsystemet:\x1B[m ${e}`,...t),u=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),d=(e,t)=>getComputedStyle(e).getPropertyValue(t).trim(),f=/^["']|["']$/g,p=(e,t)=>{let n=u(e,t);return n||=d(e,`--_ds-${t}`).replace(f,``).trim(),n||null},m=e=>{let t=e?.getRootNode?.()||e?.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:e?.ownerDocument||document},h=e=>{let t=e.target?.shadowRoot&&e.composedPath()[0]||e.target;return t?.nodeType===1?t:null},g=e=>{let t=new Set;for(;e;)t.add(e),e=e.nodeType===11?e.host:e.assignedSlot||e.parentNode;return t},_=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>v(e,...t)},v=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},y=`_dsHotReloadCleanup${t}`,b=(e,t)=>{if(a()){window[y]||(window[y]=new Map);for(let t of window[y]?.get(e)||[])t();window[y]?.set(e,t())}},x=(e,t,n)=>{let r=()=>i.disconnect(),i=new MutationObserver(n=>{if(!a()||!e.isConnected)return r();t(e,n)});return t(e),i.observe(e,n),r},ee=(e,t)=>{let n=document.createElement(e);if(t)for(let[e,r]of Object.entries(t))u(n,e,r);return n},S={define:(e,t)=>!a()||window.customElements.get(e)||window.customElements.define(e,t)},C=0;function w(e){return a()?(window.dsUseId||(window.dsUseId=0),e&&!e.id&&(e.id=`:ds:${++window.dsUseId}`),e?.id||``):`:ds:${++C}`}let T,te=0,ne=0,re=e=>{clearTimeout(ne),T&&(T.textContent=`${e}${te++%2?`\xA0`:``}`),e&&(ne=setTimeout(re,2e3,``))},ie=()=>{document.readyState===`complete`&&(T||(T=ee(`div`,{"aria-live":`assertive`}),T.style.overflow=`hidden`,T.style.position=`fixed`,T.style.whiteSpace=`nowrap`,T.style.width=`1px`),T.isConnected||document.body.appendChild(T))};b(`announce`,()=>[_(document,`focus mouseover`,ie,i)]);let ae=`:click-delegate-hover`,oe=new Set([`A`,`BUTTON`,`DETAILS`,`DIALOG`,`INPUT`,`LABEL`,`SELECT`,`TEXTAREA`]),se=e=>{let t=e.button===1||e.metaKey||e.ctrlKey,n=h(e),r=e.button<2&&de(e);if(!(!r||r.contains(n))){for(let e of g(n))if(e.control===r)return;if(t&&r instanceof HTMLAnchorElement)return window.open(r.href,void 0,r.rel);e.stopImmediatePropagation(),r.click()}},ce,le,ue=e=>{let t=h(e);if(!t||t===le)return;le=t;let n=de(e);ce!==n&&(ce&&ce.classList.remove(ae),n&&n.classList.add(ae),ce=n)},de=e=>{let t;for(let n of e.composedPath()){if(n.nodeType!==1)continue;n.nodeName===`LABEL`&&(n=n.control||n);let e=n.getAttribute(`data-clickdelegatefor`);if(e){let r=m(n).getElementById(e);return r&&!(t&&t!==r)&&!r.disabled&&!r.readOnly?r:void 0}!t&&fe(n)&&(t=n)}},fe=e=>e.isContentEditable||e.popover||oe.has(e.nodeName)||u(e,`role`)===`button`;b(`clickdelegatefor`,()=>[_(window,`click auxclick`,se,!0),_(document,`mousemove`,ue,i)]);var pe=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,me=pe(),he=me?navigator.userAgent:``,ge=/android/i.test(he),_e=/firefox/i.test(he);me&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var ve=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),ye=(e,t,n)=>{let r=new MutationObserver(n=>{if(!pe()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},be=`__uDetailsPolyfillSummarys`;if(pe()&&ge&&_e&&!window[be]){let e=document.getElementsByTagName(`summary`);window[be]=ye(document,()=>{for(let t of e){let e=t.parentElement;ve(t,`role`,`button`),ve(t,`aria-expanded`,`${!!e?.open}`)}},{attributeFilter:[`open`],attributes:!0,childList:!0,subtree:!0})}let xe=!1,Se=e=>{let{type:t,clientX:n=0,clientY:r=0}=e,i=h(e);if(i&&t===`pointerdown`)for(let e of g(i)){if(e.nodeName!==`DIALOG`)continue;let t=e.getBoundingClientRect();xe=t.top<=r&&r<=t.bottom&&t.left<=n&&n<=t.right;return}else{let e=i?.nodeName===`DIALOG`&&!xe&&u(i,`closedby`)===`any`;xe=!1,e&&setTimeout(Ce,0,i)}},Ce=e=>e.open&&e.close(),we=`--show-non-modal`,Te=e=>{for(let t of e.composedPath()){let e=t.nodeType===1&&u(t,`command`);if(e===`show-modal`||e===we)return u(t,`aria-haspopup`,`dialog`)}},Ee=({command:e,target:t})=>e===we&&t instanceof HTMLDialogElement&&t.show();b(`dialog`,()=>[_(document,`command`,Ee,i),_(document,`focus`,Te,i),_(document,`pointerdown pointerup`,Se,i)]);let De=a()?document.getElementsByTagName(`fieldset`):[],Oe=()=>{for(let e of De){if(e.hasAttribute(`aria-labelledby`))continue;let t=``;for(let n of e.children){let e=n.nodeName;(e===`LEGEND`||n.getAttribute(`data-field`)===`description`||e===`P`&&n.previousElementSibling?.nodeName===`LEGEND`)&&(t+=`${w(n)} `)}u(e,r,t.trim()||null)}};b(`fieldset`,()=>[x(document,Oe,{childList:!0,subtree:!0})]);let ke=`focusgroup`,Ae=`${ke}start`,je=new WeakMap,Me=new Map,Ne={listbox:{block:!0,wrap:!1,items:`option`},menu:{block:!0,wrap:!0,items:`menuitem`},menubar:{block:!1,wrap:!0,items:`menuitem`},radiogroup:{block:null,wrap:!0,items:`radio`},tablist:{block:!1,wrap:!0,items:`tab`},toolbar:{block:!1,wrap:!1,items:null}},Pe=!1,Fe=new Set([`AUDIO`,`VIDEO`,`TEXTAREA`,`SELECT`,`date`,`datetime-local`,`email`,`month`,`number`,`password`,`range`,`search`,`tel`,`text`,`time`,`url`,`week`]),Ie=a()&&(ke in HTMLElement.prototype||`focusGroup`in HTMLElement.prototype),Le=e=>Pe=e,Re=e=>{if(e.defaultPrevented||e.altKey||e.metaKey||e.ctrlKey)return;let t=e.key===`Tab`,n=e.key===`ArrowUp`||e.key===`ArrowDown`,r=n||e.key===`ArrowLeft`||e.key===`ArrowRight`;if(!t&&!r&&e.key!==`Home`&&e.key!==`End`)return;t&&(Le(!0),setTimeout(Le,100,!1));let i=h(e);if(!i||Je(i))return;let a=Be(g(i));if(a?.role&&a?.el===i&&(a=Be(g(a.el.parentNode))),!a?.role)return;let o=He(a.el,i),s=0;if(t)return setTimeout(Ye,0,o,Ye(o));if(e.key===`Home`)s=0;else if(e.key===`End`)s=o.length-1;else{let{direction:t,writingMode:r}=getComputedStyle(i),c=r.startsWith(`vertical`),l=c?r===`vertical-rl`:t===`rtl`,u=e.key===`ArrowDown`||e.key===`ArrowRight`,d=n!==c,f=u!==(!n&&l);if((a.block??d)!==d)return;s=o.indexOf(i)+(f?1:-1),s=a.wrap?(o.length+s)%o.length:Math.max(0,Math.min(s,o.length-1))}o[s]!==i&&e.preventDefault(),o[s]?.focus?.()},ze=e=>{let t=h(e),n=g(t);for(let[e,t]of Me)!n.has(e)&&Me.delete(e)&&t();for(let e of n)e.nodeType===11&&!Me.has(e)&&Me.set(e,_(e,`focus`,ze,i));if(e.target?.shadowRoot)return;let r=Be(n);if(r?.role){if(Pe&&!Je(r.focus)){let e=Ue(He(r.el,null),t),n=r.memory&&e.includes(r.focus)&&r.focus||e.find(e=>e?.hasAttribute(Ae))||e[0];if(n!==t)return n?.focus?.()}r.focus=t}},Be=e=>{for(let t of e){if(t.nodeType!==Node.ELEMENT_NODE)continue;let e=t.getAttribute(ke);if(e!==null){let n=je.get(t);if(n?.key===e)return n;n=Ve(t,e),je.set(t,n);for(let e of He(t))e&&!e.hasAttribute(`role`)&&u(e,`role`,n.items);return t.hasAttribute(`role`)||u(t,`role`,n.role),n}if(Ge(t))return}},Ve=(e,t)=>{let n=new Set(t.toLowerCase().split(` `)),r=[...n].find(e=>e in Ne),i=Ne[r],a=n.has(`inline`),o=n.has(`block`);return{key:t,el:e,role:r,block:a&&o?null:o||!a&&i?.block,focus:null,items:i?.items,memory:!n.has(`nomemory`),wrap:n.has(`wrap`)||!n.has(`nowrap`)&&i?.wrap}},He=(e,t,n=[],r=!1)=>{let i=e?.nodeName===`SLOT`?e.assignedElements({flatten:!0}):(e?.shadowRoot||e)?.children;for(let e=0,a=i?.length||e;i&&e<a;e++){let a=i[e];if(a.nodeName===`SLOT`)He(a,t,n,r);else if(We(a)&&!Ge(a)&&Ke(a)){let e=a.getAttribute(ke);a===t||!r&&e!==`none`&&qe(a)?n.push(a):e!==null&&t===null?n.push(null):He(a,t,n,r||e!==null)}}return n},Ue=(e,t)=>{let n=e.indexOf(t),r=e.indexOf(null,n);return e.slice(e.lastIndexOf(null,n)+1,r===-1?void 0:r)},We=e=>!e.inert&&!e.hidden&&!e.disabled,Ge=e=>e?.nodeName===`DIALOG`||e?.hasAttribute(`popover`),Ke=a()&&typeof Element.prototype.checkVisibility==`function`?e=>e.checkVisibility():e=>e.offsetParent!==null,qe=e=>e.isContentEditable||e.tabIndex>=0&&!e.disabled,Je=e=>e?.isContentEditable||Fe.has(e?.nodeName)||e?.nodeName===`INPUT`&&Fe.has(e.type),Ye=(e,t)=>Array.from(e,(e,n)=>{let r=e?.getAttribute(`tabindex`);return e&&u(e,`tabindex`,t?t[n]:`-1`),r});Ie||b(ke,()=>[_(document,`keydown`,Re),_(document,`focus`,ze,i),()=>{for(let[,e]of Me)e();Me.clear()}]);function Xe(){return typeof HTMLButtonElement<`u`&&`command`in HTMLButtonElement.prototype&&`source`in((globalThis.CommandEvent||{}).prototype||{})}function Ze(){document.addEventListener(`invoke`,e=>{e.type==`invoke`&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())},!0),document.addEventListener(`command`,e=>{e.type==`command`&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())},!0);function e(e,t,n=!0){Object.defineProperty(e,t,{...Object.getOwnPropertyDescriptor(e,t),enumerable:n})}function t(e){return e&&typeof e.getRootNode==`function`?e.getRootNode():e&&e.parentNode?t(e.parentNode):e}let n=new WeakMap,r=new WeakMap;class i extends Event{constructor(e,t={}){super(e,t);let{source:i,command:a}=t;if(i!=null&&!(i instanceof Element))throw TypeError(`source must be an element`);n.set(this,i||null),r.set(this,a===void 0?``:String(a))}get[Symbol.toStringTag](){return`CommandEvent`}get source(){if(!n.has(this))throw TypeError(`illegal invocation`);let e=n.get(this);if(!(e instanceof Element))return null;let r=t(e);return r===t(this.target||document)?e:r.host}get command(){if(!r.has(this))throw TypeError(`illegal invocation`);return r.get(this)}}e(i.prototype,`source`),e(i.prototype,`command`);let a=new WeakMap;function o(e){Object.defineProperties(e.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(e){if(e===null)this.removeAttribute(`commandfor`),a.delete(this);else if(e instanceof Element){this.setAttribute(`commandfor`,``);let n=t(e);t(this)===n||n===this.ownerDocument?a.set(this,e):a.delete(this)}else throw TypeError(`commandForElement must be an element or null`)},get(){if(this.localName!==`button`||this.disabled)return null;if(this.form&&this.getAttribute(`type`)!==`button`)return console.warn("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work"),null;let e=a.get(this);if(e)return e.isConnected?e:(a.delete(this),null);let n=t(this),r=this.getAttribute(`commandfor`);return(n instanceof Document||n instanceof ShadowRoot)&&r&&n.getElementById(r)||null}},command:{enumerable:!0,configurable:!0,get(){let e=this.getAttribute(`command`)||``;if(e.startsWith(`--`))return e;let t=e.toLowerCase();switch(t){case`show-modal`:case`request-close`:case`close`:case`toggle-popover`:case`hide-popover`:case`show-popover`:return t}return``},set(e){this.setAttribute(`command`,e)}}})}let s=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return l.takeRecords(),s.get(this)||null},set(e){let t=s.get(this)||null;t&&this.removeEventListener(`command`,t),s.set(this,typeof e==`object`||typeof e==`function`?e:null),typeof e==`function`&&this.addEventListener(`command`,e)}}});function c(e){for(let t of e)t.oncommand=Function(`event`,t.getAttribute(`oncommand`))}let l=new MutationObserver(e=>{for(let t of e){let{target:e}=t;t.type===`childList`?c(e.querySelectorAll(`[oncommand]`)):c([e])}});l.observe(document,{subtree:!0,childList:!0,attributeFilter:[`oncommand`]}),c(document.querySelectorAll(`[oncommand]`));let u=new WeakSet;function d(e){if(u.has(e)||(u.add(e),e.defaultPrevented)||e.type!==`click`)return;let t=e.composedPath().find(e=>e.matches?.(`button[commandfor], button[command]`));if(!t)return;if(t.form&&t.getAttribute(`type`)!==`button`)throw e.preventDefault(),Error("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes");if(t.hasAttribute(`command`)!==t.hasAttribute(`commandfor`)){let e=t.hasAttribute(`command`)?`command`:`commandfor`,n=t.hasAttribute(`command`)?`commandfor`:`command`;throw Error(`Element with ${e} attribute must also have a ${n} attribute to function.`)}if(t.command!==`show-popover`&&t.command!==`hide-popover`&&t.command!==`toggle-popover`&&t.command!==`show-modal`&&t.command!==`request-close`&&t.command!==`close`&&!t.command.startsWith(`--`)){console.warn(`"${t.command}" is not a valid command value. Custom commands must begin with --`);return}let n=t.commandForElement;if(!n)return;let r=new i(`command`,{command:t.command,source:t,cancelable:!0});if(n.dispatchEvent(r),r.defaultPrevented)return;let a=r.command.toLowerCase();if(n.popover){let e=!n.matches(`:popover-open`);e&&(a===`toggle-popover`||a===`show-popover`)?n.showPopover({source:t}):!e&&a===`hide-popover`&&n.hidePopover()}else if(n.localName===`dialog`){let e=!n.hasAttribute(`open`);e&&a==`show-modal`?n.showModal():!e&&a==`close`?n.close(t.value?t.value:void 0):!e&&a==`request-close`&&(HTMLDialogElement.prototype.requestClose||(HTMLDialogElement.prototype.requestClose=function(){let e=new Event(`cancel`,{cancelable:!0});this.dispatchEvent(e),e.defaultPrevented||this.close()}),n.requestClose(t.value?t.value:void 0))}}function f(e){e.addEventListener(`click`,d,!0)}function p(e,t){let n=e.prototype.attachShadow;e.prototype.attachShadow=function(e){let r=n.call(this,e);return t(r),r};let r=e.prototype.attachInternals;e.prototype.attachInternals=function(){let e=r.call(this);return e.shadowRoot&&t(e.shadowRoot),e}}o(HTMLButtonElement),p(HTMLElement,e=>{f(e),l.observe(e,{attributeFilter:[`oncommand`]}),c(e.querySelectorAll(`[oncommand]`))}),f(document),Object.assign(globalThis,{CommandEvent:i})}a()&&!Xe()&&Ze();let Qe=Math.min,E=Math.max,$e=Math.round,et=Math.floor,D=e=>({x:e,y:e}),tt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function nt(e,t,n){return E(e,Qe(t,n))}function O(e,t){return typeof e==`function`?e(t):e}function k(e){return e.split(`-`)[0]}function rt(e){return e.split(`-`)[1]}function it(e){return e===`x`?`y`:`x`}function at(e){return e===`y`?`height`:`width`}function A(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ot(e){return it(A(e))}function st(e,t,n){n===void 0&&(n=!1);let r=rt(e),i=ot(e),a=at(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=gt(o)),[o,gt(o)]}function ct(e){let t=gt(e);return[lt(e),t,lt(t)]}function lt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}let ut=[`left`,`right`],dt=[`right`,`left`],ft=[`top`,`bottom`],pt=[`bottom`,`top`];function mt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?dt:ut:t?ut:dt;case`left`:case`right`:return t?ft:pt;default:return[]}}function ht(e,t,n,r){let i=rt(e),a=mt(k(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(lt)))),a}function gt(e){let t=k(e);return tt[t]+e.slice(t.length)}function _t(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function vt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_t(e)}function yt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function bt(e,t,n){let{reference:r,floating:i}=e,a=A(t),o=ot(t),s=at(o),c=k(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=rt(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function xt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=O(t,e),p=vt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=yt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=yt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}let St=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:xt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=bt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<50&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=bt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ct=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=O(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=k(r),_=A(o),v=k(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[gt(o)]:ct(o)),x=p!==`none`;!d&&x&&b.push(...ht(o,m,p,y));let ee=[o,...b],S=await s.detectOverflow(t,h),C=[],w=i.flip?.overflows||[];if(l&&C.push(S[g]),u){let e=st(r,a,y);C.push(S[e[0]],S[e[1]])}if(w=[...w,{placement:r,overflows:C}],!C.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=ee[e];if(t&&(u!==`alignment`||_===A(t)||w.every(e=>A(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:w},reset:{placement:t}};let n=w.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=w.filter(e=>{if(x){let t=A(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},wt=new Set([`left`,`top`]);async function Tt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=k(n),s=rt(n),c=A(n)===`y`,l=wt.has(o)?-1:1,u=a&&c?-1:1,d=O(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}let Et=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Tt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Dt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=O(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=A(i),p=it(f),m=u[p],h=u[f],g=(e,t)=>nt(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ot=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=O(e,t),u={x:n,y:r},d=A(i),f=it(d),p=u[f],m=u[d],h=O(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=wt.has(k(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},kt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=O(e,t),c=await i.detectOverflow(t,s),l=k(n),u=rt(n),d=A(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Qe(p-c[m],g),y=Qe(f-c[h],_),b=t.middlewareData.shift,x=!b,ee=v,S=y;b!=null&&b.enabled.x&&(S=_),b!=null&&b.enabled.y&&(ee=g),x&&!u&&(d?S=f-2*E(c.left,c.right):ee=p-2*E(c.top,c.bottom)),await o({...t,availableWidth:S,availableHeight:ee});let C=await i.getDimensions(a.floating);return f!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function At(){return typeof window<`u`}function jt(e){return Mt(e)?(e.nodeName||``).toLowerCase():`#document`}function j(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function M(e){return((Mt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Mt(e){return At()?e instanceof Node||e instanceof j(e).Node:!1}function N(e){return At()?e instanceof Element||e instanceof j(e).Element:!1}function P(e){return At()?e instanceof HTMLElement||e instanceof j(e).HTMLElement:!1}function Nt(e){return!At()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof j(e).ShadowRoot}function Pt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=I(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ft(e){return/^(table|td|th)$/.test(jt(e))}function It(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}let Lt=/transform|translate|scale|rotate|perspective|filter/,Rt=/paint|layout|strict|content/,F=e=>!!e&&e!==`none`,zt;function Bt(e){let t=N(e)?I(e):e;return F(t.transform)||F(t.translate)||F(t.scale)||F(t.rotate)||F(t.perspective)||!Ht()&&(F(t.backdropFilter)||F(t.filter))||Lt.test(t.willChange||``)||Rt.test(t.contain||``)}function Vt(e){let t=L(e);for(;P(t)&&!Ut(t);){if(Bt(t))return t;if(It(t))return null;t=L(t)}return null}function Ht(){return zt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),zt}function Ut(e){return/^(html|body|#document)$/.test(jt(e))}function I(e){return j(e).getComputedStyle(e)}function Wt(e){return N(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function L(e){if(jt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Nt(e)&&e.host||M(e);return Nt(t)?t.host:t}function Gt(e){let t=L(e);return Ut(t)?(e.ownerDocument||e).body:P(t)&&Pt(t)?t:Gt(t)}function Kt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Gt(e),i=r===e.ownerDocument?.body,a=j(r);if(i){let e=qt(a);return t.concat(a,a.visualViewport||[],Pt(r)?r:[],e&&n?Kt(e):[])}return t.concat(r,Kt(r,[],n))}function qt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jt(e){let t=I(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=P(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=$e(n)!==a||$e(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Yt(e){return N(e)?e:e.contextElement}function Xt(e){let t=Yt(e);if(!P(t))return D(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Jt(t),o=(a?$e(n.width):n.width)/r,s=(a?$e(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let Zt=D(0);function Qt(e){let t=j(e);return!Ht()||!t.visualViewport?Zt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $t(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===j(e)}function R(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Yt(e),o=D(1);t&&(r?N(r)&&(o=Xt(r)):o=Xt(e));let s=$t(a,n,r)?Qt(a):D(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=j(a),t=N(r)?j(r):r,n=e,i=qt(n);for(;i&&t!==n;){let e=Xt(i),t=i.getBoundingClientRect(),r=I(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=j(i),i=qt(n)}}return yt({width:u,height:d,x:c,y:l})}function en(e,t){let n=Wt(e).scrollLeft;return t?t.left+n:R(M(e)).left+n}function tn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-en(e,n),y:n.top+t.scrollTop}}function nn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=M(r),s=t?It(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=D(1),u=D(0),d=P(r);if((d||!a)&&((jt(r)!==`body`||Pt(o))&&(c=Wt(r)),d)){let e=R(r);l=Xt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?tn(o,c):D(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function rn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function an(e){let t=Wt(e),n=e.ownerDocument.body,r=E(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=E(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+en(e),o=-t.scrollTop;return I(n).direction===`rtl`&&(a+=E(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}function on(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=j(e),a=M(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ht()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(en(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=25&&(s-=o)}return{width:s,height:c,x:l,y:u}}function sn(e,t){let n=R(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Xt(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function cn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=on(e,n,t);else if(t===`document`)r=an(M(e));else if(N(t))r=sn(t,n);else{let n=Qt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yt(r)}function ln(e,t){let n=t.get(e);if(n)return n;let r=Kt(e,[],!1).filter(e=>N(e)&&jt(e)!==`body`),i=null,a=I(e).position===`fixed`,o=a?L(e):e;for(;N(o)&&!Ut(o);){let e=I(o),t=Bt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=L(o)}return t.set(e,r),r}function un(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?It(t)?[]:ln(t,this._c):[].concat(n),r],o=cn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=cn(t,a[e],i);s=E(n.top,s),c=Qe(n.right,c),l=Qe(n.bottom,l),u=E(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function dn(e){let{width:t,height:n}=Jt(e);return{width:t,height:n}}function fn(e,t,n){let r=P(t),i=M(t),a=n===`fixed`,o=R(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=D(0);if((r||!a)&&((jt(t)!==`body`||Pt(i))&&(s=Wt(t)),r)){let e=R(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=en(i));let l=i&&!r&&!a?tn(i,s):D(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function pn(e){return I(e).position===`static`}function mn(e,t){if(!P(e)||I(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return M(e)===n&&(n=n.ownerDocument.body),n}function hn(e,t){let n=j(e);if(It(e))return n;if(!P(e)){let t=L(e);for(;t&&!Ut(t);){if(N(t)&&!pn(t))return t;t=L(t)}return n}let r=mn(e,t);for(;r&&Ft(r)&&pn(r);)r=mn(r,t);return r&&Ut(r)&&pn(r)&&!Bt(r)?n:r||Vt(e)||n}let gn=async function(e){let t=this.getOffsetParent||hn,n=this.getDimensions,r=await n(e.floating);return{reference:fn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _n(e){return I(e).direction===`rtl`}let vn={convertOffsetParentRelativeRectToViewportRelativeRect:nn,getDocumentElement:M,getClippingRect:un,getOffsetParent:hn,getElementRects:gn,getClientRects:rn,getDimensions:dn,getScale:Xt,isElement:N,isRTL:_n};function yn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bn(e,t,n){let r=null,i,a=M(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=et(d),h=et(a.clientWidth-(u+f)),g=et(a.clientHeight-(d+p)),_=et(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:E(0,Qe(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!yn(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=j(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function xn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Yt(e),u=i||a?[...l?Kt(l):[],...t?Kt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?bn(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?R(e):null;c&&g();function g(){let t=R(e);h&&!yn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}let Sn=Et,Cn=Dt,wn=Ct,Tn=kt,En=Ot,Dn=(e,t,n)=>{let r=new Map,i=n??{},a={...vn,...i.platform,_c:r};return St(e,t,{...i,platform:a})};var On=class extends Event{oldState;newState;constructor(e,t={}){let n=Object.assign({},t);delete n.oldState,delete n.newState,super(e,n),this.oldState=String(t.oldState||``),this.newState=String(t.newState||``)}},kn=new WeakMap;function An(e,t,n){kn.set(e,setTimeout(()=>{kn.has(e)&&e.dispatchEvent(new On(`toggle`,{cancelable:!1,oldState:t,newState:n}))},0))}var jn=globalThis.ShadowRoot||function(){},Mn=globalThis.HTMLDialogElement||function(){},Nn=new WeakMap,z=new WeakMap,B=new WeakMap,Pn=new WeakMap;function Fn(e){return Pn.get(e)||`hidden`}var In=new WeakMap;function Ln(e){return[...e].pop()}function Rn(e){let t=e.popoverTargetElement;if(!(t instanceof HTMLElement))return;let n=Fn(t);(e.popoverTargetAction!==`show`||n!==`showing`)&&(e.popoverTargetAction!==`hide`||n!==`hidden`)&&(n===`showing`?Qn(t,!0,!0):V(t,!1)&&(In.set(t,e),Zn(t)))}function V(e,t){return!(e.popover!==`auto`&&e.popover!==`manual`&&e.popover!==`hint`||!e.isConnected||t&&Fn(e)!==`showing`||!t&&Fn(e)!==`hidden`||e instanceof Mn&&e.hasAttribute(`open`)||document.fullscreenElement===e)}function zn(e){if(!e)return 0;let t=z.get(document)||new Set,n=B.get(document)||new Set;return n.has(e)?[...n].indexOf(e)+t.size+1:t.has(e)?[...t].indexOf(e)+1:0}function Bn(e){let t=Wn(e),n=Gn(e);return zn(t)>zn(n)?t:n}function Vn(e){let t,n=B.get(e)||new Set,r=z.get(e)||new Set,i=n.size>0?n:r.size>0?r:null;return i?(t=Ln(i),t.isConnected?t:(i.delete(t),Vn(e))):null}function Hn(e){for(let t of e||[])if(!t.isConnected)e.delete(t);else return t;return null}function Un(e){return typeof e.getRootNode==`function`?e.getRootNode():e.parentNode?Un(e.parentNode):e}function Wn(e){for(;e;){if(e instanceof HTMLElement&&e.popover===`auto`&&Pn.get(e)===`showing`)return e;if(e=e instanceof Element&&e.assignedSlot||e.parentElement||Un(e),e instanceof jn&&(e=e.host),e instanceof Document)return}}function Gn(e){for(;e;){let t=e.popoverTargetElement;if(t instanceof HTMLElement)return t;if(e=e.parentElement||Un(e),e instanceof jn&&(e=e.host),e instanceof Document)return}}function Kn(e,t){let n=new Map,r=0;for(let e of t||[])n.set(e,r),r+=1;n.set(e,r),r+=1;let i=null;function a(t){if(!t)return;let r=!1,a=null;for(;!r;){if(a=Wn(t)||null,a===null||!n.has(a))return;(e.popover===`hint`||a.popover===`auto`)&&(r=!0),r||(t=a.parentElement)}let o=n.get(a)??null;(i===null||n.get(i)<o)&&(i=a)}return a(e.parentElement||Un(e)),i}function qn(e){return e.hidden||e instanceof jn||(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement||e instanceof HTMLFieldSetElement)&&e.disabled||e instanceof HTMLInputElement&&e.type===`hidden`||e instanceof HTMLAnchorElement&&e.href===``?!1:typeof e.tabIndex==`number`&&e.tabIndex!==-1}function Jn(e){if(e.shadowRoot&&e.shadowRoot.delegatesFocus!==!0)return null;let t=e;t.shadowRoot&&(t=t.shadowRoot);let n=t.querySelector(`[autofocus]`);if(n)return n;{let e=t.querySelectorAll(`slot`);for(let t of e){let e=t.assignedElements({flatten:!0});for(let t of e)if(t.hasAttribute(`autofocus`))return t;else if(n=t.querySelector(`[autofocus]`),n)return n}}let r=e.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),i=r.currentNode;for(;i;){if(qn(i))return i;i=r.nextNode()}}function Yn(e){var t;(t=Jn(e))==null||t.focus()}var Xn=new WeakMap;function Zn(e){if(!V(e,!1))return;let t=e.ownerDocument;if(!e.dispatchEvent(new On(`beforetoggle`,{cancelable:!0,oldState:`closed`,newState:`open`}))||!V(e,!1))return;let n=!1,r=e.popover,i=null,a=Kn(e,z.get(t)||new Set),o=Kn(e,B.get(t)||new Set);if(r===`auto`&&(er(B.get(t)||new Set,n,!0),H(a||t,n,!0),i=`auto`),r===`hint`&&(o?(H(o,n,!0),i=`hint`):(er(B.get(t)||new Set,n,!0),a?(H(a,n,!0),i=`auto`):i=`hint`)),r===`auto`||r===`hint`){if(r!==e.popover||!V(e,!1))return;Vn(t)||(n=!0),i===`auto`?(z.has(t)||z.set(t,new Set),z.get(t).add(e)):i===`hint`&&(B.has(t)||B.set(t,new Set),B.get(t).add(e))}Xn.delete(e);let s=t.activeElement;e.classList.add(`:popover-open`),Pn.set(e,`showing`),Nn.has(t)||Nn.set(t,new Set),Nn.get(t).add(e),ar(In.get(e),!0),Yn(e),n&&s&&e.popover===`auto`&&Xn.set(e,s),An(e,`closed`,`open`)}function Qn(e,t=!1,n=!1){var r,i;if(!V(e,!0))return;let a=e.ownerDocument;if([`auto`,`hint`].includes(e.popover)&&(H(e,t,n),!V(e,!0)))return;let o=z.get(a)||new Set,s=o.has(e)&&Ln(o)===e;if(ar(In.get(e),!1),In.delete(e),n&&(e.dispatchEvent(new On(`beforetoggle`,{oldState:`open`,newState:`closed`})),s&&Ln(o)!==e&&H(e,t,n),!V(e,!0)))return;(r=Nn.get(a))==null||r.delete(e),o.delete(e),(i=B.get(a))==null||i.delete(e),e.classList.remove(`:popover-open`),Pn.set(e,`hidden`),n&&An(e,`open`,`closed`);let c=Xn.get(e);c&&(Xn.delete(e),t&&c.focus())}function $n(e,t=!1,n=!1){let r=Vn(e);for(;r;)Qn(r,t,n),r=Vn(e)}function er(e,t=!1,n=!1){let r=Hn(e);for(;r;)Qn(r,t,n),r=Hn(e)}function tr(e,t,n,r){let i=!1,a=!1;for(;i||!a;){a=!0;let o=null,s=!1;for(let n of t)if(n===e)s=!0;else if(s){o=n;break}if(!o)return;for(;Fn(o)===`showing`&&t.size;)Qn(Ln(t),n,r);t.has(e)&&Ln(t)!==e&&(i=!0),i&&(r=!1)}}function H(e,t,n){let r=e.ownerDocument||e;if(e instanceof Document)return $n(r,t,n);if(B.get(r)?.has(e)){tr(e,B.get(r),t,n);return}er(B.get(r)||new Set,t,n),z.get(r)?.has(e)&&tr(e,z.get(r),t,n)}var nr=new WeakMap;function rr(e){if(!e.isTrusted)return;let t=e.composedPath()[0];if(!t)return;let n=t.ownerDocument;if(!Vn(n))return;let r=Bn(t);if(r&&e.type===`pointerdown`)nr.set(n,r);else if(e.type===`pointerup`){let e=nr.get(n)===r;nr.delete(n),e&&H(r||n,!1,!0)}}var ir=new WeakMap;function ar(e,t=!1){if(!e)return;ir.has(e)||ir.set(e,e.getAttribute(`aria-expanded`));let n=e.popoverTargetElement;if(n instanceof HTMLElement&&n.popover===`auto`)e.setAttribute(`aria-expanded`,String(t));else{let t=ir.get(e);t?e.setAttribute(`aria-expanded`,t):e.removeAttribute(`aria-expanded`)}}var or=globalThis.ShadowRoot||function(){},sr=`popover-polyfill`;function cr(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype==`object`&&`popover`in HTMLElement.prototype&&`showPopover`in HTMLElement.prototype}function lr(){return!!(document.body?.showPopover&&!/native code/i.test(document.body.showPopover.toString()))}function U(e,t,n){let r=e[t];Object.defineProperty(e,t,{value(e){return r.call(this,n(e))}})}var ur=/(^|[^\\]):popover-open\b/g;function dr(){return typeof globalThis.CSSLayerBlockRule==`function`}function fr(e){let t=dr(),n=(e??window.POPOVER_POLYFILL_OPTIONS?.layerName??sr).split(`.`).map(e=>CSS.escape(e)).join(`.`);return`
2
2
  ${t?`@layer ${n} {`:``}
3
3
  :where([popover]) {
4
4
  position: fixed;
@@ -60,12 +60,13 @@ ${t?`@layer ${n} {`:``}
60
60
  }
61
61
  }
62
62
  ${t?`}`:``}
63
- `}var pr=null;function mr(e,t){let n=fr(t);if(pr===null)try{pr=new CSSStyleSheet,pr.replaceSync(n)}catch{pr=!1}if(pr===!1){let t=document.createElement(`style`);t.textContent=n,e instanceof Document?e.head.prepend(t):e.prepend(t)}else e.adoptedStyleSheets=[pr,...e.adoptedStyleSheets]}function hr(e){if(typeof window>`u`)return;let t=e?.layerName;window.ToggleEvent=window.ToggleEvent||On;function n(e){return e?.includes(`:popover-open`)&&(e=e.replace(ur,`$1.\\:popover-open`)),e}U(Document.prototype,`querySelector`,n),U(Document.prototype,`querySelectorAll`,n),U(Element.prototype,`querySelector`,n),U(Element.prototype,`querySelectorAll`,n),U(Element.prototype,`matches`,n),U(Element.prototype,`closest`,n),U(DocumentFragment.prototype,`querySelectorAll`,n),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute(`popover`))return null;let e=(this.getAttribute(`popover`)||``).toLowerCase();return e===``||e==`auto`?`auto`:e==`hint`?`hint`:`manual`},set(e){e===null?this.removeAttribute(`popover`):this.setAttribute(`popover`,e)}},showPopover:{enumerable:!0,configurable:!0,value(e={}){Zn(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){Qn(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(e={}){return typeof e==`boolean`&&(e={force:e}),Pn.get(this)===`showing`&&e.force===void 0||e.force===!1?Qn(this,!0,!0):(e.force===void 0||e.force===!0)&&Zn(this),Pn.get(this)===`showing`}}});let r=Element.prototype.attachShadow;r&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(e){let n=r.call(this,e);return mr(n,t),n}}});let i=HTMLElement.prototype.attachInternals;i&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let e=i.call(this);return e.shadowRoot&&mr(e.shadowRoot,t),e}}});let a=new WeakMap;function o(e){Object.defineProperties(e.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(e){if(e===null)this.removeAttribute(`popovertarget`),a.delete(this);else if(e instanceof Element)this.setAttribute(`popovertarget`,``),a.set(this,e);else throw TypeError(`popoverTargetElement must be an element or null`)},get(){if(this.localName!==`button`&&this.localName!==`input`||this.localName===`input`&&this.type!==`reset`&&this.type!==`image`&&this.type!==`button`||this.disabled||this.form&&this.type===`submit`)return null;let e=a.get(this);if(e&&e.isConnected)return e;if(e&&!e.isConnected)return a.delete(this),null;let t=Un(this),n=this.getAttribute(`popovertarget`);return(t instanceof Document||t instanceof or)&&n&&t.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let e=(this.getAttribute(`popovertargetaction`)||``).toLowerCase();return e===`show`||e===`hide`?e:`toggle`},set(e){this.setAttribute(`popovertargetaction`,e)}}})}o(HTMLButtonElement),o(HTMLInputElement);let s=e=>{if(e.defaultPrevented)return;let t=e.composedPath(),n=t[0];if(!(n instanceof Element)||n?.shadowRoot)return;let r=Un(n);if(!(r instanceof or||r instanceof Document))return;let i=t.find(e=>e.matches?.call(e,`[popovertargetaction],[popovertarget]`));if(i){Rn(i),e.preventDefault();return}},c=e=>{let t=e.key,n=e.target;!e.defaultPrevented&&n&&(t===`Escape`||t===`Esc`)&&H(n.ownerDocument,!0,!0)};(e=>{e.addEventListener(`click`,s),e.addEventListener(`keydown`,c),e.addEventListener(`pointerdown`,rr),e.addEventListener(`pointerup`,rr)})(document),mr(document,t)}a()&&!cr()&&!lr()&&hr({layerName:`ds.base`});let gr=new Map,_r=`data-placement`,vr=`data-autoplacement`,yr=new Map,br=e=>xr(h(e),e.newState,e.oldState,e.source||e.detail);function xr(e,t,n,r){let i=e instanceof HTMLElement&&u(e,`popover`)!==null&&d(e,`--_ds-floating`),a=yr.get(e);if(t===`open`&&a&&a.source===r||(a?.cleanup(),t===`closed`||!i))return;if(!r){let t=e.id&&`[popovertarget="${e.id}"],[commandfor="${e.id}"]`;r=t&&m(e).querySelector(t)||void 0}if(!r||r===e||n&&n===t)return;e.style.scrollMarginBottom=`var(--_ds-floating-arrow-size)`;let o=d(e,`--_ds-floating-overscroll`),s=u(e,_r)||u(r,_r)||i,c=u(e,vr)||u(r,vr),l=parseFloat(d(e,`scroll-margin-bottom`))||0,f=s.match(/left|right/gi)?`Height`:`Width`,p=r[`offset${f}`]/2+l;if(s===`none`)return;let h={strategy:`absolute`,placement:s,middleware:[Sn(l),Cn({padding:10,limiter:En({offset:{mainAxis:p}})}),Tr(),...c===`false`?[]:[wn({padding:10,crossAxis:!1})],...o?[Tn({apply({availableHeight:t}){o===`fit`&&(e.style.width=`${r.offsetWidth}px`),e.style.maxHeight=`${Math.max(50,t-20)}px`}})]:[]]},g=xn(r,e,async()=>{if(!r?.isConnected)return yr.get(e)?.cleanup();let{x:t,y:n}=await Dn(r,e,h);e.style.translate=`${t}px ${n}px`});yr.set(e,{source:r,cleanup:()=>yr.delete(e)&&g()})}let Sr,Cr=e=>{if(e.type===`pointerdown`&&(Sr=!1),e.type===`scroll`&&Sr===!1&&(Sr=!0),e.type===`pointerup`&&Sr)for(let[e]of yr)e.showPopover()},wr=e=>{for(let[e,t]of gr)!e.host?.isConnected&&gr.delete(e)&&t();let t=m(h(e));t instanceof ShadowRoot&&!gr.has(t)&&gr.set(t,_(t,`toggle`,br,i))};b(`popover`,()=>{let e=e=>typeof e==`function`,t=HTMLElement.prototype.togglePopover,n=HTMLElement.prototype.showPopover,r=HTMLElement.prototype.hidePopover;return e(t)&&(HTMLElement.prototype.togglePopover=function(e){let n=this.matches(`:popover-open`),r=typeof e==`boolean`,i=n?`open`:`closed`,a=(r?e:e?.force??!n)?`open`:`closed`,o=r?void 0:e?.source,s=t.call(this,e);return xr(this,a,i,o),s}),e(n)&&(HTMLElement.prototype.showPopover=function(e){let t=this.matches(`:popover-open`)?`open`:`closed`,r=n.call(this,e);return xr(this,`open`,t,e?.source),r}),e(r)&&(HTMLElement.prototype.hidePopover=function(){let e=this.matches(`:popover-open`)?`open`:`closed`,t=r.call(this);return xr(this,`closed`,e),t}),[_(document,`click`,wr,i),_(document,`pointerdown pointerup scroll`,Cr,i),_(document,`toggle ds-toggle-source`,br,i),()=>{HTMLElement.prototype.togglePopover=t,HTMLElement.prototype.showPopover=n,HTMLElement.prototype.hidePopover=r;for(let[,e]of gr)e();gr.clear()}]});let Tr=()=>({name:`arrowPseudo`,fn(e){let t=e.elements.floating,n=e.rects.reference,r=`${Math.round(n.width/2+n.x-e.x)}px`,i=`${Math.round(n.height/2+n.y-e.y)}px`;return t.style.setProperty(`--_ds-floating-arrow-x`,r),t.style.setProperty(`--_ds-floating-arrow-y`,i),u(t,`data-floating`,e.placement),e}}),Er=e=>u(e,`readonly`)!==null||u(e,`aria-readonly`)===`true`,Dr=e=>{(!(e.key===`Tab`||e.altKey||e.ctrlKey||e.metaKey)||e.key?.startsWith(`Arrow`))&&Or(e)},Or=e=>{let t=h(e);t?.nodeName===`SELECT`&&Er(t)&&e.preventDefault()},kr=e=>{for(let t of e.composedPath())if(t?.nodeName===`LABEL`&&(t=t.control),t?.nodeName===`INPUT`||t?.nodeName===`SELECT`){Er(t)&&(e.stopImmediatePropagation(),e.preventDefault(),t[t.nodeName===`SELECT`?`blur`:`focus`](),requestAnimationFrame(()=>t.isConnected&&t.focus()));return}};b(`readonly`,()=>[_(document,`keydown`,Dr),_(document,`click`,kr,!0),_(document,`mousedown`,Or,!0)]);let Ar=`focusgroup`,jr=`data-toggle-group`,Mr=`[${jr}]`,Nr,Pr=(e,t)=>{for(let n of t||[null])if(n?.attributeName===jr)zr(n.target);else if(!n||n.addedNodes.length){let t=n?.target||e;for(let e of t.querySelectorAll(Mr))zr(e)}},Fr=e=>{Nr&&Rr(e)&&(e.preventDefault(),e.stopImmediatePropagation())},Ir=()=>Nr=!1,Lr=e=>{Nr=e.key?.startsWith(`Arrow`),e.key===`Enter`&&Rr(e)?.click(),Nr&&setTimeout(Ir,0)},Rr=e=>{let t=h(e);if(!(t?.nodeName!==`INPUT`||t.type!==`radio`||!t.name)){for(let e of g(t))if(!(e.nodeType!==1||!e.hasAttribute(Ar)))return u(e,Ar)?.includes(`radiogroup`)?t:void 0}},zr=e=>{if(e.hasAttribute(Ar))return;let t=p(e,jr),i=u(e,r)?.trim(),a=`Please use ${Ar}="radiogroup" and ${i?r:n}="${i||t}" instead of deprecated ${jr} on:`;u(e,n,i?null:t),u(e,Ar,`radiogroup`),l(a,e)};b(`toggle-group`,()=>[_(document,`click`,Fr,!0),_(document,`keydown`,Lr),x(document,Pr,{attributeFilter:[jr],attributes:!0,childList:!0,subtree:!0})]);let W,Br,Vr,G,Hr=0,Ur=`data-color`,Wr=`data-color-scheme`,Gr=`data-size`,Kr=`data-tooltip`,qr=a()&&/iPad|iPhone|iPod/.test(navigator.userAgent),Jr=`[${Ur}]`,Yr=`[${Wr}]`,Xr=`[${Gr}]`,Zr=`[${Kr}]`,Qr=e=>{e&&!(e instanceof HTMLElement)&&l(`setTooltipElement expects an HTMLElement, got: `,e),ii(),Hr=0,W=e||void 0},$r=(e=document)=>{for(let t of e?.querySelectorAll(Zr)||[])ti(t)},ei=(e,t)=>{if(!t)return $r();for(let e of t)if(e.target!==W)if(e.attributeName===Kr)ti(e.target);else for(let t of e.addedNodes)t.nodeType===1&&(t.hasAttribute(Kr)?ti(t):$r(t))},ti=(e,t=!0)=>{let r=p(e,Kr)||``;if(r[0]===`#`&&(r=m(e).getElementById(r.slice(1))?.textContent?.trim()||``),r!==(e.getAttribute(`aria-label`)||e.getAttribute(`aria-description`))){let t=u(e,`role`)!==`img`&&e.textContent?.trim();u(e,Kr,r),u(e,n,t?null:r),u(e,`aria-description`,t?r:null),e.tabIndex===-1&&l(`Missing tabindex="0" attribute on: `,e)}e===G&&W?.textContent!==r&&(W&&(W.textContent=r),r&&t&&document.activeElement===e&&re(r))},ni=e=>{let t=h(e);if(!t||Vr===t||W?.contains(t))return;Vr=t;let n=Vr?.closest?.(Zr)||void 0;if(G!==n&&(G&&ii(),G=n,n)){if(e.type===`focus`||qr||300>Date.now()-Hr)return ri();e.type===`mousemove`&&(Br=setTimeout(ri,300))}},ri=()=>{if(!G)return ii();W||=ee(`div`,{class:`ds-tooltip`}),W.isConnected||document.body.appendChild(W);let e=G.closest(Jr),t=G.closest(Yr),n=G.closest(Xr),r=e!==t&&e?.contains(t);u(W,`popover`,`manual`),u(W,Wr,t?.getAttribute(Wr)||null),u(W,Ur,r&&e?.getAttribute(Ur)||null),u(W,Gr,n?.getAttribute(Gr)||null),ti(G,!1),W.showPopover(),W.dispatchEvent(new CustomEvent(`ds-toggle-source`,{bubbles:!0,composed:!0,detail:G}))},ii=e=>{(e?.type!==`keydown`||e?.key===`Escape`)&&(G&&W?.isConnected&&W.popover&&W.hidePopover(),e||(Hr=Date.now()),clearTimeout(Br),G=void 0)};b(`tooltip`,()=>[_(document,`focus mousemove`,ni,i),_(document,`keydown`,ii,i),x(document,ei,{attributeFilter:[Kr],attributes:!0,childList:!0,subtree:!0})]);var ai=Object.defineProperty,oi=Object.getOwnPropertySymbols,si=Object.prototype.hasOwnProperty,ci=Object.prototype.propertyIsEnumerable,li=(e,t,n)=>t in e?ai(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ui=(e,t)=>{for(var n in t||={})si.call(t,n)&&li(e,n,t[n]);if(oi)for(var n of oi(t))ci.call(t,n)&&li(e,n,t[n]);return e},di=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,fi=di(),pi=fi?navigator.userAgent:``,mi=/android/i.test(pi),hi=/firefox/i.test(pi),gi=/iPad|iPhone|iPod/.test(pi),_i=fi&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform),vi=fi&&window.CSSStyleSheet&&document.adoptedStyleSheets,yi={once:!0,capture:!0,passive:!0},bi=`:host(:not([hidden])) { display: block }`,xi=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,Si=`${mi?`data`:`aria`}-multiselectable`,Ci=typeof HTMLElement>`u`?class{}:HTMLElement,K=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),wi=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>Ti(e,...t)},Ti=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},Ei=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(ji(`slot`)),!n.querySelector(`style`))if(!vi)n.append(ji(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},Di=(e,t,n)=>{let r=new MutationObserver(n=>{if(!di()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},Oi=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},ki=e=>Oi(e).activeElement,Ai=e=>{if(!e||!fi)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},ji=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))K(r,e,n);return r},Mi={define:(e,t)=>!di()||window.customElements.get(e)||window.customElements.define(e,t)},Ni=(e,t,n=``)=>{var r;let i={bubbles:!0,composed:!0,data:t,inputType:n},a=HTMLInputElement.prototype;e.dispatchEvent(new InputEvent(`beforeinput`,i)),(r=Object.getOwnPropertyDescriptor(a,`value`)?.set)==null||r.call(e,t),e.dispatchEvent(new InputEvent(`input`,i)),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},Pi=new WeakSet,Fi=(e,t)=>(t?.type===`pointerdown`&&(Pi.add(e),wi(document,`pointerup`,()=>Pi.delete(e),yi)),Pi.has(e)),Ii=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,Li=e=>{let t=K(e,`form`);K(e,`form`,`#`),setTimeout(Ri,0,e,t)},Ri=(e,t)=>K(e,`form`,t),zi=e=>(e?.textContent)?.trim()||``,q,Bi=0,Vi=0,Hi=e=>{clearTimeout(Vi),q||(q=ji(`div`,{"aria-live":`assertive`}),q.style.overflow=`hidden`,q.style.position=`fixed`,q.style.whiteSpace=`nowrap`,q.style.width=`1px`),q.isConnected||document.body.append(q),e===``&&(q.textContent=``),e&&(q.textContent=`${e}${Bi++%2?`\xA0`:``}`,Vi=setTimeout(Hi,!_i&&hi?2e3:300,``))},Ui=`disabled`,Wi=`selected`,Gi=class extends Ci{constructor(){super(...arguments),this._skipAttrChange=!1}static get observedAttributes(){return[`id`,Ui,Wi]}connectedCallback(){mi&&(this.tabIndex=-1),this.hasAttribute(`role`)||K(this,`role`,`option`),K(this,`aria-disabled`,`${this.disabled}`),K(this,`aria-selected`,`${this.selected}`),Ai(this)}attributeChangedCallback(e){this._skipAttrChange||=(this._skipAttrChange=!0,e===`id`?Ai(this):K(this,`aria-${e}`,`${this[e]}`),!1)}get defaultSelected(){return this[Wi]}set defaultSelected(e){this[Wi]=e}get disabled(){return K(this,Ui)!==null}set disabled(e){K(this,Ui,e?``:null)}get form(){return this.closest(`form`)}get index(){return[...this.parentElement?.options||[this]].indexOf(this)}get label(){return K(this,`label`)??this.text}set label(e){K(this,`label`,e)}get selected(){return K(this,Wi)!==null}set selected(e){K(this,Wi,e?``:null)}get text(){return zi(this)}set text(e){this.textContent=e}get value(){return K(this,`value`)??this.text}set value(e){K(this,`value`,e)}};Mi.define(`u-option`,Gi);var Ki=`data-activedescendant`,qi=`aria-hidden`,Ji=`${bi}
63
+ `}var pr=null;function mr(e,t){let n=fr(t);if(pr===null)try{pr=new CSSStyleSheet,pr.replaceSync(n)}catch{pr=!1}if(pr===!1||!e.adoptedStyleSheets){let t=document.createElement(`style`);t.textContent=n,e instanceof Document?e.head.prepend(t):e.prepend(t)}else e.adoptedStyleSheets=[pr,...e.adoptedStyleSheets]}function hr(e){if(typeof window>`u`)return;let t=e?.layerName;window.ToggleEvent=window.ToggleEvent||On;function n(e){return e?.includes(`:popover-open`)&&(e=e.replace(ur,`$1.\\:popover-open`)),e}U(Document.prototype,`querySelector`,n),U(Document.prototype,`querySelectorAll`,n),U(Element.prototype,`querySelector`,n),U(Element.prototype,`querySelectorAll`,n),U(Element.prototype,`matches`,n),U(Element.prototype,`closest`,n),U(DocumentFragment.prototype,`querySelectorAll`,n),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute(`popover`))return null;let e=(this.getAttribute(`popover`)||``).toLowerCase();return e===``||e==`auto`?`auto`:e==`hint`?`hint`:`manual`},set(e){e===null?this.removeAttribute(`popover`):this.setAttribute(`popover`,e)}},showPopover:{enumerable:!0,configurable:!0,writable:!0,value(e={}){Zn(this)}},hidePopover:{enumerable:!0,configurable:!0,writable:!0,value(){Qn(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,writable:!0,value(e={}){return typeof e==`boolean`&&(e={force:e}),Pn.get(this)===`showing`&&e.force===void 0||e.force===!1?Qn(this,!0,!0):(e.force===void 0||e.force===!0)&&Zn(this),Pn.get(this)===`showing`}}});let r=Element.prototype.attachShadow;r&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(e){let n=r.call(this,e);return mr(n,t),n}}});let i=HTMLElement.prototype.attachInternals;i&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let e=i.call(this);return e.shadowRoot&&mr(e.shadowRoot,t),e}}});let a=new WeakMap;function o(e){Object.defineProperties(e.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(e){if(e===null)this.removeAttribute(`popovertarget`),a.delete(this);else if(e instanceof Element)this.setAttribute(`popovertarget`,``),a.set(this,e);else throw TypeError(`popoverTargetElement must be an element or null`)},get(){if(this.localName!==`button`&&this.localName!==`input`||this.localName===`input`&&this.type!==`reset`&&this.type!==`image`&&this.type!==`button`||this.disabled||this.form&&this.type===`submit`)return null;let e=a.get(this);if(e&&e.isConnected)return e;if(e&&!e.isConnected)return a.delete(this),null;let t=Un(this),n=this.getAttribute(`popovertarget`);return(t instanceof Document||t instanceof or)&&n&&t.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let e=(this.getAttribute(`popovertargetaction`)||``).toLowerCase();return e===`show`||e===`hide`?e:`toggle`},set(e){this.setAttribute(`popovertargetaction`,e)}}})}o(HTMLButtonElement),o(HTMLInputElement);let s=e=>{if(e.defaultPrevented)return;let t=e.composedPath(),n=t[0];if(!(n instanceof Element)||n?.shadowRoot)return;let r=Un(n);if(!(r instanceof or||r instanceof Document))return;let i=t.find(e=>e.matches?.call(e,`[popovertargetaction],[popovertarget]`));if(i){Rn(i),e.preventDefault();return}},c=e=>{let t=e.key,n=e.target;!e.defaultPrevented&&n&&(t===`Escape`||t===`Esc`)&&H(n.ownerDocument||n,!0,!0)};(e=>{e.addEventListener(`click`,s),e.addEventListener(`keydown`,c),e.addEventListener(`pointerdown`,rr),e.addEventListener(`pointerup`,rr)})(document),mr(document,t)}a()&&!cr()&&!lr()&&hr({layerName:`ds.base`});let gr=new Map,_r=`data-placement`,vr=`data-autoplacement`,yr=new Map,br=e=>xr(h(e),e.newState,e.oldState,e.source||e.detail);function xr(e,t,n,r){let i=e instanceof HTMLElement&&u(e,`popover`)!==null&&d(e,`--_ds-floating`),a=yr.get(e);if(t===`open`&&a&&a.source===r||(a?.cleanup(),t===`closed`||!i))return;if(!r){let t=e.id&&`[popovertarget="${e.id}"],[commandfor="${e.id}"]`;r=t&&m(e).querySelector(t)||void 0}if(!r||r===e||n&&n===t)return;e.style.scrollMarginBottom=`var(--_ds-floating-arrow-size)`;let o=d(e,`--_ds-floating-overscroll`),s=u(e,_r)||u(r,_r)||i,c=u(e,vr)||u(r,vr),l=parseFloat(d(e,`scroll-margin-bottom`))||0,f=s.match(/left|right/gi)?`Height`:`Width`,p=r[`offset${f}`]/2+l;if(s===`none`)return;let h=!1,g={strategy:`absolute`,placement:s,middleware:[Sn(l),Cn({padding:10,limiter:En({offset:{mainAxis:p}})}),Tr(),...c===`false`?[]:[wn({padding:10,crossAxis:!1})],...o?[Tn({apply({availableHeight:t}){if(h)return;h=!0;let n=`${r.offsetWidth}px`,i=`${Math.max(50,t-20)}px`;requestAnimationFrame(()=>{o===`fit`&&e.style.width!==n&&(e.style.width=n),e.style.maxHeight!==i&&(e.style.maxHeight=i)})}})]:[]]},_=xn(r,e,async()=>{if(!r?.isConnected)return yr.get(e)?.cleanup();let{x:t,y:n}=await Dn(r,e,g);e.style.translate=`${t}px ${n}px`});yr.set(e,{source:r,cleanup:()=>yr.delete(e)&&_()})}let Sr,Cr=e=>{if(e.type===`pointerdown`&&(Sr=!1),e.type===`scroll`&&Sr===!1&&(Sr=!0),e.type===`pointerup`&&Sr)for(let[e]of yr)e.showPopover()},wr=e=>{for(let[e,t]of gr)!e.host?.isConnected&&gr.delete(e)&&t();let t=m(h(e));t instanceof ShadowRoot&&!gr.has(t)&&gr.set(t,_(t,`toggle`,br,i))};b(`popover`,()=>{let e=Object.getOwnPropertyDescriptors(HTMLElement.prototype),t=HTMLElement.prototype.togglePopover,n=HTMLElement.prototype.showPopover,r=HTMLElement.prototype.hidePopover;return Object.defineProperties(HTMLElement.prototype,{togglePopover:{...e.togglePopover,value(e){let n=this.matches(`:popover-open`),r=typeof e==`boolean`,i=n?`open`:`closed`,a=(r?e:e?.force??!n)?`open`:`closed`,o=r?void 0:e?.source,s=t?.call(this,e);return xr(this,a,i,o),s}},showPopover:{...e.showPopover,value(e){let t=this.matches(`:popover-open`)?`open`:`closed`,r=n?.call(this,e);return xr(this,`open`,t,e?.source),r}},hidePopover:{...e.hidePopover,value(){let e=this.matches(`:popover-open`)?`open`:`closed`,t=r?.call(this);return xr(this,`closed`,e),t}}}),[_(document,`click`,wr,i),_(document,`pointerdown pointerup scroll`,Cr,i),_(document,`toggle ds-toggle-source`,br,i),()=>{Object.defineProperties(HTMLElement.prototype,{togglePopover:{...e.togglePopover,value:t},showPopover:{...e.showPopover,value:n},hidePopover:{...e.hidePopover,value:r}});for(let[,e]of gr)e();gr.clear()}]});let Tr=()=>({name:`arrowPseudo`,fn(e){let t=e.elements.floating,n=e.rects.reference,r=`${Math.round(n.width/2+n.x-e.x)}px`,i=`${Math.round(n.height/2+n.y-e.y)}px`;return t.style.setProperty(`--_ds-floating-arrow-x`,r),t.style.setProperty(`--_ds-floating-arrow-y`,i),u(t,`data-floating`,e.placement),e}}),Er=e=>u(e,`readonly`)!==null||u(e,`aria-readonly`)===`true`,Dr=e=>{(!(e.key===`Tab`||e.altKey||e.ctrlKey||e.metaKey)||e.key?.startsWith(`Arrow`))&&Or(e)},Or=e=>{let t=h(e);t?.nodeName===`SELECT`&&Er(t)&&e.preventDefault()},kr=e=>{for(let t of e.composedPath())if(t?.nodeName===`LABEL`&&(t=t.control),t?.nodeName===`INPUT`||t?.nodeName===`SELECT`){Er(t)&&(e.stopImmediatePropagation(),e.preventDefault(),t[t.nodeName===`SELECT`?`blur`:`focus`](),requestAnimationFrame(()=>t.isConnected&&t.focus()));return}};b(`readonly`,()=>[_(document,`keydown`,Dr),_(document,`click`,kr,!0),_(document,`mousedown`,Or,!0)]);let Ar=`focusgroup`,jr=`data-toggle-group`,Mr=`[${jr}]`,Nr,Pr=(e,t)=>{for(let n of t||[null])if(n?.attributeName===jr)zr(n.target);else if(!n||n.addedNodes.length){let t=n?.target||e;for(let e of t.querySelectorAll(Mr))zr(e)}},Fr=e=>{Nr&&Rr(e)&&(e.preventDefault(),e.stopImmediatePropagation())},Ir=()=>Nr=!1,Lr=e=>{Nr=e.key?.startsWith(`Arrow`),e.key===`Enter`&&Rr(e)?.click(),Nr&&setTimeout(Ir,0)},Rr=e=>{let t=h(e);if(!(t?.nodeName!==`INPUT`||t.type!==`radio`||!t.name)){for(let e of g(t))if(!(e.nodeType!==1||!e.hasAttribute(Ar)))return u(e,Ar)?.includes(`radiogroup`)?t:void 0}},zr=e=>{if(e.hasAttribute(Ar))return;let t=p(e,jr),i=u(e,r)?.trim(),a=`Please use ${Ar}="radiogroup" and ${i?r:n}="${i||t}" instead of deprecated ${jr} on:`;u(e,n,i?null:t),u(e,Ar,`radiogroup`),l(a,e)};b(`toggle-group`,()=>[_(document,`click`,Fr,!0),_(document,`keydown`,Lr),x(document,Pr,{attributeFilter:[jr],attributes:!0,childList:!0,subtree:!0})]);let W,Br,Vr,G,Hr=0,Ur=`data-color`,Wr=`data-color-scheme`,Gr=`data-size`,Kr=`data-tooltip`,qr=a()&&/iPad|iPhone|iPod/.test(navigator.userAgent),Jr=`[${Ur}]`,Yr=`[${Wr}]`,Xr=`[${Gr}]`,Zr=`[${Kr}]`,Qr=e=>{e&&!(e instanceof HTMLElement)&&l(`setTooltipElement expects an HTMLElement, got: `,e),ii(),Hr=0,W=e||void 0},$r=(e=document)=>{for(let t of e?.querySelectorAll(Zr)||[])ti(t)},ei=(e,t)=>{if(!t)return $r();for(let e of t)if(e.target!==W){if(e.attributeName===Kr)ti(e.target);else for(let t of e.addedNodes)t.nodeType===1&&(t.hasAttribute(Kr)?ti(t):$r(t))}},ti=(e,t=!0)=>{let r=p(e,Kr)||``;if(r[0]===`#`&&(r=m(e).getElementById(r.slice(1))?.textContent?.trim()||``),r!==(e.getAttribute(`aria-label`)||e.getAttribute(`aria-description`))){let t=u(e,`role`)!==`img`&&e.textContent?.trim();u(e,Kr,r),u(e,n,t?null:r),u(e,`aria-description`,t?r:null),e.tabIndex===-1&&l(`Missing tabindex="0" attribute on: `,e)}e===G&&W?.textContent!==r&&(W&&(W.textContent=r),r&&t&&document.activeElement===e&&re(r))},ni=e=>{let t=h(e);if(!t||Vr===t||W?.contains(t))return;Vr=t;let n=Vr?.closest?.(Zr)||void 0;if(G!==n&&(G&&ii(),G=n,n)){if(e.type===`focus`||qr||300>Date.now()-Hr)return ri();e.type===`mousemove`&&(Br=setTimeout(ri,300))}},ri=()=>{if(!G)return ii();W||=ee(`div`,{class:`ds-tooltip`}),W.isConnected||document.body.appendChild(W);let e=G.closest(Jr),t=G.closest(Yr),n=G.closest(Xr),r=e!==t&&e?.contains(t);u(W,`popover`,`manual`),u(W,Wr,t?.getAttribute(Wr)||null),u(W,Ur,r&&e?.getAttribute(Ur)||null),u(W,Gr,n?.getAttribute(Gr)||null),ti(G,!1),W.showPopover(),W.dispatchEvent(new CustomEvent(`ds-toggle-source`,{bubbles:!0,composed:!0,detail:G}))},ii=e=>{(e?.type!==`keydown`||e?.key===`Escape`)&&(G&&W?.isConnected&&W.popover&&W.hidePopover(),e||(Hr=Date.now()),clearTimeout(Br),G=void 0)};b(`tooltip`,()=>[_(document,`focus mousemove`,ni,i),_(document,`keydown`,ii,i),x(document,ei,{attributeFilter:[Kr],attributes:!0,childList:!0,subtree:!0})]);var ai=Object.defineProperty,oi=Object.getOwnPropertySymbols,si=Object.prototype.hasOwnProperty,ci=Object.prototype.propertyIsEnumerable,li=(e,t,n)=>t in e?ai(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ui=(e,t)=>{for(var n in t||={})si.call(t,n)&&li(e,n,t[n]);if(oi)for(var n of oi(t))ci.call(t,n)&&li(e,n,t[n]);return e},di=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,fi=di(),pi=fi?navigator.userAgent:``,mi=/android/i.test(pi),hi=/firefox/i.test(pi),gi=/iPad|iPhone|iPod/.test(pi),_i=fi&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform),vi=fi&&window.CSSStyleSheet&&document.adoptedStyleSheets,yi={once:!0,capture:!0,passive:!0},bi=`:host(:not([hidden])) { display: block }`,xi=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,Si=`${mi?`data`:`aria`}-multiselectable`,Ci=typeof HTMLElement>`u`?class{}:HTMLElement,K=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),wi=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>Ti(e,...t)},Ti=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},Ei=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(ji(`slot`)),!n.querySelector(`style`)){if(!vi)n.append(ji(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}}return n},Di=(e,t,n)=>{let r=new MutationObserver(n=>{if(!di()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},Oi=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},ki=e=>Oi(e).activeElement,Ai=e=>{if(!e||!fi)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},ji=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))K(r,e,n);return r},Mi={define:(e,t)=>!di()||window.customElements.get(e)||window.customElements.define(e,t)},Ni=(e,t,n=``)=>{var r;let i={bubbles:!0,composed:!0,data:t,inputType:n},a=HTMLInputElement.prototype;e.dispatchEvent(new InputEvent(`beforeinput`,i)),(r=Object.getOwnPropertyDescriptor(a,`value`)?.set)==null||r.call(e,t),e.dispatchEvent(new InputEvent(`input`,i)),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},Pi=new WeakSet,Fi=(e,t)=>(t?.type===`pointerdown`&&(Pi.add(e),wi(document,`pointerup`,()=>Pi.delete(e),yi)),Pi.has(e)),Ii=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,Li=e=>{let t=K(e,`form`);K(e,`form`,`#`),setTimeout(Ri,0,e,t)},Ri=(e,t)=>K(e,`form`,t),zi=e=>(e?.textContent)?.trim()||``,q,Bi=0,Vi=0,Hi=e=>{clearTimeout(Vi),q||(q=ji(`div`,{"aria-live":`assertive`}),q.style.overflow=`hidden`,q.style.position=`fixed`,q.style.whiteSpace=`nowrap`,q.style.width=`1px`),q.isConnected||document.body.append(q),e===``&&(q.textContent=``),e&&(q.textContent=`${e}${Bi++%2?`\xA0`:``}`,Vi=setTimeout(Hi,!_i&&hi?2e3:300,``))},Ui=`disabled`,Wi=`selected`,Gi=class extends Ci{constructor(){super(...arguments),this._skipAttrChange=!1}static get observedAttributes(){return[`id`,Ui,Wi]}connectedCallback(){mi&&(this.tabIndex=-1),this.hasAttribute(`role`)||K(this,`role`,`option`),K(this,`aria-disabled`,`${this.disabled}`),K(this,`aria-selected`,`${this.selected}`),Ai(this)}attributeChangedCallback(e){this._skipAttrChange||=(this._skipAttrChange=!0,e===`id`?Ai(this):K(this,`aria-${e}`,`${this[e]}`),!1)}get defaultSelected(){return this[Wi]}set defaultSelected(e){this[Wi]=e}get disabled(){return K(this,Ui)!==null}set disabled(e){K(this,Ui,e?``:null)}get form(){return this.closest(`form`)}get index(){return[...this.parentElement?.options||[this]].indexOf(this)}get label(){return K(this,`label`)??this.text}set label(e){K(this,`label`,e)}get selected(){return K(this,Wi)!==null}set selected(e){K(this,Wi,e?``:null)}get text(){return zi(this)}set text(e){this.textContent=e}get value(){return K(this,`value`)??this.text}set value(e){K(this,`value`,e)}};Mi.define(`u-option`,Gi);var Ki=`data-activedescendant`,qi=`aria-hidden`,Ji=`${bi}
64
64
  ::slotted([role="option"]) { display: block; cursor: pointer }
65
65
  ::slotted([role="option"][${Ki}]) { ${xi} }
66
- ::slotted([role="option"]:is([${qi}="true"], [disabled], [hidden])) { display: none !important }`,Yi=Ii(Ji),Xi,Zi=`focus click keydown`,Qi=`focusout input pointerdown`,$i={of:`of`,plural:`%d hits`,singular:`%d hit`},ea=class extends Ci{constructor(){super(),this._texts=ui({},$i),Ei(this,Ji)}static get observedAttributes(){return[`id`,...Object.keys($i).map(e=>`data-sr-${e}`)]}connectedCallback(){this._root=Oi(this),K(this,`hidden`,``),K(this,`role`,`listbox`),K(this,`tabindex`,`-1`),wi(this._root,Zi,this,!0),this._umutate=Di(this,pa,{attributeFilter:[`disabled`,`hidden`,`label`,`value`],attributes:!0,characterData:!0,childList:!0,subtree:!0})}disconnectedCallback(){var e;this._root&&Ti(this._root,Zi,this,!0),this._root&&Ti(this._root,Qi,this),oa(this,null),(e=this._umutate)==null||e.call(this),this._umutate=this._root=this._input=void 0}attributeChangedCallback(e,t,n){let r=e?.split(`data-sr-`)[1];if($i[r])this._texts[r]=n||$i[r];else if(this.id){let e=`input[list="${this.id}"]`,t=Oi(this).querySelector(e);t&&oa(this,t)}}handleEvent(e){e.defaultPrevented||(e.type===`focus`&&sa(this,e),e.type===`focusout`&&ca(this,e),e.type===`click`&&da(this,e),e.type===`input`&&pa(this),e.type===`keydown`&&fa(this,e),e.type===`pointerdown`&&ua(this,e))}get options(){let e=!this._options&&this.querySelector(`[role="option"],option`);return e&&(this._options=this.getElementsByTagName(e?.nodeName)),this._options||this.getElementsByTagName(`option`)}},ta=e=>e.disabled||e.readOnly,na=e=>e instanceof HTMLInputElement,ra=e=>K(e,qi)!==`true`&&e.clientHeight,ia=(e,t)=>{e._input&&K(e._input,`aria-expanded`,`${t}`),!(!e.isConnected||e.hidden!==t)&&(t||aa(e),e.popover&&e.togglePopover(t),t&&setTimeout(()=>clearTimeout(Xi)),e.hidden=!t)},aa=(e,t)=>{e._input&&K(e._input,`aria-activedescendant`,Ai(t));for(let n of e.options)K(n,Ki,n===t?``:null);t?.scrollIntoView({block:`nearest`})},oa=(e,t)=>{let n=t||e._input,r=!e._root||e.hidden;n&&(e.popover&&(K(e,`popover`,`manual`),K(n,`popovertarget`,t&&Ai(e))),K(n,`aria-autocomplete`,t&&`list`),K(n,`aria-controls`,t&&Ai(e)),K(n,`aria-expanded`,t&&`${!r}`),K(n,`autocomplete`,t&&`off`),K(n,`enterkeyhint`,`done`),K(n,`role`,t&&!ta(n)?`combobox`:null))},sa=(e,{target:t})=>{if(e._input!==t)if(na(t)&&t.getAttribute(`list`)===e.id){if(oa(e,null),oa(e,t),ta(t))return;e._root&&wi(e._root,Qi,e),K(e,`aria-label`,(t.labels?.[0])?.textContent.trim()||null),Hi(),e._input=t,mi&&ia(e,!0)}else la(e)},ca=(e,t)=>{Fi(e)?t.stopImmediatePropagation():mi||setTimeout(la,0,e,t)},la=e=>{let t=ki(e);e._input===t||e.contains(t)||(e._root&&Ti(e._root,Qi,e),ia(e,!1),e._input=void 0)},ua=(e,t)=>e.contains(t.target)&&Fi(e,t),da=(e,t)=>{var n;if(na(t.target)&&sa(e,t),e._input===t.target)return ia(e,!0);if(!e.contains(t.target))return la(e);for(let r of e.options)if(r.contains(t.target))return(n=e._input)==null||n.focus(),e._input&&Ni(e._input,r.value),ia(e,K(e,Si)===`true`)},fa=(e,t)=>{if(na(t.target)&&sa(e,t),e._input!==t.target)return;let{key:n,ctrlKey:r,metaKey:i,altKey:a}=t;if(r||i||n===`Shift`||n===`Tab`||a&&!n.startsWith(`Arrow`))return;n===`Escape`&&!e.hidden&&t.preventDefault(),ia(e,n!==`Escape`);let o=n===`Enter`,s=K(e._input,`aria-activedescendant`),c=[],l=-1,u=-1;for(let t of e.options)ra(t)&&(c.push(t),t.id===s&&(l=c.length-1));!a&&n===`ArrowDown`&&(u=(l+1)%c.length),!a&&n===`ArrowUp`&&(u=(l||c.length)-1),~l&&((n===`Home`||n===`PageUp`)&&(u=0),(n===`End`||n===`PageDown`)&&(u=c.length-1),o&&(u=l)),c[u]&&(t.preventDefault(),e._input.focus()),o&&c[u]?(t.stopImmediatePropagation(),Li(e._input),c[u].click()):aa(e,c[u])},pa=e=>{var t;if(!e._input||e.hidden)return;let n=e._input.value.toLowerCase().trim()||``,r=!e.hasAttribute(`data-nofilter`),i=[],a=[];for(let t of e.options)(t.disabled||t.hidden||r&&!t.label.toLowerCase().includes(n)?i:a).push(t);for(let e of i)K(e,qi,`true`);for(let e of a)K(e,qi,`false`);clearTimeout(Xi),Xi=setTimeout(ma,500,e,a),gi&&a.forEach((t,n,{length:r})=>{K(t,`title`,`${n+1} ${e._texts.of} ${r}`)}),(t=e._umutate)==null||t.takeRecords()},ma=(e,t)=>!e.hidden&&e._input===ki(e)&&Hi(`${t.some(({value:e})=>e)?`${e._texts[t[1]?`plural`:`singular`]}`.replace(`%d`,`${t.length}`):e.innerText}`);di()&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){let e=K(this,`list`);return e&&Oi(this).getElementById(e)}}),Mi.define(`u-datalist`,ea);var ha=class extends s{_items;_label={key:n,value:null};_unresize;_unmutate;static get observedAttributes(){return[n,r]}connectedCallback(){let e=c(()=>ga(this),100);this._items=this.getElementsByTagName(`a`),this._unresize=_(window,`resize`,e),this._unmutate=x(this,ga,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&ga(this)}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};let ga=e=>{let t=e._items?.[e._items.length-1],i=t?.parentElement===e?null:t,a=!i?.offsetHeight;u(e,`role`,a?null:`navigation`);for(let t of e._items||[])u(t,`aria-current`,t===i?`page`:null);let o=p(e,n)?.trim(),s=u(e,r)?.trim(),c=o||s;c&&(e._label.value=c),c&&(e._label.key=s?r:n);let l=a?null:e._label.value;c!==l&&(u(e,r,null),u(e,n,null),u(e,e._label.key,l))};S.define(`ds-breadcrumbs`,ha);var _a=class extends s{_unmutate;connectedCallback(){_(this,`animationend`,this,i),u(this,`role`,`group`),u(this,`tabindex`,`-1`),this._unmutate=x(this,va,{childList:!0,subtree:!0}),this.focus()}handleEvent({target:e}){e===this&&this.focus()}disconnectedCallback(){v(this,`animationend`,this,i),this._unmutate?.(),this._unmutate=void 0}};let va=e=>{let t=u(e,n)?.trim(),i=u(e,r)?.trim(),a=e.querySelector(`h2,h3,h4,h5,h6`);a&&!t&&!i&&u(e,r,w(a)),!a&&!t&&!i&&l(`Missing accessible name on:`,e,`\nAdd a heading (h2–h6), or set ${n} or ${r} to provide an accessible name for screen readers.`)};S.define(`ds-error-summary`,_a);let ya=`aria-invalid`,ba=`aria-describedby`,xa=`data-indeterminate`,Sa=o()?800:200,Ca=e=>{let t=[],n=[],r=e._descs||[],i=!1,a=!1;e._input?.hidden&&(e._input=void 0);for(let r of e.getElementsByTagName(`*`))if(r instanceof HTMLLabelElement&&t.push(r),!r.hidden)if(Da(r))e._input?.isConnected&&e._input!==r?l(`Fields should only have one input element. Use <fieldset> to group multiple fields:`,e):e._input=r;else{let t=r.getAttribute(`data-field`);t===`counter`&&(e._counter=r),t===`validation`?(n.unshift(w(r)),i=!0,a||=Ea(r)):t&&n.push(w(r))}if(!e._input?.isConnected)return;let o=e._input;for(let e of t)u(e,`for`,w(o)||null);let s=e.closest(`fieldset`)?.querySelector(`:scope > [data-field="validation"]`);s&&!s?.hidden&&(i=!0,a||=Ea(s),n.unshift(w(s)));let c=u(o,xa);c&&(o.indeterminate=c===`true`),(o.type===`radio`||o.type===`checkbox`)&&u(e,`data-clickdelegatefor`,w(o));let d=(u(o,ba)?.trim().split(/\s+/))?.filter(e=>!r.includes(e))||[];u(o,ba,[...n,...d].join(` `)||null),e._descs=n;let f=e._validation;i&&!f&&!o.hasAttribute(ya)?(u(o,ya,`true`),e._validation=!0):!i&&f&&(u(o,ya,null),e._validation=void 0),e.handleEvent()},wa={over:`%d tegn for mye`,under:`%d tegn igjen`},Ta=c((e,t)=>{document.activeElement===e&&re(t)},Sa),Ea=e=>e.getAttribute(`data-color`)!==`success`,Da=e=>e instanceof HTMLElement&&`validity`in e&&!(e instanceof HTMLButtonElement)&&e.type!==`hidden`;var Oa=class extends s{_counter;_descs;_input;_validation;_unevents;_unmutate;connectedCallback(){this._unevents=_(this,`input`,this,i),this._unmutate=x(this,()=>Ca(this),{attributeFilter:[`data-field`,`data-limit`,`hidden`,`id`,`value`,xa],attributes:!0,childList:!0,subtree:!0})}handleEvent(e){let{_counter:t,_input:n}=this;if(t?.isConnected&&n){let r=(Number(u(t,`data-limit`))||0)-n.value.length,i=r<0?`over`:`under`,a=(p(t,`data-${i}`)||wa[i])?.replace(`%d`,`${Math.abs(r)}`);a||l(`Missing data-${i} on:`,t),u(t,`data-label`,a),u(t,`data-state`,i),u(t,`data-color`,r<0?`danger`:null),e?.type===`input`&&a&&Ta(n,a)}n instanceof HTMLTextAreaElement&&(n.style.setProperty(`--_ds-field-sizing`,`auto`),n.style.setProperty(`--_ds-field-sizing`,`${n.scrollHeight}px`))}disconnectedCallback(){this._unevents?.(),this._unmutate?.(),this._unevents=this._unmutate=void 0,this._input=this._counter=this._descs=this._validation=void 0}};S.define(`ds-field`,Oa);let ka=`data-current`,Aa=`data-total`,ja=`data-href`,Ma=({current:e=1,total:t=10,show:n=7})=>({prev:e>1?e-1:0,next:e<t?e+1:0,pages:Fa(e,t,n).map((t,n)=>({current:t===e&&`page`,key:`key-${t}-${n}`,page:t}))});var Na=class extends s{_unmutate;_render;static get observedAttributes(){return[n,r,ka,Aa,ja]}connectedCallback(){let e=u(this,Aa),t=u(this,ka);t&&!e&&l(`Missing ${Aa} attribute on:`,this),e&&!t&&l(`Missing ${ka} attribute on:`,this);let i=p(this,n),a=u(this,r)?.trim();i||a?u(this,n,a?null:i):l(`Missing ${n} on:`,this),u(this,`role`,`navigation`),this._unmutate=x(this,Pa,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&Pa(this)}disconnectedCallback(){this._unmutate?.(),this._unmutate=this._render=void 0}};let Pa=e=>{let t=Number(u(e,ka)),r=Number(u(e,Aa));if(t&&r){let i=e.querySelectorAll(`button,a`),a=i.length-2,o=u(e,ja),{next:s,prev:c,pages:l}=Ma({current:t,total:r,show:a});i.forEach((e,t)=>{let r=t?i[t+1]?l[t-1]?.page:s:c;u(e,`aria-current`,l[t-1]?.current?`true`:null),u(e,n,`${r??`hidden`}`),u(e,`role`,r?null:`none`),u(e,`tabindex`,r?null:`-1`),e instanceof HTMLButtonElement&&u(e,`value`,`${r}`),o&&e instanceof HTMLAnchorElement&&u(e,`href`,o.replace(`%d`,`${r}`))})}},Fa=(e,t,n=1/0)=>{let r=(n-1)/2,i=Math.max(Math.min(e-Math.floor(r),t-n+1),1),a=Math.min(Math.max(e+Math.ceil(r),n),t),o=Array.from({length:a+1-i},(e,t)=>t+i);return n>4&&i>1&&o.splice(0,2,1,0),n>3&&a<t&&o.splice(-2,2,0,t),o};S.define(`ds-pagination`,Na);var Ia=Object.defineProperty,La=Object.getOwnPropertySymbols,Ra=Object.prototype.hasOwnProperty,za=Object.prototype.propertyIsEnumerable,Ba=(e,t,n)=>t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Va=(e,t)=>{for(var n in t||={})Ra.call(t,n)&&Ba(e,n,t[n]);if(La)for(var n of La(t))za.call(t,n)&&Ba(e,n,t[n]);return e},Ha=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,Ua=Ha(),Wa=Ua?navigator.userAgent:``,Ga=/android/i.test(Wa),Ka=/firefox/i.test(Wa),qa=/iPad|iPhone|iPod/.test(Wa),Ja=Ua&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform),Ya=Ua&&window.CSSStyleSheet&&document.adoptedStyleSheets,Xa={once:!0,capture:!0,passive:!0},Za=`:host(:not([hidden])) { display: block }`,Qa=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,$a=`${Ga?`data`:`aria`}-multiselectable`,eo=typeof HTMLElement>`u`?class{}:HTMLElement,J=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),to=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>no(e,...t)},no=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},ro=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(lo(`slot`)),!n.querySelector(`style`))if(!Ya)n.append(lo(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},io=(e,t,n)=>{let r=new MutationObserver(n=>{if(!Ha()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},ao=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},oo=e=>ao(e).activeElement,so=e=>{let t=J(e,`aria-label`)||``;return[...(J(e,`aria-labelledby`)?.split(` `)||[]).map(e=>document.getElementById(e.trim()||`-`)),...Array.from(e.labels||[])].reduce((e,t)=>e||(t?.innerText)?.trim()||``,t).trim()},co=e=>{if(!e||!Ua)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},lo=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))J(r,e,n);return r},uo={define:(e,t)=>!Ha()||window.customElements.get(e)||window.customElements.define(e,t)},fo=(e,t,n=``)=>{var r;let i={bubbles:!0,composed:!0,data:t,inputType:n},a=HTMLInputElement.prototype;e.dispatchEvent(new InputEvent(`beforeinput`,i)),(r=Object.getOwnPropertyDescriptor(a,`value`)?.set)==null||r.call(e,t),e.dispatchEvent(new InputEvent(`input`,i)),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},po=new WeakSet,mo=(e,t)=>(t?.type===`pointerdown`&&(po.add(e),to(document,`pointerup`,()=>po.delete(e),Xa)),po.has(e)),ho=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,go=e=>{let t=J(e,`form`);J(e,`form`,`#`),setTimeout(_o,0,e,t)},_o=(e,t)=>J(e,`form`,t),Y=e=>(e?.textContent)?.trim()||``,X,vo=0,yo=0,bo=e=>{clearTimeout(yo),X||(X=lo(`div`,{"aria-live":`assertive`}),X.style.overflow=`hidden`,X.style.position=`fixed`,X.style.whiteSpace=`nowrap`,X.style.width=`1px`),X.isConnected||document.body.append(X),e===``&&(X.textContent=``),e&&(X.textContent=`${e}${vo++%2?`\xA0`:``}`,yo=setTimeout(bo,!Ja&&Ka?2e3:300,``))},xo=`${Za}
67
- :is(:host(:not([data-multiple])), :host([data-multiple="false"])) [part="items"] { display: none }
68
- [role="listbox"] { display: inline-flex } /* Can not be "contents" as this confuses VoiceOver */
66
+ ::slotted([role="option"]:is([${qi}="true"], [disabled], [hidden])) { display: none !important }`,Yi=Ii(Ji),Xi,Zi=`focus click keydown`,Qi=`focusout input pointerdown`,$i={of:`of`,plural:`%d hits`,singular:`%d hit`},ea=class extends Ci{constructor(){super(),this._texts=ui({},$i),Ei(this,Ji)}static get observedAttributes(){return[`id`,...Object.keys($i).map(e=>`data-sr-${e}`)]}connectedCallback(){this._root=Oi(this),K(this,`hidden`,``),K(this,`role`,`listbox`),K(this,`tabindex`,`-1`),wi(this._root,Zi,this,!0),this._umutate=Di(this,pa,{attributeFilter:[`disabled`,`hidden`,`label`,`value`],attributes:!0,characterData:!0,childList:!0,subtree:!0})}disconnectedCallback(){var e;this._root&&Ti(this._root,Zi,this,!0),this._root&&Ti(this._root,Qi,this),oa(this,null),(e=this._umutate)==null||e.call(this),this._umutate=this._root=this._input=void 0}attributeChangedCallback(e,t,n){let r=e?.split(`data-sr-`)[1];if($i[r])this._texts[r]=n||$i[r];else if(this.id){let e=`input[list="${this.id}"]`,t=Oi(this).querySelector(e);t&&oa(this,t)}}handleEvent(e){e.defaultPrevented||(e.type===`focus`&&sa(this,e),e.type===`focusout`&&ca(this,e),e.type===`click`&&da(this,e),e.type===`input`&&pa(this),e.type===`keydown`&&fa(this,e),e.type===`pointerdown`&&ua(this,e))}get options(){let e=!this._options&&this.querySelector(`[role="option"],option`);return e&&(this._options=this.getElementsByTagName(e?.nodeName)),this._options||this.getElementsByTagName(`option`)}},ta=e=>e.disabled||e.readOnly,na=e=>e instanceof HTMLInputElement,ra=e=>K(e,qi)!==`true`&&e.clientHeight,ia=(e,t)=>{e._input&&K(e._input,`aria-expanded`,`${t}`),!(!e.isConnected||e.hidden!==t)&&(t||aa(e),e.popover&&e.togglePopover(t),t&&setTimeout(()=>clearTimeout(Xi)),e.hidden=!t)},aa=(e,t)=>{e._input&&K(e._input,`aria-activedescendant`,Ai(t));for(let n of e.options)K(n,Ki,n===t?``:null);t?.scrollIntoView({block:`nearest`})},oa=(e,t)=>{let n=t||e._input,r=!e._root||e.hidden;n&&(e.popover&&(K(e,`popover`,`manual`),K(n,`popovertarget`,t&&Ai(e))),K(n,`aria-autocomplete`,t&&`list`),K(n,`aria-controls`,t&&Ai(e)),K(n,`aria-expanded`,t&&`${!r}`),K(n,`autocomplete`,t&&`off`),K(n,`enterkeyhint`,`done`),K(n,`role`,t&&!ta(n)?`combobox`:null))},sa=(e,{target:t})=>{if(e._input!==t){if(na(t)&&t.getAttribute(`list`)===e.id){if(oa(e,null),oa(e,t),ta(t))return;e._root&&wi(e._root,Qi,e),K(e,`aria-label`,(t.labels?.[0])?.textContent.trim()||null),Hi(),e._input=t,mi&&ia(e,!0)}else la(e)}},ca=(e,t)=>{Fi(e)?t.stopImmediatePropagation():mi||setTimeout(la,0,e,t)},la=e=>{let t=ki(e);e._input===t||e.contains(t)||(e._root&&Ti(e._root,Qi,e),ia(e,!1),e._input=void 0)},ua=(e,t)=>e.contains(t.target)&&Fi(e,t),da=(e,t)=>{var n;if(na(t.target)&&sa(e,t),e._input===t.target)return ia(e,!0);if(!e.contains(t.target))return la(e);for(let r of e.options)if(r.contains(t.target))return(n=e._input)==null||n.focus(),e._input&&Ni(e._input,r.value),ia(e,K(e,Si)===`true`)},fa=(e,t)=>{if(na(t.target)&&sa(e,t),e._input!==t.target)return;let{key:n,ctrlKey:r,metaKey:i,altKey:a}=t;if(r||i||n===`Shift`||n===`Tab`||a&&!n.startsWith(`Arrow`))return;n===`Escape`&&!e.hidden&&t.preventDefault(),ia(e,n!==`Escape`);let o=n===`Enter`,s=K(e._input,`aria-activedescendant`),c=[],l=-1,u=-1;for(let t of e.options)ra(t)&&(c.push(t),t.id===s&&(l=c.length-1));!a&&n===`ArrowDown`&&(u=(l+1)%c.length),!a&&n===`ArrowUp`&&(u=(l||c.length)-1),~l&&((n===`Home`||n===`PageUp`)&&(u=0),(n===`End`||n===`PageDown`)&&(u=c.length-1),o&&(u=l)),c[u]&&(t.preventDefault(),e._input.focus()),o&&c[u]?(t.stopImmediatePropagation(),Li(e._input),c[u].click()):aa(e,c[u])},pa=e=>{var t;if(!e._input||e.hidden)return;let n=e._input.value.toLowerCase().trim()||``,r=!e.hasAttribute(`data-nofilter`),i=[],a=[];for(let t of e.options)(t.disabled||t.hidden||r&&!t.label.toLowerCase().includes(n)?i:a).push(t);for(let e of i)K(e,qi,`true`);for(let e of a)K(e,qi,`false`);clearTimeout(Xi),Xi=setTimeout(ma,500,e,a),gi&&a.forEach((t,n,{length:r})=>{K(t,`title`,`${n+1} ${e._texts.of} ${r}`)}),(t=e._umutate)==null||t.takeRecords()},ma=(e,t)=>!e.hidden&&e._input===ki(e)&&Hi(`${t.some(({value:e})=>e)?`${e._texts[t[1]?`plural`:`singular`]}`.replace(`%d`,`${t.length}`):e.innerText}`);di()&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){let e=K(this,`list`);return e&&Oi(this).getElementById(e)}}),Mi.define(`u-datalist`,ea);var ha=class extends s{_items;_label={key:n,value:null};_unresize;_unmutate;static get observedAttributes(){return[n,r]}connectedCallback(){let e=c(()=>ga(this),100);this._items=this.getElementsByTagName(`a`),this._unresize=_(window,`resize`,e),this._unmutate=x(this,ga,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&ga(this)}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};let ga=e=>{let t=e._items?.[e._items.length-1],i=t?.parentElement===e?null:t,a=!i?.offsetHeight;u(e,`role`,a?null:`navigation`);for(let t of e._items||[])u(t,`aria-current`,t===i?`page`:null);let o=p(e,n)?.trim(),s=u(e,r)?.trim(),c=o||s;c&&(e._label.value=c),c&&(e._label.key=s?r:n);let l=a?null:e._label.value;c!==l&&(u(e,r,null),u(e,n,null),u(e,e._label.key,l))};S.define(`ds-breadcrumbs`,ha);var _a=class extends s{_unmutate;connectedCallback(){_(this,`animationend`,this,i),u(this,`role`,`group`),u(this,`tabindex`,`-1`),this._unmutate=x(this,va,{childList:!0,subtree:!0}),this.focus()}handleEvent({target:e}){e===this&&this.focus()}disconnectedCallback(){v(this,`animationend`,this,i),this._unmutate?.(),this._unmutate=void 0}};let va=e=>{let t=u(e,n)?.trim(),i=u(e,r)?.trim(),a=e.querySelector(`h2,h3,h4,h5,h6`);a&&!t&&!i&&u(e,r,w(a)),!a&&!t&&!i&&l(`Missing accessible name on:`,e,`\nAdd a heading (h2–h6), or set ${n} or ${r} to provide an accessible name for screen readers.`)};S.define(`ds-error-summary`,_a);let ya=`data-field`,ba=`data-limit`,xa=`aria-invalid`,Sa=`aria-describedby`,Ca=`data-indeterminate`,wa=`:scope > [${ya}="validation"]`,Ta=o()?800:200,Ea=e=>{let t=[],n=[],r=e._descs||[],i=!1,a=!1;e._input?.hidden&&(e._input=void 0);for(let r of e.getElementsByTagName(`*`))if(r instanceof HTMLLabelElement&&t.push(r),!r.hidden){if(Aa(r))e._input?.isConnected&&e._input!==r?l(`Fields should only have one input element. Use <fieldset> to group multiple fields:`,e):e._input=r;else{let t=r.getAttribute(ya);t===`counter`&&(e._counter=r),t===`validation`?(n.unshift(w(r)),i=!0,a||=ka(r)):t&&n.push(w(r))}}if(!e._input?.isConnected)return;let o=e._input;for(let e of t)u(e,`for`,w(o)||null);let s=e.closest(`fieldset`)?.querySelector(wa);s&&!s?.hidden&&(i=!0,a||=ka(s),n.unshift(w(s)));let c=u(o,Ca);c&&(o.indeterminate=c===`true`),(o.type===`radio`||o.type===`checkbox`)&&u(e,`data-clickdelegatefor`,w(o));let d=(u(o,Sa)?.trim().split(/\s+/))?.filter(e=>!r.includes(e))||[];u(o,Sa,[...n,...d].join(` `)||null),e._descs=n;let f=e._validation;i&&!f&&!o.hasAttribute(xa)?(u(o,xa,a?`true`:null),e._validation=!0):!i&&f&&(u(o,xa,null),e._validation=void 0),e.handleEvent()},Da={over:`%d tegn for mye`,under:`%d tegn igjen`},Oa=c((e,t)=>{document?.activeElement===e&&re(t)},Ta),ka=e=>{let t=e.getAttribute(`data-color`);return!t||t===`danger`},Aa=e=>e instanceof HTMLElement&&`validity`in e&&!(e instanceof HTMLButtonElement)&&e.type!==`hidden`;var ja=class extends s{_counter;_descs;_input;_validation;_unevents;_unmutate;connectedCallback(){this._unevents=_(this,`input`,this,i),this._unmutate=x(this,()=>Ea(this),{attributeFilter:[ya,ba,`hidden`,`id`,`value`,Ca],attributes:!0,childList:!0,subtree:!0})}handleEvent(e){let{_counter:t,_input:n}=this;if(t?.isConnected&&n){let r=(Number(u(t,ba))||0)-n.value.length,i=r<0?`over`:`under`,a=(p(t,`data-${i}`)||Da[i])?.replace(`%d`,`${Math.abs(r)}`);a||l(`Missing data-${i} on:`,t),u(t,`data-label`,a),u(t,`data-state`,i),u(t,`data-color`,r<0?`danger`:null),u(n,`aria-invalid`,r<0?`true`:null),e?.type===`input`&&a&&Oa(n,a)}n instanceof HTMLTextAreaElement&&(n.style.setProperty(`--_ds-field-sizing`,`auto`),n.style.setProperty(`--_ds-field-sizing`,`${n.scrollHeight}px`))}disconnectedCallback(){this._unevents?.(),this._unmutate?.(),this._unevents=this._unmutate=void 0,this._input=this._counter=this._descs=this._validation=void 0}};S.define(`ds-field`,ja);let Ma=`data-current`,Na=`data-total`,Pa=`data-href`,Fa=({current:e=1,total:t=10,show:n=7})=>({prev:e>1?e-1:0,next:e<t?e+1:0,pages:Ra(e,t,n).map((t,n)=>({current:t===e&&`page`,key:`key-${t}-${n}`,page:t}))});var Ia=class extends s{_unmutate;_render;static get observedAttributes(){return[n,r,Ma,Na,Pa]}connectedCallback(){let e=u(this,Na),t=u(this,Ma);t&&!e&&l(`Missing ${Na} attribute on:`,this),e&&!t&&l(`Missing ${Ma} attribute on:`,this);let i=p(this,n),a=u(this,r)?.trim();i||a?u(this,n,a?null:i):l(`Missing ${n} on:`,this),u(this,`role`,`navigation`),this._unmutate=x(this,La,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&La(this)}disconnectedCallback(){this._unmutate?.(),this._unmutate=this._render=void 0}};let La=e=>{let t=Number(u(e,Ma)),r=Number(u(e,Na));if(t&&r){let i=e.querySelectorAll(`button,a`),a=i.length-2,o=u(e,Pa),{next:s,prev:c,pages:l}=Fa({current:t,total:r,show:a});i.forEach((e,t)=>{let r=t?i[t+1]?l[t-1]?.page:s:c;u(e,`aria-current`,l[t-1]?.current?`true`:null),u(e,n,`${r??`hidden`}`),u(e,`role`,r?null:`none`),u(e,`tabindex`,r?null:`-1`),e instanceof HTMLButtonElement&&u(e,`value`,`${r}`),o&&e instanceof HTMLAnchorElement&&u(e,`href`,o.replace(`%d`,`${r}`))})}},Ra=(e,t,n=1/0)=>{let r=(n-1)/2,i=Math.max(Math.min(e-Math.floor(r),t-n+1),1),a=Math.min(Math.max(e+Math.ceil(r),n),t),o=Array.from({length:a+1-i},(e,t)=>t+i);return n>4&&i>1&&o.splice(0,2,1,0),n>3&&a<t&&o.splice(-2,2,0,t),o};S.define(`ds-pagination`,Ia);var za=Object.defineProperty,Ba=Object.getOwnPropertySymbols,Va=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable,Ua=(e,t,n)=>t in e?za(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wa=(e,t)=>{for(var n in t||={})Va.call(t,n)&&Ua(e,n,t[n]);if(Ba)for(var n of Ba(t))Ha.call(t,n)&&Ua(e,n,t[n]);return e},Ga=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,Ka=Ga(),qa=Ka?navigator.userAgent:``,Ja=/android/i.test(qa),Ya=/firefox/i.test(qa),Xa=/iPad|iPhone|iPod/.test(qa),Za=Ka&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform),Qa=Ka&&window.CSSStyleSheet&&document.adoptedStyleSheets,$a={once:!0,capture:!0,passive:!0},eo=`:host(:not([hidden])) { display: block }`,to=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,no=`${Ja?`data`:`aria`}-multiselectable`,ro=typeof HTMLElement>`u`?class{}:HTMLElement,J=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),io=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>ao(e,...t)},ao=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},oo=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.appendChild(mo(`slot`)),!n.querySelector(`style`)){if(!Qa)n.appendChild(mo(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}}return n},so=(e,t,n)=>{let r=new MutationObserver(n=>{if(!Ga()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},co=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},lo=e=>co(e).activeElement,uo=e=>{let t=J(e,`aria-label`)||``;return[...(J(e,`aria-labelledby`)?.split(` `)||[]).map(e=>document.getElementById(e.trim()||`-`)),...Array.from(e.labels||[])].reduce((e,t)=>e||(t?.innerText)?.trim()||``,t).trim()},fo=e=>{if(!e||!Ka)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},po=Ka?Object.prototype.hasOwnProperty:()=>!1,mo=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let e in t)po.call(t,e)&&J(r,e,t[e]);return r},ho={define:(e,t)=>!Ga()||window.customElements.get(e)||window.customElements.define(e,t)},go=(e,t,n=``)=>{var r;let i={bubbles:!0,composed:!0,data:t,inputType:n},a=HTMLInputElement.prototype;e.dispatchEvent(new InputEvent(`beforeinput`,i)),(r=Object.getOwnPropertyDescriptor(a,`value`)?.set)==null||r.call(e,t),e.dispatchEvent(new InputEvent(`input`,i)),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},_o=new WeakSet,vo=(e,t)=>(t?.type===`pointerdown`&&(_o.add(e),io(document,`pointerup`,()=>_o.delete(e),$a)),_o.has(e)),yo=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,bo=e=>{let t=J(e,`form`);J(e,`form`,`#`),setTimeout(xo,0,e,t)},xo=(e,t)=>J(e,`form`,t),Y=e=>(e?.textContent)?.trim()||``,X,So=0,Co=0,wo=e=>{clearTimeout(Co),X||(X=mo(`div`,{"aria-live":`assertive`}),X.style.overflow=`hidden`,X.style.position=`fixed`,X.style.whiteSpace=`nowrap`,X.style.width=`1px`),X.isConnected||document.body.appendChild(X),e===``&&(X.textContent=``),e&&(X.textContent=`${e}${So++%2?`\xA0`:``}`,Co=setTimeout(wo,!Za&&Ya?2e3:300,``))},To=`${eo}
67
+ [part="items"] { display: inline-flex; flex-wrap: wrap } /* Can not be "contents" as this confuses VoiceOver */
68
+ :host(:not([data-multiple])) [part="items"],
69
+ :host([data-multiple="false"]) [part="items"] { display: none }
69
70
  ::slotted(button[type="reset"]),
70
71
  ::slotted(button[aria-expanded]),
71
72
  ::slotted(del) { font: inherit; border: 0; padding: 0; background: none; color: inherit; cursor: pointer; text-decoration: none }
@@ -76,7 +77,7 @@ ${t?`}`:``}
76
77
  ::slotted(button[type="reset"]:empty)::before { content: '\\00D7'; content: '\\00D7' / '' }
77
78
  ::slotted(button[aria-expanded="false"]:empty)::before { content: '\\25BC'; content: '\\25BC' / '' }
78
79
  ::slotted(button[aria-expanded="true"]:empty)::before { content: '\\25B2'; content: '\\25B2' / '' }
79
- ::slotted(data:focus),::slotted(del:focus),::slotted(button[type="reset"]:focus) { ${Qa} }`;ho(xo);var So=!1,Z=`aria-label`,Co=`button[type="reset"],del`,wo=`button[aria-expanded]`,To=`datalist,u-datalist,[role="listbox"]`,Eo=`option,u-option,[role="option"]`,Do=`blur focus click input keydown pointerdown`,Oo=`false`,ko={added:`Added`,clear:`Clear input`,empty:`No selected`,found:`Navigate left to find %d selected`,invalid:`Invalid value`,items:`Selected`,of:`of`,remove:`Press to remove`,removed:`Removed`,toggle:`Options`},Ao=class extends eo{constructor(){super(),this._focusMoved=!1,this._itemSingleVale=``,this._speak=``,this._texts=Va({},ko),this._value=``;let e=ro(this,xo);this._listbox=e.querySelector(`[role="listbox"]`)||lo(`div`),this._listbox.innerHTML=`<slot name="items"></slot>`,J(this._listbox,`aria-orientation`,`horizontal`),J(this._listbox,`role`,`listbox`),J(this._listbox,`part`,`items`),J(this._listbox,`tabindex`,`-1`),e.prepend(this._listbox)}static get observedAttributes(){return Object.keys(ko).map(e=>`data-sr-${e}`)}connectedCallback(){to(this,Do,this,!0),this._umutate=io(this,Bo,{attributeFilter:[`id`,`value`,`role`,`aria-expanded`],attributes:!0,characterData:!0,childList:!0,subtree:!0}),Ko(this),Wo(this)}attributeChangedCallback(e,t,n){let r=e.split(`data-sr-`)[1];ko[r]&&(this._texts[r]=n||ko[r]),r===`clear`&&this.clear&&J(this.clear,Z,this._texts.clear)}disconnectedCallback(){var e;no(this,Do,this,!0),(e=this._umutate)==null||e.call(this),this._umutate=this._clear=this._toggle=void 0,this._control=this._match=this._select=void 0,this._options=this._items=this._list=void 0}handleEvent(e){this.control?.disabled||this.control?.readOnly||(e.type===`blur`&&No(this),e.type===`click`&&Fo(this,e),e.type===`focus`&&bo(),e.type===`input`&&Io(this,e),e.type===`keydown`&&Lo(this,e),e.type===`pointerdown`&&(So=!!this.list?.hidden,mo(this,e)))}get multiple(){return(J(this,`data-multiple`)??Oo)!==Oo}set multiple(e){J(this,`data-multiple`,e?``:null)}get creatable(){return(J(this,`data-creatable`)??Oo)!==Oo}set creatable(e){J(this,`data-creatable`,e?``:null)}get control(){return this._control?.isConnected||(this._control=this.querySelector(`input`)),this._control}get list(){return this._list?.isConnected||(this._list=this.querySelector(To),this._options=void 0),this._list}get clear(){return this._clear?.isConnected||(this._clear=this.querySelector(Co)),this._clear}get toggle(){return this._toggle?.isConnected||(this._toggle=this.querySelector(wo)),this._toggle}get items(){return this._items||=this.getElementsByTagName(`data`),this._items}get options(){let e=!this._options&&this.list?.querySelector(Eo)?.nodeName;return e&&(this._options=this.list?.getElementsByTagName(e)),this._options||this.getElementsByTagName(`-`)}get values(){return Array.from(this.items,({value:e})=>e)}},jo=e=>{let{creatable:t,control:n,options:r,multiple:i}=e,a=(n?.value)?.trim()||``,o=a.toLowerCase()||null,s=[...r].find(e=>qo(e).trim().toLowerCase()===o),c={bubbles:!0,cancelable:!0,detail:s};if(e.dispatchEvent(new CustomEvent(`comboboxbeforematch`,c))||(s=[...r].find(Xo)),i)Go(e);else for(let e of r)Yo(e,e===s);return!s&&t&&a?{value:a,label:a}:s&&{value:Jo(s),label:qo(s)}},Mo=(e,t,n=!0)=>{let{_texts:r,control:i,items:a,multiple:o}=e;if(!t)return o?bo(r.invalid):!i?.value&&a[0]?Mo(e,a[0]):Ko(e);let s=[...a].findIndex(e=>e.value===t.value),c=a[s],l=c===oo(e)&&(o&&(a[s-1]||a[s+1])||i);if(c&&!n)return Ko(e);l&&l.focus(),e._focusMoved=!!l;let u=lo(`data`,{value:t.value},t.label||t.value),d={bubbles:!0,cancelable:!0,detail:c||u};if(e.dispatchEvent(new CustomEvent(`comboboxbeforeselect`,d))){if(!o)for(let e of[...a])e.remove();c?c.remove():i?.insertAdjacentElement(`beforebegin`,u),e.dispatchEvent(new CustomEvent(`comboboxafterselect`,d))}},No=e=>mo(e)||setTimeout(Po,0,e),Po=e=>e.multiple||e.contains(oo(e))||Mo(e,e._match,!1),Fo=(e,t)=>{let{clientX:n,clientY:r,target:i}=t,{clear:a,control:o,items:s,toggle:c}=e;if(c?.contains(i)&&(o?.focus(),So&&o?.click()),o&&a?.contains(i))return t.preventDefault(),fo(o,``,`deleteContentBackward`),o.focus(),So||o.click();for(let t of s){if(t.contains(i))return Mo(e,t);let{top:a,right:o,bottom:s,left:c,width:l,height:u}=t.getBoundingClientRect();if(l&&u&&r>=a&&r<=s&&n>=c&&n<=o)return t.focus()}i===e&&o?.focus()},Io=(e,t)=>{var n;let{control:r,options:i,multiple:a}=e,o=r?.value||null,s=t instanceof InputEvent?!t.inputType||t.inputType===`insertReplacementText`:!!r?.value;if(s||(e._value=r?.value||``),s){(n=t.stopImmediatePropagation)==null||n.call(t);let s=[...i].find(e=>Jo(e)===o);if(r&&(r.value=e._value),s)return Mo(e,s,a)}else a||(e._match=jo(e));Wo(e)},Lo=(e,t)=>{t.ctrlKey||t.metaKey||t.shiftKey||t.key===`Alt`||(e.control===t.target?Ro(e,t):zo(e,t))},Ro=(e,t)=>{var n;let{_match:r,clear:i,control:a,items:o,multiple:s}=e;(t.key===`ArrowLeft`||t.key===`Backspace`)&&!a?.selectionEnd&&((n=o[o.length-1])==null||n.focus(),t.preventDefault()),t.key===`Enter`&&a&&(go(a),Mo(e,s?jo(e):r,s)),t.key===`Tab`&&!t.shiftKey&&i&&!i.hidden&&(t.preventDefault(),J(i,`aria-hidden`,`false`),J(i,`tabindex`,`0`),i.focus(),to(i,`blur`,()=>Wo(e),Xa))},zo=(e,t)=>{var n;let{clear:r,control:i,items:a}=e,{key:o,repeat:s,target:c}=t,l=[...a].indexOf(c);if((o===` `||o===`Enter`)&&(a[l]||c===r))return(n=a[l]||r)==null||n.click(),t.preventDefault();if(a[l]){if(o.startsWith(`Arrow`)&&t.preventDefault(),o===`ArrowLeft`)return a[l-1]?.focus();if(o===`ArrowRight`)return(a[l+1]||i)?.focus();if(o===`Backspace`)return t.preventDefault(),s||Mo(e,a[l]);i?.focus()}},Bo=(e,t)=>{var n;if(!e.control)return;let{_texts:r,control:i,items:a,list:o,multiple:s,toggle:c}=e,l=[];for(let{addedNodes:e,removedNodes:n}of t||[]){for(let t of e)t instanceof HTMLDataElement&&l.unshift(t);for(let e of n)e instanceof HTMLDataElement&&l.push(e)}let u=oo(e);if((s?l.length===1:l[0]===u)&&e.contains(u)){let t=i?J(i,Z):null;e._speak=`${r[l[0].isConnected?`added`:`removed`]} ${Y(l[0])}, `,J(i,Z,`${e._speak}${so(i)}`),e._focusMoved||setTimeout(()=>bo(e._speak.slice(0,-2))),setTimeout(Vo,300,e,t)}if(!s){let t=Y(a[0]);t!==e._itemSingleVale&&Ko(e),e._itemSingleVale=t}Ho(e),Go(e),Uo(e),c&&J(c,`aria-expanded`,`${!o?.hidden}`);let d=`${a.length?r.found.replace(`%d`,`${a.length}`):r.empty}`;J(i,`aria-description`,s?d:null),J(i,`list`,co(o)),J(e._listbox,Z,r.items),(n=e._umutate)==null||n.takeRecords()},Vo=(e,t)=>{e._speak=``,e.control&&J(e.control,Z,t),Ho(e)},Ho=e=>{let{_texts:t,_speak:n,items:r}=e,i=0;for(let e of r)J(e,Z,`${n}${Y(e)}, ${t.remove}${qa?`, ${++i} ${t.of} ${r.length}`:``}`),J(e,`role`,`option`),J(e,`slot`,`items`),J(e,`tabindex`,`-1`),J(e,`value`,Jo(e))},Uo=e=>{var t;if(e._select?.isConnected||(e._select=e.querySelector(`select`)),!e._select)return;let{_select:n,items:r,multiple:i}=e,a=[],o=0;J(n,`multiple`,i?``:null);for(let e of r){let t=n?.options[o++],r=Y(e),i=Jo(e);t?Object.assign(t,{defaultSelected:!0,selected:!0,text:r,value:i}):a.push(new Option(r,i,!0,!0))}if(a.length)n.append(...a);else for(let e of[...n.options].slice(o))e.remove();(t=e._umutate)==null||t.takeRecords()},Wo=e=>{let{clear:t,control:n,toggle:r}=e,i=!n?.value||n?.disabled||n?.readOnly;t?.nodeName===`DEL`&&J(t,`role`,`button`),t&&(J(t,Z)||J(t,Z,e._texts.clear),J(t,`aria-hidden`,`${qa||Ga}`),J(t,`hidden`,i?``:null),J(t,`tabindex`,`-1`)),r&&(J(r,Z)||J(r,Z,e._texts.toggle),J(r,`aria-hidden`,`${qa||Ga}`),J(r,`hidden`,i?null:``),J(r,`tabindex`,`-1`),J(r,`type`,`button`))},Go=e=>{if(!e.list)return;let{_texts:t,list:n,multiple:r,options:i,values:a}=e;J(n,`data-sr-of`,t.of),J(n,$a,`${r}`);for(let e of i)Yo(e,a.includes(Jo(e)))},Ko=e=>{if(!e.control||e.multiple)return;let{control:t,items:n}=e,r=Y(n[0]),i=r?`insertText`:`deleteContentBackward`;r!==t.value&&fo(t,r,i)},qo=e=>J(e,`label`)??Y(e),Jo=e=>J(e,`value`)??Y(e),Yo=(e,t)=>J(e,`selected`,t?``:null),Xo=e=>e.selected??e.hasAttribute(`selected`);uo.define(`u-combobox`,Ao);let Zo=`data-empty`;var Qo=class extends Ao{_unmutate;connectedCallback(){super.connectedCallback(),this._unmutate=x(this,$o,{childList:!0}),_(this,`comboboxafterselect input`,es,i),_(this,`toggle`,ts,i)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=void 0,v(this,`comboboxafterselect input`,es,i),v(this,`toggle`,ts,i)}};let $o=e=>{let{control:t,list:n}=e,r=n||e.querySelector(`u-datalist`);t&&(u(t,`popovertarget`,n?w(n):null),t.placeholder||u(t,`placeholder`,` `)),r&&(u(r,`popover`,`manual`),u(r,`data-is-floating`,`true`))},es=({currentTarget:e})=>{let{creatable:t,control:n,options:r}=e;if(!r)return;let i=n?.value.trim()||``,a=i.toLowerCase(),o,s=!i;for(let e of r)if(!o&&e.hasAttribute(Zo)?o=e:!s&&e.label?.toLowerCase()===a&&(s=!0),s&&o)break;if(!o||(o.hidden=s,o.label=i,o.value=t?i:``,!t||o.textContent))return;let c=p(o,Zo);c?u(o,Zo,c):l(`Missing ${Zo} value on:`,o),u(o,`data-create`,c?.replace(`{value}`,i))},ts=e=>{let t=e.currentTarget,n=e.newState===`open`&&t.control;n&&t.list?.dispatchEvent(new CustomEvent(`ds-toggle-source`,{bubbles:!0,composed:!0,detail:n}))};S.define(`ds-suggestion`,Qo);var ns=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,rs=ns(),is=rs?navigator.userAgent:``,as=/android/i.test(is);rs&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var os=rs&&window.CSSStyleSheet&&document.adoptedStyleSheets,ss=`:host(:not([hidden])) { display: block }`,cs=`${as?`data`:`aria`}-labelledby`,ls=typeof HTMLElement>`u`?class{}:HTMLElement,Q=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),us=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>ds(e,...t)},ds=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},fs=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(gs(`slot`)),!n.querySelector(`style`))if(!os)n.append(gs(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},ps=(e,t,n)=>{let r=new MutationObserver(n=>{if(!ns()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},ms=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},hs=e=>{if(!e||!rs)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},gs=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))Q(r,e,n);return r},_s={define:(e,t)=>!ns()||window.customElements.get(e)||window.customElements.define(e,t)},vs=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,ys=`aria-controls`,bs=`aria-disabled`,xs=`aria-selected`,Ss=`tabindex`,Cs=ss,ws=ss,Ts=`${ss}
80
+ ::slotted(data:focus),::slotted(del:focus),::slotted(button[type="reset"]:focus) { ${to} }`;yo(To);var Eo=!1,Z=`aria-label`,Do=`button[type="reset"],del`,Oo=`button[aria-expanded]`,ko=`datalist,u-datalist,[role="listbox"]`,Ao=`option,u-option,[role="option"]`,jo=`blur focus click input keydown pointerdown`,Mo=`false`,No={added:`Added`,clear:`Clear input`,empty:`No selected`,found:`Navigate left to find %d selected`,invalid:`Invalid value`,items:`Selected`,of:`of`,remove:`Press to remove`,removed:`Removed`,toggle:`Options`},Po=class extends ro{constructor(){super(),this._focusMoved=!1,this._itemSingleVale=``,this._speak=``,this._texts=Wa({},No),this._value=``;let e=oo(this,To);this._listbox=e.querySelector(`[role="listbox"]`)||mo(`div`),this._listbox.innerHTML=`<slot name="items"></slot>`,J(this._listbox,`aria-orientation`,`horizontal`),J(this._listbox,`role`,`listbox`),J(this._listbox,`part`,`items`),J(this._listbox,`tabindex`,`-1`),e.insertBefore(this._listbox,e.firstChild)}static get observedAttributes(){return Object.keys(No).map(e=>`data-sr-${e}`)}connectedCallback(){io(this,jo,this,!0),this._umutate=so(this,Wo,{attributeFilter:[`id`,`value`,`role`,`aria-expanded`],attributes:!0,characterData:!0,childList:!0,subtree:!0}),Xo(this),Jo(this)}attributeChangedCallback(e,t,n){let r=e.split(`data-sr-`)[1];No[r]&&(this._texts[r]=n||No[r]),r===`clear`&&this.clear&&J(this.clear,Z,this._texts.clear)}disconnectedCallback(){var e;ao(this,jo,this,!0),(e=this._umutate)==null||e.call(this),this._umutate=this._clear=this._toggle=void 0,this._control=this._match=this._select=void 0,this._options=this._items=this._list=void 0}handleEvent(e){this.control?.disabled||this.control?.readOnly||(e.type===`blur`&&Lo(this),e.type===`click`&&zo(this,e),e.type===`focus`&&wo(),e.type===`input`&&Bo(this,e),e.type===`keydown`&&Vo(this,e),e.type===`pointerdown`&&(Eo=!!this.list?.hidden,vo(this,e)))}get multiple(){return(J(this,`data-multiple`)??Mo)!==Mo}set multiple(e){J(this,`data-multiple`,e?``:null)}get creatable(){return(J(this,`data-creatable`)??Mo)!==Mo}set creatable(e){J(this,`data-creatable`,e?``:null)}get control(){return this._control?.isConnected||(this._control=this.querySelector(`input`)),this._control}get list(){return this._list?.isConnected||(this._list=this.querySelector(ko),this._options=void 0),this._list}get clear(){return this._clear?.isConnected||(this._clear=this.querySelector(Do)),this._clear}get toggle(){return this._toggle?.isConnected||(this._toggle=this.querySelector(Oo)),this._toggle}get items(){return this._items||=this.getElementsByTagName(`data`),this._items}get options(){let e=!this._options&&this.list?.querySelector(Ao)?.nodeName;return e&&(this._options=this.list?.getElementsByTagName(e)),this._options||this.getElementsByTagName(`-`)}get values(){return Array.from(this.items,({value:e})=>e)}},Fo=e=>{let{creatable:t,control:n,options:r,multiple:i,list:a}=e,o=(n?.value)?.trim()||``,s=o.toLowerCase()||null,c;if(a){c=[...r].find(e=>Zo(e).trim().toLowerCase()===s);let t={bubbles:!0,cancelable:!0,detail:c};if(e.dispatchEvent(new CustomEvent(`comboboxbeforematch`,t))||(c=[...r].find(es)),i)Yo(e);else for(let e of r)$o(e,e===c)}return!c&&t&&o?{value:o,label:o}:c&&{value:Qo(c),label:Zo(c)}},Io=(e,t,n=!0)=>{let{_texts:r,control:i,items:a,multiple:o}=e;if(!t)return o?wo(r.invalid):!i?.value&&a[0]?Io(e,a[0]):Xo(e);let s=[...a].findIndex(e=>e.value===t.value),c=a[s],l=c===lo(e)&&(o&&(a[s-1]||a[s+1])||i);if(c&&!n)return Xo(e);l&&l.focus(),e._focusMoved=!!l;let u=mo(`data`,{value:t.value},t.label||t.value),d={bubbles:!0,cancelable:!0,detail:c||u};if(e.dispatchEvent(new CustomEvent(`comboboxbeforeselect`,d))){if(!o)for(let e of[...a])e.remove();c?c.remove():i?.insertAdjacentElement(`beforebegin`,u),e.dispatchEvent(new CustomEvent(`comboboxafterselect`,d))}},Lo=e=>vo(e)||setTimeout(Ro,0,e),Ro=e=>e.multiple||e.contains(lo(e))||Io(e,e._match,!1),zo=(e,t)=>{let{clientX:n,clientY:r,target:i}=t,{clear:a,control:o,items:s,toggle:c}=e;if(c?.contains(i)&&(o?.focus(),Eo&&o?.click()),o&&a?.contains(i))return t.preventDefault(),go(o,``,`deleteContentBackward`),o.focus(),Eo||o.click();for(let t of s){if(t.contains(i))return Io(e,t);let{top:a,right:o,bottom:s,left:c,width:l,height:u}=t.getBoundingClientRect();if(l&&u&&r>=a&&r<=s&&n>=c&&n<=o)return t.focus()}i===e&&o?.focus()},Bo=(e,t)=>{var n;let{control:r,options:i,multiple:a}=e,o=r?.value||null;if(!(t instanceof InputEvent?!t.inputType||t.inputType===`insertReplacementText`:r?.value))e._value=r?.value||``,a||(e._match=Fo(e));else if((n=t.stopImmediatePropagation)==null||n.call(t),e._match=[...i].find(e=>Qo(e)===o),r&&(r.value=e._value),e._match)return Io(e,e._match,a);Jo(e)},Vo=(e,t)=>{t.ctrlKey||t.metaKey||t.shiftKey||t.key===`Alt`||(e.control===t.target?Ho(e,t):Uo(e,t))},Ho=(e,t)=>{var n;let{_match:r,clear:i,control:a,creatable:o,items:s,list:c,multiple:l}=e;(t.key===`ArrowLeft`||t.key===`Backspace`)&&!a?.selectionEnd&&((n=s[s.length-1])==null||n.focus(),t.preventDefault()),t.key===`Enter`&&a&&(c||o)&&(bo(a),Io(e,l?Fo(e):r,l)),t.key===`Tab`&&!t.shiftKey&&i&&!i.hidden&&(t.preventDefault(),J(i,`aria-hidden`,`false`),J(i,`tabindex`,`0`),i.focus(),io(i,`blur`,()=>Jo(e),$a))},Uo=(e,t)=>{var n;let{clear:r,control:i,items:a}=e,{key:o,repeat:s,target:c}=t,l=[...a].indexOf(c);if((o===` `||o===`Enter`)&&(a[l]||c===r))return(n=a[l]||r)==null||n.click(),t.preventDefault();if(a[l]){if(o.startsWith(`Arrow`)&&t.preventDefault(),o===`ArrowLeft`)return a[l-1]?.focus();if(o===`ArrowRight`)return(a[l+1]||i)?.focus();if(o===`Backspace`)return t.preventDefault(),s||Io(e,a[l]);i?.focus()}},Wo=(e,t)=>{var n;if(!e.control)return;let{_texts:r,control:i,items:a,list:o,multiple:s,toggle:c}=e,l=[];for(let{addedNodes:e,removedNodes:n}of t||[]){for(let t of e)t.nodeName===`DATA`&&l.unshift(t);for(let e of n)e.nodeName===`DATA`&&l.push(e)}let u=lo(e);if((s?l.length===1:l[0]===u)&&e.contains(u)){let t=i?J(i,Z):null;e._speak=`${r[l[0].isConnected?`added`:`removed`]} ${Y(l[0])}, `,J(i,Z,`${e._speak}${uo(i)}`),e._focusMoved||setTimeout(()=>wo(e._speak.slice(0,-2))),setTimeout(Go,300,e,t)}if(!s){let t=Y(a[0]);t!==e._itemSingleVale&&Xo(e),e._itemSingleVale=t}Ko(e),Yo(e),qo(e),c&&J(c,`aria-expanded`,o?`${!o.hidden}`:Mo);let d=`${a.length?r.found.replace(`%d`,`${a.length}`):r.empty}`;J(i,`aria-description`,s?d:null),J(i,`list`,fo(o)),J(e._listbox,Z,r.items),(n=e._umutate)==null||n.takeRecords()},Go=(e,t)=>{e._speak=``,e.control&&J(e.control,Z,t),Ko(e)},Ko=e=>{let{_texts:t,_speak:n,items:r}=e,i=0;for(let e of r)J(e,Z,`${n}${Y(e)}, ${t.remove}${Xa?`, ${++i} ${t.of} ${r.length}`:``}`),J(e,`role`,`option`),J(e,`slot`,`items`),J(e,`tabindex`,`-1`),J(e,`value`,Qo(e))},qo=e=>{var t;if(e._select?.isConnected||(e._select=e.querySelector(`select`)),!e._select)return;let{_select:n,items:r,multiple:i}=e,a,o=0;J(n,`multiple`,i?``:null);for(let e of r){let t=n?.options[o++],r=Y(e),i=Qo(e);t?Object.assign(t,{defaultSelected:!0,selected:!0,text:r,value:i}):(a||=document.createDocumentFragment(),a.appendChild(new Option(r,i,!0,!0)))}if(a)n.appendChild(a);else for(let e of[...n.options].slice(o))e.remove();(t=e._umutate)==null||t.takeRecords()},Jo=e=>{let{clear:t,control:n,toggle:r,list:i}=e,a=!n?.value||n?.disabled||n?.readOnly;t?.nodeName===`DEL`&&J(t,`role`,`button`),t&&(J(t,Z)||J(t,Z,e._texts.clear),J(t,`aria-hidden`,`${Xa||Ja}`),J(t,`hidden`,a?``:null),J(t,`tabindex`,`-1`)),r&&(J(r,Z)||J(r,Z,e._texts.toggle),J(r,`aria-hidden`,`${Xa||Ja}`),J(r,`hidden`,a&&i?null:``),J(r,`tabindex`,`-1`),J(r,`type`,`button`))},Yo=e=>{if(!e.list)return;let{_texts:t,list:n,multiple:r,options:i,values:a}=e;J(n,`data-sr-of`,t.of),J(n,no,`${r}`);for(let e of i)$o(e,a.includes(Qo(e)))},Xo=e=>{if(!e.control||!e.list||e.multiple)return;let{control:t,items:n}=e,r=Y(n[0]),i=r?`insertText`:`deleteContentBackward`;r!==t.value&&go(t,r,i)},Zo=e=>J(e,`label`)??Y(e),Qo=e=>J(e,`value`)??Y(e),$o=(e,t)=>J(e,`selected`,t?``:null),es=e=>e.selected??e.hasAttribute(`selected`);ho.define(`u-combobox`,Po);let ts=`data-empty`;var ns=class extends Po{_unmutate;connectedCallback(){super.connectedCallback(),this._unmutate=x(this,rs,{childList:!0}),_(this,`comboboxafterselect input`,is,i),_(this,`toggle`,as,i)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=void 0,v(this,`comboboxafterselect input`,is,i),v(this,`toggle`,as,i)}};let rs=e=>{let{control:t,list:n}=e,r=n||e.querySelector(`u-datalist`);t&&u(t,`popovertarget`,n?w(n):null),r&&(u(r,`popover`,`manual`),u(r,`data-is-floating`,`true`)),is({currentTarget:e})},is=({currentTarget:e})=>{let{creatable:t,control:n,options:r}=e;if(!r)return;let i=n?.value.trim()||``,a=i.toLowerCase(),o,s=!i;for(let e of r)if(!o&&e.hasAttribute(ts)?o=e:!s&&e.label?.toLowerCase()===a&&(s=!0),s&&o)break;if(!o||(o.hidden=s,o.label=i,o.value=t?i:``,!t||o.textContent))return;let c=p(o,ts);c?u(o,ts,c):l(`Missing ${ts} value on:`,o),u(o,`data-create`,c?.replace(`{value}`,i))},as=e=>{let t=e.currentTarget,n=e.newState===`open`&&t.control;n&&t.list?.dispatchEvent(new CustomEvent(`ds-toggle-source`,{bubbles:!0,composed:!0,detail:n}))};S.define(`ds-suggestion`,ns);var os=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,ss=os(),cs=ss?navigator.userAgent:``,ls=/android/i.test(cs);ss&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var us=ss&&window.CSSStyleSheet&&document.adoptedStyleSheets,ds=`:host(:not([hidden])) { display: block }`,fs=`${ls?`data`:`aria`}-labelledby`,ps=typeof HTMLElement>`u`?class{}:HTMLElement,Q=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),ms=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>hs(e,...t)},hs=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},gs=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(bs(`slot`)),!n.querySelector(`style`)){if(!us)n.append(bs(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}}return n},_s=(e,t,n)=>{let r=new MutationObserver(n=>{if(!os()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},vs=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},ys=e=>{if(!e||!ss)return null;if(window.uElementsId||(window.uElementsId={}),!e.id){let t=e.nodeName.toLowerCase();window.uElementsId[t]||(window.uElementsId[t]=1),e.id=`:${t}${window.uElementsId[t]++}`}return e.id},bs=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))Q(r,e,n);return r},xs={define:(e,t)=>!os()||window.customElements.get(e)||window.customElements.define(e,t)},Ss=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,Cs=`aria-controls`,ws=`aria-disabled`,Ts=`aria-selected`,Es=`tabindex`,Ds=ds,Os=ds,ks=`${ds}
80
81
  ::slotted([role="tab"]:not([hidden])) { display: inline-block; cursor: pointer }
81
- ::slotted([role="tab"][${bs}="true"]) { cursor: default }`;vs(Cs),vs(Ts),vs(ws);var Es=class extends ls{constructor(){super(),fs(this,Cs)}get tabList(){return this.querySelector(`[role="tablist"]:not(:scope [role="tabpanel"] [role="tablist"])`)}get selectedIndex(){let e=Ls(this.tabList);return e.indexOf(Is(e))}set selectedIndex(e){$(this.tabs[e])}get tabs(){return this.querySelectorAll(`[role="tab"]:not(:scope [role="tabpanel"] [role="tab"])`)}get panels(){return this.querySelectorAll(`[role="tabpanel"]:not(:scope [role="tabpanel"] [role="tabpanel"])`)}},Ds=class extends ls{constructor(){super(),fs(this,Ts)}connectedCallback(){Q(this,`role`,`tablist`),us(this,`click keydown`,this),this._umutate=ps(this,As,{attributeFilter:[`id`,`role`,ys,xs],attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){var e;ds(this,`click keydown`,this),(e=this._umutate)==null||e.call(this),this._umutate=void 0}handleEvent(e){var t,n,r,i;let{key:a,type:o,target:s}=e,c=Ls(this),l=c.findIndex(e=>e.contains(s)),u=a===` `||a===`Enter`,d=l;if(!(e.defaultPrevented||l===-1)&&(o===`click`&&$(c[l]),o===`keydown`)){if(u)return(t=e.preventDefault)==null||t.call(e),c[l].dispatchEvent(new MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0}));if(a===`ArrowDown`||a===`ArrowRight`)d=(l+1)%c.length;else if(a===`ArrowUp`||a===`ArrowLeft`)d=(l||c.length)-1;else if(a===`End`)d=c.length-1;else if(a===`Home`)d=0;else if(a===`Tab`&&!Fs(c[l])){let e=Is(c);return e&&Q(e,Ss,`-1`),e&&setTimeout(()=>Q(e,Ss,`0`))}else return;(n=e.preventDefault)==null||n.call(e),(i=(r=c[d]).focus)==null||i.call(r)}}get tabsElement(){return zs(this)}get tabs(){return this.querySelectorAll(`:scope > [role="tab"]`)}get selectedIndex(){let e=Ls(this);return e.indexOf(Is(e))}set selectedIndex(e){$(this.tabs[e])}},Os=class extends ls{static get observedAttributes(){return[`id`,xs,ys]}connectedCallback(){Q(this,`role`,`tab`),Q(this,xs,`${this.selected}`),Q(this,Ss,this.selected?`0`:`-1`),Is(this.parentElement?.children)||$(this)}attributeChangedCallback(){!Ms.has(this.parentElement)&&this.selected&&$(this)}get tabsElement(){return zs(this)}get tabList(){let e=this.parentElement;return e instanceof Ds?e:null}get selected(){return Fs(this)}set selected(e){e&&$(this)}get index(){return Math.max(Ls(this.parentElement).indexOf(this),0)}get panel(){let e=zs(this)?.panels,t=Ls(this.parentElement).indexOf(this);return Rs(this,e?.[t])}},ks=class extends ls{constructor(){super(),fs(this,ws)}connectedCallback(){Q(this,`role`,`tabpanel`);let e=new Set(this.tabs),t=zs(this),n=t?.tabs[Array.prototype.indexOf.call(t?.panels,this)];n&&!n.hasAttribute(ys)&&e.add(n);let r=Is(e)||e.values().next().value;Ns(r,()=>js(this,r,!!r&&Fs(r)))}get tabsElement(){return zs(this)}get tabs(){return ms(this).querySelectorAll(`[${ys}="${hs(this)}"]`)}},As=(e,t=[])=>{let n;for(let{target:e}of t)e instanceof Element&&Q(e,`role`)===`tab`&&Fs(e)&&(n=e);$(n)},js=(e,t,n=!1)=>{Q(e,`aria-hidden`,`${!n}`),Q(e,`hidden`,n?null:``),Q(e,Ss,n?`0`:null),t&&Q(t,ys,hs(e)),t&&n&&Fs(t)&&Q(e,cs,hs(t))},Ms=new Set,Ns=(e,t)=>{var n;let r=e?.parentElement;r&&Ms.add(r),t(),r&&Ms.delete(r),(n=r?._umutate)==null||n.takeRecords()},Ps=e=>Q(e,bs)!==`true`,Fs=e=>Q(e,xs)===`true`,Is=(e=[])=>{for(let t of e)if(Fs(t))return t},Ls=e=>{let t=[];for(let n of e?.children||[])n.getAttribute(`role`)===`tab`&&t.push(n);return t},Rs=(e,t=null)=>{let n=Q(e,ys);return n?ms(e).getElementById(n):t},zs=e=>{for(let t=e;t;t=t.parentNode||t.host)if(t instanceof Es)return t;return null},$=e=>e&&Ps(e)&&Ns(e,()=>{let t=Ls(e.parentElement),n=zs(e)?.panels||[],r=Rs(e,n?.[t.indexOf(e)]),i=0;for(let a of t){let t=Rs(a,n[i++]);Q(a,xs,`${a===e}`),Q(a,Ss,a===e?`0`:`-1`),t&&js(t,a,t===r)}});_s.define(`u-tabs`,Es),_s.define(`u-tablist`,Ds),_s.define(`u-tab`,Os),_s.define(`u-tabpanel`,ks);var Bs=class extends Es{},Vs=class extends Ds{},Hs=class extends Os{},Us=class extends ks{};S.define(`ds-tabs`,Bs),S.define(`ds-tablist`,Vs),S.define(`ds-tab`,Hs),S.define(`ds-tabpanel`,Us),e.DSBreadcrumbsElement=ha,e.DSErrorSummaryElement=_a,e.DSFieldElement=Oa,e.DSPaginationElement=Na,e.DSSuggestionElement=Qo,e.DSTabElement=Hs,e.DSTabListElement=Vs,e.DSTabPanelElement=Us,e.DSTabsElement=Bs,e.UHTMLDataListElement=ea,e.UHTMLDataListShadowRoot=Yi,e.UHTMLDataListStyle=Ji,e.initTooltips=$r,e.pagination=Ma,e.setTooltipElement=Qr});
82
+ ::slotted([role="tab"][${ws}="true"]) { cursor: default }`;Ss(Ds),Ss(ks),Ss(Os);var As=class extends ps{constructor(){super(),gs(this,Ds)}get tabList(){return this.querySelector(`[role="tablist"]:not(:scope [role="tabpanel"] [role="tablist"])`)}get selectedIndex(){let e=Vs(this.tabList);return e.indexOf(Bs(e))}set selectedIndex(e){$(this.tabs[e])}get tabs(){return this.querySelectorAll(`[role="tab"]:not(:scope [role="tabpanel"] [role="tab"])`)}get panels(){return this.querySelectorAll(`[role="tabpanel"]:not(:scope [role="tabpanel"] [role="tabpanel"])`)}},js=class extends ps{constructor(){super(),gs(this,ks)}connectedCallback(){Q(this,`role`,`tablist`),ms(this,`click keydown`,this),this._umutate=_s(this,Ps,{attributeFilter:[`id`,`role`,Cs,Ts],attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){var e;hs(this,`click keydown`,this),(e=this._umutate)==null||e.call(this),this._umutate=void 0}handleEvent(e){var t,n,r,i;let{key:a,type:o,target:s}=e,c=Vs(this),l=c.findIndex(e=>e.contains(s)),u=a===` `||a===`Enter`,d=l;if(!(e.defaultPrevented||l===-1)&&(o===`click`&&$(c[l]),o===`keydown`)){if(u)return(t=e.preventDefault)==null||t.call(e),c[l].dispatchEvent(new MouseEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0}));if(a===`ArrowDown`||a===`ArrowRight`)d=(l+1)%c.length;else if(a===`ArrowUp`||a===`ArrowLeft`)d=(l||c.length)-1;else if(a===`End`)d=c.length-1;else if(a===`Home`)d=0;else if(a===`Tab`&&!zs(c[l])){let e=Bs(c);return e&&Q(e,Es,`-1`),e&&setTimeout(()=>Q(e,Es,`0`))}else return;(n=e.preventDefault)==null||n.call(e),(i=(r=c[d]).focus)==null||i.call(r)}}get tabsElement(){return Us(this)}get tabs(){return this.querySelectorAll(`:scope > [role="tab"]`)}get selectedIndex(){let e=Vs(this);return e.indexOf(Bs(e))}set selectedIndex(e){$(this.tabs[e])}},Ms=class extends ps{static get observedAttributes(){return[`id`,Ts,Cs]}connectedCallback(){Q(this,`role`,`tab`),Q(this,Ts,`${this.selected}`),Q(this,Es,this.selected?`0`:`-1`),Bs(this.parentElement?.children)||$(this)}attributeChangedCallback(){!Is.has(this.parentElement)&&this.selected&&$(this)}get tabsElement(){return Us(this)}get tabList(){let e=this.parentElement;return e instanceof js?e:null}get selected(){return zs(this)}set selected(e){e&&$(this)}get index(){return Math.max(Vs(this.parentElement).indexOf(this),0)}get panel(){let e=Us(this)?.panels,t=Vs(this.parentElement).indexOf(this);return Hs(this,e?.[t])}},Ns=class extends ps{constructor(){super(),gs(this,Os)}connectedCallback(){Q(this,`role`,`tabpanel`);let e=new Set(this.tabs),t=Us(this),n=t?.tabs[Array.prototype.indexOf.call(t?.panels,this)];n&&!n.hasAttribute(Cs)&&e.add(n);let r=Bs(e)||e.values().next().value;Ls(r,()=>Fs(this,r,!!r&&zs(r)))}get tabsElement(){return Us(this)}get tabs(){return vs(this).querySelectorAll(`[${Cs}="${ys(this)}"]`)}},Ps=(e,t=[])=>{let n;for(let{target:e}of t)e instanceof Element&&Q(e,`role`)===`tab`&&zs(e)&&(n=e);$(n)},Fs=(e,t,n=!1)=>{Q(e,`aria-hidden`,`${!n}`),Q(e,`hidden`,n?null:``),Q(e,Es,n?`0`:null),t&&Q(t,Cs,ys(e)),t&&n&&zs(t)&&Q(e,fs,ys(t))},Is=new Set,Ls=(e,t)=>{var n;let r=e?.parentElement;r&&Is.add(r),t(),r&&Is.delete(r),(n=r?._umutate)==null||n.takeRecords()},Rs=e=>Q(e,ws)!==`true`,zs=e=>Q(e,Ts)===`true`,Bs=(e=[])=>{for(let t of e)if(zs(t))return t},Vs=e=>{let t=[];for(let n of e?.children||[])n.getAttribute(`role`)===`tab`&&t.push(n);return t},Hs=(e,t=null)=>{let n=Q(e,Cs);return n?vs(e).getElementById(n):t},Us=e=>{for(let t=e;t;t=t.parentNode||t.host)if(t instanceof As)return t;return null},$=e=>e&&Rs(e)&&Ls(e,()=>{let t=Vs(e.parentElement),n=Us(e)?.panels||[],r=Hs(e,n?.[t.indexOf(e)]),i=0;for(let a of t){let t=Hs(a,n[i++]);Q(a,Ts,`${a===e}`),Q(a,Es,a===e?`0`:`-1`),t&&Fs(t,a,t===r)}});xs.define(`u-tabs`,As),xs.define(`u-tablist`,js),xs.define(`u-tab`,Ms),xs.define(`u-tabpanel`,Ns);var Ws=class extends As{},Gs=class extends js{},Ks=class extends Ms{},qs=class extends Ns{};S.define(`ds-tabs`,Ws),S.define(`ds-tablist`,Gs),S.define(`ds-tab`,Ks),S.define(`ds-tabpanel`,qs),e.DSBreadcrumbsElement=ha,e.DSErrorSummaryElement=_a,e.DSFieldElement=ja,e.DSPaginationElement=Ia,e.DSSuggestionElement=ns,e.DSTabElement=Ks,e.DSTabListElement=Gs,e.DSTabPanelElement=qs,e.DSTabsElement=Ws,e.UHTMLDataListElement=ea,e.UHTMLDataListShadowRoot=Yi,e.UHTMLDataListStyle=Ji,e.initTooltips=$r,e.pagination=Fa,e.setTooltipElement=Qr});
82
83
  //# sourceMappingURL=index.js.map