@digdir/designsystemet-web 1.13.3 → 1.14.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.
- package/dist/cjs/_vendors/invokers-polyfill/invoker.cjs.map +1 -1
- package/dist/cjs/suggestion/suggestion.cjs +1 -1
- package/dist/cjs/suggestion/suggestion.cjs.map +1 -1
- package/dist/custom-elements.json +0 -7
- package/dist/esm/_vendors/invokers-polyfill/invoker.js.map +1 -1
- package/dist/esm/suggestion/suggestion.js +1 -1
- package/dist/esm/suggestion/suggestion.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/umd/index.js +11 -14
- package/dist/umd/index.js.map +1 -1
- package/package.json +8 -8
package/dist/umd/index.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
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`});function t(){return typeof HTMLButtonElement<`u`&&`command`in HTMLButtonElement.prototype&&`source`in((globalThis.CommandEvent||{}).prototype||{})}function n(){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})}let r={passive:!0,capture:!0},i=()=>typeof window<`u`&&typeof document<`u`,a=()=>i()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),o=typeof HTMLElement>`u`?class{}:HTMLElement;function s(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}let c=(e,...t)=>!i()||window.dsWarnings===!1||console.log(`\x1B[1mDesignsystemet:\x1B[m ${e}`,...t),l=(e,t,n)=>n===void 0?e.getAttribute(t)??null:(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),u=(e,t)=>getComputedStyle(e).getPropertyValue(t).trim(),d=/^["']|["']$/g,f=(e,t)=>{let n=l(e,t);return n||=u(e,`--_ds-${t}`).replace(d,``).trim(),n||c(`Missing ${t} on:`,e),n||null},p=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>m(e,...t)},m=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},h=(e,t)=>{i()&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(e)?.map(e=>e()),window._dsHotReloadCleanup?.set(e,t()))},g=(e,t,n)=>{let r=()=>a.disconnect(),a=new MutationObserver(n=>{if(!i()||!e.isConnected)return r();t(e,n)});return t(e),a.observe(e,n),r},_=(e,t)=>{let n=document.createElement(e);if(t)for(let[e,r]of Object.entries(t))l(n,e,r);return n},v={define:(e,t)=>!i()||window.customElements.get(e)||window.customElements.define(e,t)},y=0;function b(e){return i()?(window.dsUseId||(window.dsUseId=0),e&&!e.id&&(e.id=`:ds:${++window.dsUseId}`),e?.id||``):`:ds:${++y}`}let x,ee=0,S=0,C=e=>{clearTimeout(S),x&&(x.textContent=`${e}${ee++%2?`\xA0`:``}`),e&&(S=setTimeout(C,2e3,``))},w=()=>{document.readyState===`complete`&&(x||(x=_(`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))};h(`announce`,()=>[p(document,`focus mouseover`,w,r)]);var te=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,ne=te(),re=ne?navigator.userAgent:``,ie=/android/i.test(re),ae=/firefox/i.test(re);ne&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var oe=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),se=(e,t,n)=>{let r=new MutationObserver(n=>{if(!te()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},ce=`__uDetailsPolyfillSummarys`;if(te()&&ie&&ae&&!window[ce]){let e=document.getElementsByTagName(`summary`);window[ce]=se(document,()=>{for(let t of e){let e=t.parentElement;oe(t,`role`,`button`),oe(t,`aria-expanded`,`${!!e?.open}`)}},{attributeFilter:[`open`],attributes:!0,childList:!0,subtree:!0})}let le=`:click-delegate-hover`,ue=`data-clickdelegatefor`,de=`[${ue}]`,fe=e=>{let t=e.button===1||e.metaKey||e.ctrlKey,n=e.button<2&&he(e);if(!(!n||n.contains(e.target))){if(t&&n instanceof HTMLAnchorElement)return window.open(n.href,void 0,n.rel);e.stopImmediatePropagation(),n.click()}},pe,me=e=>{let t=he(e);pe!==t&&(pe&&pe.classList.remove(le),t&&t.classList.add(le),pe=t)},he=({target:e})=>{let t=(e instanceof Element?e.closest(de):null)?.getAttribute(ue),n=t&&document.getElementById(t)||void 0,r=n&&e.closest(`a,button,label,input,select,textarea,details,dialog,[role="button"],[popover],[contenteditable]`);return(!r||r===n)&&!n?.disabled?n:void 0};h(`clickdelegatefor`,()=>[p(window,`click auxclick`,fe,!0),p(document,`mouseover`,me,r)]);let ge=!1,_e=({type:e,target:t,clientX:n=0,clientY:r=0})=>{if(e===`pointerdown`){let e=t?.closest?.(`dialog`)?.getBoundingClientRect();ge=!!(e&&e.top<=r&&r<=e.bottom&&e.left<=n&&n<=e.right)}else{let e=t instanceof HTMLDialogElement&&!ge&&l(t,`closedby`)===`any`;ge=!1,e&&requestAnimationFrame(()=>t.open&&t.close())}},ve=i()?document.getElementsByTagName(`button`):[],ye=()=>{for(let e of ve)e.getAttribute(`command`)?.endsWith(`-modal`)&&e.setAttribute(`aria-haspopup`,`dialog`)},be=({command:e,target:t})=>e===`--show-non-modal`&&t instanceof HTMLDialogElement&&t.show();h(`dialog`,()=>[p(document,`command`,be,r),p(document,`pointerdown pointerup`,_e,r),g(document,ye,{attributeFilter:[`command`],attributes:!0,childList:!0,subtree:!0})]);let xe=i()?document.getElementsByTagName(`fieldset`):[],Se=()=>{for(let e of xe)e.hasAttribute(`aria-labelledby`)||l(e,`aria-labelledby`,`${b(e.querySelector(`legend`))} ${b(e.querySelector(`:scope > :is([data-field="description"],legend + p)`))}`.trim()||null)};h(`fieldset`,()=>[g(document,Se,{childList:!0,subtree:!0})]);let T=Math.min,E=Math.max,Ce=Math.round,we=Math.floor,D=e=>({x:e,y:e}),Te={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ee(e,t,n){return E(e,T(t,n))}function O(e,t){return typeof e==`function`?e(t):e}function k(e){return e.split(`-`)[0]}function De(e){return e.split(`-`)[1]}function Oe(e){return e===`x`?`y`:`x`}function ke(e){return e===`y`?`height`:`width`}function A(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ae(e){return Oe(A(e))}function je(e,t,n){n===void 0&&(n=!1);let r=De(e),i=Ae(e),a=ke(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Be(o)),[o,Be(o)]}function Me(e){let t=Be(e);return[Ne(e),t,Ne(t)]}function Ne(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}let Pe=[`left`,`right`],Fe=[`right`,`left`],Ie=[`top`,`bottom`],Le=[`bottom`,`top`];function Re(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Fe:Pe:t?Pe:Fe;case`left`:case`right`:return t?Ie:Le;default:return[]}}function ze(e,t,n,r){let i=De(e),a=Re(k(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ne)))),a}function Be(e){let t=k(e);return Te[t]+e.slice(t.length)}function Ve(e){return{top:0,right:0,bottom:0,left:0,...e}}function He(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ve(e)}function Ue(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 We(e,t,n){let{reference:r,floating:i}=e,a=A(t),o=Ae(t),s=ke(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}}switch(De(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Ge(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=He(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ue(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=Ue(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 Ke=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ge},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=We(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}=We(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},qe=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?[Be(o)]:Me(o)),x=p!==`none`;!d&&x&&b.push(...ze(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=je(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:!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;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Je=new Set([`left`,`top`]);async function Ye(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=De(n),c=A(n)===`y`,l=Je.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 Xe=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 Ye(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}}}}},Ze=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(k(i)),p=Oe(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Ee(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Ee(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Qe=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=Oe(d),p=u[f],m=u[d],h=O(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=Je.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}}}},$e=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=O(e,t),u=await o.detectOverflow(t,l),d=k(i),f=De(i),p=A(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=T(h-u[g],v),x=T(m-u[_],y),ee=!t.middlewareData.shift,S=b,C=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=v),ee&&!f){let e=E(u.left,0),t=E(u.right,0),n=E(u.top,0),r=E(u.bottom,0);p?C=m-2*(e!==0||t!==0?e+t:E(u.left,u.right)):S=h-2*(n!==0||r!==0?n+r:E(u.top,u.bottom))}await c({...t,availableWidth:C,availableHeight:S});let w=await o.getDimensions(s.floating);return m!==w.width||h!==w.height?{reset:{rects:!0}}:{}}}};function et(){return typeof window<`u`}function j(e){return tt(e)?(e.nodeName||``).toLowerCase():`#document`}function M(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function N(e){return((tt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function tt(e){return et()?e instanceof Node||e instanceof M(e).Node:!1}function P(e){return et()?e instanceof Element||e instanceof M(e).Element:!1}function F(e){return et()?e instanceof HTMLElement||e instanceof M(e).HTMLElement:!1}function nt(e){return!et()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof M(e).ShadowRoot}function rt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=R(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function it(e){return/^(table|td|th)$/.test(j(e))}function at(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}let ot=/transform|translate|scale|rotate|perspective|filter/,st=/paint|layout|strict|content/,I=e=>!!e&&e!==`none`,ct;function lt(e){let t=P(e)?R(e):e;return I(t.transform)||I(t.translate)||I(t.scale)||I(t.rotate)||I(t.perspective)||!dt()&&(I(t.backdropFilter)||I(t.filter))||ot.test(t.willChange||``)||st.test(t.contain||``)}function ut(e){let t=z(e);for(;F(t)&&!L(t);){if(lt(t))return t;if(at(t))return null;t=z(t)}return null}function dt(){return ct??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ct}function L(e){return/^(html|body|#document)$/.test(j(e))}function R(e){return M(e).getComputedStyle(e)}function ft(e){return P(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function z(e){if(j(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||nt(e)&&e.host||N(e);return nt(t)?t.host:t}function pt(e){let t=z(e);return L(t)?e.ownerDocument?e.ownerDocument.body:e.body:F(t)&&rt(t)?t:pt(t)}function mt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=pt(e),i=r===e.ownerDocument?.body,a=M(r);if(i){let e=ht(a);return t.concat(a,a.visualViewport||[],rt(r)?r:[],e&&n?mt(e):[])}else return t.concat(r,mt(r,[],n))}function ht(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gt(e){let t=R(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=F(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ce(n)!==a||Ce(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function _t(e){return P(e)?e:e.contextElement}function B(e){let t=_t(e);if(!F(t))return D(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=gt(t),o=(a?Ce(n.width):n.width)/r,s=(a?Ce(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let vt=D(0);function yt(e){let t=M(e);return!dt()||!t.visualViewport?vt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==M(e)?!1:t}function V(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=_t(e),o=D(1);t&&(r?P(r)&&(o=B(r)):o=B(e));let s=bt(a,n,r)?yt(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){let e=M(a),t=r&&P(r)?M(r):r,n=e,i=ht(n);for(;i&&r&&t!==n;){let e=B(i),t=i.getBoundingClientRect(),r=R(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=M(i),i=ht(n)}}return Ue({width:u,height:d,x:c,y:l})}function xt(e,t){let n=ft(e).scrollLeft;return t?t.left+n:V(N(e)).left+n}function St(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xt(e,n),y:n.top+t.scrollTop}}function Ct(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=N(r),s=t?at(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=D(1),u=D(0),d=F(r);if((d||!d&&!a)&&((j(r)!==`body`||rt(o))&&(c=ft(r)),d)){let e=V(r);l=B(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?St(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 wt(e){return Array.from(e.getClientRects())}function Tt(e){let t=N(e),n=ft(e),r=e.ownerDocument.body,i=E(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=E(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+xt(e),s=-n.scrollTop;return R(r).direction===`rtl`&&(o+=E(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function Et(e,t){let n=M(e),r=N(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=dt();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=xt(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else l<=25&&(a+=l);return{width:a,height:o,x:s,y:c}}function Dt(e,t){let n=V(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=F(e)?B(e):D(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ot(e,t,n){let r;if(t===`viewport`)r=Et(e,n);else if(t===`document`)r=Tt(N(e));else if(P(t))r=Dt(t,n);else{let n=yt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ue(r)}function kt(e,t){let n=z(e);return n===t||!P(n)||L(n)?!1:R(n).position===`fixed`||kt(n,t)}function At(e,t){let n=t.get(e);if(n)return n;let r=mt(e,[],!1).filter(e=>P(e)&&j(e)!==`body`),i=null,a=R(e).position===`fixed`,o=a?z(e):e;for(;P(o)&&!L(o);){let t=R(o),n=lt(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||rt(o)&&!n&&kt(e,o))?r=r.filter(e=>e!==o):i=t,o=z(o)}return t.set(e,r),r}function jt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?at(t)?[]:At(t,this._c):[].concat(n),r],o=Ot(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=Ot(t,a[e],i);s=E(n.top,s),c=T(n.right,c),l=T(n.bottom,l),u=E(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Mt(e){let{width:t,height:n}=gt(e);return{width:t,height:n}}function Nt(e,t,n){let r=F(t),i=N(t),a=n===`fixed`,o=V(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=D(0);function l(){c.x=xt(i)}if(r||!r&&!a)if((j(t)!==`body`||rt(i))&&(s=ft(t)),r){let e=V(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?St(i,s):D(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Pt(e){return R(e).position===`static`}function Ft(e,t){if(!F(e)||R(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return N(e)===n&&(n=n.ownerDocument.body),n}function It(e,t){let n=M(e);if(at(e))return n;if(!F(e)){let t=z(e);for(;t&&!L(t);){if(P(t)&&!Pt(t))return t;t=z(t)}return n}let r=Ft(e,t);for(;r&&it(r)&&Pt(r);)r=Ft(r,t);return r&&L(r)&&Pt(r)&&!lt(r)?n:r||ut(e)||n}let Lt=async function(e){let t=this.getOffsetParent||It,n=this.getDimensions,r=await n(e.floating);return{reference:Nt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Rt(e){return R(e).direction===`rtl`}let zt={convertOffsetParentRelativeRectToViewportRelativeRect:Ct,getDocumentElement:N,getClippingRect:jt,getOffsetParent:It,getElementRects:Lt,getClientRects:wt,getDimensions:Mt,getScale:B,isElement:P,isRTL:Rt};function Bt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vt(e,t){let n=null,r,i=N(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=we(d),h=we(i.clientWidth-(u+f)),g=we(i.clientHeight-(d+p)),_=we(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:E(0,T(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Bt(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ht(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=_t(e),u=i||a?[...l?mt(l):[],...t?mt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Vt(l,n):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?V(e):null;c&&g();function g(){let t=V(e);h&&!Bt(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 Ut=Xe,Wt=Ze,Gt=qe,Kt=$e,qt=Qe,Jt=(e,t,n)=>{let r=new Map,i={platform:zt,...n},a={...i.platform,_c:r};return Ke(e,t,{...i,platform:a})},Yt=`data-placement`,Xt=`data-autoplacement`,Zt=new Map;function Qt(e){let{newState:t,oldState:n,target:r,source:i=e.detail}=e,a=r instanceof HTMLElement&&l(r,`popover`)!==null&&u(r,`--_ds-floating`);if(!a)return;if(t===`closed`)return Zt.get(r)?.();if(!i){let e=r.getRootNode(),t=`[popovertarget="${r.id}"],[commandfor="${r.id}"]`;i=r.id&&e?.querySelector?.(t)||void 0}if(!i||i===r||n&&n===t)return;let o=u(r,`--_ds-floating-overscroll`),s=l(r,Yt)||l(i,Yt)||a,c=l(r,Xt)||l(i,Xt),d=parseFloat(getComputedStyle(r,`::before`).height)||0,f=s.match(/left|right/gi)?`Height`:`Width`,p=i[`offset${f}`]/2+d;if(s===`none`)return;let m={strategy:`absolute`,placement:s,middleware:[Ut(d||0),Wt({padding:10,limiter:qt({offset:{mainAxis:p}})}),tn(),...c===`false`?[]:[Gt({padding:10,crossAxis:!1})],...o?[Kt({apply({availableHeight:e}){o===`fit`&&(r.style.width=`${i.clientWidth}px`),r.style.maxHeight=`${Math.max(50,e-20)}px`}})]:[]]},h=Ht(i,r,async()=>{if(!i?.isConnected)return Zt.get(r)?.();let{x:e,y:t}=await Jt(i,r,m);r.style.translate=`${e}px ${t}px`});Zt.set(r,()=>Zt.delete(r)&&h())}let $t,en=({type:e})=>{if(e===`mousedown`&&($t=!1),e===`scroll`&&$t===!1&&($t=!0),e===`mouseup`&&$t)for(let[e]of Zt)e.showPopover()};h(`popover`,()=>[p(document,`mousedown scroll mouseup`,en,!0),p(document,`toggle ds-toggle-source`,Qt,r)]);let tn=()=>({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),l(t,`data-floating`,e.placement),e}}),nn=e=>(e instanceof HTMLSelectElement||e instanceof HTMLInputElement)&&(e.hasAttribute(`readonly`)||l(e,`aria-readonly`)===`true`),rn=e=>{if(e.key!==`Tab`&&nn(e.target)){let t=e.key?.startsWith(`Arrow`),n=e.altKey||e.ctrlKey||e.metaKey;if((t||!n)&&e.preventDefault(),t&&l(e.target,`type`)===`radio`){let t=document.querySelectorAll(`input[name="${e.target.name}"]`),n=e.key?.match(/Arrow(Right|Down)/)?1:-1;t[(t.length+[...t].indexOf(e.target)+n)%t.length]?.focus()}}},an=e=>{let t=e.target?.closest?.(`label`)?.control||e.target;nn(t)&&(e.preventDefault(),t.focus())},on=e=>{e.target instanceof HTMLSelectElement&&nn(e.target)&&e.preventDefault()};h(`readonly`,()=>[p(document,`keydown`,rn),p(document,`click`,an),p(document,`mousedown`,on)]);let sn=`aria-label`,cn=`data-toggle-group`,ln=`[${cn}]`,un=()=>{for(let e of document.querySelectorAll(ln))l(e,`aria-label`,f(e,cn))},dn=e=>{let{key:t,target:n}=e,r=n instanceof HTMLInputElement&&n.closest(ln);if(r&&(!l(r,sn)&&!l(r,`aria-labelledby`)&&l(r,sn,f(r,cn)),t===`Enter`&&n.click(),t?.startsWith(`Arrow`))){e.preventDefault?.();let i=[...r.getElementsByTagName(`input`)],a=i.indexOf(n),o=t.match(/Arrow(Right|Down)/)?1:-1,s=a;for(let e=0;e<i.length;e++)if(s=(i.length+s+o)%i.length,!i[s]?.disabled){i[s]?.focus();break}}};h(`toggle-group`,()=>[p(document,`keydown`,dn),g(document,un,{attributeFilter:[cn],attributes:!0,childList:!0,subtree:!0})]);let H,fn,pn=!1,mn=0,hn=0,gn=i()&&/iPad|iPhone|iPod/.test(navigator.userAgent),U=`data-tooltip`,_n=`data-color`,vn=`aria-label`,yn=`aria-description`,bn=`[${_n}]`,xn=`[${U}]`,Sn=`data-color-scheme`,Cn=`[${Sn}]`,wn=e=>{e&&!(e instanceof HTMLElement)&&c(`setTooltipElement expects an HTMLElement, got: `,e),clearTimeout(hn),clearTimeout(mn),fn=void 0,pn=!1,H=e||void 0},Tn=()=>{for(let e of document.querySelectorAll(xn)){let t=f(e,U);if(!t)return;if(t!==(e.getAttribute(vn)||e.getAttribute(yn))){let n=l(e,`role`)!==`img`&&e.textContent?.trim();l(e,U,t),l(e,vn,n?null:t),l(e,yn,n?t:null),e.matches(`a,button,input,label,select,textarea,[tabindex]`)||c(`Missing tabindex="0" attribute on: `,e)}let n=e===fn&&H?.offsetHeight&&H?.offsetWidth,r=n&&t&&H?.textContent!==t;n&&r&&(H&&(H.textContent=t),document.activeElement===e&&C(t))}},En=({type:e,target:t})=>{if(clearTimeout(mn),t===H)return;if(e===`mouseover`&&!pn&&!gn){mn=setTimeout(En,300,{target:t});return}let n=t?.closest?.(`[${U}]`);if(n===fn)return;if(!n)return Dn();H||=_(`div`,{class:`ds-tooltip`}),H.isConnected||document.body.appendChild(H);let r=n.closest(bn),i=n.closest(Cn),a=r!==i&&r?.contains(i);clearTimeout(hn),l(H,`popover`,`manual`),l(H,Sn,i?.getAttribute(Sn)||null),l(H,_n,a&&r?.getAttribute(_n)||null),H.textContent=l(n,U),H.showPopover(),H.dispatchEvent(new CustomEvent(`ds-toggle-source`,{detail:n})),pn=!0,fn=n},Dn=()=>H?.isConnected&&H.popover&&H.hidePopover(),On=e=>{if(e?.type===`keydown`)return e?.key===`Escape`&&Dn();e?e.target===H&&e.newState===`closed`&&(fn=void 0,hn=setTimeout(On,300)):pn=!1};h(`tooltip`,()=>[p(document,`blur focus mouseover`,En,r),p(document,`toggle keydown`,On,r),g(document,Tn,{attributeFilter:[U],attributes:!0,childList:!0,subtree:!0})]);var kn=Object.defineProperty,An=Object.getOwnPropertySymbols,jn=Object.prototype.hasOwnProperty,Mn=Object.prototype.propertyIsEnumerable,Nn=(e,t,n)=>t in e?kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pn=(e,t)=>{for(var n in t||={})jn.call(t,n)&&Nn(e,n,t[n]);if(An)for(var n of An(t))Mn.call(t,n)&&Nn(e,n,t[n]);return e},Fn=typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,In=Fn&&/android/i.test(navigator.userAgent),Ln=Fn&&/iPad|iPhone|iPod/.test(navigator.userAgent);Fn&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var Rn=`${In?`data`:`aria`}-labelledby`,zn=`:host(:not([hidden])) { display: block }`,Bn=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,Vn=typeof HTMLElement>`u`?class{}:HTMLElement;function W(e,t,n){return n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null)}var Hn=(e,t,n)=>{for(let r of n[0].split(`,`))n[0]=r,Element.prototype[`${e}EventListener`].apply(t,n)},Un=(e,...t)=>Hn(`add`,e,t),Wn=(e,...t)=>Hn(`remove`,e,t),Gn=(e,t)=>e.shadowRoot||e.attachShadow({mode:`open`}).append(Zn(`slot`),Zn(`style`,t)),Kn=new WeakMap,qn=(e,t)=>{if(t===void 0)return Kn.get(e);try{Kn.get(e).disconnect(),Kn.delete(e)}catch{}if(t){let n=new MutationObserver(t=>e.handleEvent({type:`mutation`,detail:t}));n.observe(e,t),Kn.set(e,n)}},Jn=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},Yn=0,Xn=e=>e?(e.id||=`:${e.nodeName.toLowerCase()}${(++Yn).toString(32)}`,e.id):``,Zn=(e,t,n)=>{let r=document.createElement(e);return t&&(r[e===`style`?`textContent`:`innerHTML`]=t),r},Qn={define:(e,t)=>!Fn||window.customElements.get(e)||window.customElements.define(e,t)},G,$n=0,er=e=>{G||(G=Zn(`div`),G.style.cssText=`position:fixed;overflow:hidden;width:1px;white-space:nowrap`,W(G,`aria-live`,`assertive`)),G.isConnected||document.body.append(G),e&&(G.textContent=`${e}${$n++%2?`\xA0`:``}`)},tr=(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}))},nr=!1,rr=e=>(e?.type===`mouseup`&&(nr=!1),e?.type===`mousedown`&&(nr=!0,Un(document,`mouseup`,rr,{once:!0})),nr),ir=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,ar=`disabled`,or=`selected`,sr=class extends Vn{static get observedAttributes(){return[ar,or]}connectedCallback(){Ln||(this.tabIndex=-1),this.hasAttribute(`role`)||W(this,`role`,`option`),this.attributeChangedCallback()}attributeChangedCallback(){W(this,`aria-disabled`,`${this.disabled}`),W(this,`aria-selected`,`${this.selected}`)}get defaultSelected(){return this[or]}set defaultSelected(e){this[or]=e}get disabled(){return W(this,ar)!==null}set disabled(e){W(this,ar,e?``:null)}get form(){return this.closest(`form`)}get index(){return[...this.parentElement?.options||[this]].indexOf(this)}get label(){return W(this,`label`)??this.text}set label(e){W(this,`label`,e)}get selected(){return W(this,or)!==null}set selected(e){W(this,or,e?``:null)}get text(){return this.textContent?.trim()||``}set text(e){this.textContent=e}get value(){return W(this,`value`)??this.text}set value(e){W(this,`value`,e)}};Qn.define(`u-option`,sr);var cr=`${zn}
|
|
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`});function t(){return typeof HTMLButtonElement<`u`&&`command`in HTMLButtonElement.prototype&&`source`in((globalThis.CommandEvent||{}).prototype||{})}function n(){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})}let r={passive:!0,capture:!0},i=()=>typeof window<`u`&&typeof document<`u`,a=()=>i()&&/^Win/i.test(navigator.userAgentData?.platform||navigator.platform),o=typeof HTMLElement>`u`?class{}:HTMLElement;function s(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}let c=(e,...t)=>!i()||window.dsWarnings===!1||console.log(`\x1B[1mDesignsystemet:\x1B[m ${e}`,...t),l=(e,t,n)=>n===void 0?e.getAttribute(t)??null:(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),u=(e,t)=>getComputedStyle(e).getPropertyValue(t).trim(),d=/^["']|["']$/g,f=(e,t)=>{let n=l(e,t);return n||=u(e,`--_ds-${t}`).replace(d,``).trim(),n||c(`Missing ${t} on:`,e),n||null},p=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>m(e,...t)},m=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},h=(e,t)=>{i()&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(e)?.map(e=>e()),window._dsHotReloadCleanup?.set(e,t()))},g=(e,t,n)=>{let r=()=>a.disconnect(),a=new MutationObserver(n=>{if(!i()||!e.isConnected)return r();t(e,n)});return t(e),a.observe(e,n),r},_=(e,t)=>{let n=document.createElement(e);if(t)for(let[e,r]of Object.entries(t))l(n,e,r);return n},v={define:(e,t)=>!i()||window.customElements.get(e)||window.customElements.define(e,t)},y=0;function b(e){return i()?(window.dsUseId||(window.dsUseId=0),e&&!e.id&&(e.id=`:ds:${++window.dsUseId}`),e?.id||``):`:ds:${++y}`}let x,ee=0,S=0,C=e=>{clearTimeout(S),x&&(x.textContent=`${e}${ee++%2?`\xA0`:``}`),e&&(S=setTimeout(C,2e3,``))},w=()=>{document.readyState===`complete`&&(x||(x=_(`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))};h(`announce`,()=>[p(document,`focus mouseover`,w,r)]);var te=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,ne=te(),re=ne?navigator.userAgent:``,ie=/android/i.test(re),ae=/firefox/i.test(re);ne&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var oe=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),se=(e,t,n)=>{let r=new MutationObserver(n=>{if(!te()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},ce=`__uDetailsPolyfillSummarys`;if(te()&&ie&&ae&&!window[ce]){let e=document.getElementsByTagName(`summary`);window[ce]=se(document,()=>{for(let t of e){let e=t.parentElement;oe(t,`role`,`button`),oe(t,`aria-expanded`,`${!!e?.open}`)}},{attributeFilter:[`open`],attributes:!0,childList:!0,subtree:!0})}let le=`:click-delegate-hover`,ue=`data-clickdelegatefor`,de=`[${ue}]`,fe=e=>{let t=e.button===1||e.metaKey||e.ctrlKey,n=e.button<2&&he(e);if(!(!n||n.contains(e.target))){if(t&&n instanceof HTMLAnchorElement)return window.open(n.href,void 0,n.rel);e.stopImmediatePropagation(),n.click()}},pe,me=e=>{let t=he(e);pe!==t&&(pe&&pe.classList.remove(le),t&&t.classList.add(le),pe=t)},he=({target:e})=>{let t=(e instanceof Element?e.closest(de):null)?.getAttribute(ue),n=t&&document.getElementById(t)||void 0,r=n&&e.closest(`a,button,label,input,select,textarea,details,dialog,[role="button"],[popover],[contenteditable]`);return(!r||r===n)&&!n?.disabled?n:void 0};h(`clickdelegatefor`,()=>[p(window,`click auxclick`,fe,!0),p(document,`mouseover`,me,r)]);let ge=!1,_e=({type:e,target:t,clientX:n=0,clientY:r=0})=>{if(e===`pointerdown`){let e=t?.closest?.(`dialog`)?.getBoundingClientRect();ge=!!(e&&e.top<=r&&r<=e.bottom&&e.left<=n&&n<=e.right)}else{let e=t instanceof HTMLDialogElement&&!ge&&l(t,`closedby`)===`any`;ge=!1,e&&requestAnimationFrame(()=>t.open&&t.close())}},ve=i()?document.getElementsByTagName(`button`):[],ye=()=>{for(let e of ve)e.getAttribute(`command`)?.endsWith(`-modal`)&&e.setAttribute(`aria-haspopup`,`dialog`)},be=({command:e,target:t})=>e===`--show-non-modal`&&t instanceof HTMLDialogElement&&t.show();h(`dialog`,()=>[p(document,`command`,be,r),p(document,`pointerdown pointerup`,_e,r),g(document,ye,{attributeFilter:[`command`],attributes:!0,childList:!0,subtree:!0})]);let xe=i()?document.getElementsByTagName(`fieldset`):[],Se=()=>{for(let e of xe)e.hasAttribute(`aria-labelledby`)||l(e,`aria-labelledby`,`${b(e.querySelector(`legend`))} ${b(e.querySelector(`:scope > :is([data-field="description"],legend + p)`))}`.trim()||null)};h(`fieldset`,()=>[g(document,Se,{childList:!0,subtree:!0})]);let T=Math.min,E=Math.max,Ce=Math.round,we=Math.floor,D=e=>({x:e,y:e}),Te={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ee(e,t,n){return E(e,T(t,n))}function O(e,t){return typeof e==`function`?e(t):e}function k(e){return e.split(`-`)[0]}function De(e){return e.split(`-`)[1]}function Oe(e){return e===`x`?`y`:`x`}function ke(e){return e===`y`?`height`:`width`}function A(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ae(e){return Oe(A(e))}function je(e,t,n){n===void 0&&(n=!1);let r=De(e),i=Ae(e),a=ke(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Be(o)),[o,Be(o)]}function Me(e){let t=Be(e);return[Ne(e),t,Ne(t)]}function Ne(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}let Pe=[`left`,`right`],Fe=[`right`,`left`],Ie=[`top`,`bottom`],Le=[`bottom`,`top`];function Re(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Fe:Pe:t?Pe:Fe;case`left`:case`right`:return t?Ie:Le;default:return[]}}function ze(e,t,n,r){let i=De(e),a=Re(k(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ne)))),a}function Be(e){let t=k(e);return Te[t]+e.slice(t.length)}function Ve(e){return{top:0,right:0,bottom:0,left:0,...e}}function He(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ve(e)}function Ue(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 We(e,t,n){let{reference:r,floating:i}=e,a=A(t),o=Ae(t),s=ke(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}}switch(De(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Ge(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=He(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ue(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=Ue(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 Ke=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ge},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=We(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}=We(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},qe=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?[Be(o)]:Me(o)),x=p!==`none`;!d&&x&&b.push(...ze(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=je(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:!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;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Je=new Set([`left`,`top`]);async function Ye(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=De(n),c=A(n)===`y`,l=Je.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 Xe=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 Ye(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}}}}},Ze=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(k(i)),p=Oe(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Ee(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Ee(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Qe=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=Oe(d),p=u[f],m=u[d],h=O(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=Je.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}}}},$e=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=O(e,t),u=await o.detectOverflow(t,l),d=k(i),f=De(i),p=A(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=T(h-u[g],v),x=T(m-u[_],y),ee=!t.middlewareData.shift,S=b,C=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=v),ee&&!f){let e=E(u.left,0),t=E(u.right,0),n=E(u.top,0),r=E(u.bottom,0);p?C=m-2*(e!==0||t!==0?e+t:E(u.left,u.right)):S=h-2*(n!==0||r!==0?n+r:E(u.top,u.bottom))}await c({...t,availableWidth:C,availableHeight:S});let w=await o.getDimensions(s.floating);return m!==w.width||h!==w.height?{reset:{rects:!0}}:{}}}};function et(){return typeof window<`u`}function j(e){return tt(e)?(e.nodeName||``).toLowerCase():`#document`}function M(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function N(e){return((tt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function tt(e){return et()?e instanceof Node||e instanceof M(e).Node:!1}function P(e){return et()?e instanceof Element||e instanceof M(e).Element:!1}function F(e){return et()?e instanceof HTMLElement||e instanceof M(e).HTMLElement:!1}function nt(e){return!et()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof M(e).ShadowRoot}function rt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=R(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function it(e){return/^(table|td|th)$/.test(j(e))}function at(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}let ot=/transform|translate|scale|rotate|perspective|filter/,st=/paint|layout|strict|content/,I=e=>!!e&&e!==`none`,ct;function lt(e){let t=P(e)?R(e):e;return I(t.transform)||I(t.translate)||I(t.scale)||I(t.rotate)||I(t.perspective)||!dt()&&(I(t.backdropFilter)||I(t.filter))||ot.test(t.willChange||``)||st.test(t.contain||``)}function ut(e){let t=z(e);for(;F(t)&&!L(t);){if(lt(t))return t;if(at(t))return null;t=z(t)}return null}function dt(){return ct??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ct}function L(e){return/^(html|body|#document)$/.test(j(e))}function R(e){return M(e).getComputedStyle(e)}function ft(e){return P(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function z(e){if(j(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||nt(e)&&e.host||N(e);return nt(t)?t.host:t}function pt(e){let t=z(e);return L(t)?e.ownerDocument?e.ownerDocument.body:e.body:F(t)&&rt(t)?t:pt(t)}function mt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=pt(e),i=r===e.ownerDocument?.body,a=M(r);if(i){let e=ht(a);return t.concat(a,a.visualViewport||[],rt(r)?r:[],e&&n?mt(e):[])}else return t.concat(r,mt(r,[],n))}function ht(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gt(e){let t=R(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=F(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ce(n)!==a||Ce(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function _t(e){return P(e)?e:e.contextElement}function B(e){let t=_t(e);if(!F(t))return D(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=gt(t),o=(a?Ce(n.width):n.width)/r,s=(a?Ce(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let vt=D(0);function yt(e){let t=M(e);return!dt()||!t.visualViewport?vt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==M(e)?!1:t}function V(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=_t(e),o=D(1);t&&(r?P(r)&&(o=B(r)):o=B(e));let s=bt(a,n,r)?yt(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){let e=M(a),t=r&&P(r)?M(r):r,n=e,i=ht(n);for(;i&&r&&t!==n;){let e=B(i),t=i.getBoundingClientRect(),r=R(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=M(i),i=ht(n)}}return Ue({width:u,height:d,x:c,y:l})}function xt(e,t){let n=ft(e).scrollLeft;return t?t.left+n:V(N(e)).left+n}function St(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xt(e,n),y:n.top+t.scrollTop}}function Ct(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=N(r),s=t?at(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=D(1),u=D(0),d=F(r);if((d||!d&&!a)&&((j(r)!==`body`||rt(o))&&(c=ft(r)),d)){let e=V(r);l=B(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?St(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 wt(e){return Array.from(e.getClientRects())}function Tt(e){let t=N(e),n=ft(e),r=e.ownerDocument.body,i=E(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=E(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+xt(e),s=-n.scrollTop;return R(r).direction===`rtl`&&(o+=E(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function Et(e,t){let n=M(e),r=N(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=dt();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=xt(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else l<=25&&(a+=l);return{width:a,height:o,x:s,y:c}}function Dt(e,t){let n=V(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=F(e)?B(e):D(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ot(e,t,n){let r;if(t===`viewport`)r=Et(e,n);else if(t===`document`)r=Tt(N(e));else if(P(t))r=Dt(t,n);else{let n=yt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ue(r)}function kt(e,t){let n=z(e);return n===t||!P(n)||L(n)?!1:R(n).position===`fixed`||kt(n,t)}function At(e,t){let n=t.get(e);if(n)return n;let r=mt(e,[],!1).filter(e=>P(e)&&j(e)!==`body`),i=null,a=R(e).position===`fixed`,o=a?z(e):e;for(;P(o)&&!L(o);){let t=R(o),n=lt(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||rt(o)&&!n&&kt(e,o))?r=r.filter(e=>e!==o):i=t,o=z(o)}return t.set(e,r),r}function jt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?at(t)?[]:At(t,this._c):[].concat(n),r],o=Ot(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=Ot(t,a[e],i);s=E(n.top,s),c=T(n.right,c),l=T(n.bottom,l),u=E(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Mt(e){let{width:t,height:n}=gt(e);return{width:t,height:n}}function Nt(e,t,n){let r=F(t),i=N(t),a=n===`fixed`,o=V(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=D(0);function l(){c.x=xt(i)}if(r||!r&&!a)if((j(t)!==`body`||rt(i))&&(s=ft(t)),r){let e=V(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?St(i,s):D(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Pt(e){return R(e).position===`static`}function Ft(e,t){if(!F(e)||R(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return N(e)===n&&(n=n.ownerDocument.body),n}function It(e,t){let n=M(e);if(at(e))return n;if(!F(e)){let t=z(e);for(;t&&!L(t);){if(P(t)&&!Pt(t))return t;t=z(t)}return n}let r=Ft(e,t);for(;r&&it(r)&&Pt(r);)r=Ft(r,t);return r&&L(r)&&Pt(r)&&!lt(r)?n:r||ut(e)||n}let Lt=async function(e){let t=this.getOffsetParent||It,n=this.getDimensions,r=await n(e.floating);return{reference:Nt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Rt(e){return R(e).direction===`rtl`}let zt={convertOffsetParentRelativeRectToViewportRelativeRect:Ct,getDocumentElement:N,getClippingRect:jt,getOffsetParent:It,getElementRects:Lt,getClientRects:wt,getDimensions:Mt,getScale:B,isElement:P,isRTL:Rt};function Bt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vt(e,t){let n=null,r,i=N(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=we(d),h=we(i.clientWidth-(u+f)),g=we(i.clientHeight-(d+p)),_=we(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:E(0,T(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Bt(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ht(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=_t(e),u=i||a?[...l?mt(l):[],...t?mt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Vt(l,n):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?V(e):null;c&&g();function g(){let t=V(e);h&&!Bt(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 Ut=Xe,Wt=Ze,Gt=qe,Kt=$e,qt=Qe,Jt=(e,t,n)=>{let r=new Map,i={platform:zt,...n},a={...i.platform,_c:r};return Ke(e,t,{...i,platform:a})},Yt=`data-placement`,Xt=`data-autoplacement`,Zt=new Map;function Qt(e){let{newState:t,oldState:n,target:r,source:i=e.detail}=e,a=r instanceof HTMLElement&&l(r,`popover`)!==null&&u(r,`--_ds-floating`);if(!a)return;if(t===`closed`)return Zt.get(r)?.();if(!i){let e=r.getRootNode(),t=`[popovertarget="${r.id}"],[commandfor="${r.id}"]`;i=r.id&&e?.querySelector?.(t)||void 0}if(!i||i===r||n&&n===t)return;let o=u(r,`--_ds-floating-overscroll`),s=l(r,Yt)||l(i,Yt)||a,c=l(r,Xt)||l(i,Xt),d=parseFloat(getComputedStyle(r,`::before`).height)||0,f=s.match(/left|right/gi)?`Height`:`Width`,p=i[`offset${f}`]/2+d;if(s===`none`)return;let m={strategy:`absolute`,placement:s,middleware:[Ut(d||0),Wt({padding:10,limiter:qt({offset:{mainAxis:p}})}),tn(),...c===`false`?[]:[Gt({padding:10,crossAxis:!1})],...o?[Kt({apply({availableHeight:e}){o===`fit`&&(r.style.width=`${i.clientWidth}px`),r.style.maxHeight=`${Math.max(50,e-20)}px`}})]:[]]},h=Ht(i,r,async()=>{if(!i?.isConnected)return Zt.get(r)?.();let{x:e,y:t}=await Jt(i,r,m);r.style.translate=`${e}px ${t}px`});Zt.set(r,()=>Zt.delete(r)&&h())}let $t,en=({type:e})=>{if(e===`mousedown`&&($t=!1),e===`scroll`&&$t===!1&&($t=!0),e===`mouseup`&&$t)for(let[e]of Zt)e.showPopover()};h(`popover`,()=>[p(document,`mousedown scroll mouseup`,en,!0),p(document,`toggle ds-toggle-source`,Qt,r)]);let tn=()=>({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),l(t,`data-floating`,e.placement),e}}),nn=e=>(e instanceof HTMLSelectElement||e instanceof HTMLInputElement)&&(e.hasAttribute(`readonly`)||l(e,`aria-readonly`)===`true`),rn=e=>{if(e.key!==`Tab`&&nn(e.target)){let t=e.key?.startsWith(`Arrow`),n=e.altKey||e.ctrlKey||e.metaKey;if((t||!n)&&e.preventDefault(),t&&l(e.target,`type`)===`radio`){let t=document.querySelectorAll(`input[name="${e.target.name}"]`),n=e.key?.match(/Arrow(Right|Down)/)?1:-1;t[(t.length+[...t].indexOf(e.target)+n)%t.length]?.focus()}}},an=e=>{let t=e.target?.closest?.(`label`)?.control||e.target;nn(t)&&(e.preventDefault(),t.focus())},on=e=>{e.target instanceof HTMLSelectElement&&nn(e.target)&&e.preventDefault()};h(`readonly`,()=>[p(document,`keydown`,rn),p(document,`click`,an),p(document,`mousedown`,on)]);let sn=`aria-label`,cn=`data-toggle-group`,ln=`[${cn}]`,un=()=>{for(let e of document.querySelectorAll(ln))l(e,`aria-label`,f(e,cn))},dn=e=>{let{key:t,target:n}=e,r=n instanceof HTMLInputElement&&n.closest(ln);if(r&&(!l(r,sn)&&!l(r,`aria-labelledby`)&&l(r,sn,f(r,cn)),t===`Enter`&&n.click(),t?.startsWith(`Arrow`))){e.preventDefault?.();let i=[...r.getElementsByTagName(`input`)],a=i.indexOf(n),o=t.match(/Arrow(Right|Down)/)?1:-1,s=a;for(let e=0;e<i.length;e++)if(s=(i.length+s+o)%i.length,!i[s]?.disabled){i[s]?.focus();break}}};h(`toggle-group`,()=>[p(document,`keydown`,dn),g(document,un,{attributeFilter:[cn],attributes:!0,childList:!0,subtree:!0})]);let H,fn,pn=!1,mn=0,hn=0,gn=i()&&/iPad|iPhone|iPod/.test(navigator.userAgent),U=`data-tooltip`,_n=`data-color`,vn=`aria-label`,yn=`aria-description`,bn=`[${_n}]`,xn=`[${U}]`,Sn=`data-color-scheme`,Cn=`[${Sn}]`,wn=e=>{e&&!(e instanceof HTMLElement)&&c(`setTooltipElement expects an HTMLElement, got: `,e),clearTimeout(hn),clearTimeout(mn),fn=void 0,pn=!1,H=e||void 0},Tn=()=>{for(let e of document.querySelectorAll(xn)){let t=f(e,U);if(!t)return;if(t!==(e.getAttribute(vn)||e.getAttribute(yn))){let n=l(e,`role`)!==`img`&&e.textContent?.trim();l(e,U,t),l(e,vn,n?null:t),l(e,yn,n?t:null),e.matches(`a,button,input,label,select,textarea,[tabindex]`)||c(`Missing tabindex="0" attribute on: `,e)}let n=e===fn&&H?.offsetHeight&&H?.offsetWidth,r=n&&t&&H?.textContent!==t;n&&r&&(H&&(H.textContent=t),document.activeElement===e&&C(t))}},En=({type:e,target:t})=>{if(clearTimeout(mn),t===H)return;if(e===`mouseover`&&!pn&&!gn){mn=setTimeout(En,300,{target:t});return}let n=t?.closest?.(`[${U}]`);if(n===fn)return;if(!n)return Dn();H||=_(`div`,{class:`ds-tooltip`}),H.isConnected||document.body.appendChild(H);let r=n.closest(bn),i=n.closest(Cn),a=r!==i&&r?.contains(i);clearTimeout(hn),l(H,`popover`,`manual`),l(H,Sn,i?.getAttribute(Sn)||null),l(H,_n,a&&r?.getAttribute(_n)||null),H.textContent=l(n,U),H.showPopover(),H.dispatchEvent(new CustomEvent(`ds-toggle-source`,{detail:n})),pn=!0,fn=n},Dn=()=>H?.isConnected&&H.popover&&H.hidePopover(),On=e=>{if(e?.type===`keydown`)return e?.key===`Escape`&&Dn();e?e.target===H&&e.newState===`closed`&&(fn=void 0,hn=setTimeout(On,300)):pn=!1};h(`tooltip`,()=>[p(document,`blur focus mouseover`,En,r),p(document,`toggle keydown`,On,r),g(document,Tn,{attributeFilter:[U],attributes:!0,childList:!0,subtree:!0})]);var kn=Object.defineProperty,An=Object.getOwnPropertySymbols,jn=Object.prototype.hasOwnProperty,Mn=Object.prototype.propertyIsEnumerable,Nn=(e,t,n)=>t in e?kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pn=(e,t)=>{for(var n in t||={})jn.call(t,n)&&Nn(e,n,t[n]);if(An)for(var n of An(t))Mn.call(t,n)&&Nn(e,n,t[n]);return e},Fn=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,In=Fn(),Ln=In?navigator.userAgent:``,Rn=/android/i.test(Ln),zn=/firefox/i.test(Ln),Bn=/iPad|iPhone|iPod/.test(Ln),Vn=In&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform),Hn=In&&window.CSSStyleSheet&&document.adoptedStyleSheets,Un={once:!0,capture:!0,passive:!0},Wn=`:host(:not([hidden])) { display: block }`,Gn=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,Kn=`${Rn?`data`:`aria`}-multiselectable`,qn=typeof HTMLElement>`u`?class{}:HTMLElement,W=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),Jn=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>Yn(e,...t)},Yn=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},Xn=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(tr(`slot`)),!n.querySelector(`style`))if(!Hn)n.append(tr(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},Zn=(e,t,n)=>{let r=new MutationObserver(n=>{if(!Fn()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},Qn=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},$n=e=>Qn(e).activeElement,er=e=>{if(!e||!In)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},tr=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))W(r,e,n);return r},nr={define:(e,t)=>!Fn()||window.customElements.get(e)||window.customElements.define(e,t)},rr=(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}))},ir=!1,ar=e=>(e?.type===`pointerup`&&(ir=!1),e?.type===`pointerdown`&&(ir=!0,Jn(document,`pointerup`,ar,Un)),ir),or=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,sr=e=>{let t=W(e,`form`);W(e,`form`,`#`),setTimeout(cr,0,e,t)},cr=(e,t)=>W(e,`form`,t),G,lr=0,ur=0,dr=e=>{clearTimeout(ur),G||(G=tr(`div`,{"aria-live":`assertive`}),G.style.overflow=`hidden`,G.style.position=`fixed`,G.style.whiteSpace=`nowrap`,G.style.width=`1px`),G.isConnected||document.body.append(G),e===``&&(G.textContent=``),e&&(G.textContent=`${e}${lr++%2?`\xA0`:``}`,ur=setTimeout(dr,!Vn&&zn?2e3:300,``))},fr=`disabled`,pr=`selected`,mr=class extends qn{constructor(){super(...arguments),this._skipAttrChange=!1}static get observedAttributes(){return[`id`,fr,pr]}connectedCallback(){Rn&&(this.tabIndex=-1),this.hasAttribute(`role`)||W(this,`role`,`option`),W(this,`aria-disabled`,`${this.disabled}`),W(this,`aria-selected`,`${this.selected}`),er(this)}attributeChangedCallback(e){this._skipAttrChange||=(this._skipAttrChange=!0,e===`id`?er(this):W(this,`aria-${e}`,`${this[e]}`),!1)}get defaultSelected(){return this[pr]}set defaultSelected(e){this[pr]=e}get disabled(){return W(this,fr)!==null}set disabled(e){W(this,fr,e?``:null)}get form(){return this.closest(`form`)}get index(){return[...this.parentElement?.options||[this]].indexOf(this)}get label(){return W(this,`label`)??this.text}set label(e){W(this,`label`,e)}get selected(){return W(this,pr)!==null}set selected(e){W(this,pr,e?``:null)}get text(){return this.textContent?.trim()||``}set text(e){this.textContent=e}get value(){return W(this,`value`)??this.text}set value(e){W(this,`value`,e)}};nr.define(`u-option`,mr);var hr=`data-activedescendant`,gr=`aria-hidden`,_r=`${Wn}
|
|
2
2
|
::slotted([role="option"]) { display: block; cursor: pointer }
|
|
3
|
-
::slotted([role="option"]
|
|
4
|
-
::slotted([role="option"][aria-hidden="true"]),
|
|
5
|
-
|
|
6
|
-
::slotted([role="option"][hidden]) { display: none !important }`,lr=ir(cr),ur,dr=0,fr=Ln||In,pr=`click,focusout,input,keydown,mousedown,mouseup`,mr=`focus,focusin,blur,focusout`,hr={singular:`%d hit`,plural:`%d hits`},gr=class extends Vn{constructor(){super(),this._texts=Pn({},hr),this._value=``,this._of=`/`,Gn(this,cr)}static get observedAttributes(){return[`id`,...Object.keys(hr).map(e=>`data-sr-${e}`)]}connectedCallback(){this.hidden=!0,this._root=Jn(this),W(this,`role`,`listbox`),W(this,`tabindex`,`-1`),Un(this._root,`focusin`,this),Un(this._root,`focus`,this,!0),qn(this,{attributeFilter:[`disabled`,`hidden`,`label`,`value`],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(()=>this.attributeChangedCallback())}disconnectedCallback(){Wn(this._root||this,`focus`,this,!0),Wn(this._root||this,`focusin`,this),qn(this,!1),yr(this),this._root=void 0}attributeChangedCallback(e,t,n){let r=e?.split(`data-sr-`)[1],i=`input[list="${this.id}"]`;if(hr[r])this._texts[r]=n||hr[r];else if(this._root){this._input&&br(this,this._input);for(let e of this._root.querySelectorAll(i))br(this,e)}}handleEvent(e){let{target:t,type:n}=e;e.defaultPrevented||(n===`click`&&wr(this,e),(n===`focus`||n===`focusin`)&&xr(this,e),(n===`blur`||n===`focusout`)&&Sr(this,e),n===`keydown`&&Tr(this,e),n===`mousedown`&&this.contains(t)&&rr(e),(n===`mutation`||n===`input`)&&(clearTimeout(dr),dr=setTimeout(Er,0,this,e)))}get options(){if(!this._options){let e=this.querySelector(`[role="option"],option`)?.nodeName;e&&(this._options=this.getElementsByTagName(e))}return this._options||this.getElementsByTagName(`option`)}},_r=e=>e?.disabled||e?.readOnly||!1,vr=(e,t)=>{var n;if(e.hidden!==t)return;e.hidden=_r(e?._input)||!t,(n=qn(e))==null||n.takeRecords();let r=e.isConnected&&e.popover&&e._input?.isConnected&&e._input?.popoverTargetElement===e;e._input&&br(e,e._input,t),r&&W(e,`popover`,`manual`),r&&e.togglePopover(t),t&&Er(e)},yr=e=>{e._input&&=(Wn(e._input||e,mr,e),Wn(e._root||e,pr,e),vr(e,!1),void 0)},br=(e,t,n=!1)=>{e.popover&&W(t,`popovertarget`,Xn(e)),Un(t,mr,e,!0),W(t,`aria-autocomplete`,`list`),W(t,`aria-controls`,Xn(e)),W(t,`aria-expanded`,`${!fr||n}`),W(t,`autocomplete`,`off`),W(t,`role`,_r(t)?null:`combobox`)},xr=(e,t)=>{let n=t.target instanceof HTMLInputElement;n&&t.isTrusted&&t.stopImmediatePropagation(),e._input!==t.target&&n&&t.target.list===e&&(e._input&&yr(e),e._input=t.target,e._input.dispatchEvent(new FocusEvent(`focus`)),e._input.dispatchEvent(new FocusEvent(`focusin`,{bubbles:!0})),W(e,Rn,Xn(e._input.labels?.[0])),Un(e._root||e,pr,e),vr(e,W(e._input,`inputmode`)!==`none`),er())},Sr=(e,t)=>{!In&&!rr()&&e._input&&setTimeout(Cr,0,e),t.target===e._input&&t.isTrusted&&t.stopImmediatePropagation()},Cr=e=>{let t=e._root?.activeElement||null,n=e._input;n&&n!==t&&!e.contains(t)&&(n.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:t})),n.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:t})),yr(e))},wr=(e,{target:t})=>{var n;if(!e._input||e._input===t)return vr(e,!0);for(let r of e.options)if(r.contains(t))return W(e,`aria-multiselectable`)!==`true`&&((n=e._input)==null||n.focus(),vr(e,!1)),tr(e._input,r.value);In&&Cr(e)},Tr=(e,t)=>{var n;let{key:r,target:i,altKey:a,ctrlKey:o,shiftKey:s,metaKey:c}=t,l=r===`Escape`||r===`Esc`;if(a||o||c||s||r===`Tab`)return;l&&!e.hidden&&t?.preventDefault(),vr(e,!l);let u=[...e.options].filter(e=>W(e,`aria-hidden`)!==`true`&&e.offsetHeight),d=u.indexOf(i),f=-1;if(r===`ArrowDown`&&(f=(d+1)%u.length),r===`ArrowUp`&&(f=(~d?d:u.length)-1),~d&&((r===`Home`||r===`PageUp`)&&(f=0),(r===`End`||r===`PageDown`)&&(f=u.length-1),r===`Enter`))return u[d].click(),t.preventDefault();if(u[f])for(let e of u)e.tabIndex=-1;u[f]&&t.preventDefault(),(n=u[f]||e._input)==null||n.focus(),!u[f]&&r===`ArrowUp`&&setTimeout(()=>e._input?.setSelectionRange(999,999))},Er=(e,t)=>{let{_texts:n,_root:r,_input:i,options:a}=e,o=i?.value.toLowerCase().trim()||``,s=!e.hasAttribute(`data-nofilter`),c=[],l=[];for(let e of a)(e.disabled||e.hidden||s&&!e.label.toLowerCase().includes(o)?c:l).push(e);for(let e of c)W(e,`aria-hidden`,`true`);for(let e of l)W(e,`aria-hidden`,`false`);let u=l.length;clearTimeout(ur),t?.type===`input`&&o!==e._value&&(ur=setTimeout(()=>{let t=`${!u&&e.innerText.trim()||`${n[u===1?`singular`:`plural`]}`.replace(`%d`,`${u}`)}`;!e.hidden&&r?.activeElement===i&&er(t),e._value=o},1e3));let d=0;if(Ln)for(let t of l)W(t,`title`,`${++d} ${e._of} ${u}`)};Fn&&Object.defineProperty(HTMLInputElement.prototype,`list`,{configurable:!0,enumerable:!0,get(){return Jn(this).getElementById(W(this,`list`)||``)}}),Qn.define(`u-datalist`,gr);let Dr=`aria-label`;var Or=class extends o{_items;_label=null;_unresize;_unmutate;static get observedAttributes(){return[Dr]}connectedCallback(){let e=s(()=>kr(this),100);this._label=f(this,Dr),this._items=this.getElementsByTagName(`a`),this._unresize=p(window,`resize`,e),this._unmutate=g(this,kr,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,n){!this._unmutate||!n||(this._label=n,kr(this))}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};let kr=e=>{let t=e._items?.[e._items.length-1],n=t?.parentElement===e?null:t,r=!n?.offsetHeight;l(e,`role`,r?null:`navigation`),l(e,Dr,r?null:e._label);for(let t of e._items||[])l(t,`aria-current`,t===n?`page`:null)};v.define(`ds-breadcrumbs`,Or);var Ar=class extends o{_unmutate;connectedCallback(){p(this,`animationend`,this,r),l(this,`tabindex`,`-1`),this._unmutate=g(this,jr,{childList:!0,subtree:!0}),this.focus()}handleEvent({target:e}){e===this&&this.focus()}disconnectedCallback(){m(this,`animationend`,this,r),this._unmutate?.(),this._unmutate=void 0}};let jr=e=>{let t=e.querySelector(`h2,h3,h4,h5,h6`);t&&l(e,`aria-labelledby`,b(t))};v.define(`ds-error-summary`,Ar);let Mr=`aria-invalid`,Nr=`aria-describedby`,Pr=`data-indeterminate`,Fr=a()?800:200,Ir=new WeakMap,Lr=new Map,Rr=new WeakSet,zr=(e,t=[])=>{for(let{target:e}of t){let t=e instanceof HTMLFieldSetElement;for(let[n]of Lr)(t?e.contains(n):n.contains(e))&&Br(n)}},Br=e=>{let t=[],n=[],r=Lr.get(e)||[],i,a,o=!1,s=!1;for(let r of e.getElementsByTagName(`*`))if(r instanceof HTMLLabelElement&&t.push(r),!r.hidden)if(Gr(r))i?c(`Fields should only have one input element. Use <fieldset> to group multiple fields:`,e):i=r;else{let e=r.getAttribute(`data-field`);e===`counter`&&(a=r),e===`validation`?(n.unshift(b(r)),o=!0,s||=Wr(r)):e&&n.push(b(r))}if(!i)return;a&&Ir.set(i,a);for(let e of t)l(e,`for`,b(i));let u=e.closest(`fieldset`)?.querySelector(`:scope > [data-field="validation"]`);u&&!u?.hidden&&(o=!0,s||=Wr(u),n.unshift(b(u)));let d=l(i,Pr);d&&(i.indeterminate=d===`true`),(i.type===`radio`||i.type===`checkbox`)&&l(e,`data-clickdelegatefor`,b(i));let f=(l(i,Nr)?.trim().split(/\s+/))?.filter(e=>!r.includes(e))||[];l(i,Nr,[...n,...f].join(` `)||null),Lr.set(e,n);let p=Rr.has(i);o&&!p&&!i.hasAttribute(Mr)?(l(i,Mr,`true`),Rr.add(i)):!o&&p&&(l(i,Mr,null),Rr.delete(i)),Hr(i)},Vr={over:`%d tegn for mye`,under:`%d tegn igjen`},Hr=e=>{let t=e.target||e,n=Ir.get(t);if(n?.isConnected){let r=(Number(l(n,`data-limit`))||0)-t.value.length,i=r<0?`over`:`under`,a=(f(n,`data-${i}`)||Vr[i])?.replace(`%d`,`${Math.abs(r)}`);l(n,`data-label`,a),l(n,`data-state`,i),l(n,`data-color`,r<0?`danger`:null),e.type===`input`&&a&&Ur(t,a)}t instanceof HTMLTextAreaElement&&(t.style.setProperty(`--_ds-field-sizing`,`auto`),t.style.setProperty(`--_ds-field-sizing`,`${t.scrollHeight}px`))},Ur=s((e,t)=>{document.activeElement===e&&C(t)},Fr),Wr=e=>e.getAttribute(`data-color`)!==`success`,Gr=e=>e instanceof HTMLElement&&`validity`in e&&!(e instanceof HTMLButtonElement)&&e.type!==`hidden`;var Kr=class extends o{connectedCallback(){Lr.set(this,[]),Br(this)}disconnectedCallback(){Lr.delete(this)}};v.define(`ds-field`,Kr),h(`field`,()=>[p(document,`input`,Hr,r),g(document,zr,{attributeFilter:[`data-field`,`data-limit`,`hidden`,`id`,`value`,Pr],attributes:!0,childList:!0,subtree:!0})]);let qr=`aria-label`,Jr=`data-current`,Yr=`data-total`,Xr=`data-href`,Zr=({current:e=1,total:t=10,show:n=7})=>({prev:e>1?e-1:0,next:e<t?e+1:0,pages:ei(e,t,n).map((t,n)=>({current:t===e&&`page`,key:`key-${t}-${n}`,page:t}))});var Qr=class extends o{_unmutate;_render;static get observedAttributes(){return[qr,Jr,Yr,Xr]}connectedCallback(){let e=l(this,Yr),t=l(this,Jr);t&&!e&&c(`Missing ${Yr} attribute on:`,this),e&&!t&&c(`Missing ${Jr} attribute on:`,this),l(this,qr,f(this,qr)),l(this,`role`,`navigation`),this._unmutate=g(this,$r,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&$r(this)}disconnectedCallback(){this._unmutate?.(),this._unmutate=this._render=void 0}};let $r=e=>{let t=Number(l(e,Jr)),n=Number(l(e,Yr));if(t&&n){let r=e.querySelectorAll(`button,a`),i=r.length-2,a=l(e,Xr),{next:o,prev:s,pages:c}=Zr({current:t,total:n,show:i});r.forEach((e,t)=>{let n=t?r[t+1]?c[t-1]?.page:o:s;l(e,`aria-current`,c[t-1]?.current?`true`:null),l(e,`aria-label`,`${n??`hidden`}`),l(e,`role`,n?null:`none`),l(e,`tabindex`,n?null:`-1`),e instanceof HTMLButtonElement&&l(e,`value`,`${n}`),a&&e instanceof HTMLAnchorElement&&l(e,`href`,a.replace(`%d`,`${n}`))})}},ei=(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};v.define(`ds-pagination`,Qr);var ti=Object.defineProperty,ni=Object.getOwnPropertySymbols,ri=Object.prototype.hasOwnProperty,ii=Object.prototype.propertyIsEnumerable,ai=(e,t,n)=>t in e?ti(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oi=(e,t)=>{for(var n in t||={})ri.call(t,n)&&ai(e,n,t[n]);if(ni)for(var n of ni(t))ii.call(t,n)&&ai(e,n,t[n]);return e},si=typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,ci=si&&/android/i.test(navigator.userAgent),li=si&&/iPad|iPhone|iPod/.test(navigator.userAgent);si&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var ui=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,di=typeof HTMLElement>`u`?class{}:HTMLElement;function K(e,t,n){return n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null)}var fi=(e,t,n)=>{for(let r of n[0].split(`,`))n[0]=r,Element.prototype[`${e}EventListener`].apply(t,n)},pi=(e,...t)=>fi(`add`,e,t),mi=(e,...t)=>fi(`remove`,e,t),hi=new WeakMap,gi=(e,t)=>{if(t===void 0)return hi.get(e);try{hi.get(e).disconnect(),hi.delete(e)}catch{}if(t){let n=new MutationObserver(t=>e.handleEvent({type:`mutation`,detail:t}));n.observe(e,t),hi.set(e,n)}},_i=e=>{var t;let n=e.key===` `||e.key===`Enter`;return n&&((t=e.preventDefault)==null||t.call(e)),n&&e.target instanceof HTMLElement&&e.target.dispatchEvent(new MouseEvent(`click`,e)),n},vi=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},yi=0,bi=e=>e?(e.id||=`:${e.nodeName.toLowerCase()}${(++yi).toString(32)}`,e.id):``,q=(e,t,n)=>{let r=document.createElement(e);if(t&&(r[e===`style`?`textContent`:`innerHTML`]=t),n)for(let[e,t]of Object.entries(n))K(r,e,t);return r},xi={define:(e,t)=>!si||window.customElements.get(e)||window.customElements.define(e,t)},Si=e=>{let t=K(e,`aria-label`)||``;return[...(K(e,`aria-labelledby`)?.trim().split(/\s+/)||[]).map(e=>document.getElementById(e)),...Array.from(e.labels||[])].reduce((e,t)=>e||(t?.innerText)?.trim()||``,t)},J,Ci=0,wi=e=>{J||(J=q(`div`),J.style.cssText=`position:fixed;overflow:hidden;width:1px;white-space:nowrap`,K(J,`aria-live`,`assertive`)),J.isConnected||document.body.append(J),e&&(J.textContent=`${e}${Ci++%2?`\xA0`:``}`)},Ti=(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}))},Ei=!1,Di=e=>(e?.type===`mouseup`&&(Ei=!1),e?.type===`mousedown`&&(Ei=!0,pi(document,`mouseup`,Di,{once:!0})),Ei),Oi=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,ki=`:host(:not([hidden])) { display: block; -webkit-tap-highlight-color: rgba(0, 0, 0, 0) } /* Must be display block in Safari to allow focus inside */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
::slotted(
|
|
11
|
-
::slotted(del) { text-
|
|
12
|
-
::slotted(data:not([hidden])) { display: inline-block; pointer-events: none }
|
|
13
|
-
::slotted(data)::after { content: '\\00D7'; content: '\\00D7' / ''; padding-inline: .5ch; pointer-events: auto; cursor: pointer }
|
|
14
|
-
::slotted(data:focus) { ${ui} }`;Oi(ki);var Ai=`beforeinput,blur,focus,click,input,keydown,mousedown`,ji={once:!0,capture:!0,passive:!0},Mi=`false`,Ni=ci||li,Pi=``.repeat(5),Fi=`deleteContentBackward`,Ii=`insertText`,Li=`\xA0`,Ri={added:`Added`,empty:`No selected`,found:`Navigate left to find %d selected`,invalid:`Invalid value`,items:`Selected`,of:`of`,remove:`Press to remove`,removed:`Removed`},zi=class extends di{constructor(){super(),this._item=``,this._speak=``,this._texts=oi({},Ri),this._value=``,this.shadowRoot||this.attachShadow({mode:`open`}).append(q(`slot`,null,{"aria-orientation":`horizontal`,tabindex:`-1`,role:`listbox`,name:`items`}),q(`slot`),q(`div`,`<div role="option" tabindex="-1"></div>`,{"aria-hidden":`true`,role:`listbox`}),q(`style`,ki))}static get observedAttributes(){return Object.keys(Ri).map(e=>`data-sr-${e}`)}connectedCallback(){this._root=vi(this),pi(this,Ai,this,!0),gi(this,{attributeFilter:[`value`,`id`,`role`],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(Hi,0,this),setTimeout(Gi,0,this)}attributeChangedCallback(e,t,n){let r=e.split(`data-sr-`)[1];Ri[r]&&(this._texts[r]=n||Ri[r])}disconnectedCallback(){gi(this,!1),mi(this,Ai,this,!0),this._items=this._clear=this._focus=this._control=void 0,this._list=this._options=this._root=this._form=void 0}handleEvent(e){let t=e.target;Vi(this)||(e.type===`beforeinput`&&(this._value=t?.value||``),e.type===`blur`&&Ji(this),e.type===`click`&&Xi(this,e),e.type===`focus`&&qi(this,e),e.type===`input`&&Zi(this,e),e.type===`keydown`&&Qi(this,e),e.type===`mousedown`&&Di(e),e.type===`mutation`&&Hi(this,e))}get multiple(){return(K(this,`data-multiple`)??Mi)!==Mi}set multiple(e){K(this,`data-multiple`,e?``:null)}get creatable(){return(K(this,`data-creatable`)??Mi)!==Mi}set creatable(e){K(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(`datalist,[role="listbox"]`)),this._list}get clear(){return this._clear?.isConnected||(this._clear=this.querySelector(`del`)),this._clear}get items(){return this._items||=this.getElementsByTagName(`data`),this._items}get options(){if(!this._options){let e=this.list?.querySelector(`[role="option"],option`)?.nodeName;e&&(this._options=this.getElementsByTagName(e))}return this._options}get values(){return[...this.items].map(({value:e})=>e)}},Y=e=>(e?.textContent)?.trim()||``,Bi=e=>e instanceof HTMLDataElement,Vi=({control:e})=>e?.disabled||e?.readOnly||!1,Hi=(e,t)=>{var n;let{_focus:r,_texts:i,items:a,control:o,list:s,multiple:c}=e;if(!o)return;let l=Si(o),u=l.endsWith(Pi)?K(o,`data-label`):l;K(o,`data-label`,u);let d=`${u}${c?`, ${a.length?i.found.replace(`%d`,`${a.length}`):i.empty}`:``}`,f=[];for(let{addedNodes:e,removedNodes:n}of t?.detail||[]){for(let t of e)Bi(t)&&f.unshift(t);for(let e of n)Bi(e)&&f.push(e)}let p=c?f.length===1:f[0]===r;if(r&&p){let t=K(o,`aria-expanded`),n=K(o,`inputmode`),a=Bi(r)?o:r,s=!f[0].isConnected;e._speak=`${i[s?`removed`:`added`]} ${Y(f[0])}, `,(Ni||r===o)&&wi(e._speak),o!==a&&(Ni&&K(o,`aria-expanded`,null),Ni&&K(o,`inputmode`,`none`),d=Li,o.focus()),setTimeout(()=>{var r;K(o,`aria-expanded`,t),K(o,`inputmode`,s?`none`:n),(r=a?.focus)==null||r.call(a),K(o,`inputmode`,n),e._speak=``,Ni?setTimeout(Hi,100,e):pi(e,`blur`,()=>Hi(e),ji)},100)}let m=0,h=e.querySelector(`select`),g=Vi(e)?``:i.remove,_=e.shadowRoot?.firstElementChild;_&&K(_,`aria-label`,i.items);for(let t of a){let n=h?.options[m++],r=Y(t),o=t.value||r;K(t,`aria-label`,`${e._speak}${r}, ${g}`),K(t,`aria-selected`,`true`),K(t,`role`,`option`),K(t,`slot`,`items`),K(t,`tabindex`,`-1`),K(t,`value`,o),n?Object.assign(n,{textContent:r,value:o}):h?.appendChild(new Option(r,o,!0,!0)),li&&K(t,`title`,`${m} ${i.of} ${a.length}`)}h&&K(h,`multiple`,c?``:null);for(let e of[...h?.options||[]].slice(m))e.remove();!c&&m>1&&console.warn(e,` Multiple <data> found in single mode.`),s&&(K(s,`aria-multiselectable`,`${c}`),K(o,`list`,bi(s)),K(o,`aria-label`,`${e._speak}${d}${Pi}`),s.hasAttribute(`popover`)&&(K(o,`popovertarget`,bi(s)),K(s,`popover`,`manual`)),s._of=i.of);let v=Y(a[0]);v!==e._item&&Gi(e),e._item=v,Ui(e),Wi(e),(n=gi(e))==null||n.takeRecords()},Ui=e=>{e.clear&&K(e.clear,`role`,`button`),e.clear&&(e.clear.hidden=!e.control?.value||Vi(e))},Wi=e=>{let{_speak:t,options:n=[],values:r}=e;for(let e of n){let n=K(e,`value`)??Y(e);K(e,`aria-label`,t?`${t}${Y(e)}`:null),K(e,`selected`,r.includes(n)?``:null)}},Gi=e=>{let{multiple:t,control:n,items:r}=e,i=Y(r[0]);!t&&n&&i!==n.value&&Ti(n,i,i?Ii:Fi)},Ki=(e,t=!0)=>{let{_texts:n,options:r=[],creatable:i,control:a,items:o,multiple:s}=e,c=(a?.value)?.trim()||``,l=c.toLowerCase()||null,u=[...r].find(e=>(K(e,`label`)||Y(e)).trim().toLowerCase()===l),d={bubbles:!0,cancelable:!0,detail:u};if(e.dispatchEvent(new CustomEvent(`comboboxbeforematch`,d))||(u=[...r].find(e=>e.selected)),t)return Wi(e),u?X(e,u,!1):i&&c?X(e,{value:c},!1):(!s&&!c&&o[0]?X(e,o[0]):Gi(e),wi(n.invalid));for(let e of r)e.selected=e===u},X=(e,t,n=!0)=>{var r;let{control:i,items:a,multiple:o}=e,s=q(`data`,t.label||t.value,{value:t.value}),c=[...a].find(e=>e.value===t.value),l={bubbles:!0,cancelable:!0,detail:c||s};if(c&&!n)return Gi(e);if(c===vi(e)?.activeElement&&((r=e.shadowRoot?.querySelector(`[role="option"]`))==null||r.focus()),e.dispatchEvent(new CustomEvent(`comboboxbeforeselect`,l))){if(!o)for(let e of[...a])e.remove();c?c.remove():i?.insertAdjacentElement(`beforebegin`,s),e.dispatchEvent(new CustomEvent(`comboboxafterselect`,l))}},qi=(e,{target:t})=>{let{_form:n,control:r,multiple:i}=e;t instanceof HTMLElement&&(e._focus=t),i&&n===void 0&&r&&t===r&&(e._form=K(r,`form`),K(r,`form`,`#`)),wi()},Ji=e=>Di()||setTimeout(Yi,0,e),Yi=e=>{let{_focus:t,_root:n,_form:r,multiple:i,control:a}=e;!t||e.contains(n?.activeElement)||(i||Ki(e),r&&a&&K(a,`form`,r),e._focus=e._form=void 0)},Xi=(e,t)=>{let{clientX:n,clientY:r,target:i}=t,{clear:a,control:o,items:s}=e;if(a?.contains(i))return o&&Ti(o,``,Fi),o?.focus();for(let t of s){let{top:a,right:o,bottom:s,left:c}=t.getBoundingClientRect();if(t.contains(i))return X(e,t);if(r>=a&&r<=s&&n>=c&&n<=o)return t.focus()}i===e&&o?.focus()},Zi=(e,t)=>{let{options:n=[],control:r,multiple:i}=e,a=(r?.value)?.trim()||``;if(t instanceof InputEvent?!t.inputType||t.inputType===`insertReplacementText`:a){t.stopImmediatePropagation(),r&&(r.value=e._value);for(let t of n)if(t.value&&t.value===a)return X(e,t,i)}else i||Ki(e,!1);Ui(e)},Qi=(e,t)=>{var n;let{clear:r,control:i,items:a}=e,{key:o,repeat:s,target:c}=t,l=i&&i===c,u=l&&i.selectionEnd,d=t.ctrlKey||t.metaKey||t.shiftKey||t.key===`Alt`,f=l?a.length:[...a].indexOf(c);if(l&&o===`Tab`&&!t.shiftKey&&r&&!r.hidden&&(t.preventDefault(),r.tabIndex=0,r.focus(),pi(r,`blur`,()=>K(r,`tabindex`,null),ji)),!(!l&&_i(t)||f===-1||d)){if(o===`ArrowRight`&&!l)f+=1;else if(o===`ArrowLeft`&&!u)--f;else if(o===`Enter`&&l)return Ki(e);else if(o===`Backspace`&&!u){if(t.preventDefault(),!s&&a[f])return X(e,a[f]);l&&--f}else return l||i?.focus();t.preventDefault(),(n=a[Math.max(0,f)]||i)==null||n.focus()}};xi.define(`u-combobox`,zi);var $i=class extends zi{_render;_unmutate;connectedCallback(){super.connectedCallback(),this._unmutate=g(this,ea,{childList:!0}),p(this,`toggle`,ta,r)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=this._render=void 0,m(this,`toggle`,ta,r)}};let ea=({control:e,list:t})=>{e&&!e.placeholder&&l(e,`placeholder`,` `),e&&l(e,`popovertarget`,b(t)||null),t&&l(t,`popover`,`manual`)},ta=e=>{let t=e.currentTarget,n=e.newState===`open`&&t.control;n&&t.list?.dispatchEvent(new CustomEvent(`ds-toggle-source`,{detail:n}))};v.define(`ds-suggestion`,$i);var na=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,ra=na(),ia=ra?navigator.userAgent:``,aa=/android/i.test(ia);ra&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var oa=ra&&window.CSSStyleSheet&&document.adoptedStyleSheets,sa=`:host(:not([hidden])) { display: block }`,ca=`${aa?`data`:`aria`}-labelledby`,la=typeof HTMLElement>`u`?class{}:HTMLElement,Z=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),ua=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>da(e,...t)},da=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},fa=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(ga(`slot`)),!n.querySelector(`style`))if(!oa)n.append(ga(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},pa=(e,t,n)=>{let r=new MutationObserver(n=>{if(!na()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},ma=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},ha=e=>{if(!e||!ra)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},ga=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))Z(r,e,n);return r},_a={define:(e,t)=>!na()||window.customElements.get(e)||window.customElements.define(e,t)},va=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,ya=`aria-controls`,ba=`aria-disabled`,xa=`aria-selected`,Sa=`tabindex`,Ca=sa,wa=sa,Ta=`${sa}
|
|
3
|
+
::slotted([role="option"][${hr}]) { ${Gn} }
|
|
4
|
+
::slotted([role="option"]:is([${gr}="true"], [disabled], [hidden])) { display: none !important }`,vr=or(_r),yr,br=`focus click keydown`,xr=`focusout input pointerdown`,Sr={of:`of`,plural:`%d hits`,singular:`%d hit`},Cr=class extends qn{constructor(){super(),this._texts=Pn({},Sr),Xn(this,_r)}static get observedAttributes(){return[`id`,...Object.keys(Sr).map(e=>`data-sr-${e}`)]}connectedCallback(){this._root=Qn(this),W(this,`hidden`,``),W(this,`role`,`listbox`),W(this,`tabindex`,`-1`),Jn(this._root,br,this,!0),this._umutate=Zn(this,Ir,{attributeFilter:[`disabled`,`hidden`,`label`,`value`],attributes:!0,characterData:!0,childList:!0,subtree:!0})}disconnectedCallback(){var e;this._root&&Yn(this._root,br,this,!0),this._root&&Yn(this._root,xr,this),kr(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(Sr[r])this._texts[r]=n||Sr[r];else if(this.id){let e=`input[list="${this.id}"]`,t=Qn(this).querySelector(e);t&&kr(this,t)}}handleEvent(e){e.defaultPrevented||(e.type===`focus`&&Ar(this,e),e.type===`focusout`&&jr(this,e),e.type===`click`&&Pr(this,e),e.type===`input`&&Ir(this),e.type===`keydown`&&Fr(this,e),e.type===`pointerdown`&&Nr(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`)}},wr=e=>e.disabled||e.readOnly,Tr=e=>e instanceof HTMLInputElement,Er=e=>W(e,gr)!==`true`&&e.clientHeight,Dr=(e,t)=>{e._input&&W(e._input,`aria-expanded`,`${t}`),!(!e.isConnected||e.hidden!==t)&&(t||Or(e),e.popover&&e.togglePopover(t),t&&setTimeout(()=>clearTimeout(yr)),e.hidden=!t)},Or=(e,t)=>{e._input&&W(e._input,`aria-activedescendant`,er(t));for(let n of e.options)W(n,hr,n===t?``:null);t?.scrollIntoView({block:`nearest`})},kr=(e,t)=>{let n=t||e._input;n&&(e.popover&&(W(e,`popover`,`manual`),W(n,`popovertarget`,t&&er(e))),W(n,`aria-autocomplete`,t&&`list`),W(n,`aria-controls`,t&&er(e)),W(n,`autocomplete`,t&&`off`),W(n,`enterkeyhint`,`done`),W(n,`role`,t&&!wr(n)?`combobox`:null))},Ar=(e,{target:t})=>{if(e._input!==t)if(Tr(t)&&t.getAttribute(`list`)===e.id){if(kr(e,null),kr(e,t),wr(t))return;e._root&&Jn(e._root,xr,e),W(e,`aria-label`,(t.labels?.[0])?.textContent.trim()||null),dr(),e._input=t,Rn&&Dr(e,!0)}else Mr(e)},jr=(e,t)=>{ar()?t.stopImmediatePropagation():Rn||setTimeout(Mr,0,e,t)},Mr=e=>{let t=$n(e);e._input===t||e.contains(t)||(e._root&&Yn(e._root,xr,e),Dr(e,!1),e._input=void 0)},Nr=(e,t)=>e.contains(t.target)&&ar(t),Pr=(e,t)=>{var n;if(Tr(t.target)&&Ar(e,t),e._input===t.target)return Dr(e,!0);if(!e.contains(t.target))return Mr(e);for(let r of e.options)if(r.contains(t.target))return(n=e._input)==null||n.focus(),e._input&&rr(e._input,r.value),Dr(e,W(e,Kn)===`true`)},Fr=(e,t)=>{if(Tr(t.target)&&Ar(e,t),e._input!==t.target)return;let{key:n,ctrlKey:r,metaKey:i,shiftKey:a,altKey:o}=t;if(r||i||a||n===`Tab`||o&&!n.startsWith(`Arrow`))return;n===`Escape`&&!e.hidden&&t.preventDefault(),Dr(e,n!==`Escape`);let s=n===`Enter`,c=W(e._input,`aria-activedescendant`),l=[],u=-1,d=-1;for(let t of e.options)Er(t)&&(l.push(t),t.id===c&&(u=l.length-1));!o&&n===`ArrowDown`&&(d=(u+1)%l.length),!o&&n===`ArrowUp`&&(d=(u||l.length)-1),~u&&((n===`Home`||n===`PageUp`)&&(d=0),(n===`End`||n===`PageDown`)&&(d=l.length-1),s&&(d=u)),l[d]&&(t.preventDefault(),e._input.focus()),s&&l[d]?(t.stopImmediatePropagation(),sr(e._input),l[d].click()):Or(e,l[d])},Ir=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)W(e,gr,`true`);for(let e of a)W(e,gr,`false`);clearTimeout(yr),yr=setTimeout(Lr,500,e,a),Bn&&a.forEach((t,n,{length:r})=>{W(t,`title`,`${n+1} ${e._texts.of} ${r}`)}),(t=e._umutate)==null||t.takeRecords()},Lr=(e,t)=>!e.hidden&&e._input===$n(e)&&dr(`${t.some(({value:e})=>e)?`${e._texts[t[1]?`plural`:`singular`]}`.replace(`%d`,`${t.length}`):e.innerText}`);Fn()&&Object.defineProperty(HTMLInputElement.prototype,`list`,{configurable:!0,enumerable:!0,get(){let e=W(this,`list`);return e&&Qn(this).getElementById(e)}}),nr.define(`u-datalist`,Cr);let Rr=`aria-label`;var zr=class extends o{_items;_label=null;_unresize;_unmutate;static get observedAttributes(){return[Rr]}connectedCallback(){let e=s(()=>Br(this),100);this._label=f(this,Rr),this._items=this.getElementsByTagName(`a`),this._unresize=p(window,`resize`,e),this._unmutate=g(this,Br,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,n){!this._unmutate||!n||(this._label=n,Br(this))}disconnectedCallback(){this._unresize?.(),this._unmutate?.(),this._unresize=this._unmutate=this._items=void 0}};let Br=e=>{let t=e._items?.[e._items.length-1],n=t?.parentElement===e?null:t,r=!n?.offsetHeight;l(e,`role`,r?null:`navigation`),l(e,Rr,r?null:e._label);for(let t of e._items||[])l(t,`aria-current`,t===n?`page`:null)};v.define(`ds-breadcrumbs`,zr);var Vr=class extends o{_unmutate;connectedCallback(){p(this,`animationend`,this,r),l(this,`tabindex`,`-1`),this._unmutate=g(this,Hr,{childList:!0,subtree:!0}),this.focus()}handleEvent({target:e}){e===this&&this.focus()}disconnectedCallback(){m(this,`animationend`,this,r),this._unmutate?.(),this._unmutate=void 0}};let Hr=e=>{let t=e.querySelector(`h2,h3,h4,h5,h6`);t&&l(e,`aria-labelledby`,b(t))};v.define(`ds-error-summary`,Vr);let Ur=`aria-invalid`,Wr=`aria-describedby`,Gr=`data-indeterminate`,Kr=a()?800:200,qr=new WeakMap,Jr=new Map,Yr=new WeakSet,Xr=(e,t=[])=>{for(let{target:e}of t){let t=e instanceof HTMLFieldSetElement;for(let[n]of Jr)(t?e.contains(n):n.contains(e))&&Zr(n)}},Zr=e=>{let t=[],n=[],r=Jr.get(e)||[],i,a,o=!1,s=!1;for(let r of e.getElementsByTagName(`*`))if(r instanceof HTMLLabelElement&&t.push(r),!r.hidden)if(ni(r))i?c(`Fields should only have one input element. Use <fieldset> to group multiple fields:`,e):i=r;else{let e=r.getAttribute(`data-field`);e===`counter`&&(a=r),e===`validation`?(n.unshift(b(r)),o=!0,s||=ti(r)):e&&n.push(b(r))}if(!i)return;a&&qr.set(i,a);for(let e of t)l(e,`for`,b(i));let u=e.closest(`fieldset`)?.querySelector(`:scope > [data-field="validation"]`);u&&!u?.hidden&&(o=!0,s||=ti(u),n.unshift(b(u)));let d=l(i,Gr);d&&(i.indeterminate=d===`true`),(i.type===`radio`||i.type===`checkbox`)&&l(e,`data-clickdelegatefor`,b(i));let f=(l(i,Wr)?.trim().split(/\s+/))?.filter(e=>!r.includes(e))||[];l(i,Wr,[...n,...f].join(` `)||null),Jr.set(e,n);let p=Yr.has(i);o&&!p&&!i.hasAttribute(Ur)?(l(i,Ur,`true`),Yr.add(i)):!o&&p&&(l(i,Ur,null),Yr.delete(i)),$r(i)},Qr={over:`%d tegn for mye`,under:`%d tegn igjen`},$r=e=>{let t=e.target||e,n=qr.get(t);if(n?.isConnected){let r=(Number(l(n,`data-limit`))||0)-t.value.length,i=r<0?`over`:`under`,a=(f(n,`data-${i}`)||Qr[i])?.replace(`%d`,`${Math.abs(r)}`);l(n,`data-label`,a),l(n,`data-state`,i),l(n,`data-color`,r<0?`danger`:null),e.type===`input`&&a&&ei(t,a)}t instanceof HTMLTextAreaElement&&(t.style.setProperty(`--_ds-field-sizing`,`auto`),t.style.setProperty(`--_ds-field-sizing`,`${t.scrollHeight}px`))},ei=s((e,t)=>{document.activeElement===e&&C(t)},Kr),ti=e=>e.getAttribute(`data-color`)!==`success`,ni=e=>e instanceof HTMLElement&&`validity`in e&&!(e instanceof HTMLButtonElement)&&e.type!==`hidden`;var ri=class extends o{connectedCallback(){Jr.set(this,[]),Zr(this)}disconnectedCallback(){Jr.delete(this)}};v.define(`ds-field`,ri),h(`field`,()=>[p(document,`input`,$r,r),g(document,Xr,{attributeFilter:[`data-field`,`data-limit`,`hidden`,`id`,`value`,Gr],attributes:!0,childList:!0,subtree:!0})]);let ii=`aria-label`,ai=`data-current`,oi=`data-total`,si=`data-href`,ci=({current:e=1,total:t=10,show:n=7})=>({prev:e>1?e-1:0,next:e<t?e+1:0,pages:di(e,t,n).map((t,n)=>({current:t===e&&`page`,key:`key-${t}-${n}`,page:t}))});var li=class extends o{_unmutate;_render;static get observedAttributes(){return[ii,ai,oi,si]}connectedCallback(){let e=l(this,oi),t=l(this,ai);t&&!e&&c(`Missing ${oi} attribute on:`,this),e&&!t&&c(`Missing ${ai} attribute on:`,this),l(this,ii,f(this,ii)),l(this,`role`,`navigation`),this._unmutate=g(this,ui,{childList:!0,subtree:!0})}attributeChangedCallback(){this._unmutate&&ui(this)}disconnectedCallback(){this._unmutate?.(),this._unmutate=this._render=void 0}};let ui=e=>{let t=Number(l(e,ai)),n=Number(l(e,oi));if(t&&n){let r=e.querySelectorAll(`button,a`),i=r.length-2,a=l(e,si),{next:o,prev:s,pages:c}=ci({current:t,total:n,show:i});r.forEach((e,t)=>{let n=t?r[t+1]?c[t-1]?.page:o:s;l(e,`aria-current`,c[t-1]?.current?`true`:null),l(e,`aria-label`,`${n??`hidden`}`),l(e,`role`,n?null:`none`),l(e,`tabindex`,n?null:`-1`),e instanceof HTMLButtonElement&&l(e,`value`,`${n}`),a&&e instanceof HTMLAnchorElement&&l(e,`href`,a.replace(`%d`,`${n}`))})}},di=(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};v.define(`ds-pagination`,li);var fi=Object.defineProperty,pi=Object.getOwnPropertySymbols,mi=Object.prototype.hasOwnProperty,hi=Object.prototype.propertyIsEnumerable,gi=(e,t,n)=>t in e?fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_i=(e,t)=>{for(var n in t||={})mi.call(t,n)&&gi(e,n,t[n]);if(pi)for(var n of pi(t))hi.call(t,n)&&gi(e,n,t[n]);return e},vi=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,yi=vi(),bi=yi?navigator.userAgent:``,xi=/android/i.test(bi),Si=/firefox/i.test(bi),Ci=/iPad|iPhone|iPod/.test(bi),wi=yi&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform),Ti=yi&&window.CSSStyleSheet&&document.adoptedStyleSheets,Ei={once:!0,capture:!0,passive:!0},Di=`:host(:not([hidden])) { display: block }`,Oi=`outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color`,ki=`${xi?`data`:`aria`}-multiselectable`,Ai=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),ji=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>Mi(e,...t)},Mi=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},Ni=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(zi(`slot`)),!n.querySelector(`style`))if(!Ti)n.append(zi(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},Pi=(e,t,n)=>{let r=new MutationObserver(n=>{if(!vi()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},Fi=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},Ii=e=>Fi(e).activeElement,Li=e=>{let t=K(e,`aria-label`)||``;return[...(K(e,`aria-labelledby`)?.split(` `)||[]).map(e=>document.getElementById(e.trim()||`-`)),...Array.from(e.labels||[])].reduce((e,t)=>e||(t?.innerText)?.trim()||``,t).trim()},Ri=e=>{if(!e||!yi)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},zi=(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},Bi={define:(e,t)=>!vi()||window.customElements.get(e)||window.customElements.define(e,t)},Vi=(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}))},Hi=new WeakSet,Ui=(e,t)=>(t?.type===`pointerdown`&&(Hi.add(e),ji(document,`pointerup`,()=>Hi.delete(e),Ei)),Hi.has(e)),Wi=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,Gi=e=>{let t=K(e,`form`);K(e,`form`,`#`),setTimeout(Ki,0,e,t)},Ki=(e,t)=>K(e,`form`,t),qi=e=>(e?.textContent)?.trim()||``,q,Ji=0,Yi=0,Xi=e=>{clearTimeout(Yi),q||(q=zi(`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}${Ji++%2?`\xA0`:``}`,Yi=setTimeout(Xi,!wi&&Si?2e3:300,``))},Zi=`${Di}
|
|
5
|
+
:is(:host(:not([data-multiple])), :host([data-multiple="false"])) [part="items"] { display: none }
|
|
6
|
+
[role="listbox"] { display: contents }
|
|
7
|
+
::slotted(button[type="reset"]),::slotted(del) { font: inherit; border: 0; padding: 0; background: none; color: inherit; cursor: pointer; text-decoration: none }
|
|
8
|
+
::slotted(data) { cursor: pointer; pointer-events: none }
|
|
9
|
+
::slotted(data)::after { padding-inline: .5ch; pointer-events: auto }
|
|
10
|
+
::slotted(data)::after,::slotted(button[type="reset"]:empty)::before,::slotted(del:empty)::before { content: '\\00D7'; content: '\\00D7' / '' }
|
|
11
|
+
::slotted(data:focus),::slotted(del:focus),::slotted(button[type="reset"]:focus) { ${Oi} }`;Wi(Zi);var J=`aria-label`,Qi=`button[type="reset"],del`,$i=`datalist,[role="listbox"]`,ea=`option,[role="option"]`,ta=`blur focus click input keydown pointerdown`,na=`false`,ra={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`},ia=class extends Ai{constructor(){super(),this._focusMoved=!1,this._itemSingleVale=``,this._speak=``,this._texts=_i({},ra),this._value=``;let e=Ni(this,Zi);this._listbox=e.querySelector(`[role="listbox"]`)||zi(`div`),this._listbox.innerHTML=`<slot name="items"></slot>`,K(this._listbox,`aria-orientation`,`horizontal`),K(this._listbox,`role`,`listbox`),K(this._listbox,`part`,`items`),K(this._listbox,`tabindex`,`-1`),e.prepend(this._listbox)}static get observedAttributes(){return Object.keys(ra).map(e=>`data-sr-${e}`)}connectedCallback(){ji(this,ta,this,!0),this._umutate=Pi(this,ma,{attributeFilter:[`id`,`value`,`role`],attributes:!0,characterData:!0,childList:!0,subtree:!0}),ba(this),va(this)}attributeChangedCallback(e,t,n){let r=e.split(`data-sr-`)[1];ra[r]&&(this._texts[r]=n||ra[r]),r===`clear`&&this.clear&&K(this.clear,J,this._texts.clear)}disconnectedCallback(){var e;Mi(this,ta,this,!0),(e=this._umutate)==null||e.call(this),this._umutate=this._list=this._options=this._match=void 0,this._items=this._clear=this._control=this._select=void 0}handleEvent(e){this.control?.disabled||this.control?.readOnly||(e.type===`blur`&&sa(this),e.type===`click`&&la(this,e),e.type===`focus`&&Xi(),e.type===`input`&&ua(this,e),e.type===`keydown`&&da(this,e),e.type===`pointerdown`&&Ui(this,e))}get multiple(){return(K(this,`data-multiple`)??na)!==na}set multiple(e){K(this,`data-multiple`,e?``:null)}get creatable(){return(K(this,`data-creatable`)??na)!==na}set creatable(e){K(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($i),this._options=void 0),this._list}get clear(){return this._clear?.isConnected||(this._clear=this.querySelector(Qi)),this._clear}get items(){return this._items||=this.getElementsByTagName(`data`),this._items}get options(){let e=!this._options&&this.list?.querySelector(ea)?.nodeName;return e&&(this._options=this.list?.getElementsByTagName(e)),this._options||this.getElementsByTagName(`-`)}get values(){return Array.from(this.items,({value:e})=>e)}},aa=e=>{let{creatable:t,control:n,options:r,multiple:i}=e,a=(n?.value)?.trim()||``,o=a.toLowerCase()||null,s=[...r].find(e=>e.label.trim().toLowerCase()===o),c={bubbles:!0,cancelable:!0,detail:s};if(e.dispatchEvent(new CustomEvent(`comboboxbeforematch`,c))||(s=[...r].find(e=>e.selected)),i)ya(e);else for(let e of r)e.selected=e===s;return!s&&t&&a?{value:a,label:a}:s&&{value:s.value,label:s.label}},oa=(e,t,n=!0)=>{let{_texts:r,control:i,items:a,multiple:o}=e;if(!t)return o?Xi(r.invalid):!i?.value&&a[0]?oa(e,a[0]):ba(e);let s=[...a].findIndex(e=>e.value===t.value),c=a[s],l=c===Ii(e)&&(o&&(a[s-1]||a[s+1])||i);if(c&&!n)return ba(e);l&&l.focus(),e._focusMoved=!!l;let u=zi(`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))}},sa=e=>Ui(e)||setTimeout(ca,0,e),ca=e=>e.multiple||e.contains(Ii(e))||oa(e,e._match,!1),la=(e,t)=>{let{clientX:n,clientY:r,target:i}=t,{clear:a,control:o,items:s}=e;if(o&&a?.contains(i))return t.preventDefault(),Vi(o,``,`deleteContentBackward`),o.focus();for(let t of s){if(t.contains(i))return oa(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()},ua=(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=>e.value===o);if(r&&(r.value=e._value),s)return oa(e,s,a)}else a||(e._match=aa(e));va(e)},da=(e,t)=>{t.ctrlKey||t.metaKey||t.shiftKey||t.key===`Alt`||(e.control===t.target?fa(e,t):pa(e,t))},fa=(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.key===`Enter`&&a&&(Gi(a),oa(e,s?aa(e):r,s)),t.key===`Tab`&&!t.shiftKey&&i&&!i.hidden&&(t.preventDefault(),K(i,`aria-hidden`,`false`),K(i,`tabindex`,`0`),i.focus(),ji(i,`blur`,()=>va(e),Ei))},pa=(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===`ArrowLeft`)return a[l-1]?.focus();if(o===`ArrowRight`)return(a[l+1]||i)?.focus();if(o===`Backspace`)return t.preventDefault(),s||oa(e,a[l]);i?.focus()}},ma=(e,t)=>{var n;if(!e.control)return;let{_texts:r,control:i,items:a,list:o,multiple:s}=e,c=[];for(let{addedNodes:e,removedNodes:n}of t||[]){for(let t of e)t instanceof HTMLDataElement&&c.unshift(t);for(let e of n)e instanceof HTMLDataElement&&c.push(e)}let l=Ii(e);if((s?c.length===1:c[0]===l)&&e.contains(l)){let t=i?K(i,J):null;e._speak=`${r[c[0].isConnected?`added`:`removed`]} ${qi(c[0])}, `,K(i,J,`${e._speak}${Li(i)}`),e._focusMoved||setTimeout(()=>Xi(e._speak.slice(0,-2))),setTimeout(ha,300,e,t)}if(!s){let t=qi(a[0]);t!==e._itemSingleVale&&ba(e),e._itemSingleVale=t}ga(e),ya(e),_a(e);let u=`${a.length?r.found.replace(`%d`,`${a.length}`):r.empty}`;K(i,`aria-description`,s?u:null),K(i,`list`,Ri(o)),K(e._listbox,J,r.items),(n=e._umutate)==null||n.takeRecords()},ha=(e,t)=>{e._speak=``,e.control&&K(e.control,J,t),ga(e)},ga=e=>{let{_texts:t,_speak:n,items:r}=e,i=0;for(let e of r)K(e,J,`${n}${qi(e)}, ${t.remove}${Ci?`, ${++i} ${t.of} ${r.length}`:``}`),K(e,`role`,`option`),K(e,`slot`,`items`),K(e,`tabindex`,`-1`),K(e,`value`,e.value||qi(e))},_a=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;K(n,`multiple`,i?``:null);for(let e of r){let t=n?.options[o++],r=qi(e),i=e?.value;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()},va=e=>{if(!e.clear)return;let{clear:t,control:n}=e,r=!n?.value||n?.disabled||n?.readOnly;t.nodeName===`DEL`&&K(t,`role`,`button`),K(t,J)||K(t,J,e._texts.clear),K(t,`aria-hidden`,`${Ci||xi}`),K(t,`hidden`,r?``:null),K(t,`tabindex`,`-1`)},ya=e=>{if(!e.list)return;let{_texts:t,list:n,multiple:r,options:i,values:a}=e;K(n,`data-sr-of`,t.of),K(n,ki,`${r}`);for(let e of i)e.selected=a.includes(e.value)},ba=e=>{if(!e.control||e.multiple)return;let{control:t,items:n}=e,r=qi(n[0]),i=r?`insertText`:`deleteContentBackward`;r!==t.value&&Vi(t,r,i)};Bi.define(`u-combobox`,ia);var xa=class extends ia{_unmutate;connectedCallback(){super.connectedCallback(),this._unmutate=g(this,Sa,{childList:!0}),p(this,`toggle`,Ca,r)}disconnectedCallback(){super.disconnectedCallback(),this._unmutate?.(),this._unmutate=void 0,m(this,`toggle`,Ca,r)}};let Sa=({control:e,list:t})=>{e&&!e.placeholder&&l(e,`placeholder`,` `),e&&l(e,`popovertarget`,b(t)||null),t&&l(t,`popover`,`manual`),t&&l(t,`data-is-floating`,`true`)},Ca=e=>{let t=e.currentTarget,n=e.newState===`open`&&t.control;n&&t.list?.dispatchEvent(new CustomEvent(`ds-toggle-source`,{detail:n}))};v.define(`ds-suggestion`,xa);var wa=()=>typeof window<`u`&&window.document!==void 0&&window.navigator!==void 0,Ta=wa(),Ea=Ta?navigator.userAgent:``,Da=/android/i.test(Ea);Ta&&/^Mac/i.test(navigator.userAgentData?.platform||navigator.platform);var Oa=Ta&&window.CSSStyleSheet&&document.adoptedStyleSheets,ka=`:host(:not([hidden])) { display: block }`,Aa=`${Da?`data`:`aria`}-labelledby`,ja=typeof HTMLElement>`u`?class{}:HTMLElement,Y=(e,t,n)=>n===void 0?e.getAttribute(t):(n===null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),Ma=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.addEventListener(t,...r);return()=>Na(e,...t)},Na=(e,...t)=>{let[n,...r]=t;for(let t of n.split(` `))e.removeEventListener(t,...r)},Pa=(e,t)=>{let n=e.shadowRoot||e.attachShadow({mode:`open`});if(n.querySelector(`slot`)||n.append(Ra(`slot`)),!n.querySelector(`style`))if(!Oa)n.append(Ra(`style`,null,t));else{let e=new CSSStyleSheet;e.replaceSync(t),n.adoptedStyleSheets=[e]}return n},Fa=(e,t,n)=>{let r=new MutationObserver(n=>{if(!wa()||!e.isConnected)return i();t(e,n)}),i=Object.assign(()=>r.disconnect(),{takeRecords:()=>r.takeRecords()});return t(e),r.observe(e,n),i},Ia=e=>{let t=e.getRootNode?.call(e)||e.ownerDocument;return t instanceof Document||t instanceof ShadowRoot?t:document},La=e=>{if(!e||!Ta)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},Ra=(e,t,n)=>{let r=document.createElement(e);if(n&&(r.textContent=n),t)for(let[e,n]of Object.entries(t))Y(r,e,n);return r},za={define:(e,t)=>!wa()||window.customElements.get(e)||window.customElements.define(e,t)},Ba=(e,t=`<slot></slot>`)=>`<template shadowrootmode="open">${t}<style>${e}</style></template>`,X=`aria-controls`,Va=`aria-disabled`,Ha=`aria-selected`,Ua=`tabindex`,Wa=ka,Ga=ka,Ka=`${ka}
|
|
15
12
|
::slotted([role="tab"]:not([hidden])) { display: inline-block; cursor: pointer }
|
|
16
|
-
::slotted([role="tab"][${
|
|
13
|
+
::slotted([role="tab"][${Va}="true"]) { cursor: default }`;Ba(Wa),Ba(Ka),Ba(Ga);var qa=class extends ja{constructor(){super(),Pa(this,Wa)}get tabList(){return this.querySelector(`[role="tablist"]:not(:scope [role="tabpanel"] [role="tablist"])`)}get selectedIndex(){let e=Z(this.tabList);return e.indexOf(ro(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"])`)}},Ja=class extends ja{constructor(){super(),Pa(this,Ka)}connectedCallback(){Y(this,`role`,`tablist`),Ma(this,`click keydown`,this),this._umutate=Fa(this,Za,{attributeFilter:[`id`,`role`,X,Ha],attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){var e;Na(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=Z(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`&&!no(c[l])){let e=ro(c);return e&&Y(e,Ua,`-1`),e&&setTimeout(()=>Y(e,Ua,`0`))}else return;(n=e.preventDefault)==null||n.call(e),(i=(r=c[d]).focus)==null||i.call(r)}}get tabsElement(){return Q(this)}get tabs(){return this.querySelectorAll(`:scope > [role="tab"]`)}get selectedIndex(){let e=Z(this);return e.indexOf(ro(e))}set selectedIndex(e){$(this.tabs[e])}},Ya=class extends ja{static get observedAttributes(){return[`id`,Ha,X]}connectedCallback(){Y(this,`role`,`tab`),Y(this,Ha,`${this.selected}`),Y(this,Ua,this.selected?`0`:`-1`),ro(this.parentElement?.children)||$(this)}attributeChangedCallback(){!$a.has(this.parentElement)&&this.selected&&$(this)}get tabsElement(){return Q(this)}get tabList(){let e=this.parentElement;return e instanceof Ja?e:null}get selected(){return no(this)}set selected(e){e&&$(this)}get index(){return Math.max(Z(this.parentElement).indexOf(this),0)}get panel(){let e=Q(this)?.panels,t=Z(this.parentElement).indexOf(this);return io(this,e?.[t])}},Xa=class extends ja{constructor(){super(),Pa(this,Ga)}connectedCallback(){Y(this,`role`,`tabpanel`);let e=new Set(this.tabs),t=Q(this),n=t?.tabs[Array.prototype.indexOf.call(t?.panels,this)];n&&!n.hasAttribute(X)&&e.add(n);let r=ro(e)||e.values().next().value;eo(r,()=>Qa(this,r,!!r&&no(r)))}get tabsElement(){return Q(this)}get tabs(){return Ia(this).querySelectorAll(`[${X}="${La(this)}"]`)}},Za=(e,t=[])=>{let n,r=Z(e);for(let{target:e}of t)e instanceof Element&&Y(e,`role`)===`tab`&&no(e)&&(n=e);!n&&!ro(r)&&(n=r.find(to)),$(n)},Qa=(e,t,n=!1)=>{Y(e,`aria-hidden`,`${!n}`),Y(e,`hidden`,n?null:``),Y(e,Ua,n?`0`:null),t&&Y(t,X,La(e)),t&&n&&no(t)&&Y(e,Aa,La(t))},$a=new Set,eo=(e,t)=>{var n;let r=e?.parentElement;r&&$a.add(r),t(),r&&$a.delete(r),(n=r?._umutate)==null||n.takeRecords()},to=e=>Y(e,Va)!==`true`,no=e=>Y(e,Ha)===`true`,ro=(e=[])=>{for(let t of e)if(no(t))return t},Z=e=>{let t=[];for(let n of e?.children||[])n.getAttribute(`role`)===`tab`&&t.push(n);return t},io=(e,t=null)=>{let n=Y(e,X);return n?Ia(e).getElementById(n):t},Q=e=>{for(let t=e;t;t=t.parentNode||t.host)if(t instanceof qa)return t;return null},$=e=>e&&to(e)&&eo(e,()=>{let t=Z(e.parentElement),n=Q(e)?.panels||[],r=io(e,n?.[t.indexOf(e)]),i=0;for(let a of t){let t=io(a,n[i++]);Y(a,Ha,`${a===e}`),Y(a,Ua,a===e?`0`:`-1`),t&&Qa(t,a,t===r)}});za.define(`u-tabs`,qa),za.define(`u-tablist`,Ja),za.define(`u-tab`,Ya),za.define(`u-tabpanel`,Xa);var ao=class extends qa{},oo=class extends Ja{},so=class extends Ya{},co=class extends Xa{};v.define(`ds-tabs`,ao),v.define(`ds-tablist`,oo),v.define(`ds-tab`,so),v.define(`ds-tabpanel`,co),i()&&!t()&&n(),e.DSBreadcrumbsElement=zr,e.DSErrorSummaryElement=Vr,e.DSFieldElement=ri,e.DSPaginationElement=li,e.DSSuggestionElement=xa,e.DSTabElement=so,e.DSTabListElement=oo,e.DSTabPanelElement=co,e.DSTabsElement=ao,e.UHTMLDataListElement=Cr,e.UHTMLDataListShadowRoot=vr,e.UHTMLDataListStyle=_r,e.pagination=ci,e.setTooltipElement=wn});
|
|
17
14
|
//# sourceMappingURL=index.js.map
|