@mndw/cli 0.1.6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/meta.json +80 -24
  2. package/dist/mndw.js +382 -69
  3. package/host-dev/assets/index-BqQCCILo.css +1 -0
  4. package/host-dev/assets/index-DFVRx7na.js +94 -0
  5. package/host-dev/assets/sandbox-url-D8HO7UBF.js +1 -0
  6. package/host-dev/index.html +3 -3
  7. package/host-dev/shared/{mndw-ui@0.1.6.js → mndw-ui@0.2.0.js} +171 -156
  8. package/package.json +18 -14
  9. package/templates/angular/i18n/en.json +4 -9
  10. package/templates/angular/i18n/ru.json +4 -9
  11. package/templates/angular/src/app.component.ts +39 -39
  12. package/templates/angular/src/index.ts +14 -1
  13. package/templates/angular/src/l10n.test.ts +50 -17
  14. package/templates/go/i18n/en.json +1 -1
  15. package/templates/go/i18n/ru.json +1 -1
  16. package/templates/go/src/index.css +4 -20
  17. package/templates/go/src/index.test.ts +12 -24
  18. package/templates/go/src/index.ts +18 -15
  19. package/templates/go/src/l10n.test.ts +37 -23
  20. package/templates/svelte/i18n/en.json +4 -9
  21. package/templates/svelte/i18n/ru.json +4 -9
  22. package/templates/svelte/src/App.svelte +46 -72
  23. package/templates/svelte/src/index.ts +7 -0
  24. package/templates/svelte/src/l10n.test.ts +64 -17
  25. package/templates/svelte/svelte.config.js +7 -0
  26. package/templates/svelte/vitest.config.ts +2 -1
  27. package/templates/vanilla/i18n/en.json +4 -3
  28. package/templates/vanilla/i18n/ru.json +4 -3
  29. package/templates/vanilla/src/index.css +4 -20
  30. package/templates/vanilla/src/index.ts +47 -17
  31. package/templates/vanilla/src/l10n.test.ts +50 -17
  32. package/templates/vue/i18n/en.json +4 -9
  33. package/templates/vue/i18n/ru.json +4 -9
  34. package/templates/vue/src/App.vue +36 -54
  35. package/templates/vue/src/index.ts +7 -0
  36. package/templates/vue/src/l10n.test.ts +50 -17
  37. package/host-dev/assets/index-B_LYyF1e.css +0 -1
  38. package/host-dev/assets/index-MuieOssk.js +0 -94
  39. package/host-dev/assets/sandbox-url-CsfwrS11.js +0 -1
  40. package/templates/angular/src/table.test.ts +0 -59
  41. package/templates/svelte/src/TableNameCell.svelte +0 -10
  42. package/templates/svelte/src/table.test.ts +0 -53
  43. package/templates/vue/src/TableNameCell.vue +0 -12
  44. package/templates/vue/src/table.test.ts +0 -53
@@ -1,6 +1,6 @@
1
- var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,cr=Symbol(),ui=new WeakMap,Ne=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==cr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(xt&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=ui.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&ui.set(t,e))}return e}toString(){return this.cssText}},hi=i=>new Ne(typeof i=="string"?i:i+"",void 0,cr),v=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,o)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1],i[0]);return new Ne(t,i,cr)},pi=(i,e)=>{if(xt)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=St.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},ur=xt?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return hi(t)})(i):i;var{is:to,defineProperty:ro,getOwnPropertyDescriptor:io,getOwnPropertyNames:no,getOwnPropertySymbols:oo,getPrototypeOf:ao}=Object,Ct=globalThis,mi=Ct.trustedTypes,so=mi?mi.emptyScript:"",lo=Ct.reactiveElementPolyfillSupport,Oe=(i,e)=>i,hr={toAttribute(i,e){switch(e){case Boolean:i=i?so:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},fi=(i,e)=>!to(i,e),bi={attribute:!0,type:String,converter:hr,reflect:!1,useDefault:!1,hasChanged:fi};Symbol.metadata??=Symbol("metadata"),Ct.litPropertyMetadata??=new WeakMap;var H=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=bi){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&ro(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:o}=io(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:n,set(a){let s=n?.call(this);o?.call(this,a),this.requestUpdate(e,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??bi}static _$Ei(){if(this.hasOwnProperty(Oe("elementProperties")))return;let e=ao(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Oe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Oe("properties"))){let t=this.properties,r=[...no(t),...oo(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(ur(n))}else e!==void 0&&t.push(ur(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return pi(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:hr).toAttribute(t,r.type);this._$Em=e,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,t){let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let o=r.getPropertyOptions(n),a=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:hr;this._$Em=n;let s=a.fromAttribute(t,o.type);this[n]=s??this._$Ej?.get(n)??s,this._$Em=null}}requestUpdate(e,t,r,n=!1,o){if(e!==void 0){let a=this.constructor;if(n===!1&&(o=this[e]),r??=a.getPropertyOptions(e),!((r.hasChanged??fi)(o,t)||r.useDefault&&r.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:o},a){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),o!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[n,o]of r){let{wrapped:a}=o,s=this[n];a!==!0||this._$AL.has(n)||s===void 0||this.C(n,void 0,o,s)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};H.elementStyles=[],H.shadowRootOptions={mode:"open"},H[Oe("elementProperties")]=new Map,H[Oe("finalized")]=new Map,lo?.({ReactiveElement:H}),(Ct.reactiveElementVersions??=[]).push("2.1.2");var mr=globalThis,vi=i=>i,Mt=mr.trustedTypes,gi=Mt?Mt.createPolicy("lit-html",{createHTML:i=>i}):void 0,br="$lit$",j=`lit$${Math.random().toFixed(9).slice(2)}$`,fr="?"+j,co=`<${fr}>`,se=document,Ie=()=>se.createComment(""),Fe=i=>i===null||typeof i!="object"&&typeof i!="function",vr=Array.isArray,Mi=i=>vr(i)||typeof i?.[Symbol.iterator]=="function",pr=`[
2
- \f\r]`,$e=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,wi=/-->/g,yi=/>/g,oe=RegExp(`>|${pr}(?:([^\\s"'>=/]+)(${pr}*=${pr}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Si=/'/g,xi=/"/g,Ei=/^(?:script|style|textarea|title)$/i,gr=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),u=gr(1),ce=gr(2),Fa=gr(3),Y=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Ci=new WeakMap,ae=se.createTreeWalker(se,129);function Ti(i,e){if(!vr(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return gi!==void 0?gi.createHTML(e):e}var Ri=(i,e)=>{let t=i.length-1,r=[],n,o=e===2?"<svg>":e===3?"<math>":"",a=$e;for(let s=0;s<t;s++){let l=i[s],c,d,h=-1,p=0;for(;p<l.length&&(a.lastIndex=p,d=a.exec(l),d!==null);)p=a.lastIndex,a===$e?d[1]==="!--"?a=wi:d[1]!==void 0?a=yi:d[2]!==void 0?(Ei.test(d[2])&&(n=RegExp("</"+d[2],"g")),a=oe):d[3]!==void 0&&(a=oe):a===oe?d[0]===">"?(a=n??$e,h=-1):d[1]===void 0?h=-2:(h=a.lastIndex-d[2].length,c=d[1],a=d[3]===void 0?oe:d[3]==='"'?xi:Si):a===xi||a===Si?a=oe:a===wi||a===yi?a=$e:(a=oe,n=void 0);let f=a===oe&&i[s+1].startsWith("/>")?" ":"";o+=a===$e?l+co:h>=0?(r.push(c),l.slice(0,h)+br+l.slice(h)+j+f):l+j+(h===-2?s:f)}return[Ti(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},He=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,a=0,s=e.length-1,l=this.parts,[c,d]=Ri(e,t);if(this.el=i.createElement(c,r),ae.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=ae.nextNode())!==null&&l.length<s;){if(n.nodeType===1){if(n.hasAttributes())for(let h of n.getAttributeNames())if(h.endsWith(br)){let p=d[a++],f=n.getAttribute(h).split(j),m=/([.?@])?(.*)/.exec(p);l.push({type:1,index:o,name:m[2],strings:f,ctor:m[1]==="."?Tt:m[1]==="?"?Rt:m[1]==="@"?At:de}),n.removeAttribute(h)}else h.startsWith(j)&&(l.push({type:6,index:o}),n.removeAttribute(h));if(Ei.test(n.tagName)){let h=n.textContent.split(j),p=h.length-1;if(p>0){n.textContent=Mt?Mt.emptyScript:"";for(let f=0;f<p;f++)n.append(h[f],Ie()),ae.nextNode(),l.push({type:2,index:++o});n.append(h[p],Ie())}}}else if(n.nodeType===8)if(n.data===fr)l.push({type:2,index:o});else{let h=-1;for(;(h=n.data.indexOf(j,h+1))!==-1;)l.push({type:7,index:o}),h+=j.length-1}o++}}static createElement(e,t){let r=se.createElement("template");return r.innerHTML=e,r}};function le(i,e,t=i,r){if(e===Y)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl,o=Fe(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=le(i,n._$AS(i,e.values),n,r)),e}var Et=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,n=(e?.creationScope??se).importNode(t,!0);ae.currentNode=n;let o=ae.nextNode(),a=0,s=0,l=r[0];for(;l!==void 0;){if(a===l.index){let c;l.type===2?c=new ge(o,o.nextSibling,this,e):l.type===1?c=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(c=new Lt(o,this,e)),this._$AV.push(c),l=r[++s]}a!==l?.index&&(o=ae.nextNode(),a++)}return ae.currentNode=se,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},ge=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=le(this,e,t),Fe(e)?e===b||e==null||e===""?(this._$AH!==b&&this._$AR(),this._$AH=b):e!==this._$AH&&e!==Y&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Mi(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==b&&Fe(this._$AH)?this._$AA.nextSibling.data=e:this.T(se.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=He.createElement(Ti(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{let o=new Et(n,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Ci.get(e.strings);return t===void 0&&Ci.set(e.strings,t=new He(e)),t}k(e){vr(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let o of e)n===t.length?t.push(r=new i(this.O(Ie()),this.O(Ie()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=vi(e).nextSibling;vi(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},de=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=b,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=b}_$AI(e,t=this,r,n){let o=this.strings,a=!1;if(o===void 0)e=le(this,e,t,0),a=!Fe(e)||e!==this._$AH&&e!==Y,a&&(this._$AH=e);else{let s=e,l,c;for(e=o[0],l=0;l<o.length-1;l++)c=le(this,s[r+l],t,l),c===Y&&(c=this._$AH[l]),a||=!Fe(c)||c!==this._$AH[l],c===b?e=b:e!==b&&(e+=(c??"")+o[l+1]),this._$AH[l]=c}a&&!n&&this.j(e)}j(e){e===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Tt=class extends de{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===b?void 0:e}},Rt=class extends de{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==b)}},At=class extends de{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=le(this,e,t,0)??b)===Y)return;let r=this._$AH,n=e===b&&r!==b||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==b&&(r===b||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Lt=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){le(this,e)}},Ai={M:br,P:j,A:fr,C:1,L:Ri,R:Et,D:Mi,V:le,I:ge,H:de,N:Rt,U:At,B:Tt,F:Lt},uo=mr.litHtmlPolyfillSupport;uo?.(He,ge),(mr.litHtmlVersions??=[]).push("3.3.3");var Li=(i,e,t)=>{let r=t?.renderBefore??e,n=r._$litPart$;if(n===void 0){let o=t?.renderBefore??null;r._$litPart$=n=new ge(e.insertBefore(Ie(),o),o,void 0,t??{})}return n._$AI(i),n};var wr=globalThis,g=class extends H{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Li(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Y}};g._$litElement$=!0,g.finalized=!0,wr.litElementHydrateSupport?.({LitElement:g});var ho=wr.litElementPolyfillSupport;ho?.({LitElement:g});(wr.litElementVersions??=[]).push("4.2.2");import*as V from"d3";var ki={select:{placeholder:"Select\u2026",validation:{required:"Please select an option."},overlay:{title:"Select option"}},overlay:{close:"Close"},chart:{empty:"No data available",values:"Values"},input:{password:{show:"Show password",hide:"Hide password"}},checkbox:{validation:{required:"Please select this option."}},segmented:{validation:{required:"Please select an option."}},table:{selectRow:"Select {rowName}",selectAll:"Select all",sortBy:"Sort by {column}",columnMenu:"Column menu",rowFallback:"Row {index}",reordered:"{rowName} moved to position {pos} of {total}",invalidData:"Table data is invalid"}};var _i={select:{placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435\u2026",validation:{required:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442."},overlay:{title:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442"}},overlay:{close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C"},chart:{empty:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445",values:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u044F"},input:{password:{show:"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C",hide:"\u0421\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C"}},checkbox:{validation:{required:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u044D\u0442\u043E\u0442 \u0432\u0430\u0440\u0438\u0430\u043D\u0442."}},segmented:{validation:{required:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442."}},table:{selectRow:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C {rowName}",selectAll:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435",sortBy:"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E {column}",columnMenu:"\u041C\u0435\u043D\u044E \u0441\u0442\u043E\u043B\u0431\u0446\u043E\u0432",rowFallback:"\u0421\u0442\u0440\u043E\u043A\u0430 {index}",reordered:"{rowName} \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0430 \u043D\u0430 \u043F\u043E\u0437\u0438\u0446\u0438\u044E {pos} \u0438\u0437 {total}",invalidData:"\u0414\u0430\u043D\u043D\u044B\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B \u043D\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u044C\u043D\u044B"}};var kt={en:ki,ru:_i},_t="en",yr=new Set;function bo(i){try{if(typeof Intl.getCanonicalLocales=="function")return Intl.getCanonicalLocales(i)[0]??"en";if(typeof Intl.Locale=="function")return new Intl.Locale(i).toString()}catch{}return"en"}function fo(i){let e=i==="en-XA"?"en":bo(i);if(kt[e]!==void 0)return e;let t=e.split("-")[0];return kt[t]!==void 0?t:"en"}function Sr(i){let e=fo(i);if(e!==_t){_t=e;for(let t of yr)t()}}function xr(){return _t}function y(i){return Pi(kt[_t],i)??Pi(kt.en,i)??i}function Pi(i,e){let t=i;for(let r of e.split(".")){if(typeof t!="object"||t===void 0)return;t=t[r]}return typeof t=="string"?t:void 0}function Cr(i){return yr.add(i),()=>{yr.delete(i)}}var Di=5e3,vo=i=>{if(i===0)return"0 b/s";let e=Math.abs(i),t=["b/s","Kb/s","Mb/s","Gb/s"],r=0,n=e;for(;n>=1e3&&r<t.length-1;)n/=1e3,r+=1;return`${r===0?n:n.toFixed(1)} ${t[r]}`},go=i=>{if(!Number.isFinite(i)||i<=0)return Di;let e=String(Math.floor(i)).length-1,t=Math.pow(10,e),r=Math.ceil(i/t)*t;return Math.max(r,Di)},we=i=>new Intl.NumberFormat(xr()).format(i),Pt=i=>{if(!Number.isFinite(i)||i<=0)return 1;let e=Math.pow(10,Math.floor(Math.log10(i))),t=i/e,n=([1,1.5,2,2.5,5,10].find(o=>o>=t)??10)*e;return Number.isFinite(n)?n:i},Q=i=>{let e=new Date(i),t=r=>String(r).padStart(2,"0");return`${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}`},Dt=i=>`${Math.round(i)}%`,Nt=i=>Number.isFinite(i)&&i>0?i:100,wo=["accent","success","warning","muted"],Ot=i=>wo.includes(i)?i:"accent",Ve=i=>i.flatMap(e=>!Number.isFinite(e.value)||e.time!==void 0&&!Number.isFinite(e.time)?[]:e.time===void 0?[{value:e.value}]:[{time:e.time,value:e.value}]),U=i=>i.filter(e=>Number.isFinite(e.time)&&Number.isFinite(e.value)),Ni=i=>{let e=[],t=[];for(let r of i){if(!Number.isFinite(r.time)||!Number.isFinite(r.value)){t.length>0&&(e.push(t),t=[]);continue}t.push(r)}return t.length>0&&e.push(t),e},Oi=(i,e)=>{if(e!==void 0&&Number.isFinite(e.start)&&Number.isFinite(e.end)&&e.start<e.end)return{start:e.start,end:e.end};let t=U(i);return t.length===0?null:{start:Math.min(...t.map(r=>r.time)),end:Math.max(...t.map(r=>r.time))}},ye=(i,e,t)=>{let r=Ve(i);if(r.length===0)return null;let o=r.every(l=>l.time!==void 0)?r.reduce((l,c)=>l.time===void 0||c.time===void 0?l:c.time>l.time?c:l):r[r.length-1],a=Math.min(...r.map(l=>l.value)),s=Math.max(...r.map(l=>l.value));return o===void 0?null:`${e}: latest ${t(o.value)}; range ${t(a)} to ${t(s)}`},$i=(i,e,t=we,r)=>{let n=i.map(a=>ye(a.data,a.label??a.id,t)).filter(a=>a!==null);return n.length===0?e:`${r===void 0?"Chart. ":`Chart. ${r}: `}${n.join("; ")}`},Ii=(i,e,t,r=we)=>ye(i,e,r)??t;var Se=class{constructor(e,t){this.host=e;this.onResize=t;e.addController(this)}plotElement=null;disposePlot=null;resizeObserver=null;observedContainer=null;hostConnected(){this.host.setAttribute("role","img"),this.host.requestUpdate()}hostDisconnected(){this.disconnectPlot(),this.resizeObserver!==null&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.observedContainer=null}setPlot(e,t){this.disconnectPlot(),this.plotElement=e,this.disposePlot=t}observeContainer(e){typeof ResizeObserver>"u"||(this.resizeObserver===null&&(this.resizeObserver=new ResizeObserver(t=>{let r=t[0];this.onResize(r===void 0?void 0:{width:r.contentRect.width,height:r.contentRect.height})})),this.observedContainer!==e&&(this.observedContainer!==null&&this.resizeObserver.unobserve(this.observedContainer),this.resizeObserver.observe(e),this.observedContainer=e))}disconnectPlot(){this.disposePlot!==null&&(this.disposePlot(),this.disposePlot=null),this.plotElement=null}};var $t=v`
1
+ var xt=globalThis,Ct=xt.ShadowRoot&&(xt.ShadyCSS===void 0||xt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,cr=Symbol(),hi=new WeakMap,Ne=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==cr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Ct&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=hi.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&hi.set(t,e))}return e}toString(){return this.cssText}},pi=i=>new Ne(typeof i=="string"?i:i+"",void 0,cr),v=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,o)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1],i[0]);return new Ne(t,i,cr)},mi=(i,e)=>{if(Ct)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=xt.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},ur=Ct?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return pi(t)})(i):i;var{is:no,defineProperty:oo,getOwnPropertyDescriptor:ao,getOwnPropertyNames:so,getOwnPropertySymbols:lo,getPrototypeOf:co}=Object,Mt=globalThis,bi=Mt.trustedTypes,uo=bi?bi.emptyScript:"",ho=Mt.reactiveElementPolyfillSupport,$e=(i,e)=>i,hr={toAttribute(i,e){switch(e){case Boolean:i=i?uo:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},vi=(i,e)=>!no(i,e),fi={attribute:!0,type:String,converter:hr,reflect:!1,useDefault:!1,hasChanged:vi};Symbol.metadata??=Symbol("metadata"),Mt.litPropertyMetadata??=new WeakMap;var H=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=fi){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&oo(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:o}=ao(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:n,set(a){let s=n?.call(this);o?.call(this,a),this.requestUpdate(e,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??fi}static _$Ei(){if(this.hasOwnProperty($e("elementProperties")))return;let e=co(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty($e("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($e("properties"))){let t=this.properties,r=[...so(t),...lo(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(ur(n))}else e!==void 0&&t.push(ur(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return mi(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:hr).toAttribute(t,r.type);this._$Em=e,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,t){let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let o=r.getPropertyOptions(n),a=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:hr;this._$Em=n;let s=a.fromAttribute(t,o.type);this[n]=s??this._$Ej?.get(n)??s,this._$Em=null}}requestUpdate(e,t,r,n=!1,o){if(e!==void 0){let a=this.constructor;if(n===!1&&(o=this[e]),r??=a.getPropertyOptions(e),!((r.hasChanged??vi)(o,t)||r.useDefault&&r.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:o},a){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),o!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[n,o]of r){let{wrapped:a}=o,s=this[n];a!==!0||this._$AL.has(n)||s===void 0||this.C(n,void 0,o,s)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};H.elementStyles=[],H.shadowRootOptions={mode:"open"},H[$e("elementProperties")]=new Map,H[$e("finalized")]=new Map,ho?.({ReactiveElement:H}),(Mt.reactiveElementVersions??=[]).push("2.1.2");var mr=globalThis,gi=i=>i,Tt=mr.trustedTypes,wi=Tt?Tt.createPolicy("lit-html",{createHTML:i=>i}):void 0,br="$lit$",X=`lit$${Math.random().toFixed(9).slice(2)}$`,fr="?"+X,po=`<${fr}>`,de=document,Fe=()=>de.createComment(""),He=i=>i===null||typeof i!="object"&&typeof i!="function",vr=Array.isArray,Ti=i=>vr(i)||typeof i?.[Symbol.iterator]=="function",pr=`[
2
+ \f\r]`,Ie=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,yi=/-->/g,Si=/>/g,se=RegExp(`>|${pr}(?:([^\\s"'>=/]+)(${pr}*=${pr}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),xi=/'/g,Ci=/"/g,Ei=/^(?:script|style|textarea|title)$/i,gr=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),u=gr(1),he=gr(2),za=gr(3),J=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),Mi=new WeakMap,le=de.createTreeWalker(de,129);function Ai(i,e){if(!vr(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return wi!==void 0?wi.createHTML(e):e}var Ri=(i,e)=>{let t=i.length-1,r=[],n,o=e===2?"<svg>":e===3?"<math>":"",a=Ie;for(let s=0;s<t;s++){let l=i[s],c,d,h=-1,p=0;for(;p<l.length&&(a.lastIndex=p,d=a.exec(l),d!==null);)p=a.lastIndex,a===Ie?d[1]==="!--"?a=yi:d[1]!==void 0?a=Si:d[2]!==void 0?(Ei.test(d[2])&&(n=RegExp("</"+d[2],"g")),a=se):d[3]!==void 0&&(a=se):a===se?d[0]===">"?(a=n??Ie,h=-1):d[1]===void 0?h=-2:(h=a.lastIndex-d[2].length,c=d[1],a=d[3]===void 0?se:d[3]==='"'?Ci:xi):a===Ci||a===xi?a=se:a===yi||a===Si?a=Ie:(a=se,n=void 0);let f=a===se&&i[s+1].startsWith("/>")?" ":"";o+=a===Ie?l+po:h>=0?(r.push(c),l.slice(0,h)+br+l.slice(h)+X+f):l+X+(h===-2?s:f)}return[Ai(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},Ve=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,a=0,s=e.length-1,l=this.parts,[c,d]=Ri(e,t);if(this.el=i.createElement(c,r),le.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=le.nextNode())!==null&&l.length<s;){if(n.nodeType===1){if(n.hasAttributes())for(let h of n.getAttributeNames())if(h.endsWith(br)){let p=d[a++],f=n.getAttribute(h).split(X),b=/([.?@])?(.*)/.exec(p);l.push({type:1,index:o,name:b[2],strings:f,ctor:b[1]==="."?At:b[1]==="?"?Rt:b[1]==="@"?Lt:ue}),n.removeAttribute(h)}else h.startsWith(X)&&(l.push({type:6,index:o}),n.removeAttribute(h));if(Ei.test(n.tagName)){let h=n.textContent.split(X),p=h.length-1;if(p>0){n.textContent=Tt?Tt.emptyScript:"";for(let f=0;f<p;f++)n.append(h[f],Fe()),le.nextNode(),l.push({type:2,index:++o});n.append(h[p],Fe())}}}else if(n.nodeType===8)if(n.data===fr)l.push({type:2,index:o});else{let h=-1;for(;(h=n.data.indexOf(X,h+1))!==-1;)l.push({type:7,index:o}),h+=X.length-1}o++}}static createElement(e,t){let r=de.createElement("template");return r.innerHTML=e,r}};function ce(i,e,t=i,r){if(e===J)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl,o=He(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=ce(i,n._$AS(i,e.values),n,r)),e}var Et=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,n=(e?.creationScope??de).importNode(t,!0);le.currentNode=n;let o=le.nextNode(),a=0,s=0,l=r[0];for(;l!==void 0;){if(a===l.index){let c;l.type===2?c=new ye(o,o.nextSibling,this,e):l.type===1?c=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(c=new kt(o,this,e)),this._$AV.push(c),l=r[++s]}a!==l?.index&&(o=le.nextNode(),a++)}return le.currentNode=de,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},ye=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=ce(this,e,t),He(e)?e===m||e==null||e===""?(this._$AH!==m&&this._$AR(),this._$AH=m):e!==this._$AH&&e!==J&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ti(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==m&&He(this._$AH)?this._$AA.nextSibling.data=e:this.T(de.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Ve.createElement(Ai(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{let o=new Et(n,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Mi.get(e.strings);return t===void 0&&Mi.set(e.strings,t=new Ve(e)),t}k(e){vr(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let o of e)n===t.length?t.push(r=new i(this.O(Fe()),this.O(Fe()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=gi(e).nextSibling;gi(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},ue=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=m,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=m}_$AI(e,t=this,r,n){let o=this.strings,a=!1;if(o===void 0)e=ce(this,e,t,0),a=!He(e)||e!==this._$AH&&e!==J,a&&(this._$AH=e);else{let s=e,l,c;for(e=o[0],l=0;l<o.length-1;l++)c=ce(this,s[r+l],t,l),c===J&&(c=this._$AH[l]),a||=!He(c)||c!==this._$AH[l],c===m?e=m:e!==m&&(e+=(c??"")+o[l+1]),this._$AH[l]=c}a&&!n&&this.j(e)}j(e){e===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},At=class extends ue{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===m?void 0:e}},Rt=class extends ue{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==m)}},Lt=class extends ue{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=ce(this,e,t,0)??m)===J)return;let r=this._$AH,n=e===m&&r!==m||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==m&&(r===m||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},kt=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){ce(this,e)}},Li={M:br,P:X,A:fr,C:1,L:Ri,R:Et,D:Ti,V:ce,I:ye,H:ue,N:Rt,U:Lt,B:At,F:kt},mo=mr.litHtmlPolyfillSupport;mo?.(Ve,ye),(mr.litHtmlVersions??=[]).push("3.3.3");var ki=(i,e,t)=>{let r=t?.renderBefore??e,n=r._$litPart$;if(n===void 0){let o=t?.renderBefore??null;r._$litPart$=n=new ye(e.insertBefore(Fe(),o),o,void 0,t??{})}return n._$AI(i),n};var wr=globalThis,g=class extends H{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ki(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return J}};g._$litElement$=!0,g.finalized=!0,wr.litElementHydrateSupport?.({LitElement:g});var bo=wr.litElementPolyfillSupport;bo?.({LitElement:g});(wr.litElementVersions??=[]).push("4.2.2");import*as z from"d3";var Pi={select:{placeholder:"Select\u2026",validation:{required:"Please select an option."},overlay:{title:"Select option"}},overlay:{close:"Close"},chart:{empty:"No data available",values:"Values"},input:{password:{show:"Show password",hide:"Hide password"}},checkbox:{validation:{required:"Please select this option."}},segmented:{validation:{required:"Please select an option."}},table:{selectRow:"Select {rowName}",selectAll:"Select all",sortBy:"Sort by {column}",columnMenu:"Column menu",rowFallback:"Row {index}",reordered:"{rowName} moved to position {pos} of {total}",invalidData:"Table data is invalid"}};var _i={select:{placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435\u2026",validation:{required:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442."},overlay:{title:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442"}},overlay:{close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C"},chart:{empty:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445",values:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u044F"},input:{password:{show:"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C",hide:"\u0421\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C"}},checkbox:{validation:{required:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u044D\u0442\u043E\u0442 \u0432\u0430\u0440\u0438\u0430\u043D\u0442."}},segmented:{validation:{required:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442."}},table:{selectRow:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C {rowName}",selectAll:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435",sortBy:"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E {column}",columnMenu:"\u041C\u0435\u043D\u044E \u0441\u0442\u043E\u043B\u0431\u0446\u043E\u0432",rowFallback:"\u0421\u0442\u0440\u043E\u043A\u0430 {index}",reordered:"{rowName} \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0430 \u043D\u0430 \u043F\u043E\u0437\u0438\u0446\u0438\u044E {pos} \u0438\u0437 {total}",invalidData:"\u0414\u0430\u043D\u043D\u044B\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B \u043D\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u044C\u043D\u044B"}};var Pt={en:Pi,ru:_i},_t="en",yr=new Set;function go(i){try{if(typeof Intl.getCanonicalLocales=="function")return Intl.getCanonicalLocales(i)[0]??"en";if(typeof Intl.Locale=="function")return new Intl.Locale(i).toString()}catch{}return"en"}function wo(i){let e=i==="en-XA"?"en":go(i);if(Pt[e]!==void 0)return e;let t=e.split("-")[0];return Pt[t]!==void 0?t:"en"}function Sr(i){let e=wo(i);if(e!==_t){_t=e;for(let t of yr)t()}}function xr(){return _t}function w(i){return Di(Pt[_t],i)??Di(Pt.en,i)??i}function Di(i,e){let t=i;for(let r of e.split(".")){if(typeof t!="object"||t===void 0)return;t=t[r]}return typeof t=="string"?t:void 0}function Cr(i){return yr.add(i),()=>{yr.delete(i)}}var Oi=5e3,yo=i=>{if(i===0)return"0 b/s";let e=Math.abs(i),t=["b/s","Kb/s","Mb/s","Gb/s"],r=0,n=e;for(;n>=1e3&&r<t.length-1;)n/=1e3,r+=1;return`${r===0?n:n.toFixed(1)} ${t[r]}`},So=i=>{if(!Number.isFinite(i)||i<=0)return Oi;let e=String(Math.floor(i)).length-1,t=Math.pow(10,e),r=Math.ceil(i/t)*t;return Math.max(r,Oi)},Se=i=>new Intl.NumberFormat(xr()).format(i),Dt=i=>{if(!Number.isFinite(i)||i<=0)return 1;let e=Math.pow(10,Math.floor(Math.log10(i))),t=i/e,n=([1,1.5,2,2.5,5,10].find(o=>o>=t)??10)*e;return Number.isFinite(n)?n:i},te=i=>{let e=new Date(i),t=r=>String(r).padStart(2,"0");return`${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}`},Ot=i=>`${Math.round(i)}%`,Nt=i=>Number.isFinite(i)&&i>0?i:100,xo=["accent","success","warning","muted"],$t=i=>xo.includes(i)?i:"accent",ze=i=>i.flatMap(e=>!Number.isFinite(e.value)||e.time!==void 0&&!Number.isFinite(e.time)?[]:e.time===void 0?[{value:e.value}]:[{time:e.time,value:e.value}]),V=i=>i.filter(e=>Number.isFinite(e.time)&&Number.isFinite(e.value)),Ni=i=>{let e=[],t=[];for(let r of i){if(!Number.isFinite(r.time)||!Number.isFinite(r.value)){t.length>0&&(e.push(t),t=[]);continue}t.push(r)}return t.length>0&&e.push(t),e},$i=(i,e)=>{if(e!==void 0&&Number.isFinite(e.start)&&Number.isFinite(e.end)&&e.start<e.end)return{start:e.start,end:e.end};let t=V(i);return t.length===0?null:{start:Math.min(...t.map(r=>r.time)),end:Math.max(...t.map(r=>r.time))}},xe=(i,e,t)=>{let r=ze(i);if(r.length===0)return null;let o=r.every(l=>l.time!==void 0)?r.reduce((l,c)=>l.time===void 0||c.time===void 0?l:c.time>l.time?c:l):r[r.length-1],a=Math.min(...r.map(l=>l.value)),s=Math.max(...r.map(l=>l.value));return o===void 0?null:`${e}: latest ${t(o.value)}; range ${t(a)} to ${t(s)}`},Ii=(i,e,t=Se,r)=>{let n=i.map(a=>xe(a.data,a.label??a.id,t)).filter(a=>a!==null);return n.length===0?e:`${r===void 0?"Chart. ":`Chart. ${r}: `}${n.join("; ")}`},Fi=(i,e,t,r=Se)=>xe(i,e,r)??t;var Ce=class{constructor(e,t){this.host=e;this.onResize=t;e.addController(this)}plotElement=null;disposePlot=null;resizeObserver=null;observedContainer=null;hostConnected(){this.host.setAttribute("role","img"),this.host.requestUpdate()}hostDisconnected(){this.disconnectPlot(),this.resizeObserver!==null&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.observedContainer=null}setPlot(e,t){this.disconnectPlot(),this.plotElement=e,this.disposePlot=t}observeContainer(e){typeof ResizeObserver>"u"||(this.resizeObserver===null&&(this.resizeObserver=new ResizeObserver(t=>{let r=t[0];this.onResize(r===void 0?void 0:{width:r.contentRect.width,height:r.contentRect.height})})),this.observedContainer!==e&&(this.observedContainer!==null&&this.resizeObserver.unobserve(this.observedContainer),this.resizeObserver.observe(e),this.observedContainer=e))}disconnectPlot(){this.disposePlot!==null&&(this.disposePlot(),this.disposePlot=null),this.plotElement=null}};var It=v`
4
4
  :host {
5
5
  display: block;
6
6
  width: 100%;
@@ -67,19 +67,19 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
67
67
  [part='axis'] text {
68
68
  fill: var(--mndw-text-subtle);
69
69
  }
70
- `,yo=i=>i===null?"":`left: ${i.left}px; top: ${i.top}px;`,It=i=>u`
70
+ `,Co=i=>i===null?"":`left: ${i.left}px; top: ${i.top}px;`,Ft=i=>{let e=i.getBoundingClientRect();return{width:e.width,height:e.height}},Ht=i=>u`
71
71
  <div class="container" part="container">
72
72
  ${i.hasContent?u`<svg part="plot" aria-hidden="true"></svg>`:u`<div class="empty" part="empty">${i.emptyLabel}</div>`}
73
73
  <div
74
74
  class="tooltip"
75
75
  part="tooltip"
76
76
  ?data-visible=${i.tooltip!==null}
77
- style=${yo(i.tooltip)}
77
+ style=${Co(i.tooltip)}
78
78
  >
79
79
  ${i.tooltip===null?"":i.tooltipBody}
80
80
  </div>
81
81
  </div>
82
- `;var L=class{constructor(e,t={}){this.host=e;this.options=t;e.addController(this)}unsubscribe=null;hostConnected(){this.options.applyLocale?.(),this.unsubscribe=Cr(()=>{this.options.applyLocale?.(),this.host.requestUpdate()})}hostDisconnected(){this.unsubscribe?.(),this.unsubscribe=null}};var Mr=new WeakMap,Fi=new WeakMap;function So(i,e){let t=Object.getPrototypeOf(i);for(;t!==null;){let r=Object.getOwnPropertyDescriptor(t,e);if(r!==void 0)return{prototype:t,descriptor:r};t=Object.getPrototypeOf(t)}}function xo(i,e){return Mr.get(i)?.get(e)}function Co(i,e){let t=Fi.get(i.prototype);t?.has(e)||(t===void 0&&(t=new Map,Fi.set(i.prototype,t)),t.set(e,i.descriptor),Object.defineProperty(i.prototype,e,{configurable:i.descriptor.configurable,enumerable:i.descriptor.enumerable,get:function(){return i.descriptor.get?.call(this)},set:function(r){let n=xo(this,e);n!==void 0&&!n.internal&&(n.dirty=!0),i.descriptor.set?.call(this,r)}}))}function Hi(i,e,t){let r=!1,n=i.setAttribute.bind(i),o=i.removeAttribute.bind(i),a=i.toggleAttribute.bind(i);return Object.defineProperty(i,"setAttribute",{configurable:!0,value:(s,l)=>{s===e&&!r&&t(),n(s,l)}}),Object.defineProperty(i,"removeAttribute",{configurable:!0,value:s=>{s===e&&!r&&t(),o(s)}}),Object.defineProperty(i,"toggleAttribute",{configurable:!0,value:(s,l)=>(s===e&&!r&&t(),a(s,l))}),s=>{r=!0;try{s()}finally{r=!1}}}function O(i,e,t=e){let r=So(i,e);if(r?.descriptor.set===void 0||r.descriptor.get===void 0)throw new Error(`Property ${e} has no accessor on ${i.localName}`);Co(r,e);let n={dirty:i.hasAttribute(t),internal:!1},o=Mr.get(i)??new Map;o.set(e,n),Mr.set(i,o);let a=Hi(i,t,()=>{n.dirty=!0});return{get dirty(){return n.dirty},setGenerated(s){n.dirty||a(()=>{n.internal=!0;try{r.descriptor.set?.call(i,s)}finally{n.internal=!1}})}}}function X(i,e){let t=i.hasAttribute(e),r=Hi(i,e,()=>{t=!0});return{get dirty(){return t},setGenerated(n){t||r(()=>{n===null?i.removeAttribute(e):i.setAttribute(e,n)})}}}var Er="mndw-bar-chart",ze=class extends g{static shadowRootOptions={mode:"open"};static properties={points:{attribute:!1},valueDomain:{attribute:!1},emptyLabel:{type:String,attribute:"empty-label"},valueLabel:{type:String,attribute:"value-label"},valueFormatter:{attribute:!1},timeFormatter:{attribute:!1},color:{type:String,reflect:!0}};static styles=[$t,v`
82
+ `;var L=class{constructor(e,t={}){this.host=e;this.options=t;e.addController(this)}unsubscribe=null;hostConnected(){this.options.applyLocale?.(),this.unsubscribe=Cr(()=>{this.options.applyLocale?.(),this.host.requestUpdate()})}hostDisconnected(){this.unsubscribe?.(),this.unsubscribe=null}};var Mr=new WeakMap,Hi=new WeakMap;function Mo(i,e){let t=Object.getPrototypeOf(i);for(;t!==null;){let r=Object.getOwnPropertyDescriptor(t,e);if(r!==void 0)return{prototype:t,descriptor:r};t=Object.getPrototypeOf(t)}}function To(i,e){return Mr.get(i)?.get(e)}function Eo(i,e){let t=Hi.get(i.prototype);t?.has(e)||(t===void 0&&(t=new Map,Hi.set(i.prototype,t)),t.set(e,i.descriptor),Object.defineProperty(i.prototype,e,{configurable:i.descriptor.configurable,enumerable:i.descriptor.enumerable,get:function(){return i.descriptor.get?.call(this)},set:function(r){let n=To(this,e);n!==void 0&&!n.internal&&(n.dirty=!0),i.descriptor.set?.call(this,r)}}))}function Vi(i,e,t){let r=!1,n=i.setAttribute.bind(i),o=i.removeAttribute.bind(i),a=i.toggleAttribute.bind(i);return Object.defineProperty(i,"setAttribute",{configurable:!0,value:(s,l)=>{s===e&&!r&&t(),n(s,l)}}),Object.defineProperty(i,"removeAttribute",{configurable:!0,value:s=>{s===e&&!r&&t(),o(s)}}),Object.defineProperty(i,"toggleAttribute",{configurable:!0,value:(s,l)=>(s===e&&!r&&t(),a(s,l))}),s=>{r=!0;try{s()}finally{r=!1}}}function N(i,e,t=e){let r=Mo(i,e);if(r?.descriptor.set===void 0||r.descriptor.get===void 0)throw new Error(`Property ${e} has no accessor on ${i.localName}`);Eo(r,e);let n={dirty:i.hasAttribute(t),internal:!1},o=Mr.get(i)??new Map;o.set(e,n),Mr.set(i,o);let a=Vi(i,t,()=>{n.dirty=!0});return{get dirty(){return n.dirty},setGenerated(s){n.dirty||a(()=>{n.internal=!0;try{r.descriptor.set?.call(i,s)}finally{n.internal=!1}})}}}function Z(i,e){let t=i.hasAttribute(e),r=Vi(i,e,()=>{t=!0});return{get dirty(){return t},setGenerated(n){t||r(()=>{n===null?i.removeAttribute(e):i.setAttribute(e,n)})}}}var Tr="mndw-bar-chart",Ue=class extends g{static shadowRootOptions={mode:"open"};static properties={points:{attribute:!1},valueDomain:{attribute:!1},emptyLabel:{type:String,attribute:"empty-label"},valueLabel:{type:String,attribute:"value-label"},valueFormatter:{attribute:!1},timeFormatter:{attribute:!1},tooltipFormatter:{attribute:!1},color:{type:String,reflect:!0}};static styles=[It,v`
83
83
  [part='hover-band'] {
84
84
  fill: color-mix(in srgb, var(--mndw-text) 12%, transparent);
85
85
  opacity: 0;
@@ -93,10 +93,13 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
93
93
  .tooltip {
94
94
  min-width: 6.25rem;
95
95
  }
96
- `];tooltipState=null;emptyLabelState;valueLabelState;ariaLabelState;localeController=new L(this,{applyLocale:()=>{this.applyLocale()}});frame=new Se(this,e=>{this.drawChart(e)});constructor(){super(),this.points=[],this.valueDomain=void 0,this.valueFormatter=we,this.timeFormatter=Q,this.color="accent",this.emptyLabelState=O(this,"emptyLabel","empty-label"),this.valueLabelState=O(this,"valueLabel","value-label"),this.ariaLabelState=X(this,"aria-label")}render(){let e=U(this.points).length>0;return It({hasContent:e,emptyLabel:this.emptyLabel??y("chart.empty"),tooltip:this.tooltipState,tooltipBody:this.tooltipState===null?"":u`
97
- <div>${this.tooltipState.time}</div>
98
- <div>${this.valueLabel??y("chart.values")}: <strong>${this.tooltipState.value}</strong></div>
99
- `})}willUpdate(e){(e.has("points")||e.has("valueDomain")||e.has("emptyLabel")||e.has("valueLabel")||e.has("valueFormatter")||e.has("timeFormatter")||e.has("color"))&&(this.tooltipState=null)}updated(e){(e.has("points")||e.has("valueDomain")||e.has("emptyLabel")||e.has("valueLabel")||e.has("valueFormatter")||e.has("timeFormatter")||e.has("color")||this.frame.plotElement===null)&&(this.updateAccessibilityLabel(),this.drawChart())}updateAccessibilityLabel(){this.ariaLabelState.setGenerated(Ii(this.points,this.valueLabel??y("chart.values"),this.emptyLabel??y("chart.empty"),this.valueFormatter))}applyLocale(){this.emptyLabelState.setGenerated(y("chart.empty")),this.valueLabelState.setGenerated(y("chart.values"))}drawChart(e){let t=this.renderRoot.querySelector(".container");if(t===null)return;this.frame.observeContainer(t),this.frame.disconnectPlot();let r=this.tooltipState!==null;this.tooltipState=null,r&&this.requestUpdate();let n=t.querySelector("svg"),o=U(this.points).sort((C,P)=>C.time-P.time);if(n===null||o.length===0)return;let a=t.getBoundingClientRect(),s=e?.width||a.width||400,l=e?.height||a.height||200,c=s<300,d=c?{top:15,right:10,bottom:25,left:50}:{top:20,right:15,bottom:30,left:60},h=Math.max(s-d.left-d.right,50),p=Math.max(l-d.top-d.bottom,50),f=Math.max(...o.map(C=>C.value),1),m=this.valueDomain?.min??0,S=this.valueDomain?.max??Pt(f),x=V.scaleBand().domain(o.map((C,P)=>String(P))).range([0,h]).padding(.15),E=V.scaleLinear().domain([m,S]).range([p,0]),A=V.select(n).attr("width",s).attr("height",l);A.selectAll("*").remove();let k=A.append("g").attr("transform",`translate(${d.left}, ${d.top})`);k.append("g").attr("part","grid").call(V.axisLeft(E).ticks(3).tickSize(-h).tickFormat(()=>"")).select(".domain").remove();let gt=c?9:10,or=k.append("g").attr("part","axis").call(V.axisLeft(E).ticks(3).tickFormat(C=>this.valueFormatter(C.valueOf())));or.selectAll("text").attr("font-size",gt),or.select(".domain").remove();let ar=Ot(this.color),wt=k.append("rect").attr("part","hover-band").attr("y",0).attr("height",p);for(let[C,P]of o.entries()){let I=x(String(C))??0;k.append("rect").attr("data-bar","true").attr("data-color",ar).attr("x",I).attr("y",E(P.value)).attr("width",x.bandwidth()).attr("height",E(m)-E(P.value)).style("fill",`var(--mndw-${ar})`)}let ve=Math.min(o.length,5),_e=Math.max(Math.ceil(o.length/ve),1),z=[];for(let C=0;C<o.length&&z.length<ve;C+=_e)z.push(C);z[z.length-1]!==o.length-1&&o.length>1&&(z[z.length-1]=o.length-1),k.append("g").attr("part","axis").attr("transform",`translate(0, ${p})`).selectAll("text").data(z).enter().append("text").attr("x",C=>(x(String(C))??0)+x.bandwidth()/2).attr("dy","1.2em").style("text-anchor","middle").attr("font-size",gt-1).text(C=>{let P=o[C];return P===void 0?"":this.timeFormatter(P.time)});let w=k.append("rect").attr("width",h).attr("height",p).attr("fill","transparent").style("cursor","crosshair"),D=C=>{let P=k.node();if(P===null)return;let[I,q]=V.pointer(C,P);if(I<0||I>h||q<0||q>p){wt.attr("data-active",null),this.tooltipState=null,this.requestUpdate();return}let ne=x.step(),sr=x(String(0))??0,yt=(ne-x.bandwidth())/2,Pe=Math.min(Math.max(Math.floor((I-sr+yt)/ne),0),o.length-1),lr=o[Pe];if(lr===void 0)return;let eo=x(String(Pe))??0,di=ne,ci=Math.max(0,eo-(di-x.bandwidth())/2);wt.attr("x",ci).attr("width",Math.min(di,h-ci)).attr("data-active","");let dr=I+d.left+8,De=q-30;dr+120>s&&(dr=I+d.left-128),De<0&&(De=0),De+50>l&&(De=Math.max(0,l-50)),this.tooltipState={left:dr,top:De,time:this.timeFormatter(lr.time),value:this.valueFormatter(lr.value)},this.requestUpdate()};w.on("mousemove.chart",D),w.on("mouseleave.chart",()=>{wt.attr("data-active",null),this.tooltipState=null,this.requestUpdate()}),this.frame.setPlot(n,()=>{w.on(".chart",null)})}};var Rr="mndw-heat-strip",xe=[{at:10,token:"var(--mndw-util-low)"},{at:25,token:"var(--mndw-util-moderate)"},{at:40,token:"var(--mndw-util-elevated)"},{at:55,token:"var(--mndw-util-high)"},{at:70,token:"var(--mndw-util-critical)"}],Vi=xe[0],Tr=xe[xe.length-1],zi=10,Mo=(i,e,t)=>{let r=Math.min(Math.max(e,0),Math.max(t,0))/2,n=r,o=Math.max(n,t-r);return Math.min(Math.max(i,n),o)},Eo=(i,e)=>Number.isFinite(i)?Math.min(Math.max(i,0),e):0,To=i=>Math.min(100,Math.floor(i/zi)*zi),Ro=i=>{if(i<=Vi.at)return Vi.token;if(i>=Tr.at)return Tr.token;for(let e=0;e<xe.length-1;e+=1){let t=xe[e],r=xe[e+1];if(i<=r.at){let n=Math.round((r.at-i)/(r.at-t.at)*100);return`color-mix(in srgb, ${t.token} ${n}%, ${r.token})`}}return Tr.token},Ue=class extends g{static shadowRootOptions={mode:"open"};static properties={points:{attribute:!1},max:{type:Number},emptyLabel:{type:String,attribute:"empty-label"},valueLabel:{type:String,attribute:"value-label"},valueFormatter:{attribute:!1},timeFormatter:{attribute:!1}};static styles=v`
96
+ `];tooltipState=null;formatterErrorLogged=!1;emptyLabelState;valueLabelState;ariaLabelState;localeController=new L(this,{applyLocale:()=>{this.applyLocale()}});frame=new Ce(this,e=>{this.drawChart(e)});constructor(){super(),this.points=[],this.valueDomain=void 0,this.valueFormatter=Se,this.timeFormatter=te,this.color="accent",this.emptyLabelState=N(this,"emptyLabel","empty-label"),this.valueLabelState=N(this,"valueLabel","value-label"),this.ariaLabelState=Z(this,"aria-label")}render(){let e=V(this.points).length>0,t=this.tooltipState;return Ht({hasContent:e,emptyLabel:this.emptyLabel??w("chart.empty"),tooltip:t,tooltipBody:t===null?"":t.content===void 0?u`
97
+ <div>${t.time}</div>
98
+ <div>${this.valueLabel??w("chart.values")}: <strong>${t.value}</strong></div>
99
+ `:u`
100
+ <div>${t.content.title??t.time}</div>
101
+ ${t.content.rows.map(r=>u`<div>${r.label}: <strong>${r.value}</strong></div>`)}
102
+ `})}willUpdate(e){(e.has("points")||e.has("valueDomain")||e.has("emptyLabel")||e.has("valueLabel")||e.has("valueFormatter")||e.has("timeFormatter")||e.has("tooltipFormatter")||e.has("color"))&&(this.tooltipState=null)}updated(e){(e.has("points")||e.has("valueDomain")||e.has("emptyLabel")||e.has("valueLabel")||e.has("valueFormatter")||e.has("timeFormatter")||e.has("tooltipFormatter")||e.has("color")||this.frame.plotElement===null)&&(this.updateAccessibilityLabel(),this.drawChart()),this.updateTooltipPosition()}disconnectedCallback(){this.formatterErrorLogged=!1,super.disconnectedCallback()}updateAccessibilityLabel(){this.ariaLabelState.setGenerated(Fi(this.points,this.valueLabel??w("chart.values"),this.emptyLabel??w("chart.empty"),this.valueFormatter))}applyLocale(){this.emptyLabelState.setGenerated(w("chart.empty")),this.valueLabelState.setGenerated(w("chart.values"))}drawChart(e){let t=this.renderRoot.querySelector(".container");if(t===null)return;this.frame.observeContainer(t),this.frame.disconnectPlot();let r=this.tooltipState!==null;this.tooltipState=null,r&&this.requestUpdate();let n=t.querySelector("svg"),o=V(this.points).sort((x,P)=>x.time-P.time);if(n===null||o.length===0)return;let a=t.getBoundingClientRect(),s=e?.width||a.width||400,l=e?.height||a.height||200,c=s<300,d=c?{top:15,right:10,bottom:25,left:50}:{top:20,right:15,bottom:30,left:60},h=Math.max(s-d.left-d.right,50),p=Math.max(l-d.top-d.bottom,50),f=Math.max(...o.map(x=>x.value),1),b=this.valueDomain?.min??0,S=this.valueDomain?.max??Dt(f),C=z.scaleBand().domain(o.map((x,P)=>String(P))).range([0,h]).padding(.15),T=z.scaleLinear().domain([b,S]).range([p,0]),R=z.select(n).attr("width",s).attr("height",l);R.selectAll("*").remove();let k=R.append("g").attr("transform",`translate(${d.left}, ${d.top})`);k.append("g").attr("part","grid").call(z.axisLeft(T).ticks(3).tickSize(-h).tickFormat(()=>"")).select(".domain").remove();let wt=c?9:10,sr=k.append("g").attr("part","axis").call(z.axisLeft(T).ticks(3).tickFormat(x=>this.valueFormatter(x.valueOf())));sr.selectAll("text").attr("font-size",wt),sr.select(".domain").remove();let lr=$t(this.color),yt=k.append("rect").attr("part","hover-band").attr("y",0).attr("height",p);for(let[x,P]of o.entries()){let F=C(String(x))??0;k.append("rect").attr("data-bar","true").attr("data-color",lr).attr("x",F).attr("y",T(P.value)).attr("width",C.bandwidth()).attr("height",T(b)-T(P.value)).style("fill",`var(--mndw-${lr})`)}let ge=Math.min(o.length,5),De=Math.max(Math.ceil(o.length/ge),1),B=[];for(let x=0;x<o.length&&B.length<ge;x+=De)B.push(x);B[B.length-1]!==o.length-1&&o.length>1&&(B[B.length-1]=o.length-1),k.append("g").attr("part","axis").attr("transform",`translate(0, ${p})`).selectAll("text").data(B).enter().append("text").attr("x",x=>(C(String(x))??0)+C.bandwidth()/2).attr("dy","1.2em").style("text-anchor","middle").attr("font-size",wt-1).text(x=>{let P=o[x];return P===void 0?"":this.timeFormatter(P.time)});let y=k.append("rect").attr("width",h).attr("height",p).attr("fill","transparent").style("cursor","crosshair"),D=x=>{let P=k.node();if(P===null)return;let[F,we]=z.pointer(x,P);if(F<0||F>h||we<0||we>p){yt.attr("data-active",null),this.formatterErrorLogged=!1,this.tooltipState=null,this.requestUpdate();return}let ae=C.step(),j=C(String(0))??0,di=(ae-C.bandwidth())/2,Oe=Math.min(Math.max(Math.floor((F-j+di)/ae),0),o.length-1),Y=o[Oe];if(Y===void 0)return;let St=C(String(Oe))??0,ci=ae,ui=Math.max(0,St-(ci-C.bandwidth())/2);yt.attr("x",ui).attr("width",Math.min(ci,h-ui)).attr("data-active","");let ro=this.valueLabel??w("chart.values"),io={time:Y.time,samples:[{seriesId:"value",label:ro,value:Y.value,time:Y.time}]},dr=this.formatTooltip(io);if(dr===null){this.tooltipState=null,this.requestUpdate();return}this.tooltipState={left:F+d.left+8,top:we-30,anchorX:F+d.left,anchorY:we,chartWidth:s,bottomLimit:l,horizontalOffset:8,time:this.timeFormatter(Y.time),value:this.valueFormatter(Y.value),...dr===void 0?{}:{content:dr}},this.requestUpdate()};y.on("mousemove.chart",D),y.on("mouseleave.chart",()=>{yt.attr("data-active",null),this.formatterErrorLogged=!1,this.tooltipState=null,this.requestUpdate()}),this.frame.setPlot(n,()=>{y.on(".chart",null)})}updateTooltipPosition(){let e=this.renderRoot.querySelector('[part="tooltip"][data-visible]'),t=this.tooltipState;if(e===null||t===null)return;let{width:r,height:n}=Ft(e),o=t.anchorX+t.horizontalOffset;o+r>t.chartWidth&&(o=t.anchorX-r-t.horizontalOffset),o=Math.max(0,Math.min(o,t.chartWidth-r));let a=Math.min(Math.max(t.anchorY-30,0),Math.max(0,t.bottomLimit-n));o===t.left&&a===t.top||(this.tooltipState={...t,left:o,top:a},e.style.left=`${o}px`,e.style.top=`${a}px`)}formatTooltip(e){let t=this.tooltipFormatter;if(t!==void 0)try{let r=t(e);return this.formatterErrorLogged=!1,r}catch(r){this.formatterErrorLogged||(console.error("Chart tooltip formatter failed",r),this.formatterErrorLogged=!0);return}}};var Ar="mndw-heat-strip",Me=[{at:10,token:"var(--mndw-util-low)"},{at:25,token:"var(--mndw-util-moderate)"},{at:40,token:"var(--mndw-util-elevated)"},{at:55,token:"var(--mndw-util-high)"},{at:70,token:"var(--mndw-util-critical)"}],zi=Me[0],Er=Me[Me.length-1],Ui=10,Ao=(i,e,t)=>{let r=Math.min(Math.max(e,0),Math.max(t,0))/2,n=r,o=Math.max(n,t-r);return Math.min(Math.max(i,n),o)},Ro=(i,e)=>Number.isFinite(i)?Math.min(Math.max(i,0),e):0,Lo=i=>Math.min(100,Math.floor(i/Ui)*Ui),ko=i=>{if(i<=zi.at)return zi.token;if(i>=Er.at)return Er.token;for(let e=0;e<Me.length-1;e+=1){let t=Me[e],r=Me[e+1];if(i<=r.at){let n=Math.round((r.at-i)/(r.at-t.at)*100);return`color-mix(in srgb, ${t.token} ${n}%, ${r.token})`}}return Er.token},Be=class extends g{static shadowRootOptions={mode:"open"};static properties={points:{attribute:!1},max:{type:Number},emptyLabel:{type:String,attribute:"empty-label"},valueLabel:{type:String,attribute:"value-label"},valueFormatter:{attribute:!1},timeFormatter:{attribute:!1}};static styles=v`
100
103
  :host {
101
104
  display: block;
102
105
  width: 100%;
@@ -152,9 +155,9 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
152
155
  overflow-wrap: anywhere;
153
156
  pointer-events: none;
154
157
  }
155
- `;hoverIndex=null;emptyLabelState;valueLabelState;ariaLabelState;localeController=new L(this,{applyLocale:()=>{this.applyLocale()}});constructor(){super(),this.points=[],this.max=100,this.emptyLabel=void 0,this.valueLabel=void 0,this.valueFormatter=Dt,this.timeFormatter=Q,this.emptyLabelState=O(this,"emptyLabel","empty-label"),this.valueLabelState=O(this,"valueLabel","value-label"),this.ariaLabelState=X(this,"aria-label")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","img")}updated(){this.ariaLabelState.setGenerated(this.computeAriaLabel()),this.positionTooltip()}positionTooltip(){let e=this.shadowRoot?.querySelector(".plot"),t=this.shadowRoot?.querySelector('[part="tooltip"]');if(e==null||t===null||t===void 0)return;let r=e.getBoundingClientRect(),n=t.getBoundingClientRect();if(r.width<=0||n.width<=0)return;let o=Number.parseFloat(t.style.left),a=Number.isFinite(o)?o/100*r.width:r.width/2,s=Mo(a,n.width,r.width);t.style.left=`${s}px`}render(){let e=this.samples();if(e.length===0)return u`
158
+ `;hoverIndex=null;emptyLabelState;valueLabelState;ariaLabelState;localeController=new L(this,{applyLocale:()=>{this.applyLocale()}});constructor(){super(),this.points=[],this.max=100,this.emptyLabel=void 0,this.valueLabel=void 0,this.valueFormatter=Ot,this.timeFormatter=te,this.emptyLabelState=N(this,"emptyLabel","empty-label"),this.valueLabelState=N(this,"valueLabel","value-label"),this.ariaLabelState=Z(this,"aria-label")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","img")}updated(){this.ariaLabelState.setGenerated(this.computeAriaLabel()),this.positionTooltip()}positionTooltip(){let e=this.shadowRoot?.querySelector(".plot"),t=this.shadowRoot?.querySelector('[part="tooltip"]');if(e==null||t===null||t===void 0)return;let r=e.getBoundingClientRect(),n=t.getBoundingClientRect();if(r.width<=0||n.width<=0)return;let o=Number.parseFloat(t.style.left),a=Number.isFinite(o)?o/100*r.width:r.width/2,s=Ao(a,n.width,r.width);t.style.left=`${s}px`}render(){let e=this.samples();if(e.length===0)return u`
156
159
  <div class="container" part="container">
157
- <div class="empty" part="empty">${this.emptyLabel??y("chart.empty")}</div>
160
+ <div class="empty" part="empty">${this.emptyLabel??w("chart.empty")}</div>
158
161
  </div>
159
162
  `;let t=this.tooltipState(e);return u`
160
163
  <div class="container" part="container">
@@ -168,7 +171,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
168
171
  @pointerleave=${this.onPointerLeave}
169
172
  >
170
173
  ${e.map((r,n)=>this.renderSlice(r.value,n))}
171
- ${this.hoverIndex===null?b:ce`
174
+ ${this.hoverIndex===null?m:he`
172
175
  <rect
173
176
  part="hover-cell"
174
177
  fill="color-mix(in srgb, var(--mndw-text) 22%, transparent)"
@@ -191,24 +194,27 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
191
194
  <span>${this.timeFormatter(t)}</span>
192
195
  <span>${this.timeFormatter(r)}</span>
193
196
  </div>
194
- `}renderSlice(e,t){let r=Nt(this.max),n=Eo(e,r),o=To(n/r*100);return ce`
197
+ `}renderSlice(e,t){let r=Nt(this.max),n=Ro(e,r),o=Lo(n/r*100);return he`
195
198
  <rect
196
199
  class="slice"
197
- style=${`fill: ${Ro(o)}`}
200
+ style=${`fill: ${ko(o)}`}
198
201
  ?data-active=${t===this.hoverIndex}
199
202
  x=${t}
200
203
  y="0"
201
204
  width="1.02"
202
205
  height="1"
203
206
  ></rect>
204
- `}tooltipState(e){if(this.hoverIndex===null||this.hoverIndex<0||this.hoverIndex>=e.length)return null;let t=e[this.hoverIndex];return t===void 0?null:{left:(this.hoverIndex+.5)/e.length*100,value:t.value,time:t.time===void 0?null:this.timeFormatter(t.time)}}onPointerMove=e=>{let t=this.samples();if(t.length===0)return;let n=e.currentTarget.getBoundingClientRect();if(n.width<=0)return;let o=(e.clientX-n.left)/n.width,a=Math.min(t.length-1,Math.max(0,Math.floor(o*t.length)));a!==this.hoverIndex&&(this.hoverIndex=a,this.requestUpdate())};onPointerLeave=()=>{this.hoverIndex!==null&&(this.hoverIndex=null,this.requestUpdate())};samples(){return Ve(this.points)}computeAriaLabel(){return ye(this.samples(),this.valueLabel??y("chart.values"),this.valueFormatter)??this.emptyLabel??y("chart.empty")}applyLocale(){this.emptyLabelState.setGenerated(y("chart.empty")),this.valueLabelState.setGenerated(y("chart.values"))}};import*as _ from"d3";var Ar="mndw-line-chart",Ui=i=>`var(--mndw-${i})`,Ao=(i,e)=>{let t=e.getBoundingClientRect();return[i.clientX-t.left,i.clientY-t.top]},Be=class extends g{static shadowRootOptions={mode:"open"};static properties={series:{attribute:!1},bands:{attribute:!1},domain:{attribute:!1},valueDomain:{attribute:!1},emptyLabel:{type:String,attribute:"empty-label"},valueLabel:{type:String,attribute:"value-label"},valueFormatter:{attribute:!1},timeFormatter:{attribute:!1}};static styles=[$t,v`
207
+ `}tooltipState(e){if(this.hoverIndex===null||this.hoverIndex<0||this.hoverIndex>=e.length)return null;let t=e[this.hoverIndex];return t===void 0?null:{left:(this.hoverIndex+.5)/e.length*100,value:t.value,time:t.time===void 0?null:this.timeFormatter(t.time)}}onPointerMove=e=>{let t=this.samples();if(t.length===0)return;let n=e.currentTarget.getBoundingClientRect();if(n.width<=0)return;let o=(e.clientX-n.left)/n.width,a=Math.min(t.length-1,Math.max(0,Math.floor(o*t.length)));a!==this.hoverIndex&&(this.hoverIndex=a,this.requestUpdate())};onPointerLeave=()=>{this.hoverIndex!==null&&(this.hoverIndex=null,this.requestUpdate())};samples(){return ze(this.points)}computeAriaLabel(){return xe(this.samples(),this.valueLabel??w("chart.values"),this.valueFormatter)??this.emptyLabel??w("chart.empty")}applyLocale(){this.emptyLabelState.setGenerated(w("chart.empty")),this.valueLabelState.setGenerated(w("chart.values"))}};import*as _ from"d3";var Rr="mndw-line-chart",Bi=i=>`var(--mndw-${i})`,Po=(i,e)=>{let t=e.getBoundingClientRect();return[i.clientX-t.left,i.clientY-t.top]},Ke=class extends g{static shadowRootOptions={mode:"open"};static properties={series:{attribute:!1},bands:{attribute:!1},domain:{attribute:!1},valueDomain:{attribute:!1},emptyLabel:{type:String,attribute:"empty-label"},valueLabel:{type:String,attribute:"value-label"},valueFormatter:{attribute:!1},timeFormatter:{attribute:!1},tooltipFormatter:{attribute:!1}};static styles=[It,v`
205
208
  .tooltip {
206
209
  min-width: 7.5rem;
207
210
  }
208
- `];tooltipState=null;lastPointerPosition=null;emptyLabelState;valueLabelState;ariaLabelState;localeController=new L(this,{applyLocale:()=>{this.applyLocale()}});frame=new Se(this,e=>{this.drawChart(e)});constructor(){super(),this.series=[],this.bands=[],this.domain=void 0,this.valueFormatter=we,this.timeFormatter=Q,this.emptyLabelState=O(this,"emptyLabel","empty-label"),this.valueLabelState=O(this,"valueLabel","value-label"),this.ariaLabelState=X(this,"aria-label")}render(){let e=this.series.some(t=>U(t.data).length>0)||this.bands.some(t=>t.data.length>0);return It({hasContent:e,emptyLabel:this.emptyLabel??y("chart.empty"),tooltip:this.tooltipState,tooltipBody:this.tooltipState===null?"":u`
209
- <div>${this.tooltipState.time}</div>
210
- ${this.tooltipState.values.map(t=>u`<div>${t.label}: <strong>${t.value}</strong></div>`)}
211
- `})}willUpdate(e){if(e.has("series")||e.has("bands")||e.has("domain")||e.has("valueDomain")||e.has("emptyLabel")||e.has("valueLabel")||e.has("valueFormatter")||e.has("timeFormatter")){let t=this.series.some(r=>U(r.data).length>0)||this.bands.some(r=>r.data.length>0);(this.lastPointerPosition===null||!t)&&(this.tooltipState=null),t||(this.lastPointerPosition=null)}}updated(e){(e.has("series")||e.has("bands")||e.has("domain")||e.has("valueDomain")||e.has("emptyLabel")||e.has("valueLabel")||e.has("valueFormatter")||e.has("timeFormatter")||this.frame.plotElement===null)&&(this.updateAccessibilityLabel(),this.drawChart())}disconnectedCallback(){this.lastPointerPosition=null,super.disconnectedCallback()}updateAccessibilityLabel(){this.ariaLabelState.setGenerated($i(this.series,this.emptyLabel??y("chart.empty"),this.valueFormatter,this.valueLabelState.dirty?this.valueLabel:void 0))}applyLocale(){this.emptyLabelState.setGenerated(y("chart.empty")),this.valueLabelState.setGenerated(y("chart.values"))}drawChart(e){let t=this.renderRoot.querySelector(".container");if(t===null)return;this.frame.observeContainer(t),this.frame.disconnectPlot();let r=t.querySelector("svg"),n=this.series.filter(w=>U(w.data).length>0),o=this.bands.filter(w=>w.data.length>0);if(r===null||n.length===0&&o.length===0)return;let a=t.getBoundingClientRect(),s=e?.width||a.width||400,l=e?.height||a.height||200,c=s<400,d=c?{top:6,right:40,bottom:22,left:58}:{top:10,right:60,bottom:30,left:72},h=n.length>0?n.flatMap(w=>U(w.data)):o.flatMap(w=>w.data.map(D=>({time:D.time,value:D.max}))),p=Oi(h,this.domain);if(p===null)return;let f=Math.max(...h.map(w=>w.value),1),m=this.valueDomain?.min??0,S=this.valueDomain?.max??Pt(f),x=_.scaleTime().domain([new Date(p.start),new Date(p.end)]).range([d.left,Math.max(s-d.right,d.left+1)]),E=_.scaleLinear().domain([m,S]).range([Math.max(l-d.bottom,d.top+1),d.top]),A=c?Math.max(8,Math.min(11,Math.floor(s/50))):Math.max(10,Math.min(13,Math.floor(s/50))),k=_.select(r).attr("width",s).attr("height",l);k.selectAll("*").remove();let si=_.line().x(w=>x(w.time)).y(w=>E(w.value)).curve(_.curveMonotoneX),gt=_.area().x(w=>x(w.time)).y0(E(m)).y1(w=>E(w.value)).curve(_.curveMonotoneX);for(let w of n){let D=Ui(w.color),C=w.segments?.map(P=>U(P.data))??Ni(w.data);for(let P of C.filter(I=>I.length>0))w.fill&&k.append("path").attr("data-color",w.color).style("fill",`color-mix(in srgb, ${D} 15%, transparent)`).attr("d",gt(P)),k.append("path").attr("data-color",w.color).style("fill","none").style("stroke",D).attr("stroke-width",2).attr("d",si(P))}for(let w of o){let D=_.area().x(C=>x(C.time)).y0(C=>E(C.min)).y1(C=>E(C.max)).curve(_.curveMonotoneX);k.append("path").attr("data-band",w.id).style("fill",`color-mix(in srgb, ${Ui(w.color)} 15%, transparent)`).attr("d",D(w.data))}k.append("g").attr("part","grid").attr("transform",`translate(${d.left}, 0)`).call(_.axisLeft(E).ticks(c?2:4).tickFormat(()=>"").tickSize(-(s-d.left-d.right))).selectAll("text").attr("font-size",A),k.append("g").attr("part","axis").attr("transform",`translate(${d.left}, 0)`).call(_.axisLeft(E).ticks(c?2:4).tickFormat(w=>w.valueOf()===0?"":this.valueFormatter(w.valueOf()))).selectAll("text").attr("font-size",A),k.append("g").attr("part","axis").attr("transform",`translate(0, ${l-d.bottom})`).call(_.axisBottom(x).tickValues(x.domain()).tickFormat(w=>{let D=w instanceof Date?w.getTime():w.valueOf();return this.timeFormatter(D)})).selectAll("text").attr("font-size",A);let ve=k.append("rect").attr("x",d.left).attr("y",d.top).attr("width",Math.max(s-d.left-d.right,1)).attr("height",Math.max(l-d.top-d.bottom,1)).attr("fill","transparent").style("cursor","crosshair"),_e=k.append("line").style("stroke","var(--mndw-text-subtle)").attr("pointer-events","none").attr("stroke-width",1).attr("stroke-dasharray","2,2").attr("y1",d.top).attr("y2",l-d.bottom).style("display","none"),z=(w,D)=>{if(w<d.left||w>s-d.right||D<d.top||D>l-d.bottom){this.lastPointerPosition=null,_e.style("display","none"),this.tooltipState=null,this.requestUpdate();return}this.lastPointerPosition=[w,D];let C=x.invert(w),P=n.map(ne=>{let sr=ne.data.reduce((yt,Pe)=>Math.abs(Pe.time-C.getTime())<Math.abs(yt.time-C.getTime())?Pe:yt);return{label:ne.label??ne.id,value:this.valueFormatter(sr.value)}});_e.style("display",null).attr("x1",w).attr("x2",w);let I=w+12,q=D-30;I+140>s&&(I=w-152),q<d.top&&(q=d.top+4),q+60>l-d.bottom&&(q=Math.max(d.top,l-d.bottom-64)),this.tooltipState={left:I,top:q,time:this.timeFormatter(C.getTime()),values:P},this.requestUpdate()},li=w=>{let[D,C]=Ao(w,r);z(D,C)};ve.on("mousemove.chart",li),ve.on("mouseleave.chart",()=>{this.lastPointerPosition=null,_e.style("display","none"),this.tooltipState=null,this.requestUpdate()}),this.frame.setPlot(r,()=>{ve.on(".chart",null)}),this.lastPointerPosition!==null&&z(...this.lastPointerPosition)}};function Bi(i,e,t,r,n){if(i.length===0||t<=0||r<=0||!(e>0))return[];let o=t/i.length,a=Math.max(1,o-n);return i.map((s,l)=>{let c=Math.min(Math.max(Number.isFinite(s)?s:0,0),e),d=Math.max(1,c/e*r);return{value:s,left:l*o,top:r-d,width:a,height:d}})}function Ki(i,e,t){if(t===0||e<=0)return null;let r=Math.floor(i/e*t);return Math.min(t-1,Math.max(0,r))}var Lr="mndw-sparkline",Ft=28,Lo=1,ko=240,_o=i=>`var(--mndw-${i})`,Ke=class extends g{static shadowRootOptions={mode:"open"};static properties={points:{attribute:!1},timeDomain:{attribute:!1},max:{type:Number},color:{type:String},emptyLabel:{type:String,attribute:"empty-label"},valueLabel:{type:String,attribute:"value-label"},valueFormatter:{attribute:!1},timeFormatter:{attribute:!1}};static styles=v`
211
+ `];tooltipState=null;lastPointerPosition=null;formatterErrorLogged=!1;emptyLabelState;valueLabelState;ariaLabelState;localeController=new L(this,{applyLocale:()=>{this.applyLocale()}});frame=new Ce(this,e=>{this.drawChart(e)});constructor(){super(),this.series=[],this.bands=[],this.domain=void 0,this.valueFormatter=Se,this.timeFormatter=te,this.emptyLabelState=N(this,"emptyLabel","empty-label"),this.valueLabelState=N(this,"valueLabel","value-label"),this.ariaLabelState=Z(this,"aria-label")}render(){let e=this.series.some(r=>V(r.data).length>0)||this.bands.some(r=>r.data.length>0),t=this.tooltipState;return Ht({hasContent:e,emptyLabel:this.emptyLabel??w("chart.empty"),tooltip:t,tooltipBody:t===null?"":t.content===void 0?u`
212
+ <div>${t.time}</div>
213
+ ${t.values.map(r=>u`<div>${r.label}: <strong>${r.value}</strong></div>`)}
214
+ `:u`
215
+ <div>${t.content.title??t.time}</div>
216
+ ${t.content.rows.map(r=>u`<div>${r.label}: <strong>${r.value}</strong></div>`)}
217
+ `})}willUpdate(e){if(e.has("series")||e.has("bands")||e.has("domain")||e.has("valueDomain")||e.has("emptyLabel")||e.has("valueLabel")||e.has("valueFormatter")||e.has("timeFormatter")||e.has("tooltipFormatter")){let t=this.series.some(r=>V(r.data).length>0)||this.bands.some(r=>r.data.length>0);(this.lastPointerPosition===null||!t)&&(this.tooltipState=null),t||(this.lastPointerPosition=null)}}updated(e){(e.has("series")||e.has("bands")||e.has("domain")||e.has("valueDomain")||e.has("emptyLabel")||e.has("valueLabel")||e.has("valueFormatter")||e.has("timeFormatter")||e.has("tooltipFormatter")||this.frame.plotElement===null)&&(this.updateAccessibilityLabel(),this.drawChart()),this.updateTooltipPosition()}disconnectedCallback(){this.lastPointerPosition=null,this.formatterErrorLogged=!1,super.disconnectedCallback()}updateAccessibilityLabel(){this.ariaLabelState.setGenerated(Ii(this.series,this.emptyLabel??w("chart.empty"),this.valueFormatter,this.valueLabelState.dirty?this.valueLabel:void 0))}applyLocale(){this.emptyLabelState.setGenerated(w("chart.empty")),this.valueLabelState.setGenerated(w("chart.values"))}drawChart(e){let t=this.renderRoot.querySelector(".container");if(t===null)return;this.frame.observeContainer(t),this.frame.disconnectPlot();let r=t.querySelector("svg"),n=this.series.filter(y=>V(y.data).length>0),o=this.bands.filter(y=>y.data.length>0);if(r===null||n.length===0&&o.length===0)return;let a=t.getBoundingClientRect(),s=e?.width||a.width||400,l=e?.height||a.height||200,c=s<400,d=c?{top:6,right:40,bottom:22,left:58}:{top:10,right:60,bottom:30,left:72},h=n.length>0?n.flatMap(y=>V(y.data)):o.flatMap(y=>y.data.map(D=>({time:D.time,value:D.max}))),p=$i(h,this.domain);if(p===null)return;let f=Math.max(...h.map(y=>y.value),1),b=this.valueDomain?.min??0,S=this.valueDomain?.max??Dt(f),C=_.scaleTime().domain([new Date(p.start),new Date(p.end)]).range([d.left,Math.max(s-d.right,d.left+1)]),T=_.scaleLinear().domain([b,S]).range([Math.max(l-d.bottom,d.top+1),d.top]),R=c?Math.max(8,Math.min(11,Math.floor(s/50))):Math.max(10,Math.min(13,Math.floor(s/50))),k=_.select(r).attr("width",s).attr("height",l);k.selectAll("*").remove();let si=_.line().x(y=>C(y.time)).y(y=>T(y.value)).curve(_.curveMonotoneX),wt=_.area().x(y=>C(y.time)).y0(T(b)).y1(y=>T(y.value)).curve(_.curveMonotoneX);for(let y of n){let D=Bi(y.color),x=y.segments?.map(P=>V(P.data))??Ni(y.data);for(let P of x.filter(F=>F.length>0))y.fill&&k.append("path").attr("data-color",y.color).style("fill",`color-mix(in srgb, ${D} 15%, transparent)`).attr("d",wt(P)),k.append("path").attr("data-color",y.color).style("fill","none").style("stroke",D).attr("stroke-width",2).attr("d",si(P))}for(let y of o){let D=_.area().x(x=>C(x.time)).y0(x=>T(x.min)).y1(x=>T(x.max)).curve(_.curveMonotoneX);k.append("path").attr("data-band",y.id).style("fill",`color-mix(in srgb, ${Bi(y.color)} 15%, transparent)`).attr("d",D(y.data))}k.append("g").attr("part","grid").attr("transform",`translate(${d.left}, 0)`).call(_.axisLeft(T).ticks(c?2:4).tickFormat(()=>"").tickSize(-(s-d.left-d.right))).selectAll("text").attr("font-size",R),k.append("g").attr("part","axis").attr("transform",`translate(${d.left}, 0)`).call(_.axisLeft(T).ticks(c?2:4).tickFormat(y=>y.valueOf()===0?"":this.valueFormatter(y.valueOf()))).selectAll("text").attr("font-size",R),k.append("g").attr("part","axis").attr("transform",`translate(0, ${l-d.bottom})`).call(_.axisBottom(C).tickValues(C.domain()).tickFormat(y=>{let D=y instanceof Date?y.getTime():y.valueOf();return this.timeFormatter(D)})).selectAll("text").attr("font-size",R);let ge=k.append("rect").attr("x",d.left).attr("y",d.top).attr("width",Math.max(s-d.left-d.right,1)).attr("height",Math.max(l-d.top-d.bottom,1)).attr("fill","transparent").style("cursor","crosshair"),De=k.append("line").style("stroke","var(--mndw-text-subtle)").attr("pointer-events","none").attr("stroke-width",1).attr("stroke-dasharray","2,2").attr("y1",d.top).attr("y2",l-d.bottom).style("display","none"),B=(y,D)=>{if(y<d.left||y>s-d.right||D<d.top||D>l-d.bottom){this.lastPointerPosition=null,this.formatterErrorLogged=!1,De.style("display","none"),this.tooltipState=null,this.requestUpdate();return}this.lastPointerPosition=[y,D];let x=C.invert(y),P=n.map(j=>{let Oe=V(j.data).reduce((Y,St)=>Math.abs(St.time-x.getTime())<Math.abs(Y.time-x.getTime())?St:Y);return{seriesId:j.id,label:j.label??j.id,value:Oe.value,time:Oe.time}}),F=P.map(j=>({label:j.label,value:this.valueFormatter(j.value)}));De.style("display",null).attr("x1",y).attr("x2",y);let we={time:x.getTime(),samples:P},ae=this.formatTooltip(we);if(ae===null){this.tooltipState=null,this.requestUpdate();return}this.tooltipState={left:y+12,top:D-30,anchorX:y,anchorY:D,chartWidth:s,topMin:d.top,bottomLimit:l-d.bottom,horizontalOffset:12,time:this.timeFormatter(x.getTime()),values:F,...ae===void 0?{}:{content:ae}},this.requestUpdate()},li=y=>{let[D,x]=Po(y,r);B(D,x)};ge.on("mousemove.chart",li),ge.on("mouseleave.chart",()=>{this.lastPointerPosition=null,this.formatterErrorLogged=!1,De.style("display","none"),this.tooltipState=null,this.requestUpdate()}),this.frame.setPlot(r,()=>{ge.on(".chart",null)}),this.lastPointerPosition!==null&&B(...this.lastPointerPosition)}updateTooltipPosition(){let e=this.renderRoot.querySelector('[part="tooltip"][data-visible]'),t=this.tooltipState;if(e===null||t===null)return;let{width:r,height:n}=Ft(e),o=t.anchorX+t.horizontalOffset;o+r>t.chartWidth&&(o=t.anchorX-r-t.horizontalOffset),o=Math.max(0,Math.min(o,t.chartWidth-r));let a=Math.max(t.topMin,t.bottomLimit-n),s=Math.min(Math.max(t.anchorY-30,t.topMin),a);o===t.left&&s===t.top||(this.tooltipState={...t,left:o,top:s},e.style.left=`${o}px`,e.style.top=`${s}px`)}formatTooltip(e){let t=this.tooltipFormatter;if(t!==void 0)try{let r=t(e);return this.formatterErrorLogged=!1,r}catch(r){this.formatterErrorLogged||(console.error("Chart tooltip formatter failed",r),this.formatterErrorLogged=!0);return}}};function Ki(i,e,t,r,n){if(i.length===0||t<=0||r<=0||!(e>0))return[];let o=t/i.length,a=Math.max(1,o-n);return i.map((s,l)=>{let c=Math.min(Math.max(Number.isFinite(s)?s:0,0),e),d=Math.max(1,c/e*r);return{value:s,left:l*o,top:r-d,width:a,height:d}})}function Wi(i,e,t){if(t===0||e<=0)return null;let r=Math.floor(i/e*t);return Math.min(t-1,Math.max(0,r))}var Lr="mndw-sparkline",Vt=28,_o=1,Do=240,Oo=i=>`var(--mndw-${i})`,We=class extends g{static shadowRootOptions={mode:"open"};static properties={points:{attribute:!1},timeDomain:{attribute:!1},max:{type:Number},color:{type:String},emptyLabel:{type:String,attribute:"empty-label"},valueLabel:{type:String,attribute:"value-label"},valueFormatter:{attribute:!1},timeFormatter:{attribute:!1}};static styles=v`
212
218
  :host {
213
219
  display: block;
214
220
  width: 100%;
@@ -284,16 +290,16 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
284
290
  white-space: nowrap;
285
291
  pointer-events: none;
286
292
  }
287
- `;hoverIndex=null;chartWidth=0;resizeObserver=null;emptyLabelState;valueLabelState;ariaLabelState;localeController=new L(this,{applyLocale:()=>{this.applyLocale()}});constructor(){super(),this.points=[],this.timeDomain=void 0,this.max=100,this.color="accent",this.emptyLabel=void 0,this.valueLabel=void 0,this.valueFormatter=Dt,this.timeFormatter=Q,this.emptyLabelState=O(this,"emptyLabel","empty-label"),this.valueLabelState=O(this,"valueLabel","value-label"),this.ariaLabelState=X(this,"aria-label")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","img"),this.observeSize()}disconnectedCallback(){this.resizeObserver?.disconnect(),this.resizeObserver=null,super.disconnectedCallback()}updated(){this.ariaLabelState.setGenerated(this.computeAriaLabel())}render(){if(this.samples().length===0)return u`
293
+ `;hoverIndex=null;chartWidth=0;resizeObserver=null;emptyLabelState;valueLabelState;ariaLabelState;localeController=new L(this,{applyLocale:()=>{this.applyLocale()}});constructor(){super(),this.points=[],this.timeDomain=void 0,this.max=100,this.color="accent",this.emptyLabel=void 0,this.valueLabel=void 0,this.valueFormatter=Ot,this.timeFormatter=te,this.emptyLabelState=N(this,"emptyLabel","empty-label"),this.valueLabelState=N(this,"valueLabel","value-label"),this.ariaLabelState=Z(this,"aria-label")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","img"),this.observeSize()}disconnectedCallback(){this.resizeObserver?.disconnect(),this.resizeObserver=null,super.disconnectedCallback()}updated(){this.ariaLabelState.setGenerated(this.computeAriaLabel())}render(){if(this.samples().length===0)return u`
288
294
  <div class="container" part="container">
289
- <div class="empty" part="empty">${this.emptyLabel??y("chart.empty")}</div>
295
+ <div class="empty" part="empty">${this.emptyLabel??w("chart.empty")}</div>
290
296
  </div>
291
- `;let t=this.layoutSamples(),r=this.plotWidth(),n=Bi(t.map(s=>s.value),Nt(this.max),r,Ft,Lo),o=this.tooltipState(n,t,r),a=Ot(this.color);return u`
297
+ `;let t=this.layoutSamples(),r=this.plotWidth(),n=Ki(t.map(s=>s.value),Nt(this.max),r,Vt,_o),o=this.tooltipState(n,t,r),a=$t(this.color);return u`
292
298
  <div class="container" part="container">
293
- <div class="plot" style=${`--spark-fill: ${_o(a)}`}>
299
+ <div class="plot" style=${`--spark-fill: ${Oo(a)}`}>
294
300
  <svg
295
301
  part="plot"
296
- viewBox="0 0 ${r} ${Ft}"
302
+ viewBox="0 0 ${r} ${Vt}"
297
303
  preserveAspectRatio="none"
298
304
  aria-hidden="true"
299
305
  @pointermove=${this.onPointerMove}
@@ -301,7 +307,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
301
307
  >
302
308
  ${n.map((s,l)=>this.renderBar(s,l))}
303
309
  <line class="frame" x1="0" x2=${r} y1="0.5" y2="0.5"></line>
304
- <line class="frame" x1="0" x2=${r} y1=${Ft-.5} y2=${Ft-.5}></line>
310
+ <line class="frame" x1="0" x2=${r} y1=${Vt-.5} y2=${Vt-.5}></line>
305
311
  </svg>
306
312
  ${o===null?"":u`
307
313
  <div class="tooltip" part="tooltip" style="left: ${o.left}px">${o.time===null?"":u`${o.time} · `}${this.valueFormatter(o.value)}</div>
@@ -309,7 +315,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
309
315
  </div>
310
316
  ${this.renderAxis(t)}
311
317
  </div>
312
- `}renderBar(e,t){return Number.isFinite(e.value)?ce`
318
+ `}renderBar(e,t){return Number.isFinite(e.value)?he`
313
319
  <rect
314
320
  class="bar"
315
321
  ?data-active=${t===this.hoverIndex}
@@ -323,21 +329,21 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
323
329
  <span>${this.timeFormatter(t)}</span>
324
330
  <span>${this.timeFormatter(r)}</span>
325
331
  </div>
326
- `}tooltipState(e,t,r){if(this.hoverIndex===null||this.hoverIndex<0||this.hoverIndex>=e.length)return null;let n=e[this.hoverIndex],o=t[this.hoverIndex];return o===void 0||!Number.isFinite(o.value)?null:{left:(n.left+n.width/2)/r*(this.chartWidth||r),value:o.value,time:o.time===void 0?null:this.timeFormatter(o.time)}}onPointerMove=e=>{let t=this.layoutSamples();if(t.length===0)return;let n=e.currentTarget.getBoundingClientRect(),o=Ki(e.clientX-n.left,n.width,t.length);o!==this.hoverIndex&&(this.hoverIndex=o,this.requestUpdate())};onPointerLeave=()=>{this.hoverIndex!==null&&(this.hoverIndex=null,this.requestUpdate())};observeSize(){typeof ResizeObserver>"u"||this.resizeObserver!==null||(this.resizeObserver=new ResizeObserver(e=>{let t=e[0]?.contentRect.width??0;t!==this.chartWidth&&(this.chartWidth=t,this.requestUpdate())}),this.resizeObserver.observe(this))}plotWidth(){return this.chartWidth>0?this.chartWidth:ko}samples(){return Ve(this.points)}layoutSamples(){return this.timeDomain===void 0?this.samples():this.points.flatMap(e=>e.time===void 0||!Number.isFinite(e.time)?[]:[{time:e.time,value:e.value}])}computeAriaLabel(){return ye(this.samples(),this.valueLabel??y("chart.values"),this.valueFormatter)??this.emptyLabel??y("chart.empty")}applyLocale(){this.emptyLabelState.setGenerated(y("chart.empty")),this.valueLabelState.setGenerated(y("chart.values"))}};var Gi=0,ee=class{host;baseId;generatedIds=new Map;constructor(e){this.host=e,this.baseId=`mndw-${e.localName}-${Gi}`,Gi+=1}sync(e,t=null){let r=new Set,n=e.map((o,a)=>{if(o.id===""){let s=this.generatedIds.get(o);if(s!==void 0)o.id=s;else{let l=a;for(;r.has(`${this.baseId}-label-${l}`);)l+=1;let c=`${this.baseId}-label-${l}`;this.generatedIds.set(o,c),o.id=c}}return r.add(o.id),o.id});n.length===0?this.host.removeAttribute("aria-labelledby"):this.host.setAttribute("aria-labelledby",n.join(" ")),t!==null&&(t.ariaLabelledByElements=Array.from(e))}},N=class{internals;host;options;fieldsetDisabled=!1;initialAttributes=null;constructor(e,t){this.host=e,this.options=t,this.internals=typeof e.attachInternals=="function"?e.attachInternals():null}get form(){return this.internals?.form??null}get labels(){let e=this.internals?.labels;return e?Array.from(e):[]}get effectiveDisabled(){return this.options.isExplicitlyDisabled()||this.fieldsetDisabled}captureInitialAttributes(e){this.initialAttributes||(this.initialAttributes=new Map(e.map(t=>[t,this.host.getAttribute(t)])))}restoreInitialAttributes(){if(this.initialAttributes)for(let[e,t]of this.initialAttributes)t===null?this.host.removeAttribute(e):this.host.setAttribute(e,t)}formDisabledCallback(e){this.fieldsetDisabled=e,this.options.onDisabledChange?.(this.effectiveDisabled)}formResetCallback(){this.restoreInitialAttributes(),this.options.onReset()}formStateRestoreCallback(e,t){this.options.onStateRestore(e,t)}setFormValue(e,t){this.internals&&(t===void 0?this.internals.setFormValue(e):this.internals.setFormValue(e,t))}setValidity(e,t="",r){this.internals&&(Object.keys(e).length===0?this.internals.setValidity({}):this.internals.setValidity(e,t,r))}clearValidity(){this.setValidity({})}};var R=v`
332
+ `}tooltipState(e,t,r){if(this.hoverIndex===null||this.hoverIndex<0||this.hoverIndex>=e.length)return null;let n=e[this.hoverIndex],o=t[this.hoverIndex];return o===void 0||!Number.isFinite(o.value)?null:{left:(n.left+n.width/2)/r*(this.chartWidth||r),value:o.value,time:o.time===void 0?null:this.timeFormatter(o.time)}}onPointerMove=e=>{let t=this.layoutSamples();if(t.length===0)return;let n=e.currentTarget.getBoundingClientRect(),o=Wi(e.clientX-n.left,n.width,t.length);o!==this.hoverIndex&&(this.hoverIndex=o,this.requestUpdate())};onPointerLeave=()=>{this.hoverIndex!==null&&(this.hoverIndex=null,this.requestUpdate())};observeSize(){typeof ResizeObserver>"u"||this.resizeObserver!==null||(this.resizeObserver=new ResizeObserver(e=>{let t=e[0]?.contentRect.width??0;t!==this.chartWidth&&(this.chartWidth=t,this.requestUpdate())}),this.resizeObserver.observe(this))}plotWidth(){return this.chartWidth>0?this.chartWidth:Do}samples(){return ze(this.points)}layoutSamples(){return this.timeDomain===void 0?this.samples():this.points.flatMap(e=>e.time===void 0||!Number.isFinite(e.time)?[]:[{time:e.time,value:e.value}])}computeAriaLabel(){return xe(this.samples(),this.valueLabel??w("chart.values"),this.valueFormatter)??this.emptyLabel??w("chart.empty")}applyLocale(){this.emptyLabelState.setGenerated(w("chart.empty")),this.valueLabelState.setGenerated(w("chart.values"))}};var Gi=0,re=class{host;baseId;generatedIds=new Map;constructor(e){this.host=e,this.baseId=`mndw-${e.localName}-${Gi}`,Gi+=1}sync(e,t=null){let r=new Set,n=e.map((o,a)=>{if(o.id===""){let s=this.generatedIds.get(o);if(s!==void 0)o.id=s;else{let l=a;for(;r.has(`${this.baseId}-label-${l}`);)l+=1;let c=`${this.baseId}-label-${l}`;this.generatedIds.set(o,c),o.id=c}}return r.add(o.id),o.id});n.length===0?this.host.removeAttribute("aria-labelledby"):this.host.setAttribute("aria-labelledby",n.join(" ")),t!==null&&(t.ariaLabelledByElements=Array.from(e))}},O=class{internals;host;options;fieldsetDisabled=!1;initialAttributes=null;constructor(e,t){this.host=e,this.options=t,this.internals=typeof e.attachInternals=="function"?e.attachInternals():null}get form(){return this.internals?.form??null}get labels(){let e=this.internals?.labels;return e?Array.from(e):[]}get effectiveDisabled(){return this.options.isExplicitlyDisabled()||this.fieldsetDisabled}captureInitialAttributes(e){this.initialAttributes||(this.initialAttributes=new Map(e.map(t=>[t,this.host.getAttribute(t)])))}restoreInitialAttributes(){if(this.initialAttributes)for(let[e,t]of this.initialAttributes)t===null?this.host.removeAttribute(e):this.host.setAttribute(e,t)}formDisabledCallback(e){this.fieldsetDisabled=e,this.options.onDisabledChange?.(this.effectiveDisabled)}formResetCallback(){this.restoreInitialAttributes(),this.options.onReset()}formStateRestoreCallback(e,t){this.options.onStateRestore(e,t)}setFormValue(e,t){this.internals&&(t===void 0?this.internals.setFormValue(e):this.internals.setFormValue(e,t))}setValidity(e,t="",r){this.internals&&(Object.keys(e).length===0?this.internals.setValidity({}):this.internals.setValidity(e,t,r))}clearValidity(){this.setValidity({})}};var A=v`
327
333
  outline: var(--mndw-focus-w) solid var(--mndw-focus-ring);
328
334
  outline-offset: 0.0625rem;
329
- `,Ce=v`
335
+ `,Te=v`
330
336
  border-color: var(--mndw-text-subtle);
331
337
  `,$=v`
332
338
  background: var(--mndw-surface-hover);
333
- `,Me=v`
339
+ `,Ee=v`
334
340
  background: var(--mndw-control-hover);
335
- `,te=v`
341
+ `,ie=v`
336
342
  border-color: var(--mndw-accent-hover);
337
343
  background: var(--mndw-accent-hover);
338
- `,re=v`
344
+ `,ne=v`
339
345
  color: var(--mndw-text);
340
- `,B=v`
346
+ `,K=v`
341
347
  box-sizing: border-box;
342
348
  min-height: var(--mndw-control-h);
343
349
  padding: 0 var(--mndw-space-3);
@@ -348,7 +354,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
348
354
  `,M=v`
349
355
  font-family: var(--mndw-font-sans);
350
356
  font-size: var(--mndw-text-sm);
351
- `;var kr="mndw-button",Ge=class extends g{static formAssociated=!0;static shadowRootOptions={mode:"open",delegatesFocus:!0};static properties={variant:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},type:{type:String},ariaLabel:{type:String,attribute:"aria-label"}};static styles=v`
357
+ `;var kr="mndw-button",Ge=class extends g{static formAssociated=!0;static shadowRootOptions={mode:"open",delegatesFocus:!0};static properties={variant:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},type:{type:String},ariaLabel:{type:String,attribute:"aria-label"},ariaExpanded:{type:String,attribute:"aria-expanded"},ariaPressed:{type:String,attribute:"aria-pressed"},ariaHaspopup:{type:String,attribute:"aria-haspopup"},ariaControls:{type:String,attribute:"aria-controls"}};static styles=v`
352
358
  :host {
353
359
  ${M}
354
360
 
@@ -361,7 +367,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
361
367
  }
362
368
 
363
369
  button {
364
- ${B}
370
+ ${K}
365
371
 
366
372
  display: inline-flex;
367
373
  gap: var(--mndw-space-2);
@@ -373,7 +379,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
373
379
  }
374
380
 
375
381
  button:focus-visible {
376
- ${R}
382
+ ${A}
377
383
  }
378
384
 
379
385
  :host([variant='primary']) button {
@@ -383,7 +389,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
383
389
  }
384
390
 
385
391
  :host([variant='primary']) button:not(:disabled):hover {
386
- ${te}
392
+ ${ie}
387
393
  }
388
394
 
389
395
  :host([variant='secondary']) button {
@@ -403,8 +409,8 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
403
409
  }
404
410
 
405
411
  :host([variant='ghost']) button:not(:disabled):hover {
406
- ${Me}
407
- ${re}
412
+ ${Ee}
413
+ ${ne}
408
414
  }
409
415
 
410
416
  /*
@@ -420,16 +426,19 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
420
426
  :host([variant='danger']) button:not(:disabled):hover {
421
427
  background: color-mix(in srgb, var(--mndw-danger) 12%, var(--mndw-danger-bg));
422
428
  }
423
- `;formState=new N(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>{},onStateRestore:()=>{},onDisabledChange:()=>{this.requestUpdate()}});constructor(){super(),this.variant="secondary",this.disabled=!1,this.type="button",this.ariaLabel="",this.addEventListener("click",this.onClick)}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}render(){return u`
429
+ `;formState=new O(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>{},onStateRestore:()=>{},onDisabledChange:()=>{this.requestUpdate()}});constructor(){super(),this.variant="secondary",this.disabled=!1,this.type="button",this.ariaLabel="",this.ariaExpanded="",this.ariaPressed="",this.ariaHaspopup="",this.ariaControls="",this.addEventListener("click",this.onClick)}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}render(){return u`
424
430
  <button
425
431
  part="button"
426
432
  type="button"
427
- aria-label=${this.ariaLabel||b}
433
+ aria-label=${this.ariaLabel||m}
434
+ aria-expanded=${this.ariaExpanded||m}
435
+ aria-pressed=${this.ariaPressed||m}
436
+ aria-haspopup=${this.ariaHaspopup||m}
428
437
  ?disabled=${this.formState.effectiveDisabled}
429
438
  >
430
439
  <slot></slot>
431
440
  </button>
432
- `}updated(){let e=this.renderRoot.querySelector("button");e&&(e.disabled=this.formState.effectiveDisabled)}onClick=e=>{if(this.formState.effectiveDisabled){e.preventDefault();return}let t=this.formState.form;t&&(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())}};var Vt="mndw-field",Ht="mndwlabelchange";function ue(i){i.dispatchEvent(new Event(Ht,{bubbles:!0,composed:!0}))}var Po=new Set(["button","input","meter","output","progress","select","textarea"]),Do=/\s+/u,Wi=0;function _r(i){let e=i.getRootNode();return typeof e.querySelectorAll=="function"?e:null}function qi(i,e){return(i.getAttribute(e)??"").split(Do).filter(t=>t!=="")}var We=class extends H{static properties={label:{type:String},hint:{type:String},error:{type:String},required:{type:Boolean,reflect:!0}};fieldId;observer;ownedTokens=new Map;ownedAttributes=new Map;ownedNodes=null;control=null;ownsControlId=!1;constructor(){super(),Wi+=1,this.fieldId=`mndw-field-${Wi}`,this.label="",this.hint="",this.error="",this.required=!1,this.observer=new MutationObserver(this.onMutations)}connectedCallback(){super.connectedCallback(),this.ownedNodes??=this.createOwnedNodes(),this.classList.add("mndw-field"),this.addEventListener(Ht,this.onLabelChange),this.observe(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(Ht,this.onLabelChange),this.observer.disconnect(),this.releaseControl()}createRenderRoot(){return this}updated(){this.wire()}createOwnedNodes(){let e=document.createElement("label"),t=document.createTextNode(""),r=document.createElement("span"),n=document.createElement("div"),o=document.createElement("div");return e.className="mndw-field__label",e.id=`${this.fieldId}-label`,r.className="mndw-field__required",r.setAttribute("aria-hidden","true"),r.textContent=" *",r.hidden=!0,e.append(t,r),n.className="mndw-field__hint",n.id=`${this.fieldId}-hint`,n.hidden=!0,o.className="mndw-field__error",o.id=`${this.fieldId}-error`,o.setAttribute("role","alert"),o.hidden=!0,{label:e,text:t,marker:r,hint:n,error:o}}wire(){let e=this.ownedNodes;if(!e||!this.isConnected)return;this.placeOwnedNodes(e);let t=this.resolveControl(e);t!==this.control&&(this.releaseControl(),this.control=t,this.observe());let r=this.label.trim()!==""&&(t===null||!this.hasOwnLabel(t,e));if(e.text.textContent=this.label,e.marker.hidden=!this.required,e.label.hidden=!r,e.hint.textContent=this.hint,e.hint.hidden=this.hint==="",e.error.textContent=this.error,e.error.hidden=this.error==="",!t){e.label.removeAttribute("for");return}this.syncControlId(t),this.syncLabelAssociation(t,e,r),this.syncDescriptions(t,e),this.syncStates(t)}placeOwnedNodes(e){this.firstChild!==e.label&&this.insertBefore(e.label,this.firstChild),this.lastChild!==e.error&&this.appendChild(e.error),e.error.previousSibling!==e.hint&&this.insertBefore(e.hint,e.error)}resolveControl(e){for(let t of this.childNodes)if(t.nodeType===Node.ELEMENT_NODE&&!this.isOwnedNode(t,e))return t;return null}syncControlId(e){let t=`${this.fieldId}-control`;e.id===""?(e.id=t,this.ownsControlId=!0):e.id!==t&&(this.ownsControlId=!1)}syncLabelAssociation(e,t,r){if(r&&this.isLabelable(e)){let a=t.label.htmlFor;t.label.htmlFor=e.id;let s=this.syncTokens(e,"aria-labelledby",[]);(a!==t.label.htmlFor||s)&&this.refreshAccessibleName(e);return}let n=t.label.hasAttribute("for");t.label.removeAttribute("for");let o=this.syncTokens(e,"aria-labelledby",r?[t.label.id]:[]);(n||o)&&this.refreshAccessibleName(e)}refreshAccessibleName(e){e.refreshAccessibleName?.call(e)}syncDescriptions(e,t){let r=[];this.hint!==""&&r.push(t.hint.id),this.error!==""&&r.push(t.error.id),this.syncTokens(e,"aria-describedby",r)}syncStates(e){this.error!==""?this.setOwnedAttribute(e,"aria-invalid","true"):this.clearOwnedAttribute(e,"aria-invalid"),this.required?this.setOwnedAttribute(e,"required",""):this.clearOwnedAttribute(e,"required")}syncTokens(e,t,r){let n=this.ownedTokens.get(t)??new Set,o=qi(e,t).filter(c=>!n.has(c)),a=[...o,...r.filter(c=>!o.includes(c))];if(r.length===0?this.ownedTokens.delete(t):this.ownedTokens.set(t,new Set(r)),a.length===0){let c=e.hasAttribute(t);return e.removeAttribute(t),c}let s=a.join(" "),l=e.getAttribute(t)!==s;return l&&e.setAttribute(t,s),l}setOwnedAttribute(e,t,r){this.ownedAttributes.has(t)||this.ownedAttributes.set(t,e.getAttribute(t)),e.getAttribute(t)!==r&&e.setAttribute(t,r)}clearOwnedAttribute(e,t){if(!this.ownedAttributes.has(t))return;let r=this.ownedAttributes.get(t)??null;this.ownedAttributes.delete(t),r===null?e.removeAttribute(t):e.setAttribute(t,r)}releaseControl(){let e=this.control;if(e){for(let t of[...this.ownedTokens.keys()])this.syncTokens(e,t,[]);for(let t of[...this.ownedAttributes.keys()])this.clearOwnedAttribute(e,t);this.ownsControlId&&e.id===`${this.fieldId}-control`&&e.removeAttribute("id"),this.ownedNodes?.label.removeAttribute("for"),this.ownsControlId=!1,this.control=null}}hasOwnLabel(e,t){return(e.getAttribute("aria-label")??"").trim()!==""||this.hasResolvedLabelledBy(e,t)||this.associatedLabels(e,t).length>0?!0:this.hasControlLabelSource(e)}hasResolvedLabelledBy(e,t){let r=_r(e);if(!r)return!1;let n=[...r.querySelectorAll("[id]")];return qi(e,"aria-labelledby").some(a=>n.some(s=>s.id===a&&s!==t.label))}associatedLabels(e,t){let r=_r(e);return r?[...r.querySelectorAll("label")].filter(n=>n!==t.label&&this.labelsControl(n,e)):[]}labelsControl(e,t){return e.control===t?!0:e.control===null&&e.htmlFor!==""&&e.htmlFor===t.id&&this.isLabelable(t)}hasControlLabelSource(e){let t=e.constructor.mndwLabelSource;if(t==="label-property"){let r=e.label;return typeof r=="string"&&r.trim()!==""}return t==="slot"?(e.textContent??"").trim()!=="":!1}isLabelable(e){return Po.has(e.localName)?e.localName!=="input"||e.getAttribute("type")!=="hidden":e.constructor.formAssociated===!0}isOwnedNode(e,t){return e===t.label||e===t.hint||e===t.error||t.label.contains(e)||t.hint.contains(e)||t.error.contains(e)}observe(){if(!this.isConnected)return;this.observer.disconnect(),this.observer.observe(this,{childList:!0,subtree:!0,characterData:!0});let e=this.control;if(!e)return;this.observer.observe(e,{attributes:!0,attributeFilter:["id","aria-label","aria-labelledby"]});let t=_r(e);t&&this.observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["for"]})}onMutations=e=>{let t=this.ownedNodes;if(!t)return;e.some(n=>this.isRelevantMutation(n,t))&&this.requestUpdate()};isRelevantMutation(e,t){return this.isOwnedNode(e.target,t)||this.isInAnotherField(e.target)?!1:e.type!=="childList"?!0:[...e.addedNodes,...e.removedNodes].some(n=>!this.isOwnedNode(n,t)&&!this.isInAnotherField(n))}isInAnotherField(e){let r=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(Vt);return r!=null&&r!==this}onLabelChange=()=>{this.requestUpdate()}};var Pr="mndw-checkbox",qe=class extends g{static formAssociated=!0;static mndwLabelSource="slot";static properties={checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},value:{type:String,reflect:!0},name:{type:String,reflect:!0}};static styles=v`
441
+ `}updated(){let e=this.renderRoot.querySelector("button");e&&(e.disabled=this.formState.effectiveDisabled,this.syncAriaControls(e))}syncAriaControls(e){let t=this.ariaControls?.trim().split(/\s+/).filter(n=>n!=="")??[];if("ariaControlsElements"in e){let n=t.map(o=>this.ownerDocument.getElementById(o)).filter(o=>o!==null);e.ariaControlsElements=n.length>0?n:null}else{let n=t.join(" ");n===""?e.removeAttribute("aria-controls"):e.setAttribute("aria-controls",n)}}onClick=e=>{if(this.formState.effectiveDisabled){e.preventDefault();return}let t=this.formState.form;t&&(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())}};var Ut="mndw-field",zt="mndwlabelchange";function pe(i){i.dispatchEvent(new Event(zt,{bubbles:!0,composed:!0}))}var No=new Set(["button","input","meter","output","progress","select","textarea"]),$o=/\s+/u,qi=0;function Pr(i){let e=i.getRootNode();return typeof e.querySelectorAll=="function"?e:null}function ji(i,e){return(i.getAttribute(e)??"").split($o).filter(t=>t!=="")}var qe=class extends H{static properties={label:{type:String},hint:{type:String},error:{type:String},required:{type:Boolean,reflect:!0}};fieldId;observer;ownedTokens=new Map;ownedAttributes=new Map;ownedNodes=null;control=null;ownsControlId=!1;constructor(){super(),qi+=1,this.fieldId=`mndw-field-${qi}`,this.label="",this.hint="",this.error="",this.required=!1,this.observer=new MutationObserver(this.onMutations)}connectedCallback(){super.connectedCallback(),this.ownedNodes??=this.createOwnedNodes(),this.classList.add("mndw-field"),this.addEventListener(zt,this.onLabelChange),this.observe(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(zt,this.onLabelChange),this.observer.disconnect(),this.releaseControl()}createRenderRoot(){return this}updated(){this.wire()}createOwnedNodes(){let e=document.createElement("label"),t=document.createTextNode(""),r=document.createElement("span"),n=document.createElement("div"),o=document.createElement("div");return e.className="mndw-field__label",e.id=`${this.fieldId}-label`,r.className="mndw-field__required",r.setAttribute("aria-hidden","true"),r.textContent=" *",r.hidden=!0,e.append(t,r),n.className="mndw-field__hint",n.id=`${this.fieldId}-hint`,n.hidden=!0,o.className="mndw-field__error",o.id=`${this.fieldId}-error`,o.setAttribute("role","alert"),o.hidden=!0,{label:e,text:t,marker:r,hint:n,error:o}}wire(){let e=this.ownedNodes;if(!e||!this.isConnected)return;this.placeOwnedNodes(e);let t=this.resolveControl(e);t!==this.control&&(this.releaseControl(),this.control=t,this.observe());let r=this.label.trim()!==""&&(t===null||!this.hasOwnLabel(t,e));if(e.text.textContent=this.label,e.marker.hidden=!this.required,e.label.hidden=!r,e.hint.textContent=this.hint,e.hint.hidden=this.hint==="",e.error.textContent=this.error,e.error.hidden=this.error==="",!t){e.label.removeAttribute("for");return}this.syncControlId(t),this.syncLabelAssociation(t,e,r),this.syncDescriptions(t,e),this.syncStates(t)}placeOwnedNodes(e){this.firstChild!==e.label&&this.insertBefore(e.label,this.firstChild),this.lastChild!==e.error&&this.appendChild(e.error),e.error.previousSibling!==e.hint&&this.insertBefore(e.hint,e.error)}resolveControl(e){for(let t of this.childNodes)if(t.nodeType===Node.ELEMENT_NODE&&!this.isOwnedNode(t,e))return t;return null}syncControlId(e){let t=`${this.fieldId}-control`;e.id===""?(e.id=t,this.ownsControlId=!0):e.id!==t&&(this.ownsControlId=!1)}syncLabelAssociation(e,t,r){if(r&&this.isLabelable(e)){let a=t.label.htmlFor;t.label.htmlFor=e.id;let s=this.syncTokens(e,"aria-labelledby",[]);(a!==t.label.htmlFor||s)&&this.refreshAccessibleName(e);return}let n=t.label.hasAttribute("for");t.label.removeAttribute("for");let o=this.syncTokens(e,"aria-labelledby",r?[t.label.id]:[]);(n||o)&&this.refreshAccessibleName(e)}refreshAccessibleName(e){e.refreshAccessibleName?.call(e)}syncDescriptions(e,t){let r=[];this.hint!==""&&r.push(t.hint.id),this.error!==""&&r.push(t.error.id),this.syncTokens(e,"aria-describedby",r)}syncStates(e){this.error!==""?this.setOwnedAttribute(e,"aria-invalid","true"):this.clearOwnedAttribute(e,"aria-invalid"),this.required?this.setOwnedAttribute(e,"required",""):this.clearOwnedAttribute(e,"required")}syncTokens(e,t,r){let n=this.ownedTokens.get(t)??new Set,o=ji(e,t).filter(c=>!n.has(c)),a=[...o,...r.filter(c=>!o.includes(c))];if(r.length===0?this.ownedTokens.delete(t):this.ownedTokens.set(t,new Set(r)),a.length===0){let c=e.hasAttribute(t);return e.removeAttribute(t),c}let s=a.join(" "),l=e.getAttribute(t)!==s;return l&&e.setAttribute(t,s),l}setOwnedAttribute(e,t,r){this.ownedAttributes.has(t)||this.ownedAttributes.set(t,e.getAttribute(t)),e.getAttribute(t)!==r&&e.setAttribute(t,r)}clearOwnedAttribute(e,t){if(!this.ownedAttributes.has(t))return;let r=this.ownedAttributes.get(t)??null;this.ownedAttributes.delete(t),r===null?e.removeAttribute(t):e.setAttribute(t,r)}releaseControl(){let e=this.control;if(e){for(let t of[...this.ownedTokens.keys()])this.syncTokens(e,t,[]);for(let t of[...this.ownedAttributes.keys()])this.clearOwnedAttribute(e,t);this.ownsControlId&&e.id===`${this.fieldId}-control`&&e.removeAttribute("id"),this.ownedNodes?.label.removeAttribute("for"),this.ownsControlId=!1,this.control=null}}hasOwnLabel(e,t){return(e.getAttribute("aria-label")??"").trim()!==""||this.hasResolvedLabelledBy(e,t)||this.associatedLabels(e,t).length>0?!0:this.hasControlLabelSource(e)}hasResolvedLabelledBy(e,t){let r=Pr(e);if(!r)return!1;let n=[...r.querySelectorAll("[id]")];return ji(e,"aria-labelledby").some(a=>n.some(s=>s.id===a&&s!==t.label))}associatedLabels(e,t){let r=Pr(e);return r?[...r.querySelectorAll("label")].filter(n=>n!==t.label&&this.labelsControl(n,e)):[]}labelsControl(e,t){return e.control===t?!0:e.control===null&&e.htmlFor!==""&&e.htmlFor===t.id&&this.isLabelable(t)}hasControlLabelSource(e){let t=e.constructor.mndwLabelSource;if(t==="label-property"){let r=e.label;return typeof r=="string"&&r.trim()!==""}return t==="slot"?(e.textContent??"").trim()!=="":!1}isLabelable(e){return No.has(e.localName)?e.localName!=="input"||e.getAttribute("type")!=="hidden":e.constructor.formAssociated===!0}isOwnedNode(e,t){return e===t.label||e===t.hint||e===t.error||t.label.contains(e)||t.hint.contains(e)||t.error.contains(e)}observe(){if(!this.isConnected)return;this.observer.disconnect(),this.observer.observe(this,{childList:!0,subtree:!0,characterData:!0});let e=this.control;if(!e)return;this.observer.observe(e,{attributes:!0,attributeFilter:["id","aria-label","aria-labelledby"]});let t=Pr(e);t&&this.observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["for"]})}onMutations=e=>{let t=this.ownedNodes;if(!t)return;e.some(n=>this.isRelevantMutation(n,t))&&this.requestUpdate()};isRelevantMutation(e,t){return this.isOwnedNode(e.target,t)||this.isInAnotherField(e.target)?!1:e.type!=="childList"?!0:[...e.addedNodes,...e.removedNodes].some(n=>!this.isOwnedNode(n,t)&&!this.isInAnotherField(n))}isInAnotherField(e){let r=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(Ut);return r!=null&&r!==this}onLabelChange=()=>{this.requestUpdate()}};var _r="mndw-checkbox",je=class extends g{static formAssociated=!0;static mndwLabelSource="slot";static properties={checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},value:{type:String,reflect:!0},name:{type:String,reflect:!0}};static styles=v`
433
442
  :host {
434
443
  ${M}
435
444
 
@@ -480,7 +489,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
480
489
 
481
490
  :host([checked]:not([disabled]):not([aria-disabled='true']):not([invalid]):not([aria-invalid='true']):hover) [part='box'],
482
491
  :host([indeterminate]:not([disabled]):not([aria-disabled='true']):not([invalid]):not([aria-invalid='true']):hover) [part='box'] {
483
- ${te}
492
+ ${ie}
484
493
  }
485
494
 
486
495
  [part='mark'] {
@@ -512,9 +521,9 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
512
521
  }
513
522
 
514
523
  :host(:focus-visible) [part='box'] {
515
- ${R}
524
+ ${A}
516
525
  }
517
- `;formState=new N(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});labelController=new ee(this);labelObserver;labelSlot=null;localeController=new L(this);constructor(){super(),this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.required=!1,this.invalid=!1,this.value="on",this.name="",this.labelObserver=new MutationObserver(()=>{ue(this)}),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown)}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["checked"]),this.labelObserver.observe(this,{childList:!0,subtree:!0,characterData:!0})}disconnectedCallback(){this.labelObserver.disconnect(),this.labelSlot?.removeEventListener("slotchange",this.onLabelSlotChange),this.labelSlot=null,super.disconnectedCallback()}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}render(){return u`
526
+ `;formState=new O(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});labelController=new re(this);labelObserver;labelSlot=null;localeController=new L(this);constructor(){super(),this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.required=!1,this.invalid=!1,this.value="on",this.name="",this.labelObserver=new MutationObserver(()=>{pe(this)}),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown)}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["checked"]),this.labelObserver.observe(this,{childList:!0,subtree:!0,characterData:!0})}disconnectedCallback(){this.labelObserver.disconnect(),this.labelSlot?.removeEventListener("slotchange",this.onLabelSlotChange),this.labelSlot=null,super.disconnectedCallback()}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}render(){return u`
518
527
  <div
519
528
  part="box"
520
529
  aria-hidden="true"
@@ -522,7 +531,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
522
531
  <span part="mark"><mndw-icon name="check"></mndw-icon></span>
523
532
  </div>
524
533
  <slot part="label"></slot>
525
- `}updated(){let e=this.shadowRoot?.querySelector('slot[part="label"]')??null;e!==this.labelSlot&&(this.labelSlot?.removeEventListener("slotchange",this.onLabelSlotChange),e?.addEventListener("slotchange",this.onLabelSlotChange),this.labelSlot=e);let t=this.indeterminate?"mixed":String(this.checked),r=this.formState.effectiveDisabled;this.setAttribute("role","checkbox"),this.setAttribute("aria-checked",t),this.setAttribute("aria-disabled",String(r)),this.setAttribute("aria-required",String(this.required)),this.tabIndex=r?-1:0;let n=this.formState.labels;this.labelController.sync(n,this.formState.internals),this.formState.internals?.setFormValue(this.checked?this.value:null,this.indeterminate?"indeterminate":this.checked?"checked":"unchecked"),this.formState.internals&&(this.formState.internals.role="checkbox",this.formState.internals.ariaChecked=t,this.formState.internals.ariaDisabled=String(r),this.formState.internals.ariaRequired=String(this.required),this.checked?this.formState.internals.states.add("checked"):this.formState.internals.states.delete("checked")),this.required&&!this.checked?this.formState.setValidity({valueMissing:!0},y("checkbox.validation.required")):this.formState.clearValidity();let o=this.invalid||this.required&&!this.checked||this.formState.internals?.validity?.valid===!1;this.setAttribute("aria-invalid",String(o)),this.formState.internals&&(this.formState.internals.ariaInvalid=String(o))}onLabelSlotChange=()=>{ue(this)};handleClick=e=>{if(this.formState.effectiveDisabled){e.preventDefault();return}this.toggle()};handleKeyDown=e=>{this.formState.effectiveDisabled||e.key!==" "||(e.preventDefault(),this.toggle())};toggle(){this.indeterminate=!1,this.checked=!this.checked,this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{checked:this.checked,indeterminate:this.indeterminate}}))}resetForm=()=>{this.checked=this.hasAttribute("checked"),this.indeterminate=!1};restoreFormState=e=>{typeof e=="string"&&(e==="checked"?(this.checked=!0,this.indeterminate=!1):e==="unchecked"?(this.checked=!1,this.indeterminate=!1):e==="indeterminate"&&(this.checked=!1,this.indeterminate=!0))}};var ji=["activity","arrow-down","arrow-left","arrow-right","arrow-up","arrow-up-down","check","chevron-down","chevron-left","chevron-right","chevron-up","circle-alert","circle-arrow-up","circle-question-mark","circle-x","copy","download","ellipsis","ellipsis-vertical","eye","eye-off","info","log-out","menu","minus","moon","pencil","plus","refresh-cw","search","settings","sun","trash","unlink","x"],No=new Set(ji);function Yi(i){return No.has(i)}var Xi=Symbol.for("mndw.ui.iconSprite"),Ji=globalThis;function Dr(){let i=Ji[Xi];if(i!==void 0)return i;let e={url:"",listeners:new Set};return Ji[Xi]=e,e}function Zi(){return Dr().url}function Qi(i){if(i.includes("#"))throw new Error(`iconSpriteUrl must not contain a fragment reference: "${i}"`);let e=Dr();if(i!==e.url){e.url=i;for(let t of[...e.listeners])t()}}function Nr(i){let e=Dr().listeners;return e.add(i),()=>{e.delete(i)}}var Or="mndw-icon",Oo="0 0 24 24";function en(i){let e=Zi();return e===""?"":`${e}#mndw-icon-${i}`}var je=class extends g{static properties={name:{type:String,reflect:!0},label:{type:String,reflect:!0}};static styles=v`
534
+ `}updated(){let e=this.shadowRoot?.querySelector('slot[part="label"]')??null;e!==this.labelSlot&&(this.labelSlot?.removeEventListener("slotchange",this.onLabelSlotChange),e?.addEventListener("slotchange",this.onLabelSlotChange),this.labelSlot=e);let t=this.indeterminate?"mixed":String(this.checked),r=this.formState.effectiveDisabled;this.setAttribute("role","checkbox"),this.setAttribute("aria-checked",t),this.setAttribute("aria-disabled",String(r)),this.setAttribute("aria-required",String(this.required)),this.tabIndex=r?-1:0;let n=this.formState.labels;this.labelController.sync(n,this.formState.internals),this.formState.internals?.setFormValue(this.checked?this.value:null,this.indeterminate?"indeterminate":this.checked?"checked":"unchecked"),this.formState.internals&&(this.formState.internals.role="checkbox",this.formState.internals.ariaChecked=t,this.formState.internals.ariaDisabled=String(r),this.formState.internals.ariaRequired=String(this.required),this.checked?this.formState.internals.states.add("checked"):this.formState.internals.states.delete("checked")),this.required&&!this.checked?this.formState.setValidity({valueMissing:!0},w("checkbox.validation.required")):this.formState.clearValidity();let o=this.invalid||this.required&&!this.checked||this.formState.internals?.validity?.valid===!1;this.setAttribute("aria-invalid",String(o)),this.formState.internals&&(this.formState.internals.ariaInvalid=String(o))}onLabelSlotChange=()=>{pe(this)};handleClick=e=>{if(this.formState.effectiveDisabled){e.preventDefault();return}this.toggle()};handleKeyDown=e=>{this.formState.effectiveDisabled||e.key!==" "||(e.preventDefault(),this.toggle())};toggle(){this.indeterminate=!1,this.checked=!this.checked,this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{checked:this.checked,indeterminate:this.indeterminate}}))}resetForm=()=>{this.checked=this.hasAttribute("checked"),this.indeterminate=!1};restoreFormState=e=>{typeof e=="string"&&(e==="checked"?(this.checked=!0,this.indeterminate=!1):e==="unchecked"?(this.checked=!1,this.indeterminate=!1):e==="indeterminate"&&(this.checked=!1,this.indeterminate=!0))}};var Yi=["activity","arrow-down","arrow-left","arrow-right","arrow-up","arrow-up-down","check","chevron-down","chevron-left","chevron-right","chevron-up","circle-alert","circle-arrow-up","circle-question-mark","circle-x","copy","download","ellipsis","ellipsis-vertical","eye","eye-off","info","log-out","menu","minus","moon","pencil","plus","refresh-cw","search","settings","sun","trash","unlink","x"],Io=new Set(Yi);function Xi(i){return Io.has(i)}var Ji=Symbol.for("mndw.ui.iconSprite"),Zi=globalThis;function Dr(){let i=Zi[Ji];if(i!==void 0)return i;let e={url:"",listeners:new Set};return Zi[Ji]=e,e}function Qi(){return Dr().url}function en(i){if(i.includes("#"))throw new Error(`iconSpriteUrl must not contain a fragment reference: "${i}"`);let e=Dr();if(i!==e.url){e.url=i;for(let t of[...e.listeners])t()}}function Or(i){let e=Dr().listeners;return e.add(i),()=>{e.delete(i)}}var Nr="mndw-icon",Fo="0 0 24 24";function tn(i){let e=Qi();return e===""?"":`${e}#mndw-icon-${i}`}var Ye=class extends g{static properties={name:{type:String,reflect:!0},label:{type:String,reflect:!0}};static styles=v`
526
535
  :host {
527
536
  display: inline-block;
528
537
  width: 1em;
@@ -536,18 +545,18 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
536
545
  width: 100%;
537
546
  height: 100%;
538
547
  }
539
- `;constructor(){super(),this.name="",this.label=""}_unsubscribe=null;_onSpriteUrlChange=()=>{this.requestUpdate()};connectedCallback(){super.connectedCallback(),this._unsubscribe?.(),this._unsubscribe=Nr(this._onSpriteUrlChange),this.requestUpdate()}disconnectedCallback(){this._unsubscribe?.(),this._unsubscribe=null,super.disconnectedCallback()}render(){let e=this._href(),t=this.label!=="";return u`
548
+ `;constructor(){super(),this.name="",this.label=""}_unsubscribe=null;_onSpriteUrlChange=()=>{this.requestUpdate()};connectedCallback(){super.connectedCallback(),this._unsubscribe?.(),this._unsubscribe=Or(this._onSpriteUrlChange),this.requestUpdate()}disconnectedCallback(){this._unsubscribe?.(),this._unsubscribe=null,super.disconnectedCallback()}render(){let e=this._href(),t=this.label!=="";return u`
540
549
  <svg
541
550
  part="svg"
542
- viewBox=${Oo}
551
+ viewBox=${Fo}
543
552
  role="img"
544
553
  focusable="false"
545
- aria-hidden=${t?b:"true"}
546
- aria-label=${t?this.label:b}
554
+ aria-hidden=${t?m:"true"}
555
+ aria-label=${t?this.label:m}
547
556
  >
548
- ${e===""?b:ce`<use href=${e}></use>`}
557
+ ${e===""?m:he`<use href=${e}></use>`}
549
558
  </svg>
550
- `}_href(){return Yi(this.name)?en(this.name):""}};var $o=["id","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-required"],nn=/\s+/u,Io=/\s+/gu,Fo="ariaDescription"in Element.prototype;function tn(i){let e=i.getRootNode();return typeof e.querySelectorAll=="function"?e:null}function on(i,e){return typeof i.getElementById=="function"?i.getElementById(e):i.querySelector(`[id="${e}"]`)}function F(i,e,t){if(t===""){i.removeAttribute(e);return}i.getAttribute(e)!==t&&i.setAttribute(e,t)}function $r(i){return(i??"").replace(Io," ").trim()}function Ir(i){if(i.nodeType===Node.TEXT_NODE)return i.textContent??"";if(i.nodeType!==Node.ELEMENT_NODE||i.getAttribute("aria-hidden")==="true")return"";let e="";for(let t of i.childNodes)e+=Ir(t);return e}function Ho(i){return i.map(e=>$r(Ir(e))).filter(e=>e!=="").join(" ")}function rn(i,e){return!i||e===null?"":e.split(nn).filter(t=>t!=="").map(t=>on(i,t)).filter(t=>t!==null).map(t=>$r(Ir(t))).filter(t=>t!=="").join(" ")}function Vo(i,e,t=Fo){return t?i:[i,e].filter(r=>r!=="").join(" ")}function zt(i){return{badInput:i.badInput,patternMismatch:i.patternMismatch,rangeOverflow:i.rangeOverflow,rangeUnderflow:i.rangeUnderflow,stepMismatch:i.stepMismatch,tooLong:i.tooLong,tooShort:i.tooShort,typeMismatch:i.typeMismatch,valueMissing:i.valueMissing}}var Ee=class{host;options;hostObserver;referenceObserver;constructor(e,t){this.host=e,this.options=t,this.hostObserver=new MutationObserver(this.onMutation),this.referenceObserver=new MutationObserver(this.onMutation)}connect(){this.hostObserver.observe(this.host,{attributes:!0,attributeFilter:$o})}disconnect(){this.hostObserver.disconnect(),this.referenceObserver.disconnect()}get hasAriaRequired(){return this.host.getAttribute("aria-required")==="true"}get labels(){let e=this.options.formState.labels;if(e.length>0)return e;let t=tn(this.host);return!t||this.host.id===""?[]:[...t.querySelectorAll("label")].filter(r=>r.htmlFor===this.host.id)}sync(e){let t=this.labels,r=tn(this.host),n=this.resolveName(t,r),o=rn(r,this.host.getAttribute("aria-describedby"));F(e,"aria-label",Vo(n,o)),F(e,"aria-description",o),F(e,"aria-invalid",this.announcedInvalid()?"true":""),this.observeReferences(t,r)}resolveName(e,t){return this.host.hasAttribute("aria-labelledby")?rn(t,this.host.getAttribute("aria-labelledby")):this.host.hasAttribute("aria-label")?$r(this.host.getAttribute("aria-label")):Ho(e)}announcedInvalid(){let e=this.host.getAttribute("aria-invalid");return e!==null?e!=="false":this.options.isInvalid()?!0:this.options.formState.internals?.validity.valid===!1}observeReferences(e,t){this.referenceObserver.disconnect();let r=new Set(e);for(let n of["aria-labelledby","aria-describedby"]){let o=this.host.getAttribute(n);if(!(o===null||!t))for(let a of o.split(nn).filter(s=>s!=="")){let s=on(t,a);s&&r.add(s)}}for(let n of r)this.referenceObserver.observe(n,{childList:!0,subtree:!0,characterData:!0})}onMutation=()=>{this.host.requestUpdate()}},Te=class{onCommit;baseline=null;fromUserInput=!1;constructor(e){this.onCommit=e}captureBaseline(e){this.baseline=e}releaseBaseline(){this.baseline=null}markUserInput(){this.fromUserInput=!0}syncValue(e){if(this.fromUserInput){this.fromUserInput=!1;return}this.baseline!==null&&(this.baseline=e)}commit(e){this.baseline===null||this.baseline===e||(this.baseline=e,this.onCommit(e))}};var Fr="mndw-input",an=["text","password","search","number","url"],Ye=class extends g{static formAssociated=!0;static shadowRootOptions={mode:"open",delegatesFocus:!0};static properties={value:{type:String},type:{type:String,reflect:!0},placeholder:{type:String,reflect:!0},autocomplete:{type:String,reflect:!0},readonly:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},name:{type:String,reflect:!0},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0},step:{type:Number,reflect:!0},maxlength:{type:Number,reflect:!0}};static styles=v`
559
+ `}_href(){return Xi(this.name)?tn(this.name):""}};var Ho=["id","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-required"],on=/\s+/u,Vo=/\s+/gu,zo="ariaDescription"in Element.prototype;function rn(i){let e=i.getRootNode();return typeof e.querySelectorAll=="function"?e:null}function an(i,e){return typeof i.getElementById=="function"?i.getElementById(e):i.querySelector(`[id="${e}"]`)}function I(i,e,t){if(t===""){i.removeAttribute(e);return}i.getAttribute(e)!==t&&i.setAttribute(e,t)}function $r(i){return(i??"").replace(Vo," ").trim()}function Ir(i){if(i.nodeType===Node.TEXT_NODE)return i.textContent??"";if(i.nodeType!==Node.ELEMENT_NODE||i.getAttribute("aria-hidden")==="true")return"";let e="";for(let t of i.childNodes)e+=Ir(t);return e}function Uo(i){return i.map(e=>$r(Ir(e))).filter(e=>e!=="").join(" ")}function nn(i,e){return!i||e===null?"":e.split(on).filter(t=>t!=="").map(t=>an(i,t)).filter(t=>t!==null).map(t=>$r(Ir(t))).filter(t=>t!=="").join(" ")}function Bo(i,e,t=zo){return t?i:[i,e].filter(r=>r!=="").join(" ")}function Bt(i){return{badInput:i.badInput,patternMismatch:i.patternMismatch,rangeOverflow:i.rangeOverflow,rangeUnderflow:i.rangeUnderflow,stepMismatch:i.stepMismatch,tooLong:i.tooLong,tooShort:i.tooShort,typeMismatch:i.typeMismatch,valueMissing:i.valueMissing}}var Ae=class{host;options;hostObserver;referenceObserver;constructor(e,t){this.host=e,this.options=t,this.hostObserver=new MutationObserver(this.onMutation),this.referenceObserver=new MutationObserver(this.onMutation)}connect(){this.hostObserver.observe(this.host,{attributes:!0,attributeFilter:Ho})}disconnect(){this.hostObserver.disconnect(),this.referenceObserver.disconnect()}get hasAriaRequired(){return this.host.getAttribute("aria-required")==="true"}get labels(){let e=this.options.formState.labels;if(e.length>0)return e;let t=rn(this.host);return!t||this.host.id===""?[]:[...t.querySelectorAll("label")].filter(r=>r.htmlFor===this.host.id)}sync(e){let t=this.labels,r=rn(this.host),n=this.resolveName(t,r),o=nn(r,this.host.getAttribute("aria-describedby"));I(e,"aria-label",Bo(n,o)),I(e,"aria-description",o),I(e,"aria-invalid",this.announcedInvalid()?"true":""),this.observeReferences(t,r)}resolveName(e,t){return this.host.hasAttribute("aria-labelledby")?nn(t,this.host.getAttribute("aria-labelledby")):this.host.hasAttribute("aria-label")?$r(this.host.getAttribute("aria-label")):Uo(e)}announcedInvalid(){let e=this.host.getAttribute("aria-invalid");return e!==null?e!=="false":this.options.isInvalid()?!0:this.options.formState.internals?.validity.valid===!1}observeReferences(e,t){this.referenceObserver.disconnect();let r=new Set(e);for(let n of["aria-labelledby","aria-describedby"]){let o=this.host.getAttribute(n);if(!(o===null||!t))for(let a of o.split(on).filter(s=>s!=="")){let s=an(t,a);s&&r.add(s)}}for(let n of r)this.referenceObserver.observe(n,{childList:!0,subtree:!0,characterData:!0})}onMutation=()=>{this.host.requestUpdate()}},Re=class{onCommit;baseline=null;fromUserInput=!1;constructor(e){this.onCommit=e}captureBaseline(e){this.baseline=e}releaseBaseline(){this.baseline=null}markUserInput(){this.fromUserInput=!0}syncValue(e){if(this.fromUserInput){this.fromUserInput=!1;return}this.baseline!==null&&(this.baseline=e)}commit(e){this.baseline===null||this.baseline===e||(this.baseline=e,this.onCommit(e))}};var Fr="mndw-input",sn=["text","password","search","number","url"],Xe=class extends g{static formAssociated=!0;static shadowRootOptions={mode:"open",delegatesFocus:!0};static properties={value:{type:String},type:{type:String,reflect:!0},placeholder:{type:String,reflect:!0},autocomplete:{type:String,reflect:!0},readonly:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},name:{type:String,reflect:!0},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0},step:{type:Number,reflect:!0},maxlength:{type:Number,reflect:!0}};static styles=v`
551
560
  :host {
552
561
  ${M}
553
562
 
@@ -560,7 +569,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
560
569
  }
561
570
 
562
571
  [part='field'] {
563
- ${B}
572
+ ${K}
564
573
 
565
574
  display: flex;
566
575
  gap: var(--mndw-space-2);
@@ -572,11 +581,11 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
572
581
  }
573
582
 
574
583
  :host(:not([disabled]):not([readonly]):not([invalid]):not([aria-invalid='true'])) [part='field']:hover {
575
- ${Ce}
584
+ ${Te}
576
585
  }
577
586
 
578
587
  :host(:focus-within) [part='field'] {
579
- ${R}
588
+ ${A}
580
589
  }
581
590
 
582
591
  input {
@@ -624,7 +633,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
624
633
  }
625
634
 
626
635
  :host(:not([disabled]):not([readonly]):not([invalid]):not([aria-invalid='true'])) [part='password-toggle']:hover {
627
- ${re}
636
+ ${ne}
628
637
  }
629
638
 
630
639
  [part='password-toggle'] mndw-icon {
@@ -635,7 +644,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
635
644
  :host([disabled]) [part='password-toggle'] {
636
645
  pointer-events: none;
637
646
  }
638
- `;formState=new N(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});announcement=new Ee(this,{formState:this.formState,isInvalid:()=>this.invalid});commits=new Te(e=>this.emitChange(e));localeController=new L(this);_showPassword=!1;constructor(){super(),this.value="",this.type="text",this.placeholder="",this.autocomplete="",this.readonly=!1,this.disabled=!1,this.required=!1,this.invalid=!1,this.name="",this.min=null,this.max=null,this.step=null,this.maxlength=null}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["value"]),this.announcement.connect(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),this.announcement.disconnect()}refreshAccessibleName(){this.requestUpdate()}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}focus(e){this.innerInput?.focus(e)}render(){return u`
647
+ `;formState=new O(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});announcement=new Ae(this,{formState:this.formState,isInvalid:()=>this.invalid});commits=new Re(e=>this.emitChange(e));localeController=new L(this);_showPassword=!1;constructor(){super(),this.value="",this.type="text",this.placeholder="",this.autocomplete="",this.readonly=!1,this.disabled=!1,this.required=!1,this.invalid=!1,this.name="",this.min=null,this.max=null,this.step=null,this.maxlength=null}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["value"]),this.announcement.connect(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),this.announcement.disconnect()}refreshAccessibleName(){this.requestUpdate()}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}focus(e){this.innerInput?.focus(e)}render(){return u`
639
648
  <div part="field">
640
649
  <slot name="prefix" part="prefix" @slotchange=${this.onAdornmentSlotChange}></slot>
641
650
  <input
@@ -646,20 +655,20 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
646
655
  @blur=${this.onInnerBlur}
647
656
  @keydown=${this.onInnerKeyDown}
648
657
  />
649
- ${this.type==="password"?this._renderPasswordToggle():b}
658
+ ${this.type==="password"?this._renderPasswordToggle():m}
650
659
  <slot name="suffix" part="suffix" @slotchange=${this.onAdornmentSlotChange}></slot>
651
660
  </div>
652
- `}updated(e){this.syncAdornmentSlots();let t=this.innerInput;t&&(this.syncInner(t),e.has("value")&&this.commits.syncValue(this.value),this.syncFormState(t),this.announcement.sync(t))}syncAdornmentSlots(){let e=this.renderRoot.querySelectorAll('slot[name="prefix"], slot[name="suffix"]');for(let t of e)this.syncAdornmentSlot(t)}syncAdornmentSlot(e){e.hidden=e.assignedNodes().length===0}onAdornmentSlotChange=e=>{let t=e.currentTarget;t&&this.syncAdornmentSlot(t)};get innerInput(){return this.renderRoot.querySelector("input")}get resolvedType(){return an.includes(this.type)?this.type:"text"}get _effectiveType(){return this.type==="password"&&this._showPassword?"text":this.resolvedType}syncInner(e){F(e,"placeholder",this.placeholder),F(e,"autocomplete",this.autocomplete),F(e,"min",this.min===null?"":String(this.min)),F(e,"max",this.max===null?"":String(this.max)),F(e,"step",this.step===null?"":String(this.step)),F(e,"maxlength",this.maxlength===null?"":String(this.maxlength)),e.toggleAttribute("readonly",this.readonly),e.toggleAttribute("disabled",this.formState.effectiveDisabled),e.toggleAttribute("required",this.required||this.announcement.hasAriaRequired),e.value!==this.value&&(e.value=this.value)}syncFormState(e){this.formState.setFormValue(this.value),this.formState.setValidity(zt(e.validity),e.validationMessage)}onInnerInput=e=>{this.commits.markUserInput(),this.value=e.target.value,this.dispatchEvent(new CustomEvent("mndwinput",{bubbles:!0,composed:!0,detail:{value:this.value}}))};onInnerFocus=()=>{this.commits.captureBaseline(this.value)};onInnerBlur=()=>{this.commits.commit(this.value),this.commits.releaseBaseline()};onInnerKeyDown=e=>{e.key==="Enter"&&this.commits.commit(this.value)};emitChange(e){this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:e}}))}_onTogglePassword=()=>{this._showPassword=!this._showPassword,this.requestUpdate(),this.updateComplete.then(()=>{this.innerInput?.focus()})};_renderPasswordToggle(){return u`
661
+ `}updated(e){this.syncAdornmentSlots();let t=this.innerInput;t&&(this.syncInner(t),e.has("value")&&this.commits.syncValue(this.value),this.syncFormState(t),this.announcement.sync(t))}syncAdornmentSlots(){let e=this.renderRoot.querySelectorAll('slot[name="prefix"], slot[name="suffix"]');for(let t of e)this.syncAdornmentSlot(t)}syncAdornmentSlot(e){e.hidden=e.assignedNodes().length===0}onAdornmentSlotChange=e=>{let t=e.currentTarget;t&&this.syncAdornmentSlot(t)};get innerInput(){return this.renderRoot.querySelector("input")}get resolvedType(){return sn.includes(this.type)?this.type:"text"}get _effectiveType(){return this.type==="password"&&this._showPassword?"text":this.resolvedType}syncInner(e){I(e,"placeholder",this.placeholder),I(e,"autocomplete",this.autocomplete),I(e,"min",this.min===null?"":String(this.min)),I(e,"max",this.max===null?"":String(this.max)),I(e,"step",this.step===null?"":String(this.step)),I(e,"maxlength",this.maxlength===null?"":String(this.maxlength)),e.toggleAttribute("readonly",this.readonly),e.toggleAttribute("disabled",this.formState.effectiveDisabled),e.toggleAttribute("required",this.required||this.announcement.hasAriaRequired),e.value!==this.value&&(e.value=this.value)}syncFormState(e){this.formState.setFormValue(this.value),this.formState.setValidity(Bt(e.validity),e.validationMessage)}onInnerInput=e=>{this.commits.markUserInput(),this.value=e.target.value,this.dispatchEvent(new CustomEvent("mndwinput",{bubbles:!0,composed:!0,detail:{value:this.value}}))};onInnerFocus=()=>{this.commits.captureBaseline(this.value)};onInnerBlur=()=>{this.commits.commit(this.value),this.commits.releaseBaseline()};onInnerKeyDown=e=>{e.key==="Enter"&&this.commits.commit(this.value)};emitChange(e){this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:e}}))}_onTogglePassword=()=>{this._showPassword=!this._showPassword,this.requestUpdate(),this.updateComplete.then(()=>{this.innerInput?.focus()})};_renderPasswordToggle(){return u`
653
662
  <button
654
663
  part="password-toggle"
655
664
  type="button"
656
- aria-label=${y(this._showPassword?"input.password.hide":"input.password.show")}
665
+ aria-label=${w(this._showPassword?"input.password.hide":"input.password.show")}
657
666
  ?disabled=${this.formState.effectiveDisabled}
658
667
  @click=${this._onTogglePassword}
659
668
  >
660
669
  <mndw-icon name=${this._showPassword?"eye-off":"eye"}></mndw-icon>
661
670
  </button>
662
- `}resetForm(){this.value=this.getAttribute("value")??""}restoreFormState(e){typeof e=="string"&&(this.value=e)}};function sn(i){switch(i){case"escape":return"escape";case"outside-click":return"outside";case"host-navigation":case"plugin-unmount":case"replaced":return"detached";default:return"api"}}function ln(i){return{open(e){if(e.presentation==="sheet"){let r=i.open({kind:"drawer",placement:"bottom",title:e.title??y("select.overlay.title"),showCloseButton:!0,closeOnEscape:!0,closeOnOutsideClick:!0,trapFocus:!0,restoreFocus:!0,lockScroll:!0,width:"100%",height:"auto",maxHeight:"100dvh",className:["mndw-ui-select-sheet",e.className].filter(Boolean).join(" "),mount(n){n.style.removeProperty("height"),n.style.minHeight="0"}});return{contentElement:r.contentElement,closed:r.closed.then(n=>sn(n.reason)),close:()=>{r.close()},reposition:()=>{}}}let t=i.createLayer({kind:"popover",anchor:{element:e.anchor},placement:"bottom-start",closeOnEscape:!0,closeOnOutsideClick:!0,trapFocus:e.trapFocus,restoreFocus:e.restoreFocus,className:e.className});return t.markReady(),{contentElement:t.contentElement,closed:t.closed.then(r=>sn(r.reason)),close:()=>{t.close()},reposition:()=>{t.update({anchor:{element:e.anchor}})}}}}}var zo=600,Uo=8,Bo=8,Ko=600,Go=8,Hr=8,Bt=["bottom-start","top-start","bottom-end","top-end"],Wo=new Set(["right","left","top","bottom"]),qo=new Set(["top-start","top-end","bottom-start","bottom-end","left-start","left-end","right-start","right-end"]);function jo(i,e=window.innerWidth){return e<=600&&(i==="modal"||i==="drawer")}function Yo(i,e){switch(i){case"modal":return"center";case"drawer":return e&&Wo.has(e)?e:"right";case"popover":return e&&qo.has(e)?e:"bottom-start";case"custom":return e??"center"}}function dn(i,e,t){switch(t){case"top-start":return{top:i.top-e.height-8,left:i.left};case"top-end":return{top:i.top-e.height-8,left:i.right-e.width};case"bottom-end":return{top:i.bottom+8,left:i.right-e.width};case"bottom-start":default:return{top:i.bottom+8,left:i.left}}}function cn(i,e,t,r){return i>=0&&e>=0&&i+t.height<=r.height&&e+t.width<=r.width}function Vr(i,e,t,r={width:window.innerWidth,height:window.innerHeight}){let n=i.element.getBoundingClientRect(),o=dn(n,e,t);if(cn(o.top,o.left,e,r))return{...o,placement:t};let a=t===Bt[0]?Bt:[t,...Bt];for(let s of a){let l=dn(n,e,s);if(cn(l.top,l.left,e,r))return{...l,placement:s}}return{...o,placement:t}}var Xo={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","bottom","top"],right:["right","left","bottom","top"]};function un(i,e,t){return Math.max(e,Math.min(i,t))}function hn(i,e,t,r){let n=i.left+(i.width-e.width)/2,o=i.top+(i.height-e.height)/2;switch(t){case"bottom":return{top:i.bottom+r,left:n};case"left":return{top:o,left:i.left-e.width-r};case"right":return{top:o,left:i.right+r};case"top":default:return{top:i.top-e.height-r,left:n}}}function Jo(i,e,t,r,n){switch(t){case"bottom":return i.top+e.height<=r.height-n;case"left":return i.left>=n;case"right":return i.left+e.width<=r.width-n;case"top":default:return i.top>=n}}function zr(i,e,t,r={width:window.innerWidth,height:window.innerHeight},n=8,o=8){let s=Xo[t].find(d=>Jo(hn(i,e,d,n),e,d,r,o))??t,l=hn(i,e,s,n),c=s==="top"||s==="bottom";return{top:c?l.top:un(l.top,o,Math.max(r.height-o-e.height,o)),left:c?un(l.left,o,Math.max(r.width-o-e.width,o)):l.left,placement:s}}function Ur(i,e=600){return i<=e?"sheet":"popover"}function Br(i,e,t=8,r=8){let n=t+r,o=Math.max(e.height-i.bottom-n,0),a=Math.max(i.top-n,0);return Math.max(Math.max(o,a),1)}function Ut(i){if(i!==void 0)return typeof i=="number"?`${i}px`:i}function Zo(i,e,t=!1){if(t&&(i==="modal"||i==="drawer"))return{width:"100%",height:"auto",maxHeight:"100dvh"};let r=Ut(e.width),n=Ut(e.height),o=Ut(e.maxWidth),a=Ut(e.maxHeight);return i==="modal"?{width:r??"min(560px, calc(100vw - 32px))",height:n,maxWidth:o,maxHeight:a??"calc(100vh - 32px)"}:i==="drawer"?{width:r??"min(420px, 100vw)",height:n??"100%",maxWidth:o,maxHeight:a}:{width:r,height:n,maxWidth:o,maxHeight:a}}var Qo=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","SUMMARY","IFRAME"]),he=[];function J(){let i=document.activeElement;for(;i?.shadowRoot?.activeElement;)i=i.shadowRoot.activeElement;return i}function pe(i,e){let t=e;for(;t;){if(t===i)return!0;t=t instanceof ShadowRoot?t.host:t.parentNode}return!1}function bn(i,e,t,r,n=5){let o=!1,a=null,s=n,l=()=>{o=!0,a!==null&&(cancelAnimationFrame(a),a=null)},c=()=>{if(a=null,o||!t()){l();return}if(e(),o||!t()){l();return}if(pe(i,J())){r(),l();return}if(s<=0){l();return}s-=1,a=requestAnimationFrame(c)};return c(),l}function ea(i){let e=i.getAttribute("contenteditable")?.toLowerCase();if(e!==""&&e!=="true"&&e!=="plaintext-only")return!1;let t=i.parentElement;for(;t;){let r=t.getAttribute("contenteditable")?.toLowerCase();if(r===""||r==="true"||r==="plaintext-only")return!1;if(r==="false")return!0;t=t.parentElement}return!0}function ta(i){let e=i.getAttribute("tabindex");if(e!==null){let t=Number.parseInt(e,10);return Number.isNaN(t)?-1:t}return i.tagName==="A"?i.hasAttribute("href")?0:-1:ea(i)||Qo.has(i.tagName)?0:-1}function ra(i){if(i.matches(":disabled"))return!0;let e=i.parentElement;for(;e;){if(e instanceof HTMLFieldSetElement&&e.disabled&&![...e.children].find(r=>r instanceof HTMLLegendElement)?.contains(i))return!0;e=e.parentElement}return!1}function ia(i){return ta(i)<0||ra(i)||i instanceof HTMLInputElement&&i.type==="hidden"?!1:typeof i.checkVisibility=="function"?i.checkVisibility():!0}function na(i){if(i instanceof HTMLSlotElement){let e=i.assignedNodes({flatten:!0});return e.length>0?e.filter(t=>t instanceof Element):[...i.children]}return i instanceof Element&&i.shadowRoot?[...i.shadowRoot.children]:i instanceof Element||i instanceof ShadowRoot?[...i.children]:[]}function fn(i,e){for(let t of na(i))t instanceof HTMLElement&&(t.hidden||t.hasAttribute("inert")||(ia(t)&&e.push(t),fn(t,e)))}function me(i){let e=[];return fn(i,e),e}function vn(i){return i.hasAttribute("tabindex")||i.setAttribute("tabindex","-1"),i}function gn(i){let[e]=me(i.container);(e??vn(i.container)).focus()}function pn(i){let e=he.at(-1);if(!e||i.key!=="Tab"||i.defaultPrevented)return;let t=J();if(t&&!pe(e.container,t)&&e.options.allowFocus?.(t)===!0)return;let r=me(e.container);if(i.preventDefault(),r.length===0){vn(e.container).focus();return}let n=t instanceof HTMLElement?r.indexOf(t):-1,o=r.length,a=n===-1?i.shiftKey?o-1:0:(n+(i.shiftKey?-1:1)+o)%o;r[a]?.focus()}function mn(i){let e=he.at(-1);if(!e)return;let[t]=i.composedPath();if(!(t instanceof Node))return;if(pe(e.container,t)){e.lastFocused=t instanceof HTMLElement?t:e.lastFocused;return}if(e.options.allowFocus?.(t)===!0)return;let r=e.lastFocused;r?.isConnected===!0&&pe(e.container,r)?r.focus():gn(e)}function Kt(i,e={}){let t=J(),r={container:i,options:e,lastFocused:null};he.length===0&&(document.addEventListener("keydown",pn),document.addEventListener("focusin",mn,!0)),he.push(r);let n=J();if(n instanceof HTMLElement&&pe(i,n)&&(r.lastFocused=n),!n||!pe(i,n)){let a=e.initialFocus?.()??null;a?a.focus():gn(r)}let o=!0;return{deactivate(){if(!o)return;o=!1;let a=he.indexOf(r);a!==-1&&he.splice(a,1),he.length===0&&(document.removeEventListener("keydown",pn),document.removeEventListener("focusin",mn,!0)),e.restoreFocus!==!1&&t instanceof HTMLElement&&t.isConnected&&t.focus()}}}function oa(){return{open(i){if(i.presentation==="sheet")return aa(i);let e=document.createElement("div");e.className=i.className??"",e.style.position="fixed",e.style.zIndex="1000",e.style.opacity="0",e.style.pointerEvents="none",document.body.appendChild(e);let t=d=>{},r=new Promise(d=>{t=d}),n=!1,o=null,a=(d="api")=>{n||(n=!0,o?.deactivate(),o=null,document.removeEventListener("pointerdown",s,!0),document.removeEventListener("keydown",l,!0),window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0),e.remove(),t(d))};function s(d){let h=d.composedPath();h.includes(e)||h.includes(i.anchor)||a("outside")}function l(d){d.key==="Escape"&&a("escape")}function c(){if(n)return;let d=window.innerHeight,h=window.innerWidth,p=e.offsetHeight,f=e.offsetWidth,m=Vr({element:i.anchor},{width:f,height:p},"bottom-start",{width:h,height:d});e.style.left=`${m.left}px`,e.style.top=`${m.top}px`,e.style.opacity="1",e.style.pointerEvents="auto"}return document.addEventListener("pointerdown",s,!0),document.addEventListener("keydown",l,!0),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),i.trapFocus===!0&&requestAnimationFrame(()=>{n||(o=Kt(e,{restoreFocus:!1,allowFocus:d=>d===i.anchor||i.anchor.contains(d)}))}),{contentElement:e,closed:r,setTitle:()=>{},close:()=>{a("api")},reposition:c}}}}function aa(i){let e=document.createElement("div");e.className=["mndw-ui-sheet-root",i.className].filter(Boolean).join(" "),e.style.position="fixed",e.style.inset="0",e.style.zIndex="1000",e.style.display="flex",e.style.flexDirection="column",e.style.justifyContent="flex-end";let t=document.createElement("div");t.className="mndw-ui-sheet__backdrop",t.style.position="absolute",t.style.inset="0";let r=document.createElement("div");r.className="mndw-ui-sheet",r.setAttribute("role","dialog"),r.style.position="relative",r.style.display="flex",r.style.flexDirection="column",r.style.width="100%",r.style.height="auto",r.style.maxHeight="100dvh",r.style.minHeight="0";let n=document.createElement("header");n.className="mndw-ui-sheet__header",n.style.display="flex",n.style.flexShrink="0",n.style.alignItems="center",n.style.justifyContent="space-between";let o=document.createElement("span");o.textContent=i.title??y("select.overlay.title");let a=document.createElement("button");a.type="button",a.setAttribute("aria-label",y("overlay.close"));let s=document.createElement("mndw-icon");s.setAttribute("name","x"),a.append(s);let l=document.createElement("div");l.className="mndw-ui-sheet__body",l.style.flex="0 1 auto",l.style.display="flex",l.style.flexDirection="column",l.style.minHeight="0",l.style.overflow="hidden";let c=document.createElement("div");c.style.display="flex",c.style.flex="1 1 auto",c.style.flexDirection="column",c.style.minHeight="0",c.style.overflow="hidden";let d=A=>{},h=new Promise(A=>{d=A}),p=!1,f=null,m=(A="api")=>{p||(p=!0,f?.deactivate(),f=null,document.removeEventListener("pointerdown",S,!0),document.removeEventListener("keydown",x,!0),a.removeEventListener("click",E),e.remove(),d(A))};function S(A){A.composedPath().includes(r)||m("outside")}function x(A){A.key==="Escape"&&m("escape")}function E(){m("api")}return l.appendChild(c),n.append(o,a),r.append(n,l),e.append(t,r),document.body.appendChild(e),a.addEventListener("click",E),document.addEventListener("pointerdown",S,!0),document.addEventListener("keydown",x,!0),i.trapFocus!==!1&&requestAnimationFrame(()=>{p||(f=Kt(r,{restoreFocus:!1}))}),{contentElement:c,closed:h,setTitle:A=>{o.textContent=A},close:()=>{m("api")},reposition:()=>{}}}var Kr,wn;function yn(i){Kr=i}function Gt(){return Kr||(wn??=oa(),wn)}var Je="mndw-option",Ze="mndwoptionchange",Xe=class extends HTMLElement{static observedAttributes=["value","disabled"];observer=null;skipNextTextMutation=!1;get textContent(){return super.textContent}set textContent(e){let t=super.textContent;super.textContent=e,t!==e&&(this.skipNextTextMutation=!0,this.announce())}get value(){return this.getAttribute("value")??""}set value(e){this.setAttribute("value",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}connectedCallback(){if(!this.observer&&typeof MutationObserver<"u"){let e=new MutationObserver(()=>{if(this.skipNextTextMutation){this.skipNextTextMutation=!1;return}this.announce()});typeof e.observe=="function"&&(this.observer=e,e.observe(this,{characterData:!0,childList:!0,subtree:!0}))}}disconnectedCallback(){this.observer?.disconnect()}attributeChangedCallback(e,t,r){t!==r&&this.announce()}announce(){this.dispatchEvent(new CustomEvent(Ze,{bubbles:!0,composed:!1}))}};var Sn={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},xn=i=>(...e)=>({_$litDirective$:i,values:e}),Wt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:sa}=Ai,Cn=i=>i;var Mn=()=>document.createComment(""),Re=(i,e,t)=>{let r=i._$AA.parentNode,n=e===void 0?i._$AB:e._$AA;if(t===void 0){let o=r.insertBefore(Mn(),n),a=r.insertBefore(Mn(),n);t=new sa(o,a,i,i.options)}else{let o=t._$AB.nextSibling,a=t._$AM,s=a!==i;if(s){let l;t._$AQ?.(i),t._$AM=i,t._$AP!==void 0&&(l=i._$AU)!==a._$AU&&t._$AP(l)}if(o!==n||s){let l=t._$AA;for(;l!==o;){let c=Cn(l).nextSibling;Cn(r).insertBefore(l,n),l=c}}}return t},ie=(i,e,t=i)=>(i._$AI(e,t),i),la={},En=(i,e=la)=>i._$AH=e,Tn=i=>i._$AH,qt=i=>{i._$AR(),i._$AA.remove()};var Rn=(i,e,t)=>{let r=new Map;for(let n=e;n<=t;n++)r.set(i[n],n);return r},jt=xn(class extends Wt{constructor(i){if(super(i),i.type!==Sn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let n=[],o=[],a=0;for(let s of i)n[a]=r?r(s,a):a,o[a]=t(s,a),a++;return{values:o,keys:n}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,r]){let n=Tn(i),{values:o,keys:a}=this.dt(e,t,r);if(!Array.isArray(n))return this.ut=a,o;let s=this.ut??=[],l=[],c,d,h=0,p=n.length-1,f=0,m=o.length-1;for(;h<=p&&f<=m;)if(n[h]===null)h++;else if(n[p]===null)p--;else if(s[h]===a[f])l[f]=ie(n[h],o[f]),h++,f++;else if(s[p]===a[m])l[m]=ie(n[p],o[m]),p--,m--;else if(s[h]===a[m])l[m]=ie(n[h],o[m]),Re(i,l[m+1],n[h]),h++,m--;else if(s[p]===a[f])l[f]=ie(n[p],o[f]),Re(i,n[h],n[p]),p--,f++;else if(c===void 0&&(c=Rn(a,f,m),d=Rn(s,h,p)),c.has(s[h]))if(c.has(s[p])){let S=d.get(a[f]),x=S!==void 0?n[S]:null;if(x===null){let E=Re(i,n[h]);ie(E,o[f]),l[f]=E}else l[f]=ie(x,o[f]),Re(i,n[h],x),n[S]=null;f++}else qt(n[p]),p--;else qt(n[h]),h++;for(;f<=m;){let S=Re(i,l[m+1]);ie(S,o[f]),l[f++]=S}for(;h<=p;){let S=n[h++];S!==null&&qt(S)}return this.ut=a,En(i,l),Y}});var et="mndw-select-panel",da=0,Qe=class extends g{static properties={options:{type:Array},value:{type:String},label:{type:String},sheet:{type:Boolean,reflect:!0},activeIndex:{type:Number,state:!0}};static styles=v`
671
+ `}resetForm(){this.value=this.getAttribute("value")??""}restoreFormState(e){typeof e=="string"&&(this.value=e)}};function ln(i){switch(i){case"escape":return"escape";case"outside-click":return"outside";case"host-navigation":case"plugin-unmount":case"replaced":return"detached";default:return"api"}}function dn(i){return{open(e){if(e.presentation==="sheet"){let r=i.open({kind:"drawer",placement:"bottom",title:e.title??w("select.overlay.title"),showCloseButton:!0,closeOnEscape:!0,closeOnOutsideClick:!0,trapFocus:!0,restoreFocus:!0,lockScroll:!0,width:"100%",height:"auto",maxHeight:"100dvh",className:["mndw-ui-select-sheet",e.className].filter(Boolean).join(" "),mount(n){n.style.removeProperty("height"),n.style.minHeight="0"}});return{contentElement:r.contentElement,closed:r.closed.then(n=>ln(n.reason)),close:()=>{r.close()},reposition:()=>{}}}let t=i.createLayer({kind:"popover",anchor:{element:e.anchor},placement:"bottom-start",closeOnEscape:!0,closeOnOutsideClick:!0,trapFocus:e.trapFocus,restoreFocus:e.restoreFocus,className:e.className});return t.markReady(),{contentElement:t.contentElement,closed:t.closed.then(r=>ln(r.reason)),close:()=>{t.close()},reposition:()=>{t.update({anchor:{element:e.anchor}})}}}}}var Ko=600,Wo=8,Go=8,qo=600,jo=8,Hr=8,Wt=["bottom-start","top-start","bottom-end","top-end"],Yo=new Set(["right","left","top","bottom"]),Xo=new Set(["top-start","top-end","bottom-start","bottom-end","left-start","left-end","right-start","right-end"]);function Jo(i,e=window.innerWidth){return e<=600&&(i==="modal"||i==="drawer")}function Zo(i,e){switch(i){case"modal":return"center";case"drawer":return e&&Yo.has(e)?e:"right";case"popover":return e&&Xo.has(e)?e:"bottom-start";case"custom":return e??"center"}}function cn(i,e,t){switch(t){case"top-start":return{top:i.top-e.height-8,left:i.left};case"top-end":return{top:i.top-e.height-8,left:i.right-e.width};case"bottom-end":return{top:i.bottom+8,left:i.right-e.width};case"bottom-start":default:return{top:i.bottom+8,left:i.left}}}function un(i,e,t,r){return i>=0&&e>=0&&i+t.height<=r.height&&e+t.width<=r.width}function Vr(i,e,t,r={width:window.innerWidth,height:window.innerHeight}){let n=i.element.getBoundingClientRect(),o=cn(n,e,t);if(un(o.top,o.left,e,r))return{...o,placement:t};let a=t===Wt[0]?Wt:[t,...Wt];for(let s of a){let l=cn(n,e,s);if(un(l.top,l.left,e,r))return{...l,placement:s}}return{...o,placement:t}}var Qo={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","bottom","top"],right:["right","left","bottom","top"]};function hn(i,e,t){return Math.max(e,Math.min(i,t))}function pn(i,e,t,r){let n=i.left+(i.width-e.width)/2,o=i.top+(i.height-e.height)/2;switch(t){case"bottom":return{top:i.bottom+r,left:n};case"left":return{top:o,left:i.left-e.width-r};case"right":return{top:o,left:i.right+r};case"top":default:return{top:i.top-e.height-r,left:n}}}function ea(i,e,t,r,n){switch(t){case"bottom":return i.top+e.height<=r.height-n;case"left":return i.left>=n;case"right":return i.left+e.width<=r.width-n;case"top":default:return i.top>=n}}function zr(i,e,t,r={width:window.innerWidth,height:window.innerHeight},n=8,o=8){let s=Qo[t].find(d=>ea(pn(i,e,d,n),e,d,r,o))??t,l=pn(i,e,s,n),c=s==="top"||s==="bottom";return{top:c?l.top:hn(l.top,o,Math.max(r.height-o-e.height,o)),left:c?hn(l.left,o,Math.max(r.width-o-e.width,o)):l.left,placement:s}}function Ur(i,e=600){return i<=e?"sheet":"popover"}function Br(i,e,t=8,r=8){let n=t+r,o=Math.max(e.height-i.bottom-n,0),a=Math.max(i.top-n,0);return Math.max(Math.max(o,a),1)}function Kt(i){if(i!==void 0)return typeof i=="number"?`${i}px`:i}function ta(i,e,t=!1){if(t&&(i==="modal"||i==="drawer"))return{width:"100%",height:"auto",maxHeight:"100dvh"};let r=Kt(e.width),n=Kt(e.height),o=Kt(e.maxWidth),a=Kt(e.maxHeight);return i==="modal"?{width:r??"min(560px, calc(100vw - 32px))",height:n,maxWidth:o,maxHeight:a??"calc(100vh - 32px)"}:i==="drawer"?{width:r??"min(420px, 100vw)",height:n??"100%",maxWidth:o,maxHeight:a}:{width:r,height:n,maxWidth:o,maxHeight:a}}var ra=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","SUMMARY","IFRAME"]),me=[];function U(){let i=document.activeElement;for(;i?.shadowRoot?.activeElement;)i=i.shadowRoot.activeElement;return i}function Q(i,e){let t=e;for(;t;){if(t===i)return!0;t=t instanceof ShadowRoot?t.host:t.parentNode}return!1}function fn(i,e,t,r,n=5){let o=!1,a=null,s=n,l=()=>{o=!0,a!==null&&(cancelAnimationFrame(a),a=null)},c=()=>{if(a=null,o||!t()){l();return}if(e(),o||!t()){l();return}if(Q(i,U())){r(),l();return}if(s<=0){l();return}s-=1,a=requestAnimationFrame(c)};return c(),l}function ia(i){let e=i.getAttribute("contenteditable")?.toLowerCase();if(e!==""&&e!=="true"&&e!=="plaintext-only")return!1;let t=i.parentElement;for(;t;){let r=t.getAttribute("contenteditable")?.toLowerCase();if(r===""||r==="true"||r==="plaintext-only")return!1;if(r==="false")return!0;t=t.parentElement}return!0}function na(i){let e=i.getAttribute("tabindex");if(e!==null){let t=Number.parseInt(e,10);return Number.isNaN(t)?-1:t}return i.tagName==="A"?i.hasAttribute("href")?0:-1:ia(i)||ra.has(i.tagName)?0:-1}function oa(i){if(i.matches(":disabled"))return!0;let e=i.parentElement;for(;e;){if(e instanceof HTMLFieldSetElement&&e.disabled&&![...e.children].find(r=>r instanceof HTMLLegendElement)?.contains(i))return!0;e=e.parentElement}return!1}function aa(i){return na(i)<0||oa(i)||i instanceof HTMLInputElement&&i.type==="hidden"?!1:typeof i.checkVisibility=="function"?i.checkVisibility():!0}function sa(i){if(i instanceof HTMLSlotElement){let e=i.assignedNodes({flatten:!0});return e.length>0?e.filter(t=>t instanceof Element):[...i.children]}return i instanceof Element&&i.shadowRoot?[...i.shadowRoot.children]:i instanceof Element||i instanceof ShadowRoot?[...i.children]:[]}function vn(i,e){for(let t of sa(i))t instanceof HTMLElement&&(t.hidden||t.hasAttribute("inert")||(aa(t)&&e.push(t),vn(t,e)))}function be(i){let e=[];return vn(i,e),e}function gn(i){return i.hasAttribute("tabindex")||i.setAttribute("tabindex","-1"),i}function wn(i){let[e]=be(i.container);(e??gn(i.container)).focus()}function mn(i){let e=me.at(-1);if(!e||i.key!=="Tab"||i.defaultPrevented)return;let t=U();if(t&&!Q(e.container,t)&&e.options.allowFocus?.(t)===!0)return;let r=be(e.container);if(i.preventDefault(),r.length===0){gn(e.container).focus();return}let n=t instanceof HTMLElement?r.indexOf(t):-1,o=r.length,a=n===-1?i.shiftKey?o-1:0:(n+(i.shiftKey?-1:1)+o)%o;r[a]?.focus()}function bn(i){let e=me.at(-1);if(!e)return;let[t]=i.composedPath();if(!(t instanceof Node))return;if(Q(e.container,t)){e.lastFocused=t instanceof HTMLElement?t:e.lastFocused;return}if(e.options.allowFocus?.(t)===!0)return;let r=e.lastFocused;r?.isConnected===!0&&Q(e.container,r)?r.focus():wn(e)}function Gt(i,e={}){let t=U(),r={container:i,options:e,lastFocused:null};me.length===0&&(document.addEventListener("keydown",mn),document.addEventListener("focusin",bn,!0)),me.push(r);let n=U();if(n instanceof HTMLElement&&Q(i,n)&&(r.lastFocused=n),!n||!Q(i,n)){let a=e.initialFocus?.()??null;a?a.focus():wn(r)}let o=!0;return{deactivate(){if(!o)return;o=!1;let a=me.indexOf(r);a!==-1&&me.splice(a,1),me.length===0&&(document.removeEventListener("keydown",mn),document.removeEventListener("focusin",bn,!0)),e.restoreFocus!==!1&&t instanceof HTMLElement&&t.isConnected&&t.focus()}}}function la(){return{open(i){if(i.presentation==="sheet")return da(i);let e=document.createElement("div");e.className=i.className??"",e.style.position="fixed",e.style.zIndex="1000",e.style.opacity="0",e.style.pointerEvents="none",document.body.appendChild(e);let t=d=>{},r=new Promise(d=>{t=d}),n=!1,o=null,a=(d="api")=>{n||(n=!0,o?.deactivate(),o=null,document.removeEventListener("pointerdown",s,!0),document.removeEventListener("keydown",l,!0),window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0),e.remove(),t(d))};function s(d){let h=d.composedPath();h.includes(e)||h.includes(i.anchor)||a("outside")}function l(d){d.key==="Escape"&&a("escape")}function c(){if(n)return;let d=window.innerHeight,h=window.innerWidth,p=e.offsetHeight,f=e.offsetWidth,b=Vr({element:i.anchor},{width:f,height:p},"bottom-start",{width:h,height:d});e.style.left=`${b.left}px`,e.style.top=`${b.top}px`,e.style.opacity="1",e.style.pointerEvents="auto"}return document.addEventListener("pointerdown",s,!0),document.addEventListener("keydown",l,!0),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),i.trapFocus===!0&&requestAnimationFrame(()=>{n||(o=Gt(e,{restoreFocus:!1,allowFocus:d=>d===i.anchor||i.anchor.contains(d)}))}),{contentElement:e,closed:r,setTitle:()=>{},close:()=>{a("api")},reposition:c}}}}function da(i){let e=document.createElement("div");e.className=["mndw-ui-sheet-root",i.className].filter(Boolean).join(" "),e.style.position="fixed",e.style.inset="0",e.style.zIndex="1000",e.style.display="flex",e.style.flexDirection="column",e.style.justifyContent="flex-end";let t=document.createElement("div");t.className="mndw-ui-sheet__backdrop",t.style.position="absolute",t.style.inset="0";let r=document.createElement("div");r.className="mndw-ui-sheet",r.setAttribute("role","dialog"),r.style.position="relative",r.style.display="flex",r.style.flexDirection="column",r.style.width="100%",r.style.height="auto",r.style.maxHeight="100dvh",r.style.minHeight="0";let n=document.createElement("header");n.className="mndw-ui-sheet__header",n.style.display="flex",n.style.flexShrink="0",n.style.alignItems="center",n.style.justifyContent="space-between";let o=document.createElement("span");o.textContent=i.title??w("select.overlay.title");let a=document.createElement("button");a.type="button",a.setAttribute("aria-label",w("overlay.close"));let s=document.createElement("mndw-icon");s.setAttribute("name","x"),a.append(s);let l=document.createElement("div");l.className="mndw-ui-sheet__body",l.style.flex="0 1 auto",l.style.display="flex",l.style.flexDirection="column",l.style.minHeight="0",l.style.overflow="hidden";let c=document.createElement("div");c.style.display="flex",c.style.flex="1 1 auto",c.style.flexDirection="column",c.style.minHeight="0",c.style.overflow="hidden";let d=R=>{},h=new Promise(R=>{d=R}),p=!1,f=null,b=(R="api")=>{p||(p=!0,f?.deactivate(),f=null,document.removeEventListener("pointerdown",S,!0),document.removeEventListener("keydown",C,!0),a.removeEventListener("click",T),e.remove(),d(R))};function S(R){R.composedPath().includes(r)||b("outside")}function C(R){R.key==="Escape"&&b("escape")}function T(){b("api")}return l.appendChild(c),n.append(o,a),r.append(n,l),e.append(t,r),document.body.appendChild(e),a.addEventListener("click",T),document.addEventListener("pointerdown",S,!0),document.addEventListener("keydown",C,!0),i.trapFocus!==!1&&requestAnimationFrame(()=>{p||(f=Gt(r,{restoreFocus:!1}))}),{contentElement:c,closed:h,setTitle:R=>{o.textContent=R},close:()=>{b("api")},reposition:()=>{}}}var Kr,yn;function Sn(i){Kr=i}function qt(){return Kr||(yn??=la(),yn)}var Ze="mndw-option",Qe="mndwoptionchange",Je=class extends HTMLElement{static observedAttributes=["value","disabled"];observer=null;skipNextTextMutation=!1;get textContent(){return super.textContent}set textContent(e){let t=super.textContent;super.textContent=e,t!==e&&(this.skipNextTextMutation=!0,this.announce())}get value(){return this.getAttribute("value")??""}set value(e){this.setAttribute("value",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}connectedCallback(){if(!this.observer&&typeof MutationObserver<"u"){let e=new MutationObserver(()=>{if(this.skipNextTextMutation){this.skipNextTextMutation=!1;return}this.announce()});typeof e.observe=="function"&&(this.observer=e,e.observe(this,{characterData:!0,childList:!0,subtree:!0}))}}disconnectedCallback(){this.observer?.disconnect()}attributeChangedCallback(e,t,r){t!==r&&this.announce()}announce(){this.dispatchEvent(new CustomEvent(Qe,{bubbles:!0,composed:!1}))}};var xn={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Cn=i=>(...e)=>({_$litDirective$:i,values:e}),jt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:ca}=Li,Mn=i=>i;var Tn=()=>document.createComment(""),Le=(i,e,t)=>{let r=i._$AA.parentNode,n=e===void 0?i._$AB:e._$AA;if(t===void 0){let o=r.insertBefore(Tn(),n),a=r.insertBefore(Tn(),n);t=new ca(o,a,i,i.options)}else{let o=t._$AB.nextSibling,a=t._$AM,s=a!==i;if(s){let l;t._$AQ?.(i),t._$AM=i,t._$AP!==void 0&&(l=i._$AU)!==a._$AU&&t._$AP(l)}if(o!==n||s){let l=t._$AA;for(;l!==o;){let c=Mn(l).nextSibling;Mn(r).insertBefore(l,n),l=c}}}return t},oe=(i,e,t=i)=>(i._$AI(e,t),i),ua={},En=(i,e=ua)=>i._$AH=e,An=i=>i._$AH,Yt=i=>{i._$AR(),i._$AA.remove()};var Rn=(i,e,t)=>{let r=new Map;for(let n=e;n<=t;n++)r.set(i[n],n);return r},Xt=Cn(class extends jt{constructor(i){if(super(i),i.type!==xn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let n=[],o=[],a=0;for(let s of i)n[a]=r?r(s,a):a,o[a]=t(s,a),a++;return{values:o,keys:n}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,r]){let n=An(i),{values:o,keys:a}=this.dt(e,t,r);if(!Array.isArray(n))return this.ut=a,o;let s=this.ut??=[],l=[],c,d,h=0,p=n.length-1,f=0,b=o.length-1;for(;h<=p&&f<=b;)if(n[h]===null)h++;else if(n[p]===null)p--;else if(s[h]===a[f])l[f]=oe(n[h],o[f]),h++,f++;else if(s[p]===a[b])l[b]=oe(n[p],o[b]),p--,b--;else if(s[h]===a[b])l[b]=oe(n[h],o[b]),Le(i,l[b+1],n[h]),h++,b--;else if(s[p]===a[f])l[f]=oe(n[p],o[f]),Le(i,n[h],n[p]),p--,f++;else if(c===void 0&&(c=Rn(a,f,b),d=Rn(s,h,p)),c.has(s[h]))if(c.has(s[p])){let S=d.get(a[f]),C=S!==void 0?n[S]:null;if(C===null){let T=Le(i,n[h]);oe(T,o[f]),l[f]=T}else l[f]=oe(C,o[f]),Le(i,n[h],C),n[S]=null;f++}else Yt(n[p]),p--;else Yt(n[h]),h++;for(;f<=b;){let S=Le(i,l[b+1]);oe(S,o[f]),l[f++]=S}for(;h<=p;){let S=n[h++];S!==null&&Yt(S)}return this.ut=a,En(i,l),J}});var tt="mndw-select-panel",ha=0,et=class extends g{static properties={options:{type:Array},value:{type:String},label:{type:String},sheet:{type:Boolean,reflect:!0},activeIndex:{type:Number,state:!0}};static styles=v`
663
672
  :host {
664
673
  ${M}
665
674
 
@@ -690,7 +699,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
690
699
  }
691
700
 
692
701
  .listbox:focus-visible {
693
- ${R}
702
+ ${A}
694
703
  outline-offset: -2px;
695
704
  }
696
705
 
@@ -714,7 +723,8 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
714
723
  cursor: pointer;
715
724
  }
716
725
 
717
- .option:not([aria-disabled='true']):hover {
726
+ .option:not([aria-disabled='true']):hover,
727
+ .option[data-active='true']:not([aria-disabled='true']) {
718
728
  ${$}
719
729
  }
720
730
 
@@ -726,7 +736,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
726
736
  color: var(--mndw-text-subtle);
727
737
  cursor: not-allowed;
728
738
  }
729
- `;panelId=da++;constructor(){super(),this.options=[],this.value="",this.label="",this.sheet=!1,this.activeIndex=-1}get listboxElement(){return this.renderRoot.querySelector('[role="listbox"]')}get activeOptionElement(){return this.renderRoot.querySelector(`#${this.optionId(this.activeIndex)}`)}focusListbox(){this.listboxElement?.focus()}willUpdate(e){if(e.has("options")||e.has("value")){let t=this.options.findIndex(r=>r.value===this.value);this.activeIndex=t>=0&&!this.options[t]?.disabled?t:this.firstEnabledIndex()}}render(){return u`
739
+ `;panelId=ha++;constructor(){super(),this.options=[],this.value="",this.label="",this.sheet=!1,this.activeIndex=-1}get listboxElement(){return this.renderRoot.querySelector('[role="listbox"]')}get activeOptionElement(){return this.renderRoot.querySelector(`#${this.optionId(this.activeIndex)}`)}focusListbox(){this.listboxElement?.focus()}willUpdate(e){if(e.has("options")||e.has("value")){let t=this.options.findIndex(r=>r.value===this.value);this.activeIndex=t>=0&&!this.options[t]?.disabled?t:this.firstEnabledIndex()}}render(){let e=this.options.findIndex(t=>t.value===this.value);return u`
730
740
  <mndw-scroll-area exportparts="viewport,scrollbar,track,thumb">
731
741
  <div
732
742
  class="listbox"
@@ -736,23 +746,24 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
736
746
  aria-activedescendant=${this.optionId(this.activeIndex)}
737
747
  tabindex="0"
738
748
  >
739
- ${jt(this.options,(e,t)=>`${t}:${e.value}`,(e,t)=>{let r=e.labelNodes.length>0?e.labelNodes.map(n=>n.cloneNode(!0)):e.label;return u`
749
+ ${Xt(this.options,(t,r)=>`${r}:${t.value}`,(t,r)=>{let n=t.labelNodes.length>0?t.labelNodes.map(s=>s.cloneNode(!0)):t.label,o=r===e,a=r===this.activeIndex;return u`
740
750
  <div
741
751
  class="option"
742
752
  part="option"
743
753
  role="option"
744
- id=${this.optionId(t)}
745
- aria-selected=${String(t===this.activeIndex)}
746
- aria-disabled=${String(e.disabled)}
747
- @click=${()=>this.select(t)}
754
+ id=${this.optionId(r)}
755
+ aria-selected=${String(o)}
756
+ data-active=${String(a)}
757
+ aria-disabled=${String(t.disabled)}
758
+ @click=${()=>this.select(r)}
748
759
  >
749
- <span>${r}</span>
750
- ${t===this.activeIndex?u`<mndw-icon name="check" aria-hidden="true"></mndw-icon>`:null}
760
+ <span>${n}</span>
761
+ ${o?u`<mndw-icon name="check" aria-hidden="true"></mndw-icon>`:null}
751
762
  </div>
752
763
  `})}
753
764
  </div>
754
765
  </mndw-scroll-area>
755
- `}firstEnabledIndex(){return this.options.findIndex(e=>!e.disabled)}optionId(e){return`mndw-select-${this.panelId}-option-${e}`}select(e){let t=this.options[e];!t||t.disabled||this.dispatchEvent(new CustomEvent("mndwpanelselect",{detail:{value:t.value}}))}dismiss(){this.dispatchEvent(new CustomEvent("mndwpaneldismiss",{detail:{restoreFocus:!0}}))}};var Ae=class{getLabel;isDisabled;pageSize;typeaheadTimeout;now;typeaheadBuffer="";lastTypeaheadAt=Number.NEGATIVE_INFINITY;constructor(e){this.getLabel=e.getLabel,this.isDisabled=e.isDisabled,this.pageSize=e.pageSize??10,this.typeaheadTimeout=e.typeaheadTimeout??500,this.now=e.now??Date.now}handleKeydown(e,t){let r=null;switch(e.key){case"ArrowDown":r=this.move(t,1);break;case"ArrowUp":r=this.move(t,-1);break;case"Home":r=this.edge(t,1);break;case"End":r=this.edge(t,-1);break;case"PageDown":r=this.page(t,1);break;case"PageUp":r=this.page(t,-1);break;default:if(this.isPrintable(e))r=this.typeahead(e.key,t);else return!1}return e.preventDefault(),r!==null&&r!==t.activeIndex&&(t.setActiveIndex(r),t.mode==="roving-focus"&&t.focusItem?.(r)),!0}isPrintable(e){return!e.ctrlKey&&!e.altKey&&!e.metaKey&&!e.isComposing&&e.key!==" "&&[...e.key].length===1}move(e,t){let r=e.items.length;if(r===0)return null;let n=e.activeIndex;if(n<0)return this.edge(e,t);for(let o=0;o<r;o+=1){if(n+=t,e.wrap)n=(n+r)%r;else if(n<0||n>=r)return null;if(!this.isDisabled(e.items[n]))return n}return null}edge(e,t){let r=t>0?0:e.items.length-1,n=t>0?e.items.length:-1;for(let o=r;o!==n;o+=t)if(!this.isDisabled(e.items[o]))return o;return null}page(e,t){if(e.items.length===0)return null;if(e.activeIndex<0)return this.edge(e,t);let r=e.activeIndex+t*this.pageSize,n=e.wrap?(r%e.items.length+e.items.length)%e.items.length:Math.max(0,Math.min(e.items.length-1,r)),o=0;for(;o<e.items.length;){if(!this.isDisabled(e.items[n]))return n;if(n+=t,e.wrap)n=(n+e.items.length)%e.items.length;else if(n<0||n>=e.items.length)return null;o+=1}return null}typeahead(e,t){let r=this.now(),o=r-this.lastTypeaheadAt<=this.typeaheadTimeout?this.typeaheadBuffer:"",a=o!==""&&[...o].every(d=>d===e.toLocaleLowerCase()),s=a?e.toLocaleLowerCase():`${o}${e}`.toLocaleLowerCase();this.typeaheadBuffer=s,this.lastTypeaheadAt=r;let l=t.items[t.activeIndex];if(o!==""&&!a&&l&&!this.isDisabled(l)&&this.normalize(this.getLabel(l)).startsWith(s))return t.activeIndex;let c=t.items.length;for(let d=1;d<=c;d+=1){let h=t.activeIndex<0?d-1:(t.activeIndex+d)%c,p=t.items[h];if(!this.isDisabled(p)&&this.normalize(this.getLabel(p)).startsWith(s))return h}return null}normalize(e){return e.trimStart().toLocaleLowerCase()}};function An(i){let e=i.querySelectorAll(Je);return Array.from(e,t=>{let r=t.getAttribute("value")??"",n=(t.textContent??"").replace(/\s+/g," ").trim(),o=Array.from(t.childNodes,a=>a.cloneNode(!0));return{value:r,label:n===""?r:n,labelNodes:o,disabled:t.hasAttribute("disabled")}})}var ca=180;function ua(i){return{top:i.top,right:i.right,bottom:i.bottom,left:i.left,width:i.width,height:i.height}}function ha(i,e){return i?.top===e.top&&i.right===e.right&&i.bottom===e.bottom&&i.left===e.left&&i.width===e.width&&i.height===e.height}function Ln(i,e,t){i.style.minWidth=`${Math.max(e.width,ca)}px`,i.style.maxWidth=`calc(100vw - ${16}px)`,i.style.maxHeight=`${Br(e,t)}px`,i.style.overflow="hidden",i.style.display="flex",i.style.flexDirection="column"}var Yt=class{options;geometry=null;needsReposition=!1;frame=null;constructor(e){this.options={...e,requestFrame:e.requestFrame??(t=>requestAnimationFrame(t)),cancelFrame:e.cancelFrame??(t=>cancelAnimationFrame(t))}}start(){this.cancel(),this.needsReposition=!0,this.frame=this.options.requestFrame(this.tick)}cancel(){this.frame!==null&&(this.options.cancelFrame(this.frame),this.frame=null),this.geometry=null,this.needsReposition=!1}tick=()=>{if(this.frame=null,!this.options.isActive())return;let e=this.options.readAnchorRect(),t=ua(e),r=!ha(this.geometry,t);r&&(this.options.onGeometryChange(e),this.geometry=t),(this.needsReposition||r)&&this.options.isConnected()&&(this.options.onReposition(),this.needsReposition=!1),this.frame=this.options.requestFrame(this.tick)}};var Gr="mndw-select",tt=class extends g{static formAssociated=!0;static shadowRootOptions={...g.shadowRootOptions,delegatesFocus:!0};static mndwLabelSource="label-property";static properties={value:{type:String},placeholder:{type:String},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},name:{type:String,reflect:!0},panelClass:{type:String,attribute:"panel-class"},label:{type:String},open:{type:Boolean,state:!0}};static styles=v`
766
+ `}firstEnabledIndex(){return this.options.findIndex(e=>!e.disabled)}optionId(e){return`mndw-select-${this.panelId}-option-${e}`}select(e){let t=this.options[e];!t||t.disabled||this.dispatchEvent(new CustomEvent("mndwpanelselect",{detail:{value:t.value}}))}dismiss(){this.dispatchEvent(new CustomEvent("mndwpaneldismiss",{detail:{restoreFocus:!0}}))}};var ke=class{getLabel;isDisabled;pageSize;typeaheadTimeout;now;typeaheadBuffer="";lastTypeaheadAt=Number.NEGATIVE_INFINITY;constructor(e){this.getLabel=e.getLabel,this.isDisabled=e.isDisabled,this.pageSize=e.pageSize??10,this.typeaheadTimeout=e.typeaheadTimeout??500,this.now=e.now??Date.now}handleKeydown(e,t){let r=null;switch(e.key){case"ArrowDown":r=this.move(t,1);break;case"ArrowUp":r=this.move(t,-1);break;case"Home":r=this.edge(t,1);break;case"End":r=this.edge(t,-1);break;case"PageDown":r=this.page(t,1);break;case"PageUp":r=this.page(t,-1);break;default:if(this.isPrintable(e))r=this.typeahead(e.key,t);else return!1}return e.preventDefault(),r!==null&&r!==t.activeIndex&&(t.setActiveIndex(r),t.mode==="roving-focus"&&t.focusItem?.(r)),!0}isPrintable(e){return!e.ctrlKey&&!e.altKey&&!e.metaKey&&!e.isComposing&&e.key!==" "&&[...e.key].length===1}move(e,t){let r=e.items.length;if(r===0)return null;let n=e.activeIndex;if(n<0)return this.edge(e,t);for(let o=0;o<r;o+=1){if(n+=t,e.wrap)n=(n+r)%r;else if(n<0||n>=r)return null;if(!this.isDisabled(e.items[n]))return n}return null}edge(e,t){let r=t>0?0:e.items.length-1,n=t>0?e.items.length:-1;for(let o=r;o!==n;o+=t)if(!this.isDisabled(e.items[o]))return o;return null}page(e,t){if(e.items.length===0)return null;if(e.activeIndex<0)return this.edge(e,t);let r=e.activeIndex+t*this.pageSize,n=e.wrap?(r%e.items.length+e.items.length)%e.items.length:Math.max(0,Math.min(e.items.length-1,r)),o=0;for(;o<e.items.length;){if(!this.isDisabled(e.items[n]))return n;if(n+=t,e.wrap)n=(n+e.items.length)%e.items.length;else if(n<0||n>=e.items.length)return null;o+=1}return null}typeahead(e,t){let r=this.now(),o=r-this.lastTypeaheadAt<=this.typeaheadTimeout?this.typeaheadBuffer:"",a=o!==""&&[...o].every(d=>d===e.toLocaleLowerCase()),s=a?e.toLocaleLowerCase():`${o}${e}`.toLocaleLowerCase();this.typeaheadBuffer=s,this.lastTypeaheadAt=r;let l=t.items[t.activeIndex];if(o!==""&&!a&&l&&!this.isDisabled(l)&&this.normalize(this.getLabel(l)).startsWith(s))return t.activeIndex;let c=t.items.length;for(let d=1;d<=c;d+=1){let h=t.activeIndex<0?d-1:(t.activeIndex+d)%c,p=t.items[h];if(!this.isDisabled(p)&&this.normalize(this.getLabel(p)).startsWith(s))return h}return null}normalize(e){return e.trimStart().toLocaleLowerCase()}};function Ln(i){let e=i.querySelectorAll(Ze);return Array.from(e,t=>{let r=t.getAttribute("value")??"",n=(t.textContent??"").replace(/\s+/g," ").trim(),o=Array.from(t.childNodes,a=>a.cloneNode(!0));return{value:r,label:n===""?r:n,labelNodes:o,disabled:t.hasAttribute("disabled")}})}var pa=180;function ma(i){return{top:i.top,right:i.right,bottom:i.bottom,left:i.left,width:i.width,height:i.height}}function ba(i,e){return i?.top===e.top&&i.right===e.right&&i.bottom===e.bottom&&i.left===e.left&&i.width===e.width&&i.height===e.height}function kn(i,e,t){i.style.minWidth=`${Math.max(e.width,pa)}px`,i.style.maxWidth=`calc(100vw - ${16}px)`,i.style.maxHeight=`${Br(e,t)}px`,i.style.overflow="hidden",i.style.display="flex",i.style.flexDirection="column"}var Jt=class{options;geometry=null;needsReposition=!1;frame=null;constructor(e){this.options={...e,requestFrame:e.requestFrame??(t=>requestAnimationFrame(t)),cancelFrame:e.cancelFrame??(t=>cancelAnimationFrame(t))}}start(){this.cancel(),this.needsReposition=!0,this.frame=this.options.requestFrame(this.tick)}cancel(){this.frame!==null&&(this.options.cancelFrame(this.frame),this.frame=null),this.geometry=null,this.needsReposition=!1}tick=()=>{if(this.frame=null,!this.options.isActive())return;let e=this.options.readAnchorRect(),t=ma(e),r=!ba(this.geometry,t);r&&(this.options.onGeometryChange(e),this.geometry=t),(this.needsReposition||r)&&this.options.isConnected()&&(this.options.onReposition(),this.needsReposition=!1),this.frame=this.options.requestFrame(this.tick)}};var Wr="mndw-select",rt=class extends g{static formAssociated=!0;static shadowRootOptions={...g.shadowRootOptions,delegatesFocus:!0};static mndwLabelSource="label-property";static properties={value:{type:String},placeholder:{type:String},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},name:{type:String,reflect:!0},panelClass:{type:String,attribute:"panel-class"},label:{type:String},open:{type:Boolean,state:!0}};static styles=v`
756
767
  :host {
757
768
  ${M}
758
769
 
@@ -767,7 +778,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
767
778
  }
768
779
 
769
780
  [part='trigger'] {
770
- ${B}
781
+ ${K}
771
782
 
772
783
  display: flex;
773
784
  gap: var(--mndw-space-2);
@@ -782,11 +793,11 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
782
793
  }
783
794
 
784
795
  :host(:not([disabled]):not([invalid]):not([aria-invalid='true'])) [part='trigger']:hover {
785
- ${Ce}
796
+ ${Te}
786
797
  }
787
798
 
788
799
  [part='trigger']:focus-visible {
789
- ${R}
800
+ ${A}
790
801
  }
791
802
 
792
803
  .value {
@@ -803,23 +814,23 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
803
814
  flex-shrink: 0;
804
815
  color: var(--mndw-text-subtle);
805
816
  }
806
- `;layer=null;panel=null;presentation=null;keyManager=new Ae({getLabel:e=>e.label,isDisabled:e=>e.disabled});placeholderState;localeController=new L(this,{applyLocale:()=>{this.applyLocale()}});formState=new N(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});popoverTracker=new Yt({isActive:()=>this.presentation==="popover"&&this.layer!==null,isConnected:()=>this.layer?.contentElement.isConnected===!0,readAnchorRect:()=>this.getBoundingClientRect(),onGeometryChange:e=>{this.layer!==null&&this.applyPopoverSizing(this.layer,e)},onReposition:()=>this.layer?.reposition()});constructor(){super(),this.placeholderState=O(this,"placeholder"),this.value="",this.disabled=!1,this.required=!1,this.invalid=!1,this.name="",this.panelClass="",this.label="",this.open=!1,this.addEventListener("click",this.onTriggerClick),this.addEventListener("keydown",this.onTriggerKeydown)}focus(e){this.triggerElement()?.focus(e)}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["value"]),this.addEventListener(Ze,this.onOptionChange)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(Ze,this.onOptionChange),this.closePanel(!1)}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}refreshAccessibleName(){this.requestUpdate()}render(){let e=this.options().find(n=>n.value===this.value),t=this.formState.effectiveDisabled,r=this.isInvalid(e);return u`
817
+ `;layer=null;panel=null;presentation=null;keyManager=new ke({getLabel:e=>e.label,isDisabled:e=>e.disabled});placeholderState;localeController=new L(this,{applyLocale:()=>{this.applyLocale()}});formState=new O(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});popoverTracker=new Jt({isActive:()=>this.presentation==="popover"&&this.layer!==null,isConnected:()=>this.layer?.contentElement.isConnected===!0,readAnchorRect:()=>this.getBoundingClientRect(),onGeometryChange:e=>{this.layer!==null&&this.applyPopoverSizing(this.layer,e)},onReposition:()=>this.layer?.reposition()});constructor(){super(),this.placeholderState=N(this,"placeholder"),this.value="",this.disabled=!1,this.required=!1,this.invalid=!1,this.name="",this.panelClass="",this.label="",this.open=!1,this.addEventListener("click",this.onTriggerClick),this.addEventListener("keydown",this.onTriggerKeydown)}focus(e){this.triggerElement()?.focus(e)}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["value"]),this.addEventListener(Qe,this.onOptionChange)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(Qe,this.onOptionChange),this.closePanel(!1)}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}refreshAccessibleName(){this.requestUpdate()}render(){let e=this.options().find(n=>n.value===this.value),t=this.formState.effectiveDisabled,r=this.isInvalid(e);return u`
807
818
  <button
808
819
  type="button"
809
820
  part="trigger"
810
- aria-label=${this.triggerLabel()??b}
821
+ aria-label=${this.triggerLabel()??m}
811
822
  aria-haspopup="listbox"
812
823
  aria-expanded=${String(this.open)}
813
824
  aria-invalid=${String(r)}
814
825
  ?disabled=${t}
815
826
  >
816
827
  <span class="value ${e?"":"placeholder"}" part="value">
817
- ${e?e.label:this.placeholder??y("select.placeholder")}
828
+ ${e?e.label:this.placeholder??w("select.placeholder")}
818
829
  </span>
819
830
  <span class="indicator" part="indicator" aria-hidden="true"><mndw-icon name="chevron-down"></mndw-icon></span>
820
831
  </button>
821
832
  <slot hidden @slotchange=${this.onSlotChange}></slot>
822
- `}updated(e){let t=this.options().find(n=>n.value===this.value),r=t?t.value:null;this.formState.setFormValue(r,this.value),this.required&&!t?this.formState.setValidity({valueMissing:!0},y("select.validation.required")):this.formState.clearValidity(),e.has("label")&&e.get("label")!==void 0&&ue(this)}options(){return An(this)}applyLocale(){this.placeholderState.setGenerated(y("select.placeholder")),this.layer?.setTitle?.(this.label||y("select.overlay.title"))}onSlotChange=()=>{this.syncOptions()};onOptionChange=()=>{this.syncOptions()};syncOptions(){this.requestUpdate(),this.panel&&(this.panel.options=this.options())}onTriggerClick=e=>{let t=this.triggerElement();if(t!==null&&!e.composedPath().includes(t)&&this.focus(),!this.formState.effectiveDisabled){if(this.open){this.closePanel(!0);return}this.openPanel()}};onTriggerKeydown=e=>{if(this.formState.effectiveDisabled||this.open)return;let t="selected";switch(e.key){case"ArrowDown":t=e.altKey?"selected":"first";break;case"ArrowUp":t="last";break;case"Home":t="first";break;case"End":t="last";break;case"Enter":case" ":break;default:{let r=this.options(),n=this.selectedEnabledIndex(r),o={items:r,wrap:!1,mode:"active-descendant",get activeIndex(){return n},set activeIndex(a){n=a},setActiveIndex(a){n=a}};if(!this.keyManager.handleKeydown(e,o))return;this.openPanel("active",n);return}}e.altKey&&e.key!=="ArrowDown"||(e.preventDefault(),this.openPanel(t))};handleOpenKeydown(e){if(e.key==="Escape"){e.preventDefault(),this.closePanel(!0);return}if(e.key==="Tab"){this.commitActiveOption(e.shiftKey?"backward":"forward");return}if(e.altKey&&e.key==="ArrowUp"){e.preventDefault(),this.commitActiveOption();return}if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.commitActiveOption();return}e.altKey||!this.panel||this.keyManager.handleKeydown(e,this.keyList(this.panel))}onPanelKeydown=e=>{this.open&&this.handleOpenKeydown(e)};openPanel(e="selected",t){if(this.formState.effectiveDisabled||this.open||!this.isConnected)return;let r=Ur(window.innerWidth),n=Gt().open({anchor:this,presentation:r,title:this.label||y("select.overlay.title"),className:this.panelClass||void 0});r==="popover"&&(this.applyPopoverSizing(n),window.addEventListener("resize",this.onViewportChange),window.addEventListener("scroll",this.onViewportChange,!0));let o=document.createElement(et);o.options=this.options(),o.value=this.value,o.label=this.label,o.sheet=r==="sheet",o.addEventListener("mndwpanelselect",this.onPanelSelect),o.addEventListener("mndwpaneldismiss",this.onPanelDismiss),o.addEventListener("keydown",this.onPanelKeydown),n.contentElement.appendChild(o),this.layer=n,this.panel=o,this.presentation=r,this.open=!0,r==="popover"&&this.startPopoverTracking(),o.updateComplete.then(async()=>{this.layer===n&&(e==="active"&&t!==void 0?o.activeIndex=t:e==="first"?o.activeIndex=this.firstEnabledIndex(o.options):e==="last"&&(o.activeIndex=this.lastEnabledIndex(o.options)),await o.updateComplete,o.focusListbox())}),n.closed.then(a=>{this.layer===n&&(this.forgetLayer(),this.restoreFocus(a))})}applyPopoverSizing(e,t=this.getBoundingClientRect()){Ln(e.contentElement,t,{width:window.innerWidth,height:window.innerHeight})}startPopoverTracking(){this.popoverTracker.start()}cancelPopoverTracking(){this.popoverTracker.cancel()}onViewportChange=()=>{let e=this.layer;this.presentation!=="popover"||!e||(this.applyPopoverSizing(e),e.reposition())};restoreFocus(e){if(e==="detached"||!this.isConnected)return;let t=J(),r=t===null||t===document.body;e!=="escape"&&!r||this.focus()}onPanelSelect=e=>{let t=e.detail;this.value=t.value,this.closePanel(!0),this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:t.value}}))};onPanelDismiss=e=>{let t=e.detail;this.closePanel(t.restoreFocus)};commitActiveOption(e){let t=this.panel?.options[this.panel.activeIndex];if(!t||t.disabled){e===void 0?this.closePanel(!0):this.closePanelAfterTab(e);return}this.value=t.value,this.dispatchChange(t.value),e===void 0?this.closePanel(!0):this.closePanelAfterTab(e)}dispatchChange(e){this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:e}}))}keyList(e){return{items:e.options,wrap:!1,mode:"active-descendant",get activeIndex(){return e.activeIndex},set activeIndex(t){e.activeIndex=t},setActiveIndex:t=>{e.activeIndex=t}}}closePanelAfterTab(e){let t=this.layer;if(t===null)return;let r=this.tabDestination(e);window.setTimeout(()=>{this.layer===t&&(this.forgetLayer(),t.close(),t.closed.then(()=>{r?.isConnected&&r.focus()}))},0)}tabDestination(e){let t=this.triggerElement();if(t===null)return null;let r=me(document.body),n=r.indexOf(t);if(n<0||r.length<2)return null;let a=(n+(e==="forward"?1:-1)+r.length)%r.length;return r[a]??null}triggerElement(){return this.renderRoot.querySelector('[part="trigger"]')}triggerLabel(){let e=this.label.trim();if(e!=="")return e;let t=this.formState.labels.map(r=>r.textContent?.trim()??"").filter(r=>r!=="").join(" ");return t===""?void 0:t}isInvalid(e){return this.invalid||this.required&&!e}closePanel(e){let t=this.layer;t&&(this.forgetLayer(),t.close(),e&&this.focus())}forgetLayer(){this.cancelPopoverTracking(),window.removeEventListener("resize",this.onViewportChange),window.removeEventListener("scroll",this.onViewportChange,!0),this.panel?.removeEventListener("mndwpanelselect",this.onPanelSelect),this.panel?.removeEventListener("mndwpaneldismiss",this.onPanelDismiss),this.panel?.removeEventListener("keydown",this.onPanelKeydown),this.panel=null,this.layer=null,this.presentation=null,this.open=!1}selectedEnabledIndex(e){let t=e.findIndex(r=>r.value===this.value&&!r.disabled);return t>=0?t:this.firstEnabledIndex(e)}firstEnabledIndex(e){return e.findIndex(t=>!t.disabled)}lastEnabledIndex(e){for(let t=e.length-1;t>=0;t-=1)if(!e[t].disabled)return t;return-1}resetForm(){this.value=this.getAttribute("value")??this.options()[0]?.value??""}restoreFormState(e){typeof e=="string"&&(this.value=e)}};var Wr=24,qr="mndw-scroll-area";function K(i,e=0){return Number.isFinite(i)&&i>=0?i:e}function kn(i,e,t){return Math.min(t,Math.max(e,i))}var rt=class extends g{static styles=v`
833
+ `}updated(e){let t=this.triggerElement();t!==null&&(t.disabled=this.formState.effectiveDisabled),this.formState.effectiveDisabled&&this.open&&Promise.resolve().then(()=>{this.formState.effectiveDisabled&&this.closePanel(!1)});let r=this.options().find(o=>o.value===this.value),n=r?r.value:null;this.formState.setFormValue(n,this.value),this.required&&!r?this.formState.setValidity({valueMissing:!0},w("select.validation.required")):this.formState.clearValidity(),e.has("label")&&e.get("label")!==void 0&&pe(this)}options(){return Ln(this)}applyLocale(){this.placeholderState.setGenerated(w("select.placeholder")),this.layer?.setTitle?.(this.label||w("select.overlay.title"))}onSlotChange=()=>{this.syncOptions()};onOptionChange=()=>{this.syncOptions()};syncOptions(){this.requestUpdate(),this.panel&&(this.panel.options=this.options())}onTriggerClick=e=>{let t=this.triggerElement();if(t!==null&&!e.composedPath().includes(t)&&this.focus(),!this.formState.effectiveDisabled){if(this.open){this.closePanel(!0);return}this.openPanel()}};onTriggerKeydown=e=>{if(this.formState.effectiveDisabled||this.open)return;let t="selected";switch(e.key){case"ArrowDown":t=e.altKey?"selected":"first";break;case"ArrowUp":t="last";break;case"Home":t="first";break;case"End":t="last";break;case"Enter":case" ":break;default:{let r=this.options(),n=this.selectedEnabledIndex(r),o={items:r,wrap:!1,mode:"active-descendant",get activeIndex(){return n},set activeIndex(a){n=a},setActiveIndex(a){n=a}};if(!this.keyManager.handleKeydown(e,o))return;this.openPanel("active",n);return}}e.altKey&&e.key!=="ArrowDown"||(e.preventDefault(),this.openPanel(t))};handleOpenKeydown(e){if(e.key==="Escape"){e.preventDefault(),this.closePanel(!0);return}if(e.key==="Tab"){this.commitActiveOption(e.shiftKey?"backward":"forward");return}if(e.altKey&&e.key==="ArrowUp"){e.preventDefault(),this.commitActiveOption();return}if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.commitActiveOption();return}e.altKey||!this.panel||this.keyManager.handleKeydown(e,this.keyList(this.panel))}onPanelKeydown=e=>{this.open&&this.handleOpenKeydown(e)};openPanel(e="selected",t){if(this.formState.effectiveDisabled||this.open||!this.isConnected)return;let r=Ur(window.innerWidth),n=qt().open({anchor:this,presentation:r,title:this.label||w("select.overlay.title"),className:this.panelClass||void 0});r==="popover"&&(this.applyPopoverSizing(n),window.addEventListener("resize",this.onViewportChange),window.addEventListener("scroll",this.onViewportChange,!0));let o=document.createElement(tt);o.options=this.options(),o.value=this.value,o.label=this.label,o.sheet=r==="sheet",o.addEventListener("mndwpanelselect",this.onPanelSelect),o.addEventListener("mndwpaneldismiss",this.onPanelDismiss),o.addEventListener("keydown",this.onPanelKeydown),n.contentElement.appendChild(o),this.layer=n,this.panel=o,this.presentation=r,this.open=!0,r==="popover"&&this.startPopoverTracking(),o.updateComplete.then(async()=>{this.layer===n&&(e==="active"&&t!==void 0?o.activeIndex=t:e==="first"?o.activeIndex=this.firstEnabledIndex(o.options):e==="last"&&(o.activeIndex=this.lastEnabledIndex(o.options)),await o.updateComplete,o.focusListbox())}),n.closed.then(a=>{this.layer===n&&(this.forgetLayer(),this.restoreFocus(a))})}applyPopoverSizing(e,t=this.getBoundingClientRect()){kn(e.contentElement,t,{width:window.innerWidth,height:window.innerHeight})}startPopoverTracking(){this.popoverTracker.start()}cancelPopoverTracking(){this.popoverTracker.cancel()}onViewportChange=()=>{let e=this.layer;this.presentation!=="popover"||!e||(this.applyPopoverSizing(e),e.reposition())};restoreFocus(e){if(e==="detached"||!this.isConnected)return;let t=U(),r=t===null||t===document.body;e!=="escape"&&!r||this.focus()}onPanelSelect=e=>{if(this.formState.effectiveDisabled){this.closePanel(!1);return}let t=e.detail;this.value=t.value,this.closePanel(!0),this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:t.value}}))};onPanelDismiss=e=>{let t=e.detail;this.closePanel(t.restoreFocus)};commitActiveOption(e){if(this.formState.effectiveDisabled){this.closePanel(!1);return}let t=this.panel?.options[this.panel.activeIndex];if(!t||t.disabled){e===void 0?this.closePanel(!0):this.closePanelAfterTab(e);return}this.value=t.value,this.dispatchChange(t.value),e===void 0?this.closePanel(!0):this.closePanelAfterTab(e)}dispatchChange(e){this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:e}}))}keyList(e){return{items:e.options,wrap:!1,mode:"active-descendant",get activeIndex(){return e.activeIndex},set activeIndex(t){e.activeIndex=t},setActiveIndex:t=>{e.activeIndex=t}}}closePanelAfterTab(e){let t=this.layer;if(t===null)return;let r=this.tabDestination(e);window.setTimeout(()=>{this.layer===t&&(this.forgetLayer(),t.close(),t.closed.then(()=>{r?.isConnected&&r.focus()}))},0)}tabDestination(e){let t=this.triggerElement();if(t===null)return null;let r=be(document.body),n=r.indexOf(t);if(n<0||r.length<2)return null;let a=(n+(e==="forward"?1:-1)+r.length)%r.length;return r[a]??null}triggerElement(){return this.renderRoot.querySelector('[part="trigger"]')}triggerLabel(){let e=this.label.trim();if(e!=="")return e;let t=this.formState.labels.map(r=>{let n=r.cloneNode(!0);return n.querySelectorAll('[aria-hidden="true"], [hidden]').forEach(o=>o.remove()),n.textContent?.trim()??""}).filter(r=>r!=="").join(" ");return t===""?void 0:t}isInvalid(e){return this.invalid||this.required&&!e}closePanel(e){let t=this.layer;t&&(this.forgetLayer(),t.close(),e&&this.focus())}forgetLayer(){this.cancelPopoverTracking(),window.removeEventListener("resize",this.onViewportChange),window.removeEventListener("scroll",this.onViewportChange,!0),this.panel?.removeEventListener("mndwpanelselect",this.onPanelSelect),this.panel?.removeEventListener("mndwpaneldismiss",this.onPanelDismiss),this.panel?.removeEventListener("keydown",this.onPanelKeydown),this.panel=null,this.layer=null,this.presentation=null,this.open=!1}selectedEnabledIndex(e){let t=e.findIndex(r=>r.value===this.value&&!r.disabled);return t>=0?t:this.firstEnabledIndex(e)}firstEnabledIndex(e){return e.findIndex(t=>!t.disabled)}lastEnabledIndex(e){for(let t=e.length-1;t>=0;t-=1)if(!e[t].disabled)return t;return-1}resetForm(){this.value=this.getAttribute("value")??this.options()[0]?.value??""}restoreFormState(e){typeof e=="string"&&(this.value=e)}};var Gr=24,qr="mndw-scroll-area";function W(i,e=0){return Number.isFinite(i)&&i>=0?i:e}function Pn(i,e,t){return Math.min(t,Math.max(e,i))}var it=class extends g{static styles=v`
823
834
  :host {
824
835
  box-sizing: border-box;
825
836
  display: flex;
@@ -884,7 +895,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
884
895
  height: var(--mndw-scrollbar-thumb-min-size);
885
896
  pointer-events: none;
886
897
  }
887
- `;viewportResizeObserver=null;contentResizeObserver=null;refreshFrame=null;shouldMeasureOnRefresh=!0;measuredMinThumbPx=Wr;assignedContent=null;listenersAttached=!1;activeDrag=null;maxScroll=0;thumbLength=0;trackTravel=0;trackTop=0;get viewportElement(){return this.shadowRoot?.querySelector('[part="viewport"]')??null}refresh(){this.scheduleRefresh(!0)}firstUpdated(){this.attachListeners(),this.scheduleRefresh(!0)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&(this.attachListeners(),this.scheduleRefresh(!0))}disconnectedCallback(){let e=this.viewportElement;e&&this.listenersAttached&&e.removeEventListener("scroll",this.handleScroll),this.listenersAttached=!1,this.viewportResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),this.assignedContent=null,this.refreshFrame!==null&&(cancelAnimationFrame(this.refreshFrame),this.refreshFrame=null),this.shouldMeasureOnRefresh=!0,this.endDrag(),super.disconnectedCallback()}render(){return u`
898
+ `;viewportResizeObserver=null;contentResizeObserver=null;refreshFrame=null;shouldMeasureOnRefresh=!0;measuredMinThumbPx=Gr;assignedContent=null;listenersAttached=!1;activeDrag=null;maxScroll=0;thumbLength=0;trackTravel=0;trackTop=0;get viewportElement(){return this.shadowRoot?.querySelector('[part="viewport"]')??null}refresh(){this.scheduleRefresh(!0)}firstUpdated(){this.attachListeners(),this.scheduleRefresh(!0)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&(this.attachListeners(),this.scheduleRefresh(!0))}disconnectedCallback(){let e=this.viewportElement;e&&this.listenersAttached&&e.removeEventListener("scroll",this.handleScroll),this.listenersAttached=!1,this.viewportResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),this.assignedContent=null,this.refreshFrame!==null&&(cancelAnimationFrame(this.refreshFrame),this.refreshFrame=null),this.shouldMeasureOnRefresh=!0,this.endDrag(),super.disconnectedCallback()}render(){return u`
888
899
  <div part="viewport" class="viewport"><slot @slotchange=${this.handleSlotChange}></slot></div>
889
900
  <div
890
901
  part="scrollbar"
@@ -899,7 +910,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
899
910
  </div>
900
911
  </div>
901
912
  <div data-measure="thumb-min" aria-hidden="true"></div>
902
- `}attachListeners(){let e=this.viewportElement;e&&(this.listenersAttached||(e.addEventListener("scroll",this.handleScroll,{passive:!0}),this.listenersAttached=!0),typeof ResizeObserver<"u"&&(this.viewportResizeObserver||(this.viewportResizeObserver=new ResizeObserver(this.handleResize)),this.contentResizeObserver||(this.contentResizeObserver=new ResizeObserver(this.handleResize)),this.viewportResizeObserver.observe(e),this.observeAssignedContent()))}observeAssignedContent(){let e=this.shadowRoot?.querySelector("slot");if(!e||!this.contentResizeObserver)return;let t=e.assignedElements({flatten:!0})[0]??null;t!==this.assignedContent&&(this.contentResizeObserver.disconnect(),this.assignedContent=t,t&&this.contentResizeObserver.observe(t))}scheduleRefresh(e){e&&(this.shouldMeasureOnRefresh=!0),this.refreshFrame===null&&(this.refreshFrame=requestAnimationFrame(()=>{this.refreshFrame=null;let t=this.shouldMeasureOnRefresh;this.shouldMeasureOnRefresh=!1,this.updateGeometry(t)}))}updateGeometry(e){let t=this.viewportElement,r=this.shadowRoot?.querySelector('[part="scrollbar"]'),n=this.shadowRoot?.querySelector('[part="track"]'),o=this.shadowRoot?.querySelector('[part="thumb"]');if(!t||!r||!n||!o)return;e&&(this.measuredMinThumbPx=this.measureMinimumThumb());let a=K(t.clientHeight),s=K(t.scrollHeight),l=K(t.scrollTop);r.style.display="block";let c=n.getBoundingClientRect(),d=K(c.height),h=Math.max(0,s-a),f=h>1&&d>0;if(this.trackTop=Number.isFinite(c.top)?c.top:0,this.maxScroll=h,r.style.display=f?"block":"none",!f){this.thumbLength=d,this.trackTravel=0,o.style.height=`${d}px`,o.style.transform="translateY(0px)";return}let m=Math.min(d,this.measuredMinThumbPx),S=s>0?a/s:1,x=K(d*S),E=Math.min(d,Math.max(m,x)),A=Math.max(0,d-E),k=h>0?A*kn(l,0,h)/h:0;this.thumbLength=E,this.trackTravel=A,o.style.height=`${E}px`,o.style.transform=`translateY(${K(k)}px)`}measureMinimumThumb(){let e=this.shadowRoot?.querySelector('[data-measure="thumb-min"]');if(!e)return Wr;let t=e.getBoundingClientRect().height;return Number.isFinite(t)&&t>0?t:Wr}setScrollFromThumbTop(e){let t=this.viewportElement;if(!t)return;let r=kn(K(e),0,this.trackTravel),n=this.trackTravel>0?this.maxScroll*r/this.trackTravel:0;t.scrollTop=K(n),this.writeThumbOffset(r),this.scheduleRefresh(!1)}writeThumbOffset(e){let t=this.shadowRoot?.querySelector('[part="thumb"]');t&&(t.style.transform=`translateY(${K(e)}px)`)}setDragging(e){let t=this.shadowRoot?.querySelector('[part="thumb"]');this.classList.toggle("dragging",e),t?.classList.toggle("dragging",e)}endDrag(){if(!this.activeDrag){this.setDragging(!1);return}let{pointerId:e,captureTarget:t}=this.activeDrag;t.releasePointerCapture?.(e),this.activeDrag=null,this.setDragging(!1)}capturePointer(e,t){e.setPointerCapture?.(t)}handleScroll=()=>{this.scheduleRefresh(!1)};handleResize=()=>{this.scheduleRefresh(!0)};handleSlotChange=()=>{this.observeAssignedContent(),this.scheduleRefresh(!1)};handleThumbPointerDown=e=>{let t=e.currentTarget,r=t.getBoundingClientRect();this.activeDrag={pointerId:e.pointerId,offset:K(e.clientY-r.top),captureTarget:t},this.capturePointer(t,e.pointerId),e.preventDefault(),this.setDragging(!0)};handleTrackPointerDown=e=>{let t=this.shadowRoot?.querySelector('[part="thumb"]');if(e.target===t)return;let r=e.currentTarget,n=r.getBoundingClientRect(),o=e.clientY-n.top-this.thumbLength/2;this.setScrollFromThumbTop(o),this.activeDrag={pointerId:e.pointerId,offset:this.thumbLength/2,captureTarget:r},this.capturePointer(r,e.pointerId),e.preventDefault(),this.setDragging(!0)};handlePointerMove=e=>{if(this.activeDrag?.pointerId!==e.pointerId)return;let t=e.clientY-this.trackTop-this.activeDrag.offset;this.setScrollFromThumbTop(t)};handlePointerUp=e=>{this.activeDrag?.pointerId===e.pointerId&&this.endDrag()};handlePointerCancel=e=>{this.activeDrag?.pointerId===e.pointerId&&this.endDrag()}};var Le="mndw-segment",nt="mndwsegmentchange",it=class extends g{static properties={value:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0}};static styles=v`
913
+ `}attachListeners(){let e=this.viewportElement;e&&(this.listenersAttached||(e.addEventListener("scroll",this.handleScroll,{passive:!0}),this.listenersAttached=!0),typeof ResizeObserver<"u"&&(this.viewportResizeObserver||(this.viewportResizeObserver=new ResizeObserver(this.handleResize)),this.contentResizeObserver||(this.contentResizeObserver=new ResizeObserver(this.handleResize)),this.viewportResizeObserver.observe(e),this.observeAssignedContent()))}observeAssignedContent(){let e=this.shadowRoot?.querySelector("slot");if(!e||!this.contentResizeObserver)return;let t=e.assignedElements({flatten:!0})[0]??null;t!==this.assignedContent&&(this.contentResizeObserver.disconnect(),this.assignedContent=t,t&&this.contentResizeObserver.observe(t))}scheduleRefresh(e){e&&(this.shouldMeasureOnRefresh=!0),this.refreshFrame===null&&(this.refreshFrame=requestAnimationFrame(()=>{this.refreshFrame=null;let t=this.shouldMeasureOnRefresh;this.shouldMeasureOnRefresh=!1,this.updateGeometry(t)}))}updateGeometry(e){let t=this.viewportElement,r=this.shadowRoot?.querySelector('[part="scrollbar"]'),n=this.shadowRoot?.querySelector('[part="track"]'),o=this.shadowRoot?.querySelector('[part="thumb"]');if(!t||!r||!n||!o)return;e&&(this.measuredMinThumbPx=this.measureMinimumThumb());let a=W(t.clientHeight),s=W(t.scrollHeight),l=W(t.scrollTop);r.style.display="block";let c=n.getBoundingClientRect(),d=W(c.height),h=Math.max(0,s-a),f=h>1&&d>0;if(this.trackTop=Number.isFinite(c.top)?c.top:0,this.maxScroll=h,r.style.display=f?"block":"none",!f){this.thumbLength=d,this.trackTravel=0,o.style.height=`${d}px`,o.style.transform="translateY(0px)";return}let b=Math.min(d,this.measuredMinThumbPx),S=s>0?a/s:1,C=W(d*S),T=Math.min(d,Math.max(b,C)),R=Math.max(0,d-T),k=h>0?R*Pn(l,0,h)/h:0;this.thumbLength=T,this.trackTravel=R,o.style.height=`${T}px`,o.style.transform=`translateY(${W(k)}px)`}measureMinimumThumb(){let e=this.shadowRoot?.querySelector('[data-measure="thumb-min"]');if(!e)return Gr;let t=e.getBoundingClientRect().height;return Number.isFinite(t)&&t>0?t:Gr}setScrollFromThumbTop(e){let t=this.viewportElement;if(!t)return;let r=Pn(W(e),0,this.trackTravel),n=this.trackTravel>0?this.maxScroll*r/this.trackTravel:0;t.scrollTop=W(n),this.writeThumbOffset(r),this.scheduleRefresh(!1)}writeThumbOffset(e){let t=this.shadowRoot?.querySelector('[part="thumb"]');t&&(t.style.transform=`translateY(${W(e)}px)`)}setDragging(e){let t=this.shadowRoot?.querySelector('[part="thumb"]');this.classList.toggle("dragging",e),t?.classList.toggle("dragging",e)}endDrag(){if(!this.activeDrag){this.setDragging(!1);return}let{pointerId:e,captureTarget:t}=this.activeDrag;t.releasePointerCapture?.(e),this.activeDrag=null,this.setDragging(!1)}capturePointer(e,t){e.setPointerCapture?.(t)}handleScroll=()=>{this.scheduleRefresh(!1)};handleResize=()=>{this.scheduleRefresh(!0)};handleSlotChange=()=>{this.observeAssignedContent(),this.scheduleRefresh(!1)};handleThumbPointerDown=e=>{let t=e.currentTarget,r=t.getBoundingClientRect();this.activeDrag={pointerId:e.pointerId,offset:W(e.clientY-r.top),captureTarget:t},this.capturePointer(t,e.pointerId),e.preventDefault(),this.setDragging(!0)};handleTrackPointerDown=e=>{let t=this.shadowRoot?.querySelector('[part="thumb"]');if(e.target===t)return;let r=e.currentTarget,n=r.getBoundingClientRect(),o=e.clientY-n.top-this.thumbLength/2;this.setScrollFromThumbTop(o),this.activeDrag={pointerId:e.pointerId,offset:this.thumbLength/2,captureTarget:r},this.capturePointer(r,e.pointerId),e.preventDefault(),this.setDragging(!0)};handlePointerMove=e=>{if(this.activeDrag?.pointerId!==e.pointerId)return;let t=e.clientY-this.trackTop-this.activeDrag.offset;this.setScrollFromThumbTop(t)};handlePointerUp=e=>{this.activeDrag?.pointerId===e.pointerId&&this.endDrag()};handlePointerCancel=e=>{this.activeDrag?.pointerId===e.pointerId&&this.endDrag()}};var Pe="mndw-segment",ot="mndwsegmentchange",nt=class extends g{static properties={value:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0}};static styles=v`
903
914
  :host {
904
915
  ${M}
905
916
 
@@ -918,7 +929,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
918
929
  }
919
930
 
920
931
  [part='segment'] {
921
- ${B}
932
+ ${K}
922
933
 
923
934
  display: inline-flex;
924
935
  align-items: center;
@@ -936,8 +947,8 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
936
947
  }
937
948
 
938
949
  :host([aria-checked='false']:not([disabled]):not([aria-disabled='true']):hover) [part='segment'] {
939
- ${Me}
940
- ${re}
950
+ ${Ee}
951
+ ${ne}
941
952
  }
942
953
 
943
954
  :host([aria-checked='true']:not([disabled]):not([aria-disabled='true']):hover) [part='segment'] {
@@ -948,7 +959,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
948
959
  <span part="segment">
949
960
  <slot></slot>
950
961
  </span>
951
- `}updated(e){["value","disabled"].some(r=>e.has(r)&&e.get(r)!==void 0)&&this.dispatchEvent(new CustomEvent(nt,{bubbles:!0,composed:!1}))}};var jr="mndw-segmented",pa=["role","aria-checked","aria-disabled","tabindex"],ma=["ArrowRight","ArrowDown"],ba=["ArrowLeft","ArrowUp"],ot=class extends g{static formAssociated=!0;static mndwLabelSource="label-property";static properties={value:{type:String},label:{type:String},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},name:{type:String,reflect:!0}};static styles=v`
962
+ `}updated(e){["value","disabled"].some(r=>e.has(r)&&e.get(r)!==void 0)&&this.dispatchEvent(new CustomEvent(ot,{bubbles:!0,composed:!1}))}};var jr="mndw-segmented",fa=["role","aria-checked","aria-disabled","tabindex"],va=["ArrowRight","ArrowDown"],ga=["ArrowLeft","ArrowUp"],at=class extends g{static formAssociated=!0;static mndwLabelSource="label-property";static properties={value:{type:String},label:{type:String},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},name:{type:String,reflect:!0}};static styles=v`
952
963
  :host {
953
964
  ${M}
954
965
 
@@ -970,15 +981,15 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
970
981
  }
971
982
 
972
983
  ::slotted(mndw-segment:focus-visible) {
973
- ${R}
984
+ ${A}
974
985
 
975
986
  border-radius: var(--mndw-radius-sm);
976
987
  }
977
- `;formState=new N(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});owned=[];ownsAriaLabel=!1;ownedAriaLabel=null;localeController=new L(this);constructor(){super(),this.value="",this.label="",this.disabled=!1,this.required=!1,this.invalid=!1,this.name="",this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["value"]),this.addEventListener(nt,this.onSegmentChange)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(nt,this.onSegmentChange),this.releaseSegments(this.owned),this.owned=[]}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}render(){return u`
988
+ `;formState=new O(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});owned=[];ownsAriaLabel=!1;ownedAriaLabel=null;localeController=new L(this);constructor(){super(),this.value="",this.label="",this.disabled=!1,this.required=!1,this.invalid=!1,this.name="",this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["value"]),this.addEventListener(ot,this.onSegmentChange)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(ot,this.onSegmentChange),this.releaseSegments(this.owned),this.owned=[]}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}render(){return u`
978
989
  <div part="group">
979
990
  <slot @slotchange=${this.onSlotChange}></slot>
980
991
  </div>
981
- `}updated(e){let t=this.syncSegments();this.syncHost(t),this.syncFormState(t),e.has("label")&&e.get("label")!==void 0&&ue(this)}segments(){return[...this.children].filter(e=>e.localName===Le&&e.value!=="")}isSegmentDisabled(e){return e.disabled||this.formState.effectiveDisabled}syncSegments(){let e=this.segments(),t=e.find(n=>n.value===this.value)??null,r=t&&!this.isSegmentDisabled(t)?t:e.find(n=>!this.isSegmentDisabled(n))??null;this.releaseSegments(this.owned.filter(n=>!e.includes(n)));for(let n of e)n.setAttribute("role","radio"),n.setAttribute("aria-checked",String(n===t)),n.setAttribute("aria-disabled",String(this.isSegmentDisabled(n))),n.setAttribute("tabindex",n===r&&!this.formState.effectiveDisabled?"0":"-1");return this.owned=e,t}releaseSegments(e){for(let t of e)for(let r of pa)t.removeAttribute(r)}syncHost(e){let t=this.formState.effectiveDisabled,r=this.invalid||this.required&&!e;this.setAttribute("role","radiogroup"),this.setAttribute("aria-orientation","horizontal"),this.setAttribute("aria-disabled",String(t)),this.setAttribute("aria-required",String(this.required)),this.setAttribute("aria-invalid",String(r)),this.syncAccessibleLabel();let n=this.formState.internals;n&&(n.role="radiogroup",n.ariaOrientation="horizontal",n.ariaLabel=this.label||null,n.ariaDisabled=String(t),n.ariaRequired=String(this.required),n.ariaInvalid=String(r))}syncAccessibleLabel(){let e=this.getAttribute("aria-label");if(this.ownsAriaLabel&&e!==this.ownedAriaLabel&&(this.ownsAriaLabel=!1,this.ownedAriaLabel=null),this.label){(this.ownsAriaLabel||e===null)&&(this.setAttribute("aria-label",this.label),this.ownsAriaLabel=!0,this.ownedAriaLabel=this.label);return}this.ownsAriaLabel&&(this.removeAttribute("aria-label"),this.ownsAriaLabel=!1,this.ownedAriaLabel=null)}syncFormState(e){if(this.formState.setFormValue(e?e.value:null,this.value),this.required&&!e){let t=this.segments().find(r=>!this.isSegmentDisabled(r));this.formState.setValidity({valueMissing:!0},y("segmented.validation.required"),t)}else this.formState.clearValidity()}onSlotChange=()=>{this.requestUpdate()};onSegmentChange=()=>{this.requestUpdate()};onClick=e=>{let t=this.segmentFrom(e.target);!t||this.isSegmentDisabled(t)||this.activate(t)};onKeyDown=e=>{if(this.formState.effectiveDisabled)return;let t=this.segments().filter(n=>!this.isSegmentDisabled(n));if(t.length===0)return;let r=this.nextSegment(e.key,t,this.segmentFrom(e.target));r&&(e.preventDefault(),this.activate(r))};nextSegment(e,t,r){let n=r?t.indexOf(r):-1,o=t.length-1;return ma.includes(e)?t[n<0||n===o?0:n+1]:ba.includes(e)?t[n<=0?o:n-1]:e===" "&&n>=0?t[n]:null}segmentFrom(e){let t=e instanceof Element?e.closest(Le):null;return t?.parentElement===this?t:null}activate(e){let t=this.value!==e.value;this.value=e.value,e.focus(),t&&this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:this.value}}))}resetForm(){this.value=this.getAttribute("value")??""}restoreFormState(e){typeof e=="string"&&(this.value=e)}};var Xr="mndw-slider",Yr=0,_n=100,Pn=1,fa=10,va=12,ga=["ArrowRight","ArrowUp"],wa=["ArrowLeft","ArrowDown"],at=class extends g{static formAssociated=!0;static properties={value:{type:Number},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0},step:{type:Number,reflect:!0},valueFormatter:{attribute:!1},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},name:{type:String,reflect:!0}};static styles=v`
992
+ `}updated(e){let t=this.syncSegments();this.syncHost(t),this.syncFormState(t),e.has("label")&&e.get("label")!==void 0&&pe(this)}segments(){return[...this.children].filter(e=>e.localName===Pe&&e.value!=="")}isSegmentDisabled(e){return e.disabled||this.formState.effectiveDisabled}syncSegments(){let e=this.segments(),t=e.find(n=>n.value===this.value)??null,r=t&&!this.isSegmentDisabled(t)?t:e.find(n=>!this.isSegmentDisabled(n))??null;this.releaseSegments(this.owned.filter(n=>!e.includes(n)));for(let n of e)n.setAttribute("role","radio"),n.setAttribute("aria-checked",String(n===t)),n.setAttribute("aria-disabled",String(this.isSegmentDisabled(n))),n.setAttribute("tabindex",n===r&&!this.formState.effectiveDisabled?"0":"-1");return this.owned=e,t}releaseSegments(e){for(let t of e)for(let r of fa)t.removeAttribute(r)}syncHost(e){let t=this.formState.effectiveDisabled,r=this.invalid||this.required&&!e;this.setAttribute("role","radiogroup"),this.setAttribute("aria-orientation","horizontal"),this.setAttribute("aria-disabled",String(t)),this.setAttribute("aria-required",String(this.required)),this.setAttribute("aria-invalid",String(r)),this.syncAccessibleLabel();let n=this.formState.internals;n&&(n.role="radiogroup",n.ariaOrientation="horizontal",n.ariaLabel=this.label||null,n.ariaDisabled=String(t),n.ariaRequired=String(this.required),n.ariaInvalid=String(r))}syncAccessibleLabel(){let e=this.getAttribute("aria-label");if(this.ownsAriaLabel&&e!==this.ownedAriaLabel&&(this.ownsAriaLabel=!1,this.ownedAriaLabel=null),this.label){(this.ownsAriaLabel||e===null)&&(this.setAttribute("aria-label",this.label),this.ownsAriaLabel=!0,this.ownedAriaLabel=this.label);return}this.ownsAriaLabel&&(this.removeAttribute("aria-label"),this.ownsAriaLabel=!1,this.ownedAriaLabel=null)}syncFormState(e){if(this.formState.setFormValue(e?e.value:null,this.value),this.required&&!e){let t=this.segments().find(r=>!this.isSegmentDisabled(r));this.formState.setValidity({valueMissing:!0},w("segmented.validation.required"),t)}else this.formState.clearValidity()}onSlotChange=()=>{this.requestUpdate()};onSegmentChange=()=>{this.requestUpdate()};onClick=e=>{let t=this.segmentFrom(e.target);!t||this.isSegmentDisabled(t)||this.activate(t)};onKeyDown=e=>{if(this.formState.effectiveDisabled)return;let t=this.segments().filter(n=>!this.isSegmentDisabled(n));if(t.length===0)return;let r=this.nextSegment(e.key,t,this.segmentFrom(e.target));r&&(e.preventDefault(),this.activate(r))};nextSegment(e,t,r){let n=r?t.indexOf(r):-1,o=t.length-1;return va.includes(e)?t[n<0||n===o?0:n+1]:ga.includes(e)?t[n<=0?o:n-1]:e==="Home"?t[0]??null:e==="End"?t[o]??null:e===" "&&n>=0?t[n]:null}segmentFrom(e){let t=e instanceof Element?e.closest(Pe):null;return t?.parentElement===this?t:null}activate(e){let t=this.value!==e.value;this.value=e.value,e.focus(),t&&this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:this.value}}))}resetForm(){this.value=this.getAttribute("value")??""}restoreFormState(e){typeof e=="string"&&(this.value=e)}};var Xr="mndw-slider",Yr=0,_n=100,Dn=1,wa=10,ya=12,Sa=["ArrowRight","ArrowUp"],xa=["ArrowLeft","ArrowDown"],st=class extends g{static formAssociated=!0;static properties={value:{type:Number},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0},step:{type:Number,reflect:!0},valueFormatter:{attribute:!1},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},name:{type:String,reflect:!0}};static styles=v`
982
993
  :host {
983
994
  ${M}
984
995
 
@@ -1037,11 +1048,11 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1037
1048
  }
1038
1049
 
1039
1050
  :host(:not([disabled]):not([aria-disabled='true']):not([invalid]):not([aria-invalid='true'])) [part='thumb']:hover {
1040
- ${te}
1051
+ ${ie}
1041
1052
  }
1042
1053
 
1043
1054
  :host(:focus-visible) [part='thumb'] {
1044
- ${R}
1055
+ ${A}
1045
1056
  }
1046
1057
 
1047
1058
  :host([disabled]) [part='fill'],
@@ -1059,13 +1070,13 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1059
1070
  font-size: var(--mndw-text-xs);
1060
1071
  font-variant-numeric: tabular-nums;
1061
1072
  }
1062
- `;formState=new N(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});labelController=new ee(this);dragPointer=null;dragBaseline=0;constructor(){super(),this.value=Yr,this.min=Yr,this.max=_n,this.step=Pn,this.disabled=!1,this.required=!1,this.invalid=!1,this.name="",this.addEventListener("keydown",this.onKeyDown),this.addEventListener("pointerdown",this.onPointerDown)}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["value"])}disconnectedCallback(){super.disconnectedCallback(),this.endDrag(!1)}refreshAccessibleName(){this.requestUpdate()}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}willUpdate(){this.min=Number.isFinite(this.min)?this.min:Yr,this.max=Number.isFinite(this.max)?this.max:_n,this.step=Number.isFinite(this.step)&&this.step>0?this.step:Pn;let e=this.normalizeValue(this.value);e!==this.value&&(this.value=e)}render(){let e=this.percent;return u`
1073
+ `;formState=new O(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});labelController=new re(this);dragPointer=null;dragBaseline=0;constructor(){super(),this.value=Yr,this.min=Yr,this.max=_n,this.step=Dn,this.disabled=!1,this.required=!1,this.invalid=!1,this.name="",this.addEventListener("keydown",this.onKeyDown),this.addEventListener("pointerdown",this.onPointerDown)}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["value"])}disconnectedCallback(){super.disconnectedCallback(),this.endDrag(!1)}refreshAccessibleName(){this.requestUpdate()}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}willUpdate(){this.min=Number.isFinite(this.min)?this.min:Yr,this.max=Number.isFinite(this.max)?this.max:_n,this.step=Number.isFinite(this.step)&&this.step>0?this.step:Dn;let e=this.normalizeValue(this.value);e!==this.value&&(this.value=e)}render(){let e=this.percent;return u`
1063
1074
  <div part="track">
1064
1075
  <div part="fill" style="width: ${e}%"></div>
1065
1076
  <div part="thumb" style="left: ${e}%"></div>
1066
1077
  </div>
1067
1078
  <span part="output" aria-hidden="true">${this.formatValue(this.value)}</span>
1068
- `}updated(){let e=this.formState.effectiveDisabled;this.setAttribute("role","slider"),this.setAttribute("aria-valuenow",String(this.value)),this.setAttribute("aria-valuemin",String(this.min)),this.setAttribute("aria-valuemax",String(this.max)),this.setAttribute("aria-orientation","horizontal"),this.setAttribute("aria-disabled",String(e)),this.tabIndex=e?-1:0,this.valueFormatter?this.setAttribute("aria-valuetext",this.formatValue(this.value)):this.removeAttribute("aria-valuetext"),this.formState.setFormValue(String(this.value),String(this.value)),this.syncValidity(),this.syncLabels()}get percent(){let e=this.max-this.min;return e<=0?0:Math.min(Math.max((this.value-this.min)/e*100,0),100)}formatValue(e){try{let t=this.valueFormatter?.(e);return typeof t=="string"?t:String(e)}catch{return String(e)}}normalizeValue(e){let t=Number.isFinite(e)?e:this.min,r=Math.min(Math.max(t,this.min),this.max),n=Math.round((r-this.min)/this.step),o=this.min+n*this.step,a=o>this.max?this.min+Math.floor((this.max-this.min)/this.step)*this.step:o;return Number.parseFloat(a.toPrecision(va))}syncLabels(){let e=this.formState.labels,t=this.formState.internals;this.labelController.sync(e,t),t&&(t.role="slider",t.ariaValueNow=String(this.value),t.ariaValueMin=String(this.min),t.ariaValueMax=String(this.max),t.ariaValueText=this.valueFormatter?this.formatValue(this.value):null,t.ariaOrientation="horizontal",t.ariaDisabled=String(this.formState.effectiveDisabled))}syncValidity(){if(this.value<this.min){this.formState.setValidity({rangeUnderflow:!0},`Value must be ${this.min} or more.`);return}if(this.value>this.max){this.formState.setValidity({rangeOverflow:!0},`Value must be ${this.max} or less.`);return}let e=(this.value-this.min)/this.step;if(Math.abs(e-Math.round(e))>Number.EPSILON){this.formState.setValidity({stepMismatch:!0},`Value must be a multiple of ${this.step}.`);return}this.formState.clearValidity()}onKeyDown=e=>{if(this.formState.effectiveDisabled)return;let t=this.keyValue(e.key);t!==null&&(e.preventDefault(),this.applyUserValue(t)&&this.dispatchChange())};keyValue(e){if(ga.includes(e))return this.value+this.step;if(wa.includes(e))return this.value-this.step;let t=Math.max(this.step,(this.max-this.min)/fa);return e==="PageUp"?this.value+t:e==="PageDown"?this.value-t:e==="Home"?this.min:e==="End"?this.max:null}onPointerDown=e=>{this.formState.effectiveDisabled||e.isPrimary===!1||this.dragPointer!==null||(e.preventDefault(),this.dragPointer=e.pointerId,this.dragBaseline=this.value,this.focus(),typeof this.setPointerCapture=="function"&&this.setPointerCapture(e.pointerId),window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerUp),this.applyUserValue(this.valueFromPointer(e)))};onPointerMove=e=>{this.dragPointer===e.pointerId&&this.applyUserValue(this.valueFromPointer(e))};onPointerUp=e=>{this.dragPointer===e.pointerId&&this.endDrag(!0)};endDrag(e){if(this.dragPointer===null)return;let t=this.dragPointer;this.dragPointer=null,window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerUp),typeof this.releasePointerCapture=="function"&&this.hasPointerCapture(t)&&this.releasePointerCapture(t),e&&this.value!==this.dragBaseline&&this.dispatchChange()}valueFromPointer(e){let r=this.renderRoot.querySelector('[part="track"]')?.getBoundingClientRect();return!r||r.width===0?this.value:this.min+(e.clientX-r.left)/r.width*(this.max-this.min)}applyUserValue(e){let t=this.normalizeValue(e);return t===this.value?!1:(this.value=t,this.dispatchEvent(new CustomEvent("mndwinput",{bubbles:!0,composed:!0,detail:{value:t}})),!0)}dispatchChange(){this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:this.value}}))}resetForm(){let e=this.getAttribute("value"),t=e===null?Number.NaN:Number(e);this.value=Number.isFinite(t)?t:this.min}restoreFormState(e){if(typeof e!="string")return;let t=Number(e);Number.isFinite(t)&&e.trim()!==""&&(this.value=t)}};var Jr="mndw-switch",st=class extends g{static formAssociated=!0;static properties={checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},value:{type:String,reflect:!0},name:{type:String,reflect:!0}};static styles=v`
1079
+ `}updated(){let e=this.formState.effectiveDisabled;this.setAttribute("role","slider"),this.setAttribute("aria-valuenow",String(this.value)),this.setAttribute("aria-valuemin",String(this.min)),this.setAttribute("aria-valuemax",String(this.max)),this.setAttribute("aria-orientation","horizontal"),this.setAttribute("aria-disabled",String(e)),this.tabIndex=e?-1:0,this.valueFormatter?this.setAttribute("aria-valuetext",this.formatValue(this.value)):this.removeAttribute("aria-valuetext"),this.formState.setFormValue(String(this.value),String(this.value)),this.syncValidity(),this.syncLabels()}get percent(){let e=this.max-this.min;return e<=0?0:Math.min(Math.max((this.value-this.min)/e*100,0),100)}formatValue(e){try{let t=this.valueFormatter?.(e);return typeof t=="string"?t:String(e)}catch{return String(e)}}normalizeValue(e){let t=Number.isFinite(e)?e:this.min,r=Math.min(Math.max(t,this.min),this.max),n=Math.round((r-this.min)/this.step),o=this.min+n*this.step,a=o>this.max?this.min+Math.floor((this.max-this.min)/this.step)*this.step:o;return Number.parseFloat(a.toPrecision(ya))}syncLabels(){let e=this.formState.labels,t=this.formState.internals;this.labelController.sync(e,t),t&&(t.role="slider",t.ariaValueNow=String(this.value),t.ariaValueMin=String(this.min),t.ariaValueMax=String(this.max),t.ariaValueText=this.valueFormatter?this.formatValue(this.value):null,t.ariaOrientation="horizontal",t.ariaDisabled=String(this.formState.effectiveDisabled))}syncValidity(){if(this.value<this.min){this.formState.setValidity({rangeUnderflow:!0},`Value must be ${this.min} or more.`);return}if(this.value>this.max){this.formState.setValidity({rangeOverflow:!0},`Value must be ${this.max} or less.`);return}let e=(this.value-this.min)/this.step;if(Math.abs(e-Math.round(e))>Number.EPSILON){this.formState.setValidity({stepMismatch:!0},`Value must be a multiple of ${this.step}.`);return}this.formState.clearValidity()}onKeyDown=e=>{if(this.formState.effectiveDisabled)return;let t=this.keyValue(e.key);t!==null&&(e.preventDefault(),this.applyUserValue(t)&&this.dispatchChange())};keyValue(e){if(Sa.includes(e))return this.value+this.step;if(xa.includes(e))return this.value-this.step;let t=Math.max(this.step,(this.max-this.min)/wa);return e==="PageUp"?this.value+t:e==="PageDown"?this.value-t:e==="Home"?this.min:e==="End"?this.max:null}onPointerDown=e=>{this.formState.effectiveDisabled||e.isPrimary===!1||this.dragPointer!==null||(e.preventDefault(),this.dragPointer=e.pointerId,this.dragBaseline=this.value,this.focus(),typeof this.setPointerCapture=="function"&&this.setPointerCapture(e.pointerId),window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerUp),this.applyUserValue(this.valueFromPointer(e)))};onPointerMove=e=>{this.dragPointer===e.pointerId&&this.applyUserValue(this.valueFromPointer(e))};onPointerUp=e=>{this.dragPointer===e.pointerId&&this.endDrag(!0)};endDrag(e){if(this.dragPointer===null)return;let t=this.dragPointer;this.dragPointer=null,window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerUp),typeof this.releasePointerCapture=="function"&&this.hasPointerCapture(t)&&this.releasePointerCapture(t),e&&this.value!==this.dragBaseline&&this.dispatchChange()}valueFromPointer(e){let r=this.renderRoot.querySelector('[part="track"]')?.getBoundingClientRect();return!r||r.width===0?this.value:this.min+(e.clientX-r.left)/r.width*(this.max-this.min)}applyUserValue(e){let t=this.normalizeValue(e);return t===this.value?!1:(this.value=t,this.dispatchEvent(new CustomEvent("mndwinput",{bubbles:!0,composed:!0,detail:{value:t}})),!0)}dispatchChange(){this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:this.value}}))}resetForm(){let e=this.getAttribute("value"),t=e===null?Number.NaN:Number(e);this.value=Number.isFinite(t)?t:this.min}restoreFormState(e){if(typeof e!="string")return;let t=Number(e);Number.isFinite(t)&&e.trim()!==""&&(this.value=t)}};var Jr="mndw-switch",lt=class extends g{static formAssociated=!0;static properties={checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},value:{type:String,reflect:!0},name:{type:String,reflect:!0}};static styles=v`
1069
1080
  :host {
1070
1081
  ${M}
1071
1082
 
@@ -1103,7 +1114,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1103
1114
  }
1104
1115
 
1105
1116
  :host(:focus-visible) [part='track'] {
1106
- ${R}
1117
+ ${A}
1107
1118
  }
1108
1119
 
1109
1120
  :host([checked]) [part='track'] {
@@ -1116,7 +1127,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1116
1127
  }
1117
1128
 
1118
1129
  :host([checked]:not([disabled]):not([aria-disabled='true']):not([invalid]):not([aria-invalid='true']):hover) [part='track'] {
1119
- ${te}
1130
+ ${ie}
1120
1131
  }
1121
1132
 
1122
1133
  [part='thumb'] {
@@ -1131,12 +1142,12 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1131
1142
  background: var(--mndw-accent-contrast);
1132
1143
  transform: translateX(calc(var(--mndw-switch-w) - var(--mndw-switch-h)));
1133
1144
  }
1134
- `;formState=new N(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});labelController=new ee(this);constructor(){super(),this.checked=!1,this.disabled=!1,this.required=!1,this.invalid=!1,this.value="on",this.name="",this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["checked"])}refreshAccessibleName(){this.requestUpdate()}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}render(){return u`
1145
+ `;formState=new O(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});labelController=new re(this);constructor(){super(),this.checked=!1,this.disabled=!1,this.required=!1,this.invalid=!1,this.value="on",this.name="",this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["checked"])}refreshAccessibleName(){this.requestUpdate()}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}render(){return u`
1135
1146
  <span part="track" aria-hidden="true">
1136
1147
  <span part="thumb"></span>
1137
1148
  </span>
1138
1149
  <slot part="label"></slot>
1139
- `}updated(){let e=this.formState.effectiveDisabled,t=String(this.checked);this.setAttribute("role","switch"),this.setAttribute("aria-checked",t),this.setAttribute("aria-disabled",String(e)),this.tabIndex=e?-1:0,this.formState.setFormValue(this.checked?this.value:null,this.checked?"checked":"unchecked");let r=this.formState.internals,n=this.formState.labels;this.labelController.sync(n,r),r&&(r.role="switch",r.ariaChecked=t,r.ariaDisabled=String(e),this.checked?r.states.add("checked"):r.states.delete("checked"))}onClick=e=>{if(this.formState.effectiveDisabled){e.preventDefault();return}this.toggle()};onKeyDown=e=>{this.formState.effectiveDisabled||e.key!==" "&&e.key!=="Enter"||(e.preventDefault(),this.toggle())};toggle(){this.checked=!this.checked,this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{checked:this.checked}}))}resetForm(){this.checked=this.hasAttribute("checked")}restoreFormState(e){e==="checked"?this.checked=!0:e==="unchecked"&&(this.checked=!1)}};var ke="mndw-tab-panel",Dn=0,lt=class extends g{static properties={for:{type:String,reflect:!0}};static styles=v`
1150
+ `}updated(){let e=this.formState.effectiveDisabled,t=String(this.checked);this.setAttribute("role","switch"),this.setAttribute("aria-checked",t),this.setAttribute("aria-disabled",String(e)),this.tabIndex=e?-1:0,this.formState.setFormValue(this.checked?this.value:null,this.checked?"checked":"unchecked");let r=this.formState.internals,n=this.formState.labels;this.labelController.sync(n,r),r&&(r.role="switch",r.ariaChecked=t,r.ariaDisabled=String(e),this.checked?r.states.add("checked"):r.states.delete("checked"))}onClick=e=>{if(this.formState.effectiveDisabled){e.preventDefault();return}this.toggle()};onKeyDown=e=>{this.formState.effectiveDisabled||e.key!==" "&&e.key!=="Enter"||(e.preventDefault(),this.toggle())};toggle(){this.checked=!this.checked,this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{checked:this.checked}}))}resetForm(){this.checked=this.hasAttribute("checked")}restoreFormState(e){e==="checked"?this.checked=!0:e==="unchecked"&&(this.checked=!1)}};var _e="mndw-tab-panel",On=0,dt=class extends g{static properties={for:{type:String,reflect:!0}};static styles=v`
1140
1151
  :host {
1141
1152
  ${M}
1142
1153
 
@@ -1148,11 +1159,11 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1148
1159
  :host([hidden]) {
1149
1160
  display: none;
1150
1161
  }
1151
- `;constructor(){super(),this.for=""}connectedCallback(){super.connectedCallback(),this.id===""&&(Dn+=1,this.id=`mndw-tab-panel-${Dn}`)}render(){return u`
1162
+ `;constructor(){super(),this.for=""}connectedCallback(){super.connectedCallback(),this.id===""&&(On+=1,this.id=`mndw-tab-panel-${On}`)}render(){return u`
1152
1163
  <div part="panel">
1153
1164
  <slot></slot>
1154
1165
  </div>
1155
- `}};var G="mndw-tab",dt=class extends g{static properties={disabled:{type:Boolean,reflect:!0}};static styles=v`
1166
+ `}};var G="mndw-tab",ct=class extends g{static properties={disabled:{type:Boolean,reflect:!0}};static styles=v`
1156
1167
  :host {
1157
1168
  ${M}
1158
1169
 
@@ -1171,7 +1182,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1171
1182
  }
1172
1183
 
1173
1184
  [part='tab'] {
1174
- ${B}
1185
+ ${K}
1175
1186
 
1176
1187
  display: inline-flex;
1177
1188
  align-items: center;
@@ -1196,14 +1207,14 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1196
1207
  }
1197
1208
 
1198
1209
  :host(:not([disabled]):not([aria-disabled='true']):hover) [part='tab'] {
1199
- ${Me}
1200
- ${re}
1210
+ ${Ee}
1211
+ ${ne}
1201
1212
  }
1202
1213
  `;constructor(){super(),this.disabled=!1}connectedCallback(){super.connectedCallback(),this.hasAttribute("for")&&console.warn(`<${G} id="${this.id}"> has a "for" attribute; the panel points at its tab, so put "for" on the <mndw-tab-panel> instead.`)}render(){return u`
1203
1214
  <span part="tab">
1204
1215
  <slot></slot>
1205
1216
  </span>
1206
- `}};var Zr="mndw-tabs",ya=["role","aria-selected","aria-controls","aria-disabled","tabindex","slot"],Sa=["role","aria-labelledby","hidden"],xa=["id","for","disabled"],Ca=["ArrowRight"],Ma=["ArrowLeft"],ct=class extends g{static properties={value:{type:String}};static styles=v`
1217
+ `}};var Zr="mndw-tabs",Ca=["role","aria-selected","aria-controls","aria-disabled","tabindex","slot"],Ma=["role","aria-labelledby","hidden"],Ta=["id","for","disabled"],Ea=["ArrowRight"],Aa=["ArrowLeft"],ut=class extends g{static properties={value:{type:String}};static styles=v`
1207
1218
  :host {
1208
1219
  ${M}
1209
1220
 
@@ -1215,12 +1226,12 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1215
1226
  gap: var(--mndw-space-1);
1216
1227
  border-bottom: var(--mndw-border-w) solid var(--mndw-border);
1217
1228
  }
1218
- `;observer;ownedTabs=[];ownedPanels=[];warnedPanels=new WeakSet;warnedTabs=new WeakSet;constructor(){super(),this.value="",this.observer=new MutationObserver(this.onMutations),this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}connectedCallback(){super.connectedCallback(),this.observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:xa})}disconnectedCallback(){super.disconnectedCallback(),this.observer.disconnect(),this.release(this.ownedTabs,this.ownedPanels),this.ownedTabs=[],this.ownedPanels=[]}render(){return u`
1229
+ `;observer;ownedTabs=[];ownedPanels=[];warnedPanels=new WeakSet;warnedTabs=new WeakSet;constructor(){super(),this.value="",this.observer=new MutationObserver(this.onMutations),this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}connectedCallback(){super.connectedCallback(),this.observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:Ta})}disconnectedCallback(){super.disconnectedCallback(),this.observer.disconnect(),this.release(this.ownedTabs,this.ownedPanels),this.ownedTabs=[],this.ownedPanels=[]}render(){return u`
1219
1230
  <div part="tablist" role="tablist" aria-orientation="horizontal">
1220
1231
  <slot name="tab"></slot>
1221
1232
  </div>
1222
1233
  <slot></slot>
1223
- `}willUpdate(){if(!this.isConnected)return;let e=this.resolveActive(this.tabChildren());this.value!==(e?.id??"")&&(this.value=e?.id??"")}updated(){if(!this.isConnected)return;let e=this.pairing(),t=this.resolveActive(e.tabs);this.release(this.ownedTabs.filter(r=>!e.tabs.includes(r)),this.ownedPanels.filter(r=>!e.panels.includes(r))),this.syncTabs(e,t),this.syncPanels(e,t),this.ownedTabs=e.tabs,this.ownedPanels=e.panels}tabChildren(){return[...this.children].filter(e=>e.localName===G)}pairing(){let e=this.tabChildren(),t=[...this.children].filter(o=>o.localName===ke),r=new Map,n=new Set;for(let o of e){if(o.id==="")continue;let a=t.find(s=>s.for===o.id&&!n.has(s));a&&(n.add(a),r.set(o,a))}return{tabs:e,panels:t,panelOf:r}}isSelectable(e){return e.id!==""&&!e.disabled}resolveActive(e){return e.find(r=>r.id===this.value&&this.isSelectable(r))??e.find(r=>this.isSelectable(r))??null}syncTabs(e,t){for(let r of e.tabs){let n=e.panelOf.get(r),o=this.isSelectable(r);r.setAttribute("slot","tab"),r.setAttribute("role","tab"),r.setAttribute("aria-selected",String(r===t)),r.setAttribute("aria-disabled",String(!o)),r.setAttribute("tabindex",r===t?"0":"-1"),n?r.setAttribute("aria-controls",n.id):r.removeAttribute("aria-controls"),r.id===""&&!this.warnedTabs.has(r)&&(this.warnedTabs.add(r),console.warn(`<${G}> needs an id for its panel to reference; this one is inert.`))}}syncPanels(e,t){let r=new Map;for(let[n,o]of e.panelOf)r.set(o,n);for(let n of e.panels){let o=r.get(n);if(n.setAttribute("role","tabpanel"),n.hidden=o!==t,o){n.setAttribute("aria-labelledby",o.id);continue}n.removeAttribute("aria-labelledby"),this.warnedPanels.has(n)||(this.warnedPanels.add(n),console.warn(`<${ke} for="${n.for}"> matches no <${G}> id; it stays hidden.`))}}release(e,t){for(let r of e)for(let n of ya)r.removeAttribute(n);for(let r of t)for(let n of Sa)r.removeAttribute(n)}onMutations=()=>{this.requestUpdate()};onClick=e=>{let t=this.tabFrom(e.target);!t||!this.isSelectable(t)||this.activate(t)};onKeyDown=e=>{let t=[...this.children].filter(n=>n.localName===G).filter(n=>this.isSelectable(n));if(t.length===0)return;let r=this.nextTab(e.key,t,this.tabFrom(e.target));r&&(e.preventDefault(),this.activate(r))};nextTab(e,t,r){let n=r?t.indexOf(r):-1,o=t.length-1;return Ca.includes(e)?t[n<0||n===o?0:n+1]:Ma.includes(e)?t[n<=0?o:n-1]:e==="Home"?t[0]:e==="End"?t[o]:null}tabFrom(e){let t=e instanceof Element?e.closest(G):null;return t?.parentElement===this?t:null}activate(e){let t=this.value!==e.id;this.value=e.id,e.focus(),t&&this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:this.value}}))}};var Qr="mndw-textarea",ut=class extends g{static formAssociated=!0;static shadowRootOptions={mode:"open",delegatesFocus:!0};static properties={value:{type:String},rows:{type:Number,reflect:!0},autosize:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},name:{type:String,reflect:!0},maxlength:{type:Number,reflect:!0}};static styles=v`
1234
+ `}willUpdate(){if(!this.isConnected)return;let e=this.resolveActive(this.tabChildren());this.value!==(e?.id??"")&&(this.value=e?.id??"")}updated(){if(!this.isConnected)return;let e=this.pairing(),t=this.resolveActive(e.tabs);this.release(this.ownedTabs.filter(r=>!e.tabs.includes(r)),this.ownedPanels.filter(r=>!e.panels.includes(r))),this.syncTabs(e,t),this.syncPanels(e,t),this.ownedTabs=e.tabs,this.ownedPanels=e.panels}tabChildren(){return[...this.children].filter(e=>e.localName===G)}pairing(){let e=this.tabChildren(),t=[...this.children].filter(o=>o.localName===_e),r=new Map,n=new Set;for(let o of e){if(o.id==="")continue;let a=t.find(s=>s.for===o.id&&!n.has(s));a&&(n.add(a),r.set(o,a))}return{tabs:e,panels:t,panelOf:r}}isSelectable(e){return e.id!==""&&!e.disabled}resolveActive(e){return e.find(r=>r.id===this.value&&this.isSelectable(r))??e.find(r=>this.isSelectable(r))??null}syncTabs(e,t){for(let r of e.tabs){let n=e.panelOf.get(r),o=this.isSelectable(r);r.setAttribute("slot","tab"),r.setAttribute("role","tab"),r.setAttribute("aria-selected",String(r===t)),r.setAttribute("aria-disabled",String(!o)),r.setAttribute("tabindex",r===t?"0":"-1"),n?r.setAttribute("aria-controls",n.id):r.removeAttribute("aria-controls"),r.id===""&&!this.warnedTabs.has(r)&&(this.warnedTabs.add(r),console.warn(`<${G}> needs an id for its panel to reference; this one is inert.`))}}syncPanels(e,t){let r=new Map;for(let[n,o]of e.panelOf)r.set(o,n);for(let n of e.panels){let o=r.get(n);if(n.setAttribute("role","tabpanel"),n.hidden=o!==t,o){n.setAttribute("aria-labelledby",o.id);continue}n.removeAttribute("aria-labelledby"),this.warnedPanels.has(n)||(this.warnedPanels.add(n),console.warn(`<${_e} for="${n.for}"> matches no <${G}> id; it stays hidden.`))}}release(e,t){for(let r of e)for(let n of Ca)r.removeAttribute(n);for(let r of t)for(let n of Ma)r.removeAttribute(n)}onMutations=()=>{this.requestUpdate()};onClick=e=>{let t=this.tabFrom(e.target);!t||!this.isSelectable(t)||this.activate(t)};onKeyDown=e=>{let t=[...this.children].filter(n=>n.localName===G).filter(n=>this.isSelectable(n));if(t.length===0)return;let r=this.nextTab(e.key,t,this.tabFrom(e.target));r&&(e.preventDefault(),this.activate(r))};nextTab(e,t,r){let n=r?t.indexOf(r):-1,o=t.length-1;return Ea.includes(e)?t[n<0||n===o?0:n+1]:Aa.includes(e)?t[n<=0?o:n-1]:e==="Home"?t[0]:e==="End"?t[o]:null}tabFrom(e){let t=e instanceof Element?e.closest(G):null;return t?.parentElement===this?t:null}activate(e){let t=this.value!==e.id;this.value=e.id,e.focus(),t&&this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:this.value}}))}};var Qr="mndw-textarea",ht=class extends g{static formAssociated=!0;static shadowRootOptions={mode:"open",delegatesFocus:!0};static properties={value:{type:String},rows:{type:Number,reflect:!0},autosize:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},invalid:{type:Boolean,reflect:!0},name:{type:String,reflect:!0},maxlength:{type:Number,reflect:!0}};static styles=v`
1224
1235
  :host {
1225
1236
  ${M}
1226
1237
 
@@ -1244,11 +1255,11 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1244
1255
  }
1245
1256
 
1246
1257
  :host(:not([disabled]):not([readonly]):not([invalid]):not([aria-invalid='true'])) [part='field']:hover {
1247
- ${Ce}
1258
+ ${Te}
1248
1259
  }
1249
1260
 
1250
1261
  :host(:focus-within) [part='field'] {
1251
- ${R}
1262
+ ${A}
1252
1263
  }
1253
1264
 
1254
1265
  textarea {
@@ -1274,7 +1285,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1274
1285
  textarea::placeholder {
1275
1286
  color: var(--mndw-text-subtle);
1276
1287
  }
1277
- `;formState=new N(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});announcement=new Ee(this,{formState:this.formState,isInvalid:()=>this.invalid});commits=new Te(e=>this.emitChange(e));resizeObserver=null;constructor(){super(),this.value="",this.rows=3,this.autosize=!1,this.readonly=!1,this.disabled=!1,this.required=!1,this.invalid=!1,this.name="",this.maxlength=null}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["value"]),this.announcement.connect(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),this.announcement.disconnect(),this.stopAutosize()}refreshAccessibleName(){this.requestUpdate()}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}focus(e){this.innerTextarea?.focus(e)}render(){return u`
1288
+ `;formState=new O(this,{isExplicitlyDisabled:()=>this.disabled,onReset:()=>this.resetForm(),onStateRestore:e=>this.restoreFormState(e),onDisabledChange:()=>{this.requestUpdate()}});announcement=new Ae(this,{formState:this.formState,isInvalid:()=>this.invalid});commits=new Re(e=>this.emitChange(e));resizeObserver=null;constructor(){super(),this.value="",this.rows=3,this.autosize=!1,this.readonly=!1,this.disabled=!1,this.required=!1,this.invalid=!1,this.name="",this.maxlength=null}connectedCallback(){super.connectedCallback(),this.formState.captureInitialAttributes(["value"]),this.announcement.connect(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),this.announcement.disconnect(),this.stopAutosize()}refreshAccessibleName(){this.requestUpdate()}formDisabledCallback(e){this.formState.formDisabledCallback(e)}formResetCallback(){this.formState.formResetCallback()}formStateRestoreCallback(e,t){this.formState.formStateRestoreCallback(e,t)}focus(e){this.innerTextarea?.focus(e)}render(){return u`
1278
1289
  <div part="field">
1279
1290
  <textarea
1280
1291
  part="textarea"
@@ -1283,7 +1294,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1283
1294
  @blur=${this.onInnerBlur}
1284
1295
  ></textarea>
1285
1296
  </div>
1286
- `}updated(e){let t=this.innerTextarea;t&&(this.syncInner(t),e.has("value")&&this.commits.syncValue(this.value),this.syncFormState(t),this.announcement.sync(t),this.syncAutosize(t))}get innerTextarea(){return this.renderRoot.querySelector("textarea")}syncInner(e){F(e,"maxlength",this.maxlength===null?"":String(this.maxlength)),F(e,"rows",this.autosize?"":String(this.rows)),e.toggleAttribute("readonly",this.readonly),e.toggleAttribute("disabled",this.formState.effectiveDisabled),e.toggleAttribute("required",this.required||this.announcement.hasAriaRequired),e.value!==this.value&&(e.value=this.value)}syncFormState(e){this.formState.setFormValue(this.value),this.formState.setValidity(zt(e.validity),e.validationMessage)}syncAutosize(e){if(!this.autosize){this.stopAutosize(),e.style.removeProperty("height");return}!this.resizeObserver&&typeof ResizeObserver=="function"&&(this.resizeObserver=new ResizeObserver(()=>{this.resizeToContent(e)}),this.resizeObserver.observe(e)),this.resizeToContent(e)}resizeToContent(e){e.style.height="auto",e.style.height=`${e.scrollHeight}px`}stopAutosize(){this.resizeObserver?.disconnect(),this.resizeObserver=null}onInnerInput=e=>{this.commits.markUserInput(),this.value=e.target.value,this.dispatchEvent(new CustomEvent("mndwinput",{bubbles:!0,composed:!0,detail:{value:this.value}}))};onInnerFocus=()=>{this.commits.captureBaseline(this.value)};onInnerBlur=()=>{this.commits.commit(this.value),this.commits.releaseBaseline()};emitChange(e){this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:e}}))}resetForm(){this.value=this.getAttribute("value")??""}restoreFormState(e){typeof e=="string"&&(this.value=e)}};var Xt="mndw-tooltip",ht="aria-describedby",Ea=/\s+/u,Ta=500,Nn=0;function ei(i){return(i.getAttribute(ht)??"").split(Ea).filter(e=>e!=="")}var pt=class extends g{static properties={text:{type:String},placement:{type:String,reflect:!0},delay:{type:Number,reflect:!0},visible:{type:Boolean,state:!0}};static styles=v`
1297
+ `}updated(e){let t=this.innerTextarea;t&&(this.syncInner(t),e.has("value")&&this.commits.syncValue(this.value),this.syncFormState(t),this.announcement.sync(t),this.syncAutosize(t))}get innerTextarea(){return this.renderRoot.querySelector("textarea")}syncInner(e){I(e,"maxlength",this.maxlength===null?"":String(this.maxlength)),I(e,"rows",this.autosize?"":String(this.rows)),e.toggleAttribute("readonly",this.readonly),e.toggleAttribute("disabled",this.formState.effectiveDisabled),e.toggleAttribute("required",this.required||this.announcement.hasAriaRequired),e.value!==this.value&&(e.value=this.value)}syncFormState(e){this.formState.setFormValue(this.value),this.formState.setValidity(Bt(e.validity),e.validationMessage)}syncAutosize(e){if(!this.autosize){this.stopAutosize(),e.style.removeProperty("height");return}!this.resizeObserver&&typeof ResizeObserver=="function"&&(this.resizeObserver=new ResizeObserver(()=>{this.resizeToContent(e)}),this.resizeObserver.observe(e)),this.resizeToContent(e)}resizeToContent(e){e.style.height="auto",e.style.height=`${e.scrollHeight}px`}stopAutosize(){this.resizeObserver?.disconnect(),this.resizeObserver=null}onInnerInput=e=>{this.commits.markUserInput(),this.value=e.target.value,this.dispatchEvent(new CustomEvent("mndwinput",{bubbles:!0,composed:!0,detail:{value:this.value}}))};onInnerFocus=()=>{this.commits.captureBaseline(this.value)};onInnerBlur=()=>{this.commits.commit(this.value),this.commits.releaseBaseline()};emitChange(e){this.dispatchEvent(new CustomEvent("mndwchange",{bubbles:!0,composed:!0,detail:{value:e}}))}resetForm(){this.value=this.getAttribute("value")??""}restoreFormState(e){typeof e=="string"&&(this.value=e)}};var Zt="mndw-tooltip",pt="aria-describedby",Ra=/\s+/u,La=500,Nn=300,$n=0;function ei(i){return(i.getAttribute(pt)??"").split(Ra).filter(e=>e!=="")}var mt=class extends g{static properties={text:{type:String},placement:{type:String,reflect:!0},delay:{type:Number,reflect:!0},hideDelay:{type:Number,reflect:!0,attribute:"hide-delay"},visible:{type:Boolean,state:!0}};static styles=v`
1287
1298
  :host {
1288
1299
  ${M}
1289
1300
 
@@ -1292,7 +1303,9 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1292
1303
 
1293
1304
  /*
1294
1305
  * Closed means invisible, never removed: the description is resolved from this text, so
1295
- * \`display: none\` or \`hidden\` would leave the trigger describing nothing.
1306
+ * \`display: none\` or \`hidden\` would leave the trigger describing nothing. The closed state
1307
+ * also takes no pointer events, so it never blocks the page beneath it; only the open state
1308
+ * below turns interactivity back on.
1296
1309
  */
1297
1310
  [part='tooltip'] {
1298
1311
  position: fixed;
@@ -1308,16 +1321,18 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1308
1321
  line-height: var(--mndw-leading);
1309
1322
  opacity: 0;
1310
1323
  pointer-events: none;
1324
+ user-select: text;
1311
1325
  transition: opacity var(--mndw-duration-fast) var(--mndw-easing);
1312
1326
  }
1313
1327
 
1314
1328
  :host([open]) [part='tooltip'] {
1315
1329
  opacity: 1;
1330
+ pointer-events: auto;
1316
1331
  }
1317
- `;observer;trigger=null;ownedToken=null;showTimer=null;warnedExtras=!1;constructor(){super(),this.text="",this.placement="top",this.delay=Ta,this.visible=!1,this.observer=new MutationObserver(this.onMutations),this.addEventListener("keydown",this.onKeyDown)}connectedCallback(){super.connectedCallback(),this.id===""&&(Nn+=1,this.id=`mndw-tooltip-${Nn}`),this.observer.observe(this,{attributes:!0,attributeFilter:["id"],childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.cancelShow(),this.observer.disconnect(),this.releaseTrigger(),this.visible=!1}render(){return u`
1332
+ `;observer;trigger=null;bubbleNode=null;ownedToken=null;showTimer=null;hideTimer=null;selecting=!1;pointerOverTrigger=!1;pointerOverBubble=!1;warnedExtras=!1;constructor(){super(),this.text="",this.placement="top",this.delay=La,this.hideDelay=Nn,this.visible=!1,this.observer=new MutationObserver(this.onMutations)}connectedCallback(){super.connectedCallback(),this.id===""&&($n+=1,this.id=`mndw-tooltip-${$n}`),this.observer.observe(this,{attributes:!0,attributeFilter:["id"],childList:!0}),document.addEventListener("keydown",this.onKeyDown,!0),document.addEventListener("pointerup",this.onPointerUp),document.addEventListener("pointercancel",this.onPointerUp)}disconnectedCallback(){super.disconnectedCallback(),this.cancelShow(),this.cancelHide(),document.removeEventListener("keydown",this.onKeyDown,!0),document.removeEventListener("pointerup",this.onPointerUp),document.removeEventListener("pointercancel",this.onPointerUp),this.observer.disconnect(),this.releaseTrigger(),this.selecting=!1,this.pointerOverTrigger=!1,this.pointerOverBubble=!1,this.visible=!1}render(){return u`
1318
1333
  <slot></slot>
1319
- ${this.text?u`<div part="tooltip" role="none">${this.text}</div>`:b}
1320
- `}willUpdate(){this.text||(this.cancelShow(),this.visible=!1)}updated(){this.isConnected&&(this.text?this.setAttribute("role","tooltip"):this.removeAttribute("role"),this.toggleAttribute("open",this.visible),this.wireTrigger())}bubble(){return this.renderRoot.querySelector('[part="tooltip"]')}assignedTrigger(){let t=this.renderRoot.querySelector("slot")?.assignedElements()??[];return t.length>1&&!this.warnedExtras&&(this.warnedExtras=!0,console.warn(`<${Xt} id="${this.id}"> takes one trigger element; the rest are ignored.`)),t[0]??null}wireTrigger(){let e=this.assignedTrigger();if(e!==this.trigger&&(this.releaseTrigger(),this.trigger=e,e&&(this.observer.observe(e,{attributes:!0,attributeFilter:[ht]}),e.addEventListener("pointerenter",this.onShowIntent),e.addEventListener("focusin",this.onShowIntent),e.addEventListener("pointerleave",this.onHideIntent),e.addEventListener("focusout",this.onHideIntent))),!e)return;let t=this.text?this.id:null;if(t===null){this.writeTokens(e,ei(e).filter(n=>n!==this.ownedToken)),this.ownedToken=null;return}let r=ei(e).filter(n=>n!==this.ownedToken&&n!==t);this.writeTokens(e,[...r,t]),this.ownedToken=t}writeTokens(e,t){if(t.length===0){e.removeAttribute(ht);return}let r=t.join(" ");e.getAttribute(ht)!==r&&e.setAttribute(ht,r)}releaseTrigger(){let e=this.trigger;e&&(e.removeEventListener("pointerenter",this.onShowIntent),e.removeEventListener("focusin",this.onShowIntent),e.removeEventListener("pointerleave",this.onHideIntent),e.removeEventListener("focusout",this.onHideIntent)),e&&this.ownedToken!==null&&this.writeTokens(e,ei(e).filter(t=>t!==this.ownedToken)),this.ownedToken=null,this.trigger=null}onMutations=()=>{this.requestUpdate()};onShowIntent=()=>{!this.text||this.visible||this.showTimer!==null||(this.showTimer=setTimeout(()=>{this.showTimer=null,this.show()},Math.max(this.delay,0)))};onHideIntent=()=>{this.cancelShow(),this.hide()};onKeyDown=e=>{e.key==="Escape"&&this.onHideIntent()};cancelShow(){this.showTimer!==null&&(clearTimeout(this.showTimer),this.showTimer=null)}show(){!this.text||!this.isConnected||(this.visible=!0,this.position())}hide(){this.visible=!1}position(){let e=this.bubble();if(!this.trigger||!e)return;let t=this.trigger.getBoundingClientRect(),r=e.getBoundingClientRect(),n=zr(t,{width:r.width,height:r.height},this.placement);e.style.top=`${n.top}px`,e.style.left=`${n.left}px`,this.setAttribute("data-placement",n.placement)}};var bt="mndw-column-menu",ti="mndwcolumnmenucheck",mt=class extends g{static properties={columns:{type:Array,attribute:!1},hiddenColumns:{type:Array,attribute:!1},initialFocus:{type:String,attribute:!1}};static styles=v`
1334
+ ${this.text?u`<div part="tooltip" role="none">${this.text}</div>`:m}
1335
+ `}willUpdate(){this.text||(this.cancelShow(),this.cancelHide(),this.visible=!1)}updated(){this.isConnected&&(this.text?this.setAttribute("role","tooltip"):this.removeAttribute("role"),this.toggleAttribute("open",this.visible),this.wireTrigger(),this.wireBubble())}bubble(){return this.renderRoot.querySelector('[part="tooltip"]')}assignedTrigger(){let t=this.renderRoot.querySelector("slot")?.assignedElements()??[];return t.length>1&&!this.warnedExtras&&(this.warnedExtras=!0,console.warn(`<${Zt} id="${this.id}"> takes one trigger element; the rest are ignored.`)),t[0]??null}wireTrigger(){let e=this.assignedTrigger();if(e!==this.trigger&&(this.releaseTrigger(),this.trigger=e,e&&(this.observer.observe(e,{attributes:!0,attributeFilter:[pt]}),e.addEventListener("pointerenter",this.onTriggerEnter),e.addEventListener("focusin",this.onShowIntent),e.addEventListener("pointerleave",this.onTriggerLeave),e.addEventListener("focusout",this.onFocusOut))),!e)return;let t=this.text?this.id:null;if(t===null){this.writeTokens(e,ei(e).filter(n=>n!==this.ownedToken)),this.ownedToken=null;return}let r=ei(e).filter(n=>n!==this.ownedToken&&n!==t);this.writeTokens(e,[...r,t]),this.ownedToken=t}wireBubble(){let e=this.bubble();e!==this.bubbleNode&&(this.bubbleNode&&(this.bubbleNode.removeEventListener("pointerenter",this.onBubbleEnter),this.bubbleNode.removeEventListener("pointerleave",this.onBubbleLeave),this.bubbleNode.removeEventListener("pointerdown",this.onBubblePointerDown)),this.pointerOverBubble=!1,this.bubbleNode=e,e&&(e.addEventListener("pointerenter",this.onBubbleEnter),e.addEventListener("pointerleave",this.onBubbleLeave),e.addEventListener("pointerdown",this.onBubblePointerDown)))}writeTokens(e,t){if(t.length===0){e.removeAttribute(pt);return}let r=t.join(" ");e.getAttribute(pt)!==r&&e.setAttribute(pt,r)}releaseTrigger(){let e=this.trigger;e&&(e.removeEventListener("pointerenter",this.onTriggerEnter),e.removeEventListener("focusin",this.onShowIntent),e.removeEventListener("pointerleave",this.onTriggerLeave),e.removeEventListener("focusout",this.onFocusOut)),e&&this.ownedToken!==null&&this.writeTokens(e,ei(e).filter(t=>t!==this.ownedToken)),this.ownedToken=null,this.trigger=null,this.pointerOverTrigger=!1}onMutations=()=>{this.requestUpdate()};onShowIntent=()=>{this.cancelHide(),!(!this.text||this.visible||this.showTimer!==null)&&(this.showTimer=setTimeout(()=>{this.showTimer=null,this.show()},Math.max(this.delay,0)))};onTriggerEnter=()=>{this.pointerOverTrigger=!0,this.onShowIntent()};onTriggerLeave=()=>{this.pointerOverTrigger=!1,this.cancelShow(),this.scheduleHide()};onBubbleEnter=()=>{this.pointerOverBubble=!0,this.cancelHide()};onBubbleLeave=()=>{this.pointerOverBubble=!1,this.scheduleHide()};onBubblePointerDown=()=>{this.selecting=!0,this.cancelHide()};onPointerUp=()=>{this.selecting&&(this.selecting=!1,!this.pointerOverTrigger&&!this.pointerOverBubble&&this.scheduleHide())};onFocusOut=()=>{this.selecting||this.pointerOverTrigger||this.pointerOverBubble||(this.cancelShow(),this.cancelHide(),this.hide())};onKeyDown=e=>{e.key==="Escape"&&(this.cancelShow(),this.cancelHide(),this.hide())};cancelShow(){this.showTimer!==null&&(clearTimeout(this.showTimer),this.showTimer=null)}cancelHide(){this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null)}scheduleHide(){this.selecting||!this.visible||this.hideTimer!==null||(this.hideTimer=setTimeout(()=>{this.hideTimer=null,this.hide()},this.hideDelayValue()))}hideDelayValue(){return Number.isFinite(this.hideDelay)?Math.max(this.hideDelay,0):Nn}show(){!this.text||!this.isConnected||(this.visible=!0,this.position())}hide(){this.cancelShow(),this.cancelHide(),this.selecting=!1,this.visible=!1}position(){let e=this.bubble();if(!this.trigger||!e)return;let t=this.trigger.getBoundingClientRect(),r=e.getBoundingClientRect(),n=zr(t,{width:r.width,height:r.height},this.placement);e.style.top=`${n.top}px`,e.style.left=`${n.left}px`,this.setAttribute("data-placement",n.placement)}};var ft="mndw-column-menu",ti="mndwcolumnmenucheck",bt=class extends g{static properties={columns:{type:Array,attribute:!1},hiddenColumns:{type:Array,attribute:!1},initialFocus:{type:String,attribute:!1}};static styles=v`
1321
1336
  :host {
1322
1337
  ${M}
1323
1338
  display: block;
@@ -1355,7 +1370,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1355
1370
  }
1356
1371
 
1357
1372
  [part='option']:focus-visible {
1358
- ${R}
1373
+ ${A}
1359
1374
  }
1360
1375
 
1361
1376
  [part='indicator'] {
@@ -1382,7 +1397,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1382
1397
  border-width: 0 2px 2px 0;
1383
1398
  transform: translateY(-0.0625rem) rotate(45deg);
1384
1399
  }
1385
- `;workingHidden=new Set;keyManager=new Ae({getLabel:e=>e.label,isDisabled:()=>!1});constructor(){super(),this.columns=[],this.hiddenColumns=[],this.initialFocus="first"}connectedCallback(){super.connectedCallback(),this.workingHidden=new Set(this.hiddenColumns)}firstUpdated(){this.focusInitialOption()}render(){return u`
1400
+ `;workingHidden=new Set;keyManager=new ke({getLabel:e=>e.label,isDisabled:()=>!1});constructor(){super(),this.columns=[],this.hiddenColumns=[],this.initialFocus="first"}connectedCallback(){super.connectedCallback(),this.workingHidden=new Set(this.hiddenColumns)}firstUpdated(){this.focusInitialOption()}render(){return u`
1386
1401
  <div
1387
1402
  part="menu"
1388
1403
  role="menu"
@@ -1405,7 +1420,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1405
1420
  </button>
1406
1421
  `})}
1407
1422
  </div>
1408
- `}toggle(e){this.workingHidden.has(e)?this.workingHidden.delete(e):this.workingHidden.add(e),this.requestUpdate(),this.dispatchEvent(new CustomEvent(ti,{bubbles:!0,composed:!0,detail:{hidden:[...this.workingHidden]}}))}focusFirstOption(){this.focusOption(0)}focusInitialOption(){this.focusOption(this.initialFocus==="last"?this.columns.length-1:0)}focusOption(e){let t=[...this.renderRoot.querySelectorAll("button[data-column-id]")];t.length!==0&&t[(e%t.length+t.length)%t.length]?.focus()}handleKeydown=e=>{let t=[...this.renderRoot.querySelectorAll("button[data-column-id]")],r=J(),n=t.indexOf(r);if(n<0&&(n=0),e.key==="Enter"){e.preventDefault(),t[n]?.click(),this.dismiss(!0);return}if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.dismiss(!0);return}if(e.key==="Tab"){this.dismiss(!1,!0,e.shiftKey?"backward":"forward");return}let o={items:this.columns,wrap:!0,mode:"roving-focus",get activeIndex(){return n},set activeIndex(a){n=a},setActiveIndex(a){n=a},focusItem(a){t[a]?.focus()}};this.keyManager.handleKeydown(e,o)};dismiss(e,t=!1,r){let n=t&&r!==void 0?{restoreFocus:e,defer:!0,tabDirection:r}:t?{restoreFocus:e,defer:!0}:{restoreFocus:e};this.dispatchEvent(new CustomEvent("mndwpaneldismiss",{bubbles:!0,composed:!0,detail:n}))}};var Jt="mndwselectionchange",ri="mndwsortchange",ii="mndwrowreorder",ni="mndwcolumnvisibilitychange",oi="mndwerror",ai="mndwrowexpand",W="__mndw_detail__";var Zt=class{entries=new Map;host;nextSlotId=1;constructor(e){this.host=e}reconcile(e,t,r,n,o,a=new Set,s){let l=new Set;for(let c of e)this.reconcileRow(c,t(c),r,n,o,l,a,s);this.pruneRemoved(l)}reconcileRow(e,t,r,n,o,a,s,l){let c=this.entries.get(t);c===void 0&&(c=new Map,this.entries.set(t,c));for(let d of r){if(d.renderer===void 0||!n.has(d.id))continue;a.add(`${t}\0${d.id}`);let h=c.get(d.id),p={node:h?.node??document.createElement("div"),row:e,value:o(d,e),colId:d.id};if(h?.rendererFactory===d.renderer){h.renderer.update(p);continue}h!==void 0&&(h.renderer.destroy(),h.node.remove());let f=d.renderer(),m=p.node;m.setAttribute("slot",`mc-${this.nextSlotId++}`),this.host.appendChild(m);let S={slotId:m.getAttribute("slot")??"",node:m,renderer:f,rendererFactory:d.renderer,rowKey:t,colId:d.id};f.mount({node:m,row:e,value:p.value,colId:d.id}),c.set(d.id,S)}if(l!==void 0&&s.has(t)){a.add(`${t}\0${W}`);let d=c.get(W),h={node:d?.node??document.createElement("div"),row:e,value:e,colId:W};if(d?.rendererFactory===l)d.renderer.update(h);else{d!==void 0&&(d.renderer.destroy(),d.node.remove());let p=l(),f=h.node;f.setAttribute("slot",`mc-${this.nextSlotId++}`),this.host.appendChild(f),p.mount({node:f,row:e,value:e,colId:W}),c.set(W,{slotId:f.getAttribute("slot")??"",node:f,renderer:p,rendererFactory:l,rowKey:t,colId:W})}}}pruneRemoved(e){for(let[t,r]of this.entries){for(let[n,o]of r)e.has(`${t}\0${n}`)||(o.renderer.destroy(),o.node.remove(),r.delete(n));r.size===0&&this.entries.delete(t)}}getSlotId(e,t){return this.entries.get(e)?.get(t)?.slotId}getRowKeyForNode(e){for(let[t,r]of this.entries)for(let n of r.values())if(n.node===e||n.node.contains(e))return t}drain(){for(let e of this.entries.values())for(let t of e.values())t.renderer.destroy(),t.node.remove();this.entries.clear()}};function On(i){for(let e=i.length-1;e>=0;e-=1){let t=i[e]?.rowKey;if(t!==void 0)return t}}var $n=new WeakMap;function In(i,e){$n.set(i,e)}function Qt(i){return $n.get(i)}function Fn(){return{createResizeObserver(i){return typeof ResizeObserver>"u"?null:new ResizeObserver(i)},requestAnimationFrame(i){return requestAnimationFrame(i)},cancelAnimationFrame(i){cancelAnimationFrame(i)},measure(i){return i.getBoundingClientRect()},getViewportScrollTop(i){return i.scrollTop},setViewportScrollTop(i,e){i.scrollTop=e},getViewportClientHeight(i){return i.clientHeight},getViewportContentWidth(i){return i.clientWidth}}}function be(i){return i!==void 0&&Number.isFinite(i)&&i>0}function Hn(i,e){return be(i)?i:e}function zn(i){let e=Hn(i.estimatedRowHeight,1),t=Hn(i.detailEstimate,1);return i.keys.map(r=>{let n=i.measurements.get(r),o=be(n?.summary)?n.summary:e,a=i.expandedKeys.has(r)?be(n?.detail)?n.detail:t:0;return o+a})}function Un(i){let e=[0];for(let t of i)e.push(e[e.length-1]+t);return e}function Bn(i,e){let t=0,r=i.length-1;for(;t<r;){let n=Math.floor((t+r)/2);i[n+1]<e?t=n+1:r=n}return Math.min(t,i.length-2)}function Ra(i,e){let t=0,r=i.length-2;for(;t<r;){let n=Math.ceil((t+r)/2);i[n]<=e?t=n:r=n-1}return Math.max(0,t)}function Vn(i){if(i.keys.length===0)return{start:0,end:0,paddingBefore:0,paddingAfter:0,totalHeight:0};let e=Un(zn(i)),t=e[e.length-1],r=Math.max(0,Number.isFinite(i.scrollOffset)?i.scrollOffset:0),n=Math.max(0,Number.isFinite(i.viewportHeight)?i.viewportHeight:0),o=Math.max(0,Number.isFinite(i.overscan)?i.overscan:0),a=Math.max(0,r-o),s=r+n+o,l=Bn(e,a),c=Ra(e,s),d=Math.max(l+1,c+1);return{start:l,end:d,paddingBefore:e[l],paddingAfter:Math.max(0,t-e[d]),totalHeight:t}}var er=class{config;keys=[];expandedKeys=new Set;measurements=new Map;prefix=[0];prefixDirty=!0;bootstrapSamples=new Map;frozenMean;initialCohortKeys;constructor(e){this.config={...e}}configure(e){let t=this.config.estimatedRowHeight!==e.estimatedRowHeight||this.config.detailEstimate!==e.detailEstimate;this.config={...e},t&&this.frozenMean===void 0&&this.bootstrapSamples.size<4&&(this.prefixDirty=!0)}setRows(e,t){this.keys=[...e],this.expandedKeys=new Set(t),this.removeMissingKeys(new Set(this.keys)),this.prefixDirty=!0}recordSummaryMeasurement(e,t){if(!this.keys.includes(e)||!be(t))return!1;let r=this.measurements.get(e)?.summary;if(be(r)&&Math.abs(r-t)<=.25)return!1;let n=this.measurements.get(e)??{};return n.summary=t,this.measurements.set(e,n),this.prefixDirty=!0,this.frozenMean===void 0&&(this.bootstrapSamples.set(e,t),this.freezeBootstrapIfReady()),!0}recordDetailMeasurement(e,t){if(!this.keys.includes(e)||!be(t))return!1;let r=this.measurements.get(e)?.detail;if(be(r)&&Math.abs(r-t)<=.25)return!1;let n=this.measurements.get(e)??{};return n.detail=t,this.measurements.set(e,n),this.prefixDirty=!0,!0}clearDetailMeasurement(e){let t=this.measurements.get(e);return t?.detail===void 0?!1:(delete t.detail,t.summary===void 0&&this.measurements.delete(e),this.prefixDirty=!0,!0)}removeMissingKeys(e){for(let t of this.measurements.keys())e.has(t)||this.measurements.delete(t);for(let t of this.bootstrapSamples.keys())e.has(t)||this.bootstrapSamples.delete(t);if(this.initialCohortKeys!==void 0)for(let t of this.initialCohortKeys)e.has(t)||this.initialCohortKeys.delete(t);this.prefixDirty=!0}resetWidthEpoch(){this.measurements.clear(),this.bootstrapSamples.clear(),this.frozenMean=void 0,this.initialCohortKeys=void 0,this.prefixDirty=!0}effectiveSummaryEstimate(){return this.frozenMean!==void 0?this.frozenMean:this.bootstrapSamples.size>=4?this.runningMean():this.config.estimatedRowHeight}range(e,t,r){if(this.initialCohortKeys===void 0&&this.keys.length>0){let n=Vn(this.input(e,t,r));this.initialCohortKeys=new Set(this.keys.slice(n.start,n.end))}return Vn(this.input(e,t,r))}offsetOf(e){let t=this.keys.indexOf(e);if(!(t<0))return this.ensurePrefix(),this.prefix[t]}captureAnchor(e){if(this.keys.length===0)return;this.ensurePrefix();let t=Math.max(0,e),r=Math.min(this.keys.length-1,Bn(this.prefix,t));return{key:this.keys[r],logicalIndex:r,intraRowOffset:Math.max(0,t-this.prefix[r])}}restoreAnchor(e,t){this.ensurePrefix();let r=this.keys.indexOf(e.key),n=r>=0?r:Math.min(Math.max(e.logicalIndex,0),Math.max(0,this.keys.length-1)),o=this.prefix[n]+e.intraRowOffset;return Math.min(Math.max(0,t),Math.max(0,o))}offsetForRow(e,t,r,n){let o=this.keys.indexOf(e);if(o<0)return;this.ensurePrefix();let a=this.prefix[o],s=this.prefix[o+1],l=s-a,c=Math.max(0,r),d=Math.max(0,n);return t==="center"?Math.max(0,a-(c-l)/2):t==="end"?Math.max(0,s-c):t==="nearest"?a<d?a:s>d+c?Math.max(0,s-c):d:a}input(e,t,r){return{keys:this.keys,expandedKeys:this.expandedKeys,measurements:this.measurements,estimatedRowHeight:this.effectiveSummaryEstimate(),detailEstimate:this.config.detailEstimate,scrollOffset:e,viewportHeight:t,overscan:r}}ensurePrefix(){this.prefixDirty&&(this.prefix=Un(zn(this.input(0,0,0))),this.prefixDirty=!1)}runningMean(){let e=0;for(let t of this.bootstrapSamples.values())e+=t;return e/this.bootstrapSamples.size}freezeBootstrapIfReady(){if(this.bootstrapSamples.size<4)return;let e=this.initialCohortKeys!==void 0&&this.initialCohortKeys.size>=4&&[...this.initialCohortKeys].every(t=>this.bootstrapSamples.has(t));(this.bootstrapSamples.size>=16||e)&&(this.frozenMean=this.runningMean())}};function T(i,e){if(typeof i=="function")return i(e);let t=e[i];return typeof t=="string"?t:""}function Wn(i,e){let t=[],r=new Set,n=new Set,o=0;for(let s of i){let l=T(e,s);if(l===""){o++;continue}if(r.has(l)){n.add(l);continue}r.add(l),t.push(s)}let a=[];return n.size>0&&a.push({category:"duplicate-row-key",rowKeys:[...n]}),o>0&&a.push({category:"empty-row-key",count:o}),{rows:t,violations:a}}function qn(i){let e=[],t=new Set,r=new Set;for(let o of i)t.has(o.id)&&r.add(o.id),t.add(o.id);r.size>0&&e.push({category:"duplicate-column-id",columnIds:[...r]});let n=i.map(o=>o.id).filter(o=>o.startsWith("__mndw_"));return n.length>0&&e.push({category:"reserved-column-id",columnIds:n}),e}function jn(i,e){return i.find(t=>t.id===e)}function rr(i,e){let t=i.accessor;return t===void 0?e[i.id]:typeof t=="function"?t(e):e[t]}function Yn(i,e,t){return e==null||jn(i,e.columnId)?.sortable!==!0||t.has(e.columnId)?null:e}function Xn(i,e){return i?.columnId!==e?{columnId:e,direction:"asc"}:i.direction==="asc"?{columnId:e,direction:"desc"}:null}function Kn(i){return i==null||typeof i=="number"&&Number.isNaN(i)}function Aa(i,e,t){let r=i.localeCompare(e,t,{sensitivity:"base"});return r!==0?r:i.localeCompare(e,t,{sensitivity:"case"})}function La(i,e,t,r="en"){return i.comparator!==void 0?i.comparator(e,t):i.kind==="number"||i.kind==="boolean"?Number(e)-Number(t):Aa(String(e),String(t),r)}function Jn(i,e,t,r="en"){if(t==null)return i;let n=jn(e,t.columnId);if(n?.sortable!==!0)return i;let o=t.direction==="desc"?-1:1,a=i.map((s,l)=>({row:s,index:l,value:rr(n,s)}));return a.sort((s,l)=>{let c=Kn(s.value),d=Kn(l.value);if(c&&d)return s.index-l.index;if(c)return 1;if(d)return-1;let h=La(n,s.value,l.value,r);return h!==0?h*o:s.index-l.index}),a.map(s=>s.row)}function ir(i,e){if(e.length===0)return"none";let t=0;for(let r of e)i.has(r)&&t++;return t===e.length?"all":t===0?"none":"indeterminate"}function Zn(i,e){let t=new Set(i);return t.has(e)?t.delete(e):t.add(e),[...t]}function Qn(i,e){let t=new Set(i);if(ir(t,e)==="all")for(let n of e)t.delete(n);else for(let n of e)t.add(n);return[...t]}function Gn(i){return new Set(i.filter(e=>e.hideable!==!1).map(e=>e.id))}function ka(i,e){let t=new Set(i);return t.has(e)?t.delete(e):t.add(e),t}var tr=class{internalHidden=new Set;seededIds=new Set;lastEffective=new Set;wasControlled=!1;effectiveHidden(e,t){this.seed(e);let r=Gn(e);if(t!==void 0){let o=new Set;for(let a of t)r.has(a)&&o.add(a);return this.lastEffective=new Set(o),this.wasControlled=!0,o}this.wasControlled&&(this.internalHidden=new Set(this.lastEffective),this.wasControlled=!1);let n=new Set;for(let o of this.internalHidden)r.has(o)&&n.add(o);return n}toggle(e,t,r){let n=this.effectiveHidden(e,t),o=ka(n,r),a=Gn(e),s=[...o].filter(l=>a.has(l));return t===void 0&&(this.internalHidden=new Set(s)),s}applyInternal(e){this.internalHidden=new Set(e),this.wasControlled=!1}seed(e){for(let t of e)this.seededIds.has(t.id)||(this.seededIds.add(t.id),t.hidden===!0&&this.internalHidden.add(t.id))}};var ft="mndw-table",fe={bubbles:!0,composed:!0,cancelable:!1};function nr(i,e){return i.replace(/\{(\w+)\}/g,(t,r)=>String(e[r]??""))}function Z(i){return i.length>0?i.join(" "):b}function _a(){return{selectRow:i=>nr(y("table.selectRow"),{rowName:i}),selectAll:y("table.selectAll"),sortBy:i=>nr(y("table.sortBy"),{column:i}),columnMenu:y("table.columnMenu"),rowFallback:i=>nr(y("table.rowFallback"),{index:i}),reordered:(i,e,t)=>nr(y("table.reordered"),{rowName:i,pos:e,total:t}),invalidData:y("table.invalidData"),expandRow:i=>`Expand ${i}`,collapseRow:i=>`Collapse ${i}`}}var vt=class i extends g{static properties={columns:{type:Array,attribute:!1},rows:{type:Array,attribute:!1},rowKey:{type:String,attribute:"row-key"},virtual:{type:Boolean,reflect:!0},estimatedRowHeight:{type:Number,attribute:"estimated-row-height",reflect:!0},overscan:{type:Number,attribute:"overscan",reflect:!0},selectable:{type:Boolean,reflect:!0},selected:{type:Array,attribute:!1},reorderable:{type:Boolean,reflect:!0},expandable:{type:Boolean,attribute:!1},expandOn:{type:String,attribute:"expand-on"},toggleCell:{type:String,attribute:"toggle-cell"},toggleAfterColumn:{type:String,attribute:"toggle-after-column"},expanded:{type:Array,attribute:!1},expandedRenderer:{type:Object,attribute:!1},sort:{type:Object,attribute:!1},sortMode:{type:String,attribute:"sort-mode"},hiddenColumns:{type:Array,attribute:!1},columnMenu:{type:Boolean,attribute:!1},columnMenuOpen:{state:!0},columnMenuPanelClass:{type:String,attribute:"column-menu-panel-class"},caption:{type:String},label:{type:String},rowLabel:{type:Object,attribute:!1},labels:{type:Object,attribute:!1},emptyLabel:{type:String,attribute:"empty-label"},layout:{type:String,reflect:!0},minWidth:{type:String,attribute:"min-width"},stickyHeader:{type:Boolean,attribute:"sticky-header",reflect:!0}};static styles=v`
1423
+ `}toggle(e){this.workingHidden.has(e)?this.workingHidden.delete(e):this.workingHidden.add(e),this.requestUpdate(),this.dispatchEvent(new CustomEvent(ti,{bubbles:!0,composed:!0,detail:{hidden:[...this.workingHidden]}}))}focusFirstOption(){this.focusOption(0)}focusInitialOption(){this.focusOption(this.initialFocus==="last"?this.columns.length-1:0)}focusOption(e){let t=[...this.renderRoot.querySelectorAll("button[data-column-id]")];t.length!==0&&t[(e%t.length+t.length)%t.length]?.focus()}handleKeydown=e=>{let t=[...this.renderRoot.querySelectorAll("button[data-column-id]")],r=U(),n=t.indexOf(r);if(n<0&&(n=0),e.key==="Enter"){e.preventDefault(),t[n]?.click(),this.dismiss(!0);return}if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.dismiss(!0);return}if(e.key==="Tab"){this.dismiss(!1,!0,e.shiftKey?"backward":"forward");return}let o={items:this.columns,wrap:!0,mode:"roving-focus",get activeIndex(){return n},set activeIndex(a){n=a},setActiveIndex(a){n=a},focusItem(a){t[a]?.focus()}};this.keyManager.handleKeydown(e,o)};dismiss(e,t=!1,r){let n=t&&r!==void 0?{restoreFocus:e,defer:!0,tabDirection:r}:t?{restoreFocus:e,defer:!0}:{restoreFocus:e};this.dispatchEvent(new CustomEvent("mndwpaneldismiss",{bubbles:!0,composed:!0,detail:n}))}};var Qt="mndwselectionchange",ri="mndwsortchange",ii="mndwrowreorder",ni="mndwcolumnvisibilitychange",oi="mndwerror",ai="mndwrowexpand",q="__mndw_detail__";var er=class{entries=new Map;host;nextSlotId=1;constructor(e){this.host=e}reconcile(e,t,r,n,o,a=new Set,s){let l=new Set;for(let c of e)this.reconcileRow(c,t(c),r,n,o,l,a,s);this.pruneRemoved(l)}reconcileRow(e,t,r,n,o,a,s,l){let c=this.entries.get(t);c===void 0&&(c=new Map,this.entries.set(t,c));for(let d of r){if(d.renderer===void 0||!n.has(d.id))continue;a.add(`${t}\0${d.id}`);let h=c.get(d.id),p={node:h?.node??document.createElement("div"),row:e,value:o(d,e),colId:d.id};if(h?.rendererFactory===d.renderer){h.renderer.update(p);continue}h!==void 0&&(h.renderer.destroy(),h.node.remove());let f=d.renderer(),b=p.node;b.setAttribute("slot",`mc-${this.nextSlotId++}`),this.host.appendChild(b);let S={slotId:b.getAttribute("slot")??"",node:b,renderer:f,rendererFactory:d.renderer,rowKey:t,colId:d.id};f.mount({node:b,row:e,value:p.value,colId:d.id}),c.set(d.id,S)}if(l!==void 0&&s.has(t)){a.add(`${t}\0${q}`);let d=c.get(q),h={node:d?.node??document.createElement("div"),row:e,value:e,colId:q};if(d?.rendererFactory===l)d.renderer.update(h);else{d!==void 0&&(d.renderer.destroy(),d.node.remove());let p=l(),f=h.node;f.setAttribute("slot",`mc-${this.nextSlotId++}`),this.host.appendChild(f),p.mount({node:f,row:e,value:e,colId:q}),c.set(q,{slotId:f.getAttribute("slot")??"",node:f,renderer:p,rendererFactory:l,rowKey:t,colId:q})}}}pruneRemoved(e){for(let[t,r]of this.entries){for(let[n,o]of r)e.has(`${t}\0${n}`)||(o.renderer.destroy(),o.node.remove(),r.delete(n));r.size===0&&this.entries.delete(t)}}getSlotId(e,t){return this.entries.get(e)?.get(t)?.slotId}getRowKeyForNode(e){for(let[t,r]of this.entries)for(let n of r.values())if(n.node===e||n.node.contains(e))return t}drain(){for(let e of this.entries.values())for(let t of e.values())t.renderer.destroy(),t.node.remove();this.entries.clear()}};function In(i){for(let e=i.length-1;e>=0;e-=1){let t=i[e]?.rowKey;if(t!==void 0)return t}}var Fn=new WeakMap;function Hn(i,e){Fn.set(i,e)}function tr(i){return Fn.get(i)}function Vn(){return{createResizeObserver(i){return typeof ResizeObserver>"u"?null:new ResizeObserver(i)},requestAnimationFrame(i){return requestAnimationFrame(i)},cancelAnimationFrame(i){cancelAnimationFrame(i)},measure(i){return i.getBoundingClientRect()},getViewportScrollTop(i){return i.scrollTop},setViewportScrollTop(i,e){i.scrollTop=e},getViewportClientHeight(i){return i.clientHeight},getViewportContentWidth(i){return i.clientWidth}}}function fe(i){return i!==void 0&&Number.isFinite(i)&&i>0}function zn(i,e){return fe(i)?i:e}function Bn(i){let e=zn(i.estimatedRowHeight,1),t=zn(i.detailEstimate,1);return i.keys.map(r=>{let n=i.measurements.get(r),o=fe(n?.summary)?n.summary:e,a=i.expandedKeys.has(r)?fe(n?.detail)?n.detail:t:0;return o+a})}function Kn(i){let e=[0];for(let t of i)e.push(e[e.length-1]+t);return e}function Wn(i,e){let t=0,r=i.length-1;for(;t<r;){let n=Math.floor((t+r)/2);i[n+1]<e?t=n+1:r=n}return Math.min(t,i.length-2)}function ka(i,e){let t=0,r=i.length-2;for(;t<r;){let n=Math.ceil((t+r)/2);i[n]<=e?t=n:r=n-1}return Math.max(0,t)}function Un(i){if(i.keys.length===0)return{start:0,end:0,paddingBefore:0,paddingAfter:0,totalHeight:0};let e=Kn(Bn(i)),t=e[e.length-1],r=Math.max(0,Number.isFinite(i.scrollOffset)?i.scrollOffset:0),n=Math.max(0,Number.isFinite(i.viewportHeight)?i.viewportHeight:0),o=Math.max(0,Number.isFinite(i.overscan)?i.overscan:0),a=Math.max(0,r-o),s=r+n+o,l=Wn(e,a),c=ka(e,s),d=Math.max(l+1,c+1);return{start:l,end:d,paddingBefore:e[l],paddingAfter:Math.max(0,t-e[d]),totalHeight:t}}var rr=class{config;keys=[];expandedKeys=new Set;measurements=new Map;prefix=[0];prefixDirty=!0;bootstrapSamples=new Map;frozenMean;initialCohortKeys;constructor(e){this.config={...e}}configure(e){let t=this.config.estimatedRowHeight!==e.estimatedRowHeight||this.config.detailEstimate!==e.detailEstimate;this.config={...e},t&&this.frozenMean===void 0&&this.bootstrapSamples.size<4&&(this.prefixDirty=!0)}setRows(e,t){this.keys=[...e],this.expandedKeys=new Set(t),this.removeMissingKeys(new Set(this.keys)),this.prefixDirty=!0}recordSummaryMeasurement(e,t){if(!this.keys.includes(e)||!fe(t))return!1;let r=this.measurements.get(e)?.summary;if(fe(r)&&Math.abs(r-t)<=.25)return!1;let n=this.measurements.get(e)??{};return n.summary=t,this.measurements.set(e,n),this.prefixDirty=!0,this.frozenMean===void 0&&(this.bootstrapSamples.set(e,t),this.freezeBootstrapIfReady()),!0}recordDetailMeasurement(e,t){if(!this.keys.includes(e)||!fe(t))return!1;let r=this.measurements.get(e)?.detail;if(fe(r)&&Math.abs(r-t)<=.25)return!1;let n=this.measurements.get(e)??{};return n.detail=t,this.measurements.set(e,n),this.prefixDirty=!0,!0}clearDetailMeasurement(e){let t=this.measurements.get(e);return t?.detail===void 0?!1:(delete t.detail,t.summary===void 0&&this.measurements.delete(e),this.prefixDirty=!0,!0)}removeMissingKeys(e){for(let t of this.measurements.keys())e.has(t)||this.measurements.delete(t);for(let t of this.bootstrapSamples.keys())e.has(t)||this.bootstrapSamples.delete(t);if(this.initialCohortKeys!==void 0)for(let t of this.initialCohortKeys)e.has(t)||this.initialCohortKeys.delete(t);this.prefixDirty=!0}resetWidthEpoch(){this.measurements.clear(),this.bootstrapSamples.clear(),this.frozenMean=void 0,this.initialCohortKeys=void 0,this.prefixDirty=!0}effectiveSummaryEstimate(){return this.frozenMean!==void 0?this.frozenMean:this.bootstrapSamples.size>=4?this.runningMean():this.config.estimatedRowHeight}range(e,t,r){if(this.initialCohortKeys===void 0&&this.keys.length>0){let n=Un(this.input(e,t,r));this.initialCohortKeys=new Set(this.keys.slice(n.start,n.end))}return Un(this.input(e,t,r))}offsetOf(e){let t=this.keys.indexOf(e);if(!(t<0))return this.ensurePrefix(),this.prefix[t]}captureAnchor(e){if(this.keys.length===0)return;this.ensurePrefix();let t=Math.max(0,e),r=Math.min(this.keys.length-1,Wn(this.prefix,t));return{key:this.keys[r],logicalIndex:r,intraRowOffset:Math.max(0,t-this.prefix[r])}}restoreAnchor(e,t){this.ensurePrefix();let r=this.keys.indexOf(e.key),n=r>=0?r:Math.min(Math.max(e.logicalIndex,0),Math.max(0,this.keys.length-1)),o=this.prefix[n]+e.intraRowOffset;return Math.min(Math.max(0,t),Math.max(0,o))}offsetForRow(e,t,r,n){let o=this.keys.indexOf(e);if(o<0)return;this.ensurePrefix();let a=this.prefix[o],s=this.prefix[o+1],l=s-a,c=Math.max(0,r),d=Math.max(0,n);return t==="center"?Math.max(0,a-(c-l)/2):t==="end"?Math.max(0,s-c):t==="nearest"?a<d?a:s>d+c?Math.max(0,s-c):d:a}input(e,t,r){return{keys:this.keys,expandedKeys:this.expandedKeys,measurements:this.measurements,estimatedRowHeight:this.effectiveSummaryEstimate(),detailEstimate:this.config.detailEstimate,scrollOffset:e,viewportHeight:t,overscan:r}}ensurePrefix(){this.prefixDirty&&(this.prefix=Kn(Bn(this.input(0,0,0))),this.prefixDirty=!1)}runningMean(){let e=0;for(let t of this.bootstrapSamples.values())e+=t;return e/this.bootstrapSamples.size}freezeBootstrapIfReady(){if(this.bootstrapSamples.size<4)return;let e=this.initialCohortKeys!==void 0&&this.initialCohortKeys.size>=4&&[...this.initialCohortKeys].every(t=>this.bootstrapSamples.has(t));(this.bootstrapSamples.size>=16||e)&&(this.frozenMean=this.runningMean())}};function E(i,e){if(typeof i=="function")return i(e);let t=e[i];return typeof t=="string"?t:""}function jn(i,e){let t=[],r=new Set,n=new Set,o=0;for(let s of i){let l=E(e,s);if(l===""){o++;continue}if(r.has(l)){n.add(l);continue}r.add(l),t.push(s)}let a=[];return n.size>0&&a.push({category:"duplicate-row-key",rowKeys:[...n]}),o>0&&a.push({category:"empty-row-key",count:o}),{rows:t,violations:a}}function Yn(i){let e=[],t=new Set,r=new Set;for(let o of i)t.has(o.id)&&r.add(o.id),t.add(o.id);r.size>0&&e.push({category:"duplicate-column-id",columnIds:[...r]});let n=i.map(o=>o.id).filter(o=>o.startsWith("__mndw_"));return n.length>0&&e.push({category:"reserved-column-id",columnIds:n}),e}function Xn(i,e){return i.find(t=>t.id===e)}function nr(i,e){let t=i.accessor;return t===void 0?e[i.id]:typeof t=="function"?t(e):e[t]}function Jn(i,e,t){return e==null||Xn(i,e.columnId)?.sortable!==!0||t.has(e.columnId)?null:e}function Zn(i,e){return i?.columnId!==e?{columnId:e,direction:"asc"}:i.direction==="asc"?{columnId:e,direction:"desc"}:null}function Gn(i){return i==null||typeof i=="number"&&Number.isNaN(i)}function Pa(i,e,t){let r=i.localeCompare(e,t,{sensitivity:"base"});return r!==0?r:i.localeCompare(e,t,{sensitivity:"case"})}function _a(i,e,t,r="en"){return i.comparator!==void 0?i.comparator(e,t):i.kind==="number"||i.kind==="boolean"?Number(e)-Number(t):Pa(String(e),String(t),r)}function Qn(i,e,t,r="en"){if(t==null)return i;let n=Xn(e,t.columnId);if(n?.sortable!==!0)return i;let o=t.direction==="desc"?-1:1,a=i.map((s,l)=>({row:s,index:l,value:nr(n,s)}));return a.sort((s,l)=>{let c=Gn(s.value),d=Gn(l.value);if(c&&d)return s.index-l.index;if(c)return 1;if(d)return-1;let h=_a(n,s.value,l.value,r);return h!==0?h*o:s.index-l.index}),a.map(s=>s.row)}function or(i,e){if(e.length===0)return"none";let t=0;for(let r of e)i.has(r)&&t++;return t===e.length?"all":t===0?"none":"indeterminate"}function eo(i,e){let t=new Set(i);return t.has(e)?t.delete(e):t.add(e),[...t]}function to(i,e){let t=new Set(i);if(or(t,e)==="all")for(let n of e)t.delete(n);else for(let n of e)t.add(n);return[...t]}function qn(i){return new Set(i.filter(e=>e.hideable!==!1).map(e=>e.id))}function Da(i,e){let t=new Set(i);return t.has(e)?t.delete(e):t.add(e),t}var ir=class{internalHidden=new Set;seededIds=new Set;lastEffective=new Set;wasControlled=!1;effectiveHidden(e,t){this.seed(e);let r=qn(e);if(t!==void 0){let o=new Set;for(let a of t)r.has(a)&&o.add(a);return this.lastEffective=new Set(o),this.wasControlled=!0,o}this.wasControlled&&(this.internalHidden=new Set(this.lastEffective),this.wasControlled=!1);let n=new Set;for(let o of this.internalHidden)r.has(o)&&n.add(o);return n}toggle(e,t,r){let n=this.effectiveHidden(e,t),o=Da(n,r),a=qn(e),s=[...o].filter(l=>a.has(l));return t===void 0&&(this.internalHidden=new Set(s)),s}applyInternal(e){this.internalHidden=new Set(e),this.wasControlled=!1}seed(e){for(let t of e)this.seededIds.has(t.id)||(this.seededIds.add(t.id),t.hidden===!0&&this.internalHidden.add(t.id))}};var vt="mndw-table",ve={bubbles:!0,composed:!0,cancelable:!1};function ar(i,e){return i.replace(/\{(\w+)\}/g,(t,r)=>String(e[r]??""))}function ee(i){return i.length>0?i.join(" "):m}function Oa(){return{selectRow:i=>ar(w("table.selectRow"),{rowName:i}),selectAll:w("table.selectAll"),sortBy:i=>ar(w("table.sortBy"),{column:i}),columnMenu:w("table.columnMenu"),rowFallback:i=>ar(w("table.rowFallback"),{index:i}),reordered:(i,e,t)=>ar(w("table.reordered"),{rowName:i,pos:e,total:t}),invalidData:w("table.invalidData"),expandRow:i=>`Expand ${i}`,collapseRow:i=>`Collapse ${i}`}}var gt=class i extends g{static properties={columns:{type:Array,attribute:!1},rows:{type:Array,attribute:!1},rowKey:{type:String,attribute:"row-key"},virtual:{type:Boolean,reflect:!0},estimatedRowHeight:{type:Number,attribute:"estimated-row-height",reflect:!0},overscan:{type:Number,attribute:"overscan",reflect:!0},selectable:{type:Boolean,reflect:!0},selected:{type:Array,attribute:!1},reorderable:{type:Boolean,reflect:!0},expandable:{type:Boolean,attribute:!1},expandOn:{type:String,attribute:"expand-on"},toggleCell:{type:String,attribute:"toggle-cell"},toggleAfterColumn:{type:String,attribute:"toggle-after-column"},expanded:{type:Array,attribute:!1},expandedRenderer:{type:Object,attribute:!1},sort:{type:Object,attribute:!1},sortMode:{type:String,attribute:"sort-mode"},hiddenColumns:{type:Array,attribute:!1},columnMenu:{type:Boolean,attribute:!1},columnMenuOpen:{state:!0},columnMenuPanelClass:{type:String,attribute:"column-menu-panel-class"},caption:{type:String},label:{type:String},rowLabel:{type:Object,attribute:!1},labels:{type:Object,attribute:!1},emptyLabel:{type:String,attribute:"empty-label"},layout:{type:String,reflect:!0},minWidth:{type:String,attribute:"min-width"},stickyHeader:{type:Boolean,attribute:"sticky-header",reflect:!0}};static styles=v`
1409
1424
  :host {
1410
1425
  ${M}
1411
1426
  display: block;
@@ -1504,7 +1519,7 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1504
1519
  }
1505
1520
 
1506
1521
  [part='expand-toggle']:focus-visible {
1507
- ${R}
1522
+ ${A}
1508
1523
  }
1509
1524
 
1510
1525
  [part='detail-cell'] {
@@ -1624,51 +1639,51 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1624
1639
  .sort-button:focus-visible,
1625
1640
  [part='drag-handle']:focus-visible,
1626
1641
  [part='column-menu-trigger']:focus-visible {
1627
- ${R}
1642
+ ${A}
1628
1643
  }
1629
- `;visibilityState=new tr;geometryProvider;virtualizer=null;resizeObserver=null;observedElements=new Set;observedViewport=null;pendingGeometryFrame=null;observerAttempted=!1;warnedInactiveReason=null;warnedStickyReason=null;pinState={byKey:new Map,inactiveReason:null,inactiveColumnId:null};lastViewportContentWidth;pendingScrollTarget=null;expectedProgrammaticScrollTop;cellRegistry=null;localeController=new L(this);menuLayer=null;cancelMenuFocusRetry=null;menuTrigger=null;effectiveColumns=[];displayRows=[];effectiveHidden=new Set;internalVisibilityNeedsReconcile=!1;effectiveSortState=null;selectedKeySet=new Set;lastCellReconcileSignature=null;lastExpandedKeys=new Set;windowRows=[];virtualRange=null;violations=[];lastViolationSignature="";optimisticOrder=null;dragKey=null;announceText="";static WIDTH_EPSILON=1;static UTILITY_COL_WIDTH="2.5rem";static PIN_KEYS={expandLead:"__mndw_pin_expandLead",select:"__mndw_pin_select",drag:"__mndw_pin_drag"};constructor(e){super(),this.geometryProvider=e??Fn(),this.columns=[],this.rows=[],this.rowKey="id",this.virtual=!1,this.estimatedRowHeight=49,this.overscan=400,this.selectable=!1,this.selected=[],this.reorderable=!1,this.expandable=!1,this.expandOn="toggle",this.toggleCell="leading",this.toggleAfterColumn=void 0,this.expanded=[],this.expandedRenderer=void 0,this.sort=null,this.sortMode="client",this.hiddenColumns=void 0,this.columnMenu=!0,this.columnMenuOpen=!1,this.columnMenuPanelClass="",this.caption="",this.label="",this.rowLabel=void 0,this.labels=void 0,this.emptyLabel="",this.layout="fixed",this.minWidth="",this.stickyHeader=!1,this.addEventListener("mndwchange",this.handleCheckboxChange),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown)}connectedCallback(){super.connectedCallback(),this.observerAttempted=!1,this.cellRegistry=new Zt(this),this.lastCellReconcileSignature=null}disconnectedCallback(){this.teardownGeometry(),this.closeColumnMenu(),this.cellRegistry?.drain(),this.cellRegistry=null,super.disconnectedCallback()}willUpdate(e){!this.hasUpdated||e.size>0||this.internalVisibilityNeedsReconcile?(this.internalVisibilityNeedsReconcile=!1,this.reconcileState(!0)):this.updateVirtualWindow(),this.unobserveStaleGeometryTargets()}reconcileState(e){let t=this.effectiveSortState,r=this.logicalStructureSignature(this.displayRows,this.lastExpandedKeys),n=this.captureCurrentAnchor();this.configureGeometryMode(),this.configureLayoutMode();let o=qn(this.columns),{rows:a,violations:s}=Wn(this.rows,this.rowKey);this.violations=[...o,...s],this.emitErrorIfChanged(),this.effectiveColumns=this.columns.filter((p,f,m)=>m.findIndex(S=>S.id===p.id)===f).filter(p=>!p.id.startsWith("__mndw_")),this.effectiveHidden=this.visibilityState.effectiveHidden(this.effectiveColumns,this.hiddenColumns),this.effectiveSortState=Yn(this.effectiveColumns,this.sort,this.effectiveHidden),this.pinState=this.computePinState(),this.applyStickyInactive(this.pinState);let l=!this.sameSortState(t,this.effectiveSortState),c=new Set(this.effectiveColumns.filter(p=>!this.effectiveHidden.has(p.id)).map(p=>p.id));this.optimisticOrder!==null?this.displayRows=this.optimisticOrder:this.sortMode==="client"&&this.effectiveSortState!==null?this.displayRows=Jn(a,this.effectiveColumns,this.effectiveSortState,this.locale()):this.displayRows=a;let d=this.expandedSet();this.selectedKeySet=new Set(this.selected);let h=r!==this.logicalStructureSignature(this.displayRows,d);if(this.isVirtualRenderingActive()){let p=this.getVirtualizer(),f=this.displayRows.map(m=>T(this.rowKey,m));for(let m of this.lastExpandedKeys)d.has(m)||p.clearDetailMeasurement(m);if(p.configure({estimatedRowHeight:this.normalizedEstimatedRowHeight(),detailEstimate:160}),p.setRows(f,d),this.updateVirtualWindow(!1),l){let m=this.viewportElement(),S=this.headerElement();m!==null&&S!==null&&(this.pendingScrollTarget=null,this.writeBodyScrollOffset(m,S,0),this.updateVirtualWindow(!1))}else if(h&&n!==void 0){let m=this.viewportElement(),S=this.headerElement();if(m!==null&&S!==null){let x=p.range(this.bodyScrollOffset(m,S),this.geometryProvider.getViewportClientHeight(m),this.normalizedOverscan()),E=Math.max(0,x.totalHeight-this.geometryProvider.getViewportClientHeight(m)),A=p.restoreAnchor(n,E);this.writeBodyScrollOffset(m,S,A),this.updateVirtualWindow(!1)}}this.lastExpandedKeys=new Set(d)}else this.virtualRange=null,this.windowRows=this.displayRows;this.pendingScrollTarget!==null&&!this.displayRows.some(p=>T(this.rowKey,p)===this.pendingScrollTarget?.key)&&(this.pendingScrollTarget=null),this.reconcileVisibleCells(e,c)}updated(e){if(this.menuLayer?.reposition(),!this.isVirtualRenderingActive()){this.teardownGeometry();return}this.syncGeometryTargets(),this.scheduleGeometryFrame()}render(){let e=this.resolveLabels(),t=this.displayRows.length===0&&this.emptyLabel;return u`
1630
- ${this.violations.length>0?u`<div part="error" role="alert">${e.invalidData}</div>`:b}
1644
+ `;visibilityState=new ir;geometryProvider;virtualizer=null;resizeObserver=null;observedElements=new Set;observedViewport=null;pendingGeometryFrame=null;observerAttempted=!1;warnedInactiveReason=null;warnedStickyReason=null;pinState={byKey:new Map,inactiveReason:null,inactiveColumnId:null};lastViewportContentWidth;pendingScrollTarget=null;expectedProgrammaticScrollTop;cellRegistry=null;localeController=new L(this);menuLayer=null;cancelMenuFocusRetry=null;menuTrigger=null;menuOpenGeneration=0;menuApiCloseHadFocus=new WeakMap;effectiveColumns=[];displayRows=[];effectiveHidden=new Set;internalVisibilityNeedsReconcile=!1;effectiveSortState=null;selectedKeySet=new Set;lastCellReconcileSignature=null;lastExpandedKeys=new Set;windowRows=[];virtualRange=null;violations=[];lastViolationSignature="";optimisticOrder=null;dragKey=null;announceText="";static WIDTH_EPSILON=1;static UTILITY_COL_WIDTH="2.5rem";static PIN_KEYS={expandLead:"__mndw_pin_expandLead",select:"__mndw_pin_select",drag:"__mndw_pin_drag"};constructor(e){super(),this.geometryProvider=e??Vn(),this.columns=[],this.rows=[],this.rowKey="id",this.virtual=!1,this.estimatedRowHeight=49,this.overscan=400,this.selectable=!1,this.selected=[],this.reorderable=!1,this.expandable=!1,this.expandOn="toggle",this.toggleCell="leading",this.toggleAfterColumn=void 0,this.expanded=[],this.expandedRenderer=void 0,this.sort=null,this.sortMode="client",this.hiddenColumns=void 0,this.columnMenu=!0,this.columnMenuOpen=!1,this.columnMenuPanelClass="",this.caption="",this.label="",this.rowLabel=void 0,this.labels=void 0,this.emptyLabel="",this.layout="fixed",this.minWidth="",this.stickyHeader=!1,this.addEventListener("mndwchange",this.handleCheckboxChange),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown)}connectedCallback(){super.connectedCallback(),this.observerAttempted=!1,this.cellRegistry=new er(this),this.lastCellReconcileSignature=null}disconnectedCallback(){this.teardownGeometry(),this.closeColumnMenu(),this.cellRegistry?.drain(),this.cellRegistry=null,super.disconnectedCallback()}willUpdate(e){!this.hasUpdated||e.size>0||this.internalVisibilityNeedsReconcile?(this.internalVisibilityNeedsReconcile=!1,this.reconcileState(!0)):this.updateVirtualWindow(),this.unobserveStaleGeometryTargets()}reconcileState(e){let t=this.effectiveSortState,r=this.logicalStructureSignature(this.displayRows,this.lastExpandedKeys),n=this.captureCurrentAnchor();this.configureGeometryMode(),this.configureLayoutMode();let o=Yn(this.columns),{rows:a,violations:s}=jn(this.rows,this.rowKey);this.violations=[...o,...s],this.emitErrorIfChanged(),this.effectiveColumns=this.columns.filter((p,f,b)=>b.findIndex(S=>S.id===p.id)===f).filter(p=>!p.id.startsWith("__mndw_")),this.effectiveHidden=this.visibilityState.effectiveHidden(this.effectiveColumns,this.hiddenColumns),this.effectiveSortState=Jn(this.effectiveColumns,this.sort,this.effectiveHidden),this.pinState=this.computePinState(),this.applyStickyInactive(this.pinState);let l=!this.sameSortState(t,this.effectiveSortState),c=new Set(this.effectiveColumns.filter(p=>!this.effectiveHidden.has(p.id)).map(p=>p.id));this.optimisticOrder!==null?this.displayRows=this.optimisticOrder:this.sortMode==="client"&&this.effectiveSortState!==null?this.displayRows=Qn(a,this.effectiveColumns,this.effectiveSortState,this.locale()):this.displayRows=a;let d=this.expandedSet();this.selectedKeySet=new Set(this.selected);let h=r!==this.logicalStructureSignature(this.displayRows,d);if(this.isVirtualRenderingActive()){let p=this.getVirtualizer(),f=this.displayRows.map(b=>E(this.rowKey,b));for(let b of this.lastExpandedKeys)d.has(b)||p.clearDetailMeasurement(b);if(p.configure({estimatedRowHeight:this.normalizedEstimatedRowHeight(),detailEstimate:160}),p.setRows(f,d),this.updateVirtualWindow(!1),l){let b=this.viewportElement(),S=this.headerElement();b!==null&&S!==null&&(this.pendingScrollTarget=null,this.writeBodyScrollOffset(b,S,0),this.updateVirtualWindow(!1))}else if(h&&n!==void 0){let b=this.viewportElement(),S=this.headerElement();if(b!==null&&S!==null){let C=p.range(this.bodyScrollOffset(b,S),this.geometryProvider.getViewportClientHeight(b),this.normalizedOverscan()),T=Math.max(0,C.totalHeight-this.geometryProvider.getViewportClientHeight(b)),R=p.restoreAnchor(n,T);this.writeBodyScrollOffset(b,S,R),this.updateVirtualWindow(!1)}}this.lastExpandedKeys=new Set(d)}else this.virtualRange=null,this.windowRows=this.displayRows;this.pendingScrollTarget!==null&&!this.displayRows.some(p=>E(this.rowKey,p)===this.pendingScrollTarget?.key)&&(this.pendingScrollTarget=null),this.reconcileVisibleCells(e,c)}updated(e){if(this.menuLayer?.reposition(),!this.isVirtualRenderingActive()){this.teardownGeometry();return}this.syncGeometryTargets(),this.scheduleGeometryFrame()}render(){let e=this.resolveLabels(),t=this.displayRows.length===0&&this.emptyLabel;return u`
1645
+ ${this.violations.length>0?u`<div part="error" role="alert">${e.invalidData}</div>`:m}
1631
1646
  ${t?u`<div part="empty">${this.emptyLabel}</div>`:u`
1632
1647
  <div class="mndw-table-viewport" part="viewport" tabindex="-1">
1633
1648
  <table
1634
1649
  part="table"
1635
1650
  style=${this.tableStyle()}
1636
- aria-label=${this.caption?b:this.label||b}
1637
- aria-rowcount=${this.virtual?this.logicalRowCount():b}
1651
+ aria-label=${this.caption?m:this.label||m}
1652
+ aria-rowcount=${this.virtual?this.logicalRowCount():m}
1638
1653
  >
1639
- ${this.caption?u`<caption part="caption">${this.caption}</caption>`:b}
1654
+ ${this.caption?u`<caption part="caption">${this.caption}</caption>`:m}
1640
1655
  ${this.renderHeader(e)}
1641
1656
  <tbody>
1642
- ${this.virtualRange===null?b:this.renderSpacer(this.virtualRange.paddingBefore)}
1643
- ${jt(this.windowRows,r=>T(this.rowKey,r),(r,n)=>this.renderRow(r,n,e))}
1644
- ${this.virtualRange===null?b:this.renderSpacer(this.virtualRange.paddingAfter)}
1657
+ ${this.virtualRange===null?m:this.renderSpacer(this.virtualRange.paddingBefore)}
1658
+ ${Xt(this.windowRows,r=>E(this.rowKey,r),(r,n)=>this.renderRow(r,n,e))}
1659
+ ${this.virtualRange===null?m:this.renderSpacer(this.virtualRange.paddingAfter)}
1645
1660
  </tbody>
1646
1661
  </table>
1647
1662
  </div>`}
1648
1663
  <div part="live-region" aria-live="polite">${this.announceText}</div>
1649
- `}renderSpacer(e){return!Number.isFinite(e)||e<=0?b:u`<tr part="virtual-spacer" aria-hidden="true">
1664
+ `}renderSpacer(e){return!Number.isFinite(e)||e<=0?m:u`<tr part="virtual-spacer" aria-hidden="true">
1650
1665
  <td colspan=${this.columnSpan()} style="height: ${e}px; padding: 0; border: 0;"></td>
1651
1666
  </tr>`}renderHeader(e){return u`
1652
1667
  <thead part="header">
1653
- <tr part="header-row" aria-rowindex=${this.virtual?1:b}>
1654
- ${this.shouldRenderLeadingToggle()?this.renderExpandHeaderCell(i.PIN_KEYS.expandLead):b}
1668
+ <tr part="header-row" aria-rowindex=${this.virtual?1:m}>
1669
+ ${this.shouldRenderLeadingToggle()?this.renderExpandHeaderCell(i.PIN_KEYS.expandLead):m}
1655
1670
  ${this.selectable?u`<th
1656
1671
  part="header-cell select-cell"
1657
1672
  scope="col"
1658
- class=${Z(this.pinClasses(i.PIN_KEYS.select))}
1673
+ class=${ee(this.pinClasses(i.PIN_KEYS.select))}
1659
1674
  style=${this.utilityPinStyle(i.PIN_KEYS.select)}
1660
1675
  >
1661
1676
  ${this.renderCheckbox({ariaLabel:e.selectAll,checked:this.isAllSelected(),indeterminate:this.isIndeterminate(),selectAll:!0})}
1662
- </th>`:b}
1677
+ </th>`:m}
1663
1678
  ${this.reorderable&&this.effectiveSortState===null?u`<th
1664
1679
  part="header-cell"
1665
1680
  scope="col"
1666
- class=${Z(this.pinClasses(i.PIN_KEYS.drag))}
1681
+ class=${ee(this.pinClasses(i.PIN_KEYS.drag))}
1667
1682
  style=${this.utilityPinStyle(i.PIN_KEYS.drag)}
1668
- ></th>`:b}
1683
+ ></th>`:m}
1669
1684
  ${this.effectiveColumns.filter(t=>!this.effectiveHidden.has(t.id)).map(t=>u`
1670
1685
  ${this.renderHeaderCell(t,e)}
1671
- ${this.shouldRenderToggleAfter(t.id)?this.renderExpandHeaderCell():b}
1686
+ ${this.shouldRenderToggleAfter(t.id)?this.renderExpandHeaderCell():m}
1672
1687
  `)}
1673
1688
  ${this.columnMenu?u`<th part="header-cell" scope="col" class="align-end">
1674
1689
  <button
@@ -1679,16 +1694,16 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1679
1694
  aria-haspopup="menu"
1680
1695
  aria-expanded=${String(this.columnMenuOpen)}
1681
1696
  ><mndw-icon name="settings"></mndw-icon></button>
1682
- </th>`:b}
1683
- ${this.shouldRenderTrailingToggle()?this.renderExpandHeaderCell():b}
1697
+ </th>`:m}
1698
+ ${this.shouldRenderTrailingToggle()?this.renderExpandHeaderCell():m}
1684
1699
  </tr>
1685
1700
  </thead>
1686
1701
  `}renderExpandHeaderCell(e){return u`<th
1687
1702
  part="header-cell expand-cell"
1688
1703
  scope="col"
1689
- class=${Z(e===void 0?[]:this.pinClasses(e))}
1690
- style=${e===void 0?b:this.utilityPinStyle(e)}
1691
- ></th>`}renderHeaderCell(e,t){let r=Z([...this.alignClassList(e),...this.pinClasses(e.id)]),n=this.columnStyle(e);if(e.sortable!==!0)return u`<th part="header-cell" scope="col" class=${r} style=${n}>${e.label}</th>`;let o=this.effectiveSortState?.columnId===e.id?this.effectiveSortState?.direction:void 0,a=o==="asc"?"ascending":o==="desc"?"descending":b,s=o==="asc"?"arrow-up":o==="desc"?"arrow-down":"arrow-up-down";return u`
1704
+ class=${ee(e===void 0?[]:this.pinClasses(e))}
1705
+ style=${e===void 0?m:this.utilityPinStyle(e)}
1706
+ ></th>`}renderHeaderCell(e,t){let r=ee([...this.alignClassList(e),...this.pinClasses(e.id)]),n=this.columnStyle(e);if(e.sortable!==!0)return u`<th part="header-cell" scope="col" class=${r} style=${n}>${e.label}</th>`;let o=this.effectiveSortState?.columnId===e.id?this.effectiveSortState?.direction:void 0,a=o==="asc"?"ascending":o==="desc"?"descending":m,s=o==="asc"?"arrow-up":o==="desc"?"arrow-down":"arrow-up-down";return u`
1692
1707
  <th part="header-cell" scope="col" class=${r} style=${n} aria-sort=${a}>
1693
1708
  <button
1694
1709
  class="sort-button"
@@ -1699,19 +1714,19 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1699
1714
  <mndw-icon name=${s}></mndw-icon>
1700
1715
  </span></button>
1701
1716
  </th>
1702
- `}renderRow(e,t,r){let n=T(this.rowKey,e),o=this.expandedSet().has(n),a=this.cellRegistry?.getSlotId(n,W);return u`
1703
- <tr part="row" data-row-key=${n} aria-rowindex=${this.virtual?this.logicalRowIndex(n,!1):b}>
1704
- ${this.shouldRenderLeadingToggle()?this.renderExpandCell(e,t,n,r,i.PIN_KEYS.expandLead):b}
1717
+ `}renderRow(e,t,r){let n=E(this.rowKey,e),o=this.expandedSet().has(n),a=this.cellRegistry?.getSlotId(n,q);return u`
1718
+ <tr part="row" data-row-key=${n} aria-rowindex=${this.virtual?this.logicalRowIndex(n,!1):m}>
1719
+ ${this.shouldRenderLeadingToggle()?this.renderExpandCell(e,t,n,r,i.PIN_KEYS.expandLead):m}
1705
1720
  ${this.selectable?u`<td
1706
1721
  part="select-cell cell"
1707
- class=${Z(this.pinClasses(i.PIN_KEYS.select))}
1722
+ class=${ee(this.pinClasses(i.PIN_KEYS.select))}
1708
1723
  style=${this.utilityPinStyle(i.PIN_KEYS.select)}
1709
1724
  >
1710
1725
  ${this.renderCheckbox({ariaLabel:r.selectRow(this.rowName(e,t)),checked:this.selectedKeySet.has(n),indeterminate:!1,rowKey:n})}
1711
- </td>`:b}
1726
+ </td>`:m}
1712
1727
  ${this.reorderable&&this.effectiveSortState===null?u`<td
1713
1728
  part="cell"
1714
- class=${Z(this.pinClasses(i.PIN_KEYS.drag))}
1729
+ class=${ee(this.pinClasses(i.PIN_KEYS.drag))}
1715
1730
  style=${this.utilityPinStyle(i.PIN_KEYS.drag)}
1716
1731
  >
1717
1732
  <button
@@ -1720,23 +1735,23 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1720
1735
  data-row-key=${n}
1721
1736
  aria-label=${r.selectRow(this.rowName(e,t))}
1722
1737
  >⠿</button>
1723
- </td>`:b}
1738
+ </td>`:m}
1724
1739
  ${this.effectiveColumns.filter(s=>!this.effectiveHidden.has(s.id)).map(s=>u`
1725
1740
  ${this.renderCell(s,e)}
1726
- ${this.shouldRenderToggleAfter(s.id)?this.renderExpandCell(e,t,n,r):b}
1741
+ ${this.shouldRenderToggleAfter(s.id)?this.renderExpandCell(e,t,n,r):m}
1727
1742
  `)}
1728
- ${this.columnMenu?u`<td part="cell"></td>`:b}
1729
- ${this.shouldRenderTrailingToggle()?this.renderExpandCell(e,t,n,r):b}
1743
+ ${this.columnMenu?u`<td part="cell"></td>`:m}
1744
+ ${this.shouldRenderTrailingToggle()?this.renderExpandCell(e,t,n,r):m}
1730
1745
  </tr>
1731
1746
  ${this.expandable&&o?u`<tr
1732
1747
  part="detail-row"
1733
1748
  data-row-key=${n}
1734
- aria-rowindex=${this.virtual?this.logicalRowIndex(n,!0):b}
1735
- ><td part="detail-cell" colspan=${this.columnSpan()}>${a!==void 0?u`<slot name=${a}></slot>`:b}</td></tr>`:b}
1749
+ aria-rowindex=${this.virtual?this.logicalRowIndex(n,!0):m}
1750
+ ><td part="detail-cell" colspan=${this.columnSpan()}>${a!==void 0?u`<slot name=${a}></slot>`:m}</td></tr>`:m}
1736
1751
  `}renderExpandCell(e,t,r,n,o){let a=this.expandedSet().has(r),s=this.rowName(e,t);return u`<td
1737
1752
  part="cell expand-cell"
1738
- class=${Z(o===void 0?[]:this.pinClasses(o))}
1739
- style=${o===void 0?b:this.utilityPinStyle(o)}
1753
+ class=${ee(o===void 0?[]:this.pinClasses(o))}
1754
+ style=${o===void 0?m:this.utilityPinStyle(o)}
1740
1755
  >
1741
1756
  <button
1742
1757
  part="expand-toggle"
@@ -1745,15 +1760,15 @@ var St=globalThis,xt=St.ShadowRoot&&(St.ShadyCSS===void 0||St.ShadyCSS.nativeSha
1745
1760
  aria-expanded=${a?"true":"false"}
1746
1761
  aria-label=${a?n.collapseRow(s):n.expandRow(s)}
1747
1762
  ><mndw-icon name=${a?"chevron-down":"chevron-right"}></mndw-icon></button>
1748
- </td>`}renderCell(e,t){let r=[...this.alignClassList(e),...this.pinClasses(e.id)],n=this.columnStyle(e),o=e.renderer!==void 0?this.cellRegistry?.getSlotId(T(this.rowKey,t),e.id):void 0;if(o!==void 0)return u`<td part="cell" class=${Z(r)} style=${n}><slot name=${o}></slot></td>`;let a=e.kind==="number"?[...r,"cell-kind-number"]:r,s=rr(e,t);return u`<td part="cell" class=${Z(a)} style=${n}>${this.renderBuiltIn(e,s,t)}</td>`}renderBuiltIn(e,t,r){if(e.kind==="badge"){let n=e.badge?.(t,r);return n===void 0?b:u`<span part="badge"
1763
+ </td>`}renderCell(e,t){let r=[...this.alignClassList(e),...this.pinClasses(e.id)],n=this.columnStyle(e),o=e.renderer!==void 0?this.cellRegistry?.getSlotId(E(this.rowKey,t),e.id):void 0;if(o!==void 0)return u`<td part="cell" class=${ee(r)} style=${n}><slot name=${o}></slot></td>`;let a=e.kind==="number"?[...r,"cell-kind-number"]:r,s=nr(e,t);return u`<td part="cell" class=${ee(a)} style=${n}>${this.renderBuiltIn(e,s,t)}</td>`}renderBuiltIn(e,t,r){if(e.kind==="badge"){let n=e.badge?.(t,r);return n===void 0?m:u`<span part="badge"
1749
1764
  ><span part="badge-dot" style="background: ${this.toneColor(n.tone)};"></span>${n.text}</span>`}return e.kind==="boolean"?t?u`<mndw-icon name="check"></mndw-icon>`:u`<mndw-icon name="minus"></mndw-icon>`:t==null?"":String(t)}renderCheckbox(e){return u`<mndw-checkbox
1750
1765
  aria-label=${e.ariaLabel}
1751
- part=${e.selectAll?"select-all":b}
1766
+ part=${e.selectAll?"select-all":m}
1752
1767
  ?data-select-all=${e.selectAll??!1}
1753
- data-row-key=${e.rowKey??b}
1768
+ data-row-key=${e.rowKey??m}
1754
1769
  .checked=${e.checked}
1755
1770
  .indeterminate=${e.indeterminate}
1756
- ></mndw-checkbox>`}expandedSet(){return new Set(this.expanded)}getVirtualizer(){return this.virtualizer===null&&(this.virtualizer=new er({estimatedRowHeight:this.normalizedEstimatedRowHeight(),detailEstimate:160})),this.virtualizer}captureCurrentAnchor(){if(!this.isVirtualRenderingActive()||this.virtualizer===null)return;let e=this.viewportElement(),t=this.headerElement();return e===null||t===null?void 0:this.virtualizer.captureAnchor(this.bodyScrollOffset(e,t))}logicalStructureSignature(e,t){return[e.map(r=>T(this.rowKey,r)).join("\0"),[...t].join("\0")].join("")}configureGeometryMode(){if(!this.virtual){this.setVirtualInactiveReason(null),this.teardownGeometry();return}if(this.resizeObserver===null&&!this.observerAttempted&&(this.observerAttempted=!0,this.resizeObserver=this.geometryProvider.createResizeObserver(this.handleGeometryResize)),this.resizeObserver===null){this.setVirtualInactiveReason("resize-observer-unavailable");return}if(this.reorderable){this.teardownGeometry(),this.setVirtualInactiveReason("reorderable");return}this.setVirtualInactiveReason(null)}configureLayoutMode(){this.virtual&&this.layout==="auto"?this.setAttribute("data-mndw-layout-inactive","virtual"):this.removeAttribute("data-mndw-layout-inactive")}isVirtualRenderingActive(){return this.virtual&&!this.reorderable&&this.resizeObserver!==null}setVirtualInactiveReason(e){e===null?this.removeAttribute("data-mndw-virtual-inactive"):(this.setAttribute("data-mndw-virtual-inactive",e),this.warnedInactiveReason!==e&&(this.warnedInactiveReason=e,console.warn(`<${ft}> virtualization inactive: ${e}`)))}updateVirtualWindow(e=!0){if(!this.isVirtualRenderingActive()||this.virtualizer===null)return;let t=this.viewportElement(),r=this.headerElement(),n=t===null||r===null?0:this.bodyScrollOffset(t,r),o=t===null?0:this.geometryProvider.getViewportClientHeight(t);this.virtualRange=this.virtualizer.range(n,o,this.normalizedOverscan());let a=this.displayRows.slice(this.virtualRange.start,this.virtualRange.end);if(t!==null&&this.windowRows!==a){let s=this.windowRows.map(c=>T(this.rowKey,c)).join("\0"),l=a.map(c=>T(this.rowKey,c)).join("\0");s!==l&&this.evacuateFocusBeforeWindowRemoval(t,this.windowRows,a)}this.windowRows=a,e&&this.reconcileVisibleCells(!1)}reconcileVisibleCells(e,t){let r=t??new Set(this.effectiveColumns.filter(o=>!this.effectiveHidden.has(o.id)).map(o=>o.id)),n=[this.windowRows.map(o=>T(this.rowKey,o)).join("\0"),[...r].join("\0"),[...this.expandedSet()].join("\0")].join("");!e&&n===this.lastCellReconcileSignature||(this.cellRegistry?.reconcile(this.windowRows,o=>T(this.rowKey,o),this.effectiveColumns,r,rr,this.expandedSet(),this.expandedRenderer),this.lastCellReconcileSignature=n)}bodyScrollOffset(e,t){return Math.max(0,this.geometryProvider.getViewportScrollTop(e)-this.geometryProvider.measure(t).height)}writeBodyScrollOffset(e,t,r){if(this.virtualizer===null)return;let n=this.geometryProvider.measure(t).height,o=this.geometryProvider.getViewportClientHeight(e),a=this.geometryProvider.getViewportScrollTop(e),s=this.virtualizer.range(this.bodyScrollOffset(e,t),o,this.normalizedOverscan()).totalHeight,l=Math.max(0,n+s-o),c=r<=0&&a<n?a:n+Math.max(0,r),d=Math.min(l,Math.max(0,c));this.expectedProgrammaticScrollTop=d,this.geometryProvider.setViewportScrollTop(e,d)}syncGeometryTargets(){let e=this.resizeObserver,t=this.viewportElement(),r=this.headerElement();if(e===null||t===null||r===null)return;let n=new Map;n.set(t,{kind:"viewport"}),n.set(r,{kind:"header"});for(let o of this.shadowRoot?.querySelectorAll('[part="row"]')??[]){let a=o.getAttribute("data-row-key");a!==null&&a!==""&&n.set(o,{kind:"summary",rowKey:a})}for(let o of this.shadowRoot?.querySelectorAll('[part="detail-row"]')??[]){let a=o.getAttribute("data-row-key");a!==null&&a!==""&&n.set(o,{kind:"detail",rowKey:a})}for(let o of this.observedElements)n.has(o)||(e.unobserve(o),this.observedElements.delete(o));for(let[o,a]of n)In(o,a),this.observedElements.has(o)||(e.observe(o),this.observedElements.add(o));this.observedViewport!==t&&(this.observedViewport?.removeEventListener("scroll",this.handleViewportScroll),t.addEventListener("scroll",this.handleViewportScroll),this.observedViewport=t)}unobserveStaleGeometryTargets(){if(this.resizeObserver===null)return;let e=new Set(this.windowRows.map(r=>T(this.rowKey,r))),t=this.expandedSet();for(let r of this.observedElements){let n=Qt(r);(n?.kind==="summary"&&!e.has(n.rowKey)||n?.kind==="detail"&&(!e.has(n.rowKey)||!t.has(n.rowKey)))&&(this.resizeObserver.unobserve(r),this.observedElements.delete(r))}}scheduleGeometryFrame(){!this.isVirtualRenderingActive()||this.pendingGeometryFrame!==null||(this.pendingGeometryFrame=this.geometryProvider.requestAnimationFrame(this.handleGeometryFrame))}handleGeometryResize=()=>{this.scheduleGeometryFrame()};handleViewportScroll=()=>{let e=this.observedViewport;if(e!==null&&this.expectedProgrammaticScrollTop!==void 0){let t=this.geometryProvider.getViewportScrollTop(e);if(Math.abs(t-this.expectedProgrammaticScrollTop)<=.25){this.expectedProgrammaticScrollTop=void 0,this.scheduleGeometryFrame();return}}this.pendingScrollTarget=null,this.scheduleGeometryFrame()};handleGeometryFrame=()=>{if(this.pendingGeometryFrame=null,!this.isConnected||!this.isVirtualRenderingActive()||this.virtualizer===null)return;let e=this.viewportElement(),t=this.headerElement();if(e===null||t===null)return;this.geometryProvider.measure(e);let r=this.geometryProvider.measure(t),n=this.geometryProvider.getViewportContentWidth(e),o=this.bodyScrollOffset(e,t),a=this.virtualizer.captureAnchor(o),s=!1;this.lastViewportContentWidth===void 0?this.lastViewportContentWidth=n:Number.isFinite(n)&&Math.abs(n-this.lastViewportContentWidth)>=i.WIDTH_EPSILON&&(this.lastViewportContentWidth=n,this.virtualizer.resetWidthEpoch(),s=!0);for(let m of this.observedElements){let S=Qt(m);S?.kind==="summary"?s=this.virtualizer.recordSummaryMeasurement(S.rowKey,this.geometryProvider.measure(m).height)||s:S?.kind==="detail"&&(s=this.virtualizer.recordDetailMeasurement(S.rowKey,this.geometryProvider.measure(m).height)||s)}let l=Math.max(0,this.geometryProvider.getViewportScrollTop(e)-r.height),c=this.virtualizer.range(l,this.geometryProvider.getViewportClientHeight(e),this.normalizedOverscan()),d=this.windowRows.map(m=>T(this.rowKey,m)).join("\0"),h=this.displayRows.slice(c.start,c.end),p=h.map(m=>T(this.rowKey,m)).join("\0");d!==p&&this.evacuateFocusBeforeWindowRemoval(e,this.windowRows,h),this.virtualRange=c,this.windowRows=h,this.reconcileVisibleCells(!1);let f=!1;if(this.pendingScrollTarget!==null){let m=this.pendingScrollTarget;if([...this.observedElements].find(x=>{let E=Qt(x);return E?.kind==="summary"&&E.rowKey===m.key})!==void 0){let x=this.virtualizer.offsetForRow(m.key,m.align,this.geometryProvider.getViewportClientHeight(e),l);x!==void 0&&this.writeBodyScrollOffset(e,t,x),this.pendingScrollTarget=null,f=!0}}if(s&&!f&&a!==void 0){let m=Math.max(0,c.totalHeight-this.geometryProvider.getViewportClientHeight(e)),S=this.virtualizer.restoreAnchor(a,m);this.writeBodyScrollOffset(e,t,S)}(s||d!==p)&&this.requestUpdate()};teardownGeometry(){if(this.observedViewport?.removeEventListener("scroll",this.handleViewportScroll),this.observedViewport=null,this.resizeObserver!==null){for(let e of this.observedElements)this.resizeObserver.unobserve(e);this.resizeObserver.disconnect(),this.resizeObserver=null}this.observedElements.clear(),this.observerAttempted=!1,this.pendingGeometryFrame!==null&&(this.geometryProvider.cancelAnimationFrame(this.pendingGeometryFrame),this.pendingGeometryFrame=null),this.lastViewportContentWidth=void 0,this.expectedProgrammaticScrollTop=void 0}normalizedEstimatedRowHeight(){return Number.isFinite(this.estimatedRowHeight)&&this.estimatedRowHeight>0?this.estimatedRowHeight:49}normalizedOverscan(){return Number.isFinite(this.overscan)&&this.overscan>=0?this.overscan:400}viewportElement(){return this.shadowRoot?.querySelector('[part="viewport"]')??null}headerElement(){return this.shadowRoot?.querySelector('[part="header-row"]')??null}collectFocusChain(){let e=[],t=document.activeElement;for(;t!==null;){e.push({rowKey:this.focusedRowKeyForElement(t)});let r=t.shadowRoot?.activeElement;if(!(r instanceof Element)||r===t)break;t=r}return e}focusedRowKeyForElement(e){let t=this.cellRegistry?.getRowKeyForNode(e);return t!==void 0?t:e.closest('[part="row"], [part="detail-row"]')?.getAttribute("data-row-key")??void 0}evacuateFocusBeforeWindowRemoval(e,t,r){let n=new Set(t.map(s=>T(this.rowKey,s))),o=new Set(r.map(s=>T(this.rowKey,s))),a=On(this.collectFocusChain());a!==void 0&&n.has(a)&&!o.has(a)&&e.focus()}shouldRenderLeadingToggle(){return this.expandable&&this.toggleAfterColumn===void 0&&this.toggleCell==="leading"}shouldRenderTrailingToggle(){return this.expandable&&this.toggleAfterColumn===void 0&&this.toggleCell==="trailing"}shouldRenderToggleAfter(e){return this.expandable&&this.toggleAfterColumn===e}leadingUtilityKeys(){let e=[];return this.shouldRenderLeadingToggle()&&e.push(i.PIN_KEYS.expandLead),this.selectable&&e.push(i.PIN_KEYS.select),this.reorderable&&this.effectiveSortState===null&&e.push(i.PIN_KEYS.drag),e}computePinState(){let e=this.effectiveColumns.filter(a=>!this.effectiveHidden.has(a.id)),t=[],r=null,n=null;for(let a of e){if(a.sticky!=="start")break;if(a.width===void 0){r="missing-width",n=a.id;break}t.push({...a,width:a.width})}if(r===null){let a=e.slice(t.length).find(s=>s.sticky==="start");a!==void 0&&(r="not-leading",n=a.id)}let o=new Map;if(t.length>0){let a=[...this.leadingUtilityKeys().map(l=>({key:l,width:i.UTILITY_COL_WIDTH})),...t.map(l=>({key:l.id,width:l.width}))],s=[];a.forEach((l,c)=>{let d=s.length===0?"0":s.length===1?s[0]:`calc(${s.join(" + ")})`;o.set(l.key,{insetInlineStart:d,isLast:c===a.length-1}),s.push(l.width)})}return{byKey:o,inactiveReason:r,inactiveColumnId:n}}applyStickyInactive(e){if(e.inactiveReason===null){this.removeAttribute("data-mndw-sticky-inactive"),this.warnedStickyReason=null;return}this.setAttribute("data-mndw-sticky-inactive",e.inactiveReason);let t=`${e.inactiveReason}:${e.inactiveColumnId??""}`;this.warnedStickyReason!==t&&(this.warnedStickyReason=t,console.warn(`<${ft}> sticky column "${e.inactiveColumnId??""}" inactive: ${e.inactiveReason}`))}tableStyle(){return this.minWidth===""?b:`min-width: ${this.minWidth};`}columnStyle(e){let t=this.pinState.byKey.get(e.id),r=[];return e.width!==void 0&&r.push(`width: ${e.width};`),t!==void 0&&e.width!==void 0&&r.push(`min-width: ${e.width};`,`max-width: ${e.width};`,"box-sizing: border-box;",`inset-inline-start: ${t.insetInlineStart};`),r.length===0?b:r.join(" ")}pinClasses(e){let t=this.pinState.byKey.get(e);return t===void 0?[]:t.isLast?["pinned","pinned-last"]:["pinned"]}utilityPinStyle(e){let t=this.pinState.byKey.get(e);if(t===void 0)return b;let r=i.UTILITY_COL_WIDTH;return`width: ${r}; min-width: ${r}; max-width: ${r}; box-sizing: border-box; inset-inline-start: ${t.insetInlineStart};`}columnSpan(){let e=this.effectiveColumns.filter(t=>!this.effectiveHidden.has(t.id)).length;return(this.expandable?1:0)+(this.selectable?1:0)+(this.reorderable&&this.effectiveSortState===null?1:0)+e+(this.columnMenu?1:0)}alignClassList(e){let t=[];return e.align==="end"&&t.push("align-end"),e.align==="center"&&t.push("align-center"),e.nowrap===!0&&t.push("nowrap"),t}toneColor(e){return`var(--mndw-${e==="neutral"?"text-muted":e})`}resolveLabels(){return{..._a(),...this.labels}}rowName(e,t){return this.rowLabel?.(e)??this.resolveLabels().rowFallback(t+1)}sameSortState(e,t){return e?.columnId===t?.columnId&&e?.direction===t?.direction}logicalRowCount(){let e=this.expandedSet(),t=new Set(this.displayRows.map(n=>T(this.rowKey,n))),r=[...e].filter(n=>t.has(n)).length;return 1+this.displayRows.length+r}logicalRowIndex(e,t){let r=2,n=this.expandedSet();for(let o of this.displayRows){let a=T(this.rowKey,o);if(a===e)return t?r+1:r;r+=1,n.has(a)&&(r+=1)}return r}locale(){return document.documentElement.lang||"en"}isAllSelected(){return ir(this.selectedKeySet,this.displayRows.map(e=>T(this.rowKey,e)))==="all"}isIndeterminate(){return ir(this.selectedKeySet,this.displayRows.map(e=>T(this.rowKey,e)))==="indeterminate"}emitErrorIfChanged(){let e=JSON.stringify(this.violations);e!==this.lastViolationSignature&&(this.lastViolationSignature=e,this.violations.length!==0&&this.dispatchEvent(new CustomEvent(oi,{...fe,detail:{violations:this.violations}})))}handleCheckboxChange=e=>{let t=e.composedPath()[0]??null;if(t===null)return;if(t.hasAttribute("data-select-all")){let n=this.displayRows.map(a=>T(this.rowKey,a)),o=Qn(this.selected,n);this.dispatchEvent(new CustomEvent(Jt,{...fe,detail:{selected:o}}));return}let r=t.getAttribute("data-row-key");if(r!==null){let n=Zn(this.selected,r);this.dispatchEvent(new CustomEvent(Jt,{...fe,detail:{selected:n}}))}};handleClick=e=>{let t=e.composedPath().find(o=>o instanceof HTMLElement)??null,r=t?.closest?.('[part="expand-toggle"]');if(r!=null){this.emitExpand(r.getAttribute("data-expand-key")??"");return}if(this.expandable&&this.expandOn==="row"){let o=e.composedPath();if(!o.some(s=>s instanceof HTMLElement&&(s.tagName==="BUTTON"||s.tagName==="A"||s.tagName==="INPUT"||s.tagName==="MNDW-CHECKBOX"||s.getAttribute("part")==="drag-handle"||s.hasAttribute("data-no-expand")))){let s=o.find(c=>c instanceof HTMLElement&&c.getAttribute("part")==="row"),l=s instanceof HTMLElement?s.getAttribute("data-row-key"):null;l!=null&&l!==""&&this.emitExpand(l)}}let n=t?.closest?.("[data-sort-column]");if(n!=null){this.activateSort(n.getAttribute("data-sort-column")??"");return}t?.closest?.('[part="column-menu-trigger"]')!==null&&t?.closest?.('[part="column-menu-trigger"]')!==void 0&&this.openColumnMenu(t)};emitExpand(e){let t=new Set(this.expanded);t.has(e)?t.delete(e):t.add(e),this.dispatchEvent(new CustomEvent(ai,{...fe,detail:{expanded:[...t]}}))}handleKeyDown=e=>{let t=e.composedPath().find(n=>n instanceof HTMLElement&&n.getAttribute("part")==="column-menu-trigger");if(t&&(e.key==="ArrowDown"||e.key==="ArrowUp")){e.preventDefault(),this.openColumnMenu(t,e.key==="ArrowUp"?"last":"first");return}let r=e.composedPath()[0]??null;r?.getAttribute("part")==="drag-handle"&&(e.key==="ArrowUp"||e.key==="ArrowDown")&&(e.preventDefault(),this.keyboardReorder(r.getAttribute("data-row-key")??"",e.key==="ArrowUp"?-1:1))};activateSort(e){if(this.effectiveColumns.find(n=>n.id===e)?.sortable!==!0)return;let r=Xn(this.sort,e);this.dispatchEvent(new CustomEvent(ri,{...fe,detail:{sort:r}}))}keyboardReorder(e,t){let r=this.displayRows.findIndex(s=>T(this.rowKey,s)===e);if(r===-1)return;let n=r+t;if(n<0||n>=this.displayRows.length)return;let o=t===-1?n:n+1,a=o<this.displayRows.length?T(this.rowKey,this.displayRows[o]):null;this.emitReorder(e,a)}emitReorder(e,t){let r=this.resolveLabels(),n=this.displayRows.find(o=>T(this.rowKey,o)===e);this.announceText=n===void 0?"":r.reordered(this.rowName(n,this.displayRows.indexOf(n)),this.displayRows.indexOf(n)+1,this.displayRows.length),this.dispatchEvent(new CustomEvent(ii,{...fe,detail:{key:e,beforeKey:t}}))}applyColumnVisibility(e){this.dispatchEvent(new CustomEvent(ni,{...fe,detail:{hidden:e}}))}getVisibleColumnIds(){return this.effectiveColumns.filter(e=>!this.effectiveHidden.has(e.id)).map(e=>e.id)}scrollToRow(e,t={}){if(!this.displayRows.some(c=>T(this.rowKey,c)===e))return!1;let n=this.viewportElement(),o=this.headerElement();if(n===null||o===null)return!1;let a=this.getVirtualizer();a.configure({estimatedRowHeight:this.normalizedEstimatedRowHeight(),detailEstimate:160}),a.setRows(this.displayRows.map(c=>T(this.rowKey,c)),this.expandedSet());let s=t.align??"nearest",l=a.offsetForRow(e,s,this.geometryProvider.getViewportClientHeight(n),this.bodyScrollOffset(n,o));return l===void 0?!1:(this.isVirtualRenderingActive()&&(this.pendingScrollTarget={key:e,align:s}),this.writeBodyScrollOffset(n,o,l),this.updateVirtualWindow(),this.isVirtualRenderingActive()&&this.requestUpdate(),!0)}openColumnMenu(e,t="first"){if(this.menuLayer!==null)return;let r=this.effectiveColumns.filter(a=>a.hideable!==!1).map(a=>({id:a.id,label:a.label})),n=Gt().open({anchor:e,presentation:"popover",className:this.columnMenuPanelClass||void 0,trapFocus:!1,restoreFocus:!1}),o=document.createElement(bt);o.columns=r,o.hiddenColumns=[...this.effectiveHidden],o.initialFocus=t,o.addEventListener(ti,this.onColumnMenuCheck),o.addEventListener("mndwpaneldismiss",this.onColumnMenuDismiss),n.contentElement.appendChild(o),this.menuLayer=n,this.menuTrigger=e,this.columnMenuOpen=!0,o.updateComplete.then(()=>{this.menuLayer===n&&(n.reposition(),this.cancelMenuFocusRetry=bn(o,()=>o.focusInitialOption(),()=>this.menuLayer===n,()=>{}))}),n.closed.then(()=>{this.forgetColumnMenu()})}closeColumnMenu(){this.menuLayer?.close(),this.forgetColumnMenu()}forgetColumnMenu(){this.cancelMenuFocusRetry?.(),this.cancelMenuFocusRetry=null,this.menuLayer=null,this.menuTrigger=null,this.columnMenuOpen=!1}onColumnMenuCheck=e=>{let t=e.detail.hidden;if(this.hiddenColumns!==void 0){this.applyColumnVisibility(t);return}this.visibilityState.applyInternal(t),this.internalVisibilityNeedsReconcile=!0,this.requestUpdate(),this.applyColumnVisibility(t)};onColumnMenuDismiss=e=>{let t=e.detail,r=this.menuLayer;if(t.defer&&r){let o=this.menuTrigger,a=o===null?null:this.tabDestination(o,t.tabDirection??"forward");window.setTimeout(()=>{this.menuLayer===r&&(this.closeColumnMenu(),a!==null&&r.closed.then(()=>{a.isConnected&&a.focus()}))},0);return}let n=this.menuTrigger;this.closeColumnMenu(),t.restoreFocus&&n?.focus()};tabDestination(e,t){let r=me(document.body),n=r.indexOf(e);if(n<0||r.length<2)return null;let a=(n+(t==="forward"?1:-1)+r.length)%r.length;return r[a]??null}};function Pa(){function i(e){return e}return i}var Da=[[Er,ze],[kr,Ge],[Pr,qe],[Vt,We],[Or,je],[Fr,Ye],[Ar,Be],[Je,Xe],[qr,rt],[et,Qe],[Gr,tt],[Le,it],[jr,ot],[Rr,Ue],[Xr,at],[Lr,Ke],[Jr,st],[ke,lt],[G,dt],[Zr,ct],[Qr,ut],[Xt,pt],[ft,vt],[bt,mt]];function Yc(i){i?.initialLocale!==void 0&&Sr(i.initialLocale),i?.overlay&&yn(ln(i.overlay)),i?.iconSpriteUrl!==void 0&&Qi(i.iconSpriteUrl);for(let[e,t]of Da)customElements.get(e)||customElements.define(e,t)}export{W as DETAIL_COL_ID,L as LocaleController,Er as MNDW_BAR_CHART_TAG,kr as MNDW_BUTTON_TAG,Pr as MNDW_CHECKBOX_TAG,bt as MNDW_COLUMN_MENU_TAG,ni as MNDW_COLUMN_VISIBILITY_CHANGE_EVENT,oi as MNDW_ERROR_EVENT,Vt as MNDW_FIELD_TAG,Rr as MNDW_HEAT_STRIP_TAG,ji as MNDW_ICON_NAMES,Or as MNDW_ICON_TAG,Fr as MNDW_INPUT_TAG,an as MNDW_INPUT_TYPES,Ht as MNDW_LABEL_CHANGE_EVENT,Ar as MNDW_LINE_CHART_TAG,Ze as MNDW_OPTION_CHANGE_EVENT,Je as MNDW_OPTION_TAG,ai as MNDW_ROW_EXPAND_EVENT,ii as MNDW_ROW_REORDER_EVENT,qr as MNDW_SCROLL_AREA_TAG,jr as MNDW_SEGMENTED_TAG,nt as MNDW_SEGMENT_CHANGE_EVENT,Le as MNDW_SEGMENT_TAG,Jt as MNDW_SELECTION_CHANGE_EVENT,et as MNDW_SELECT_PANEL_TAG,Gr as MNDW_SELECT_TAG,Xr as MNDW_SLIDER_TAG,ri as MNDW_SORT_CHANGE_EVENT,Lr as MNDW_SPARKLINE_TAG,Jr as MNDW_SWITCH_TAG,ft as MNDW_TABLE_TAG,Zr as MNDW_TABS_TAG,ke as MNDW_TAB_PANEL_TAG,G as MNDW_TAB_TAG,Qr as MNDW_TEXTAREA_TAG,Xt as MNDW_TOOLTIP_TAG,zo as MOBILE_OVERLAY_MAX_WIDTH,ze as MndwBarChart,Ge as MndwButton,qe as MndwCheckbox,mt as MndwColumnMenu,We as MndwField,Ue as MndwHeatStrip,je as MndwIcon,Ye as MndwInput,Be as MndwLineChart,Xe as MndwOption,rt as MndwScrollArea,it as MndwSegment,ot as MndwSegmented,tt as MndwSelect,Qe as MndwSelectPanel,at as MndwSlider,Ke as MndwSparkline,st as MndwSwitch,dt as MndwTab,lt as MndwTabPanel,vt as MndwTable,ct as MndwTabs,ut as MndwTextarea,pt as MndwTooltip,Uo as POPOVER_ANCHOR_GAP,Bt as POPOVER_FLIP_ORDER,Go as SELECT_ANCHOR_GAP,Ko as SELECT_MOBILE_MAX_WIDTH,Hr as SELECT_VIEWPORT_PADDING,Bo as VIEWPORT_PADDING,Br as availablePopoverHeight,Yo as coercePlacement,Pa as column,pe as composedContains,Vr as computePopoverCoords,zr as computeTooltipCoords,Kt as createFocusTrap,X as createGeneratedAttribute,O as createLocalizedProperty,J as deepActiveElement,Yc as defineMndwUi,vo as formatSpeed,xr as getMndwUiLocale,y as getMndwUiText,go as getSpeedUpperLimit,jo as isMobileSheet,en as mndwIconHref,Zo as resolveSizing,Ur as selectPresentation,Sr as setMndwUiLocale,Nr as subscribeMndwIconSprite,Cr as subscribeMndwUiLocale,me as tabbableElements};
1771
+ ></mndw-checkbox>`}expandedSet(){return new Set(this.expanded)}getVirtualizer(){return this.virtualizer===null&&(this.virtualizer=new rr({estimatedRowHeight:this.normalizedEstimatedRowHeight(),detailEstimate:160})),this.virtualizer}captureCurrentAnchor(){if(!this.isVirtualRenderingActive()||this.virtualizer===null)return;let e=this.viewportElement(),t=this.headerElement();return e===null||t===null?void 0:this.virtualizer.captureAnchor(this.bodyScrollOffset(e,t))}logicalStructureSignature(e,t){return[e.map(r=>E(this.rowKey,r)).join("\0"),[...t].join("\0")].join("")}configureGeometryMode(){if(!this.virtual){this.setVirtualInactiveReason(null),this.teardownGeometry();return}if(this.resizeObserver===null&&!this.observerAttempted&&(this.observerAttempted=!0,this.resizeObserver=this.geometryProvider.createResizeObserver(this.handleGeometryResize)),this.resizeObserver===null){this.setVirtualInactiveReason("resize-observer-unavailable");return}if(this.reorderable){this.teardownGeometry(),this.setVirtualInactiveReason("reorderable");return}this.setVirtualInactiveReason(null)}configureLayoutMode(){this.virtual&&this.layout==="auto"?this.setAttribute("data-mndw-layout-inactive","virtual"):this.removeAttribute("data-mndw-layout-inactive")}isVirtualRenderingActive(){return this.virtual&&!this.reorderable&&this.resizeObserver!==null}setVirtualInactiveReason(e){e===null?this.removeAttribute("data-mndw-virtual-inactive"):(this.setAttribute("data-mndw-virtual-inactive",e),this.warnedInactiveReason!==e&&(this.warnedInactiveReason=e,console.warn(`<${vt}> virtualization inactive: ${e}`)))}updateVirtualWindow(e=!0){if(!this.isVirtualRenderingActive()||this.virtualizer===null)return;let t=this.viewportElement(),r=this.headerElement(),n=t===null||r===null?0:this.bodyScrollOffset(t,r),o=t===null?0:this.geometryProvider.getViewportClientHeight(t);this.virtualRange=this.virtualizer.range(n,o,this.normalizedOverscan());let a=this.displayRows.slice(this.virtualRange.start,this.virtualRange.end);if(t!==null&&this.windowRows!==a){let s=this.windowRows.map(c=>E(this.rowKey,c)).join("\0"),l=a.map(c=>E(this.rowKey,c)).join("\0");s!==l&&this.evacuateFocusBeforeWindowRemoval(t,this.windowRows,a)}this.windowRows=a,e&&this.reconcileVisibleCells(!1)}reconcileVisibleCells(e,t){let r=t??new Set(this.effectiveColumns.filter(o=>!this.effectiveHidden.has(o.id)).map(o=>o.id)),n=[this.windowRows.map(o=>E(this.rowKey,o)).join("\0"),[...r].join("\0"),[...this.expandedSet()].join("\0")].join("");!e&&n===this.lastCellReconcileSignature||(this.cellRegistry?.reconcile(this.windowRows,o=>E(this.rowKey,o),this.effectiveColumns,r,nr,this.expandedSet(),this.expandedRenderer),this.lastCellReconcileSignature=n)}bodyScrollOffset(e,t){return Math.max(0,this.geometryProvider.getViewportScrollTop(e)-this.geometryProvider.measure(t).height)}writeBodyScrollOffset(e,t,r){if(this.virtualizer===null)return;let n=this.geometryProvider.measure(t).height,o=this.geometryProvider.getViewportClientHeight(e),a=this.geometryProvider.getViewportScrollTop(e),s=this.virtualizer.range(this.bodyScrollOffset(e,t),o,this.normalizedOverscan()).totalHeight,l=Math.max(0,n+s-o),c=r<=0&&a<n?a:n+Math.max(0,r),d=Math.min(l,Math.max(0,c));this.expectedProgrammaticScrollTop=d,this.geometryProvider.setViewportScrollTop(e,d)}syncGeometryTargets(){let e=this.resizeObserver,t=this.viewportElement(),r=this.headerElement();if(e===null||t===null||r===null)return;let n=new Map;n.set(t,{kind:"viewport"}),n.set(r,{kind:"header"});for(let o of this.shadowRoot?.querySelectorAll('[part="row"]')??[]){let a=o.getAttribute("data-row-key");a!==null&&a!==""&&n.set(o,{kind:"summary",rowKey:a})}for(let o of this.shadowRoot?.querySelectorAll('[part="detail-row"]')??[]){let a=o.getAttribute("data-row-key");a!==null&&a!==""&&n.set(o,{kind:"detail",rowKey:a})}for(let o of this.observedElements)n.has(o)||(e.unobserve(o),this.observedElements.delete(o));for(let[o,a]of n)Hn(o,a),this.observedElements.has(o)||(e.observe(o),this.observedElements.add(o));this.observedViewport!==t&&(this.observedViewport?.removeEventListener("scroll",this.handleViewportScroll),t.addEventListener("scroll",this.handleViewportScroll),this.observedViewport=t)}unobserveStaleGeometryTargets(){if(this.resizeObserver===null)return;let e=new Set(this.windowRows.map(r=>E(this.rowKey,r))),t=this.expandedSet();for(let r of this.observedElements){let n=tr(r);(n?.kind==="summary"&&!e.has(n.rowKey)||n?.kind==="detail"&&(!e.has(n.rowKey)||!t.has(n.rowKey)))&&(this.resizeObserver.unobserve(r),this.observedElements.delete(r))}}scheduleGeometryFrame(){!this.isVirtualRenderingActive()||this.pendingGeometryFrame!==null||(this.pendingGeometryFrame=this.geometryProvider.requestAnimationFrame(this.handleGeometryFrame))}handleGeometryResize=()=>{this.scheduleGeometryFrame()};handleViewportScroll=()=>{let e=this.observedViewport;if(e!==null&&this.expectedProgrammaticScrollTop!==void 0){let t=this.geometryProvider.getViewportScrollTop(e);if(Math.abs(t-this.expectedProgrammaticScrollTop)<=.25){this.expectedProgrammaticScrollTop=void 0,this.scheduleGeometryFrame();return}}this.pendingScrollTarget=null,this.scheduleGeometryFrame()};handleGeometryFrame=()=>{if(this.pendingGeometryFrame=null,!this.isConnected||!this.isVirtualRenderingActive()||this.virtualizer===null)return;let e=this.viewportElement(),t=this.headerElement();if(e===null||t===null)return;this.geometryProvider.measure(e);let r=this.geometryProvider.measure(t),n=this.geometryProvider.getViewportContentWidth(e),o=this.bodyScrollOffset(e,t),a=this.virtualizer.captureAnchor(o),s=!1;this.lastViewportContentWidth===void 0?this.lastViewportContentWidth=n:Number.isFinite(n)&&Math.abs(n-this.lastViewportContentWidth)>=i.WIDTH_EPSILON&&(this.lastViewportContentWidth=n,this.virtualizer.resetWidthEpoch(),s=!0);for(let b of this.observedElements){let S=tr(b);S?.kind==="summary"?s=this.virtualizer.recordSummaryMeasurement(S.rowKey,this.geometryProvider.measure(b).height)||s:S?.kind==="detail"&&(s=this.virtualizer.recordDetailMeasurement(S.rowKey,this.geometryProvider.measure(b).height)||s)}let l=Math.max(0,this.geometryProvider.getViewportScrollTop(e)-r.height),c=this.virtualizer.range(l,this.geometryProvider.getViewportClientHeight(e),this.normalizedOverscan()),d=this.windowRows.map(b=>E(this.rowKey,b)).join("\0"),h=this.displayRows.slice(c.start,c.end),p=h.map(b=>E(this.rowKey,b)).join("\0");d!==p&&this.evacuateFocusBeforeWindowRemoval(e,this.windowRows,h),this.virtualRange=c,this.windowRows=h,this.reconcileVisibleCells(!1);let f=!1;if(this.pendingScrollTarget!==null){let b=this.pendingScrollTarget;if([...this.observedElements].find(C=>{let T=tr(C);return T?.kind==="summary"&&T.rowKey===b.key})!==void 0){let C=this.virtualizer.offsetForRow(b.key,b.align,this.geometryProvider.getViewportClientHeight(e),l);C!==void 0&&this.writeBodyScrollOffset(e,t,C),this.pendingScrollTarget=null,f=!0}}if(s&&!f&&a!==void 0){let b=Math.max(0,c.totalHeight-this.geometryProvider.getViewportClientHeight(e)),S=this.virtualizer.restoreAnchor(a,b);this.writeBodyScrollOffset(e,t,S)}(s||d!==p)&&this.requestUpdate()};teardownGeometry(){if(this.observedViewport?.removeEventListener("scroll",this.handleViewportScroll),this.observedViewport=null,this.resizeObserver!==null){for(let e of this.observedElements)this.resizeObserver.unobserve(e);this.resizeObserver.disconnect(),this.resizeObserver=null}this.observedElements.clear(),this.observerAttempted=!1,this.pendingGeometryFrame!==null&&(this.geometryProvider.cancelAnimationFrame(this.pendingGeometryFrame),this.pendingGeometryFrame=null),this.lastViewportContentWidth=void 0,this.expectedProgrammaticScrollTop=void 0}normalizedEstimatedRowHeight(){return Number.isFinite(this.estimatedRowHeight)&&this.estimatedRowHeight>0?this.estimatedRowHeight:49}normalizedOverscan(){return Number.isFinite(this.overscan)&&this.overscan>=0?this.overscan:400}viewportElement(){return this.shadowRoot?.querySelector('[part="viewport"]')??null}headerElement(){return this.shadowRoot?.querySelector('[part="header-row"]')??null}collectFocusChain(){let e=[],t=document.activeElement;for(;t!==null;){e.push({rowKey:this.focusedRowKeyForElement(t)});let r=t.shadowRoot?.activeElement;if(!(r instanceof Element)||r===t)break;t=r}return e}focusedRowKeyForElement(e){let t=this.cellRegistry?.getRowKeyForNode(e);return t!==void 0?t:e.closest('[part="row"], [part="detail-row"]')?.getAttribute("data-row-key")??void 0}evacuateFocusBeforeWindowRemoval(e,t,r){let n=new Set(t.map(s=>E(this.rowKey,s))),o=new Set(r.map(s=>E(this.rowKey,s))),a=In(this.collectFocusChain());a!==void 0&&n.has(a)&&!o.has(a)&&e.focus()}shouldRenderLeadingToggle(){return this.expandable&&this.toggleAfterColumn===void 0&&this.toggleCell==="leading"}shouldRenderTrailingToggle(){return this.expandable&&this.toggleAfterColumn===void 0&&this.toggleCell==="trailing"}shouldRenderToggleAfter(e){return this.expandable&&this.toggleAfterColumn===e}leadingUtilityKeys(){let e=[];return this.shouldRenderLeadingToggle()&&e.push(i.PIN_KEYS.expandLead),this.selectable&&e.push(i.PIN_KEYS.select),this.reorderable&&this.effectiveSortState===null&&e.push(i.PIN_KEYS.drag),e}computePinState(){let e=this.effectiveColumns.filter(a=>!this.effectiveHidden.has(a.id)),t=[],r=null,n=null;for(let a of e){if(a.sticky!=="start")break;if(a.width===void 0){r="missing-width",n=a.id;break}t.push({...a,width:a.width})}if(r===null){let a=e.slice(t.length).find(s=>s.sticky==="start");a!==void 0&&(r="not-leading",n=a.id)}let o=new Map;if(t.length>0){let a=[...this.leadingUtilityKeys().map(l=>({key:l,width:i.UTILITY_COL_WIDTH})),...t.map(l=>({key:l.id,width:l.width}))],s=[];a.forEach((l,c)=>{let d=s.length===0?"0":s.length===1?s[0]:`calc(${s.join(" + ")})`;o.set(l.key,{insetInlineStart:d,isLast:c===a.length-1}),s.push(l.width)})}return{byKey:o,inactiveReason:r,inactiveColumnId:n}}applyStickyInactive(e){if(e.inactiveReason===null){this.removeAttribute("data-mndw-sticky-inactive"),this.warnedStickyReason=null;return}this.setAttribute("data-mndw-sticky-inactive",e.inactiveReason);let t=`${e.inactiveReason}:${e.inactiveColumnId??""}`;this.warnedStickyReason!==t&&(this.warnedStickyReason=t,console.warn(`<${vt}> sticky column "${e.inactiveColumnId??""}" inactive: ${e.inactiveReason}`))}tableStyle(){return this.minWidth===""?m:`min-width: ${this.minWidth};`}columnStyle(e){let t=this.pinState.byKey.get(e.id),r=[];return e.width!==void 0&&r.push(`width: ${e.width};`),t!==void 0&&e.width!==void 0&&r.push(`min-width: ${e.width};`,`max-width: ${e.width};`,"box-sizing: border-box;",`inset-inline-start: ${t.insetInlineStart};`),r.length===0?m:r.join(" ")}pinClasses(e){let t=this.pinState.byKey.get(e);return t===void 0?[]:t.isLast?["pinned","pinned-last"]:["pinned"]}utilityPinStyle(e){let t=this.pinState.byKey.get(e);if(t===void 0)return m;let r=i.UTILITY_COL_WIDTH;return`width: ${r}; min-width: ${r}; max-width: ${r}; box-sizing: border-box; inset-inline-start: ${t.insetInlineStart};`}columnSpan(){let e=this.effectiveColumns.filter(t=>!this.effectiveHidden.has(t.id)).length;return(this.expandable?1:0)+(this.selectable?1:0)+(this.reorderable&&this.effectiveSortState===null?1:0)+e+(this.columnMenu?1:0)}alignClassList(e){let t=[];return e.align==="end"&&t.push("align-end"),e.align==="center"&&t.push("align-center"),e.nowrap===!0&&t.push("nowrap"),t}toneColor(e){return`var(--mndw-${e==="neutral"?"text-muted":e})`}resolveLabels(){return{...Oa(),...this.labels}}rowName(e,t){return this.rowLabel?.(e)??this.resolveLabels().rowFallback(t+1)}sameSortState(e,t){return e?.columnId===t?.columnId&&e?.direction===t?.direction}logicalRowCount(){let e=this.expandedSet(),t=new Set(this.displayRows.map(n=>E(this.rowKey,n))),r=[...e].filter(n=>t.has(n)).length;return 1+this.displayRows.length+r}logicalRowIndex(e,t){let r=2,n=this.expandedSet();for(let o of this.displayRows){let a=E(this.rowKey,o);if(a===e)return t?r+1:r;r+=1,n.has(a)&&(r+=1)}return r}locale(){return document.documentElement.lang||"en"}isAllSelected(){return or(this.selectedKeySet,this.displayRows.map(e=>E(this.rowKey,e)))==="all"}isIndeterminate(){return or(this.selectedKeySet,this.displayRows.map(e=>E(this.rowKey,e)))==="indeterminate"}emitErrorIfChanged(){let e=JSON.stringify(this.violations);e!==this.lastViolationSignature&&(this.lastViolationSignature=e,this.violations.length!==0&&this.dispatchEvent(new CustomEvent(oi,{...ve,detail:{violations:this.violations}})))}handleCheckboxChange=e=>{let t=e.composedPath()[0]??null;if(t===null)return;if(t.hasAttribute("data-select-all")){let n=this.displayRows.map(a=>E(this.rowKey,a)),o=to(this.selected,n);this.dispatchEvent(new CustomEvent(Qt,{...ve,detail:{selected:o}}));return}let r=t.getAttribute("data-row-key");if(r!==null){let n=eo(this.selected,r);this.dispatchEvent(new CustomEvent(Qt,{...ve,detail:{selected:n}}))}};handleClick=e=>{let t=e.composedPath().find(a=>a instanceof HTMLElement)??null,r=t?.closest?.('[part="expand-toggle"]');if(r!=null){this.emitExpand(r.getAttribute("data-expand-key")??"");return}if(this.expandable&&this.expandOn==="row"){let a=e.composedPath();if(!a.some(l=>l instanceof HTMLElement&&(l.tagName==="BUTTON"||l.tagName==="A"||l.tagName==="INPUT"||l.tagName==="MNDW-CHECKBOX"||l.getAttribute("part")==="drag-handle"||l.hasAttribute("data-no-expand")))){let l=a.find(d=>d instanceof HTMLElement&&d.getAttribute("part")==="row"),c=l instanceof HTMLElement?l.getAttribute("data-row-key"):null;c!=null&&c!==""&&this.emitExpand(c)}}let n=t?.closest?.("[data-sort-column]");if(n!=null){this.activateSort(n.getAttribute("data-sort-column")??"");return}let o=t?.closest?.('[part="column-menu-trigger"]');o instanceof HTMLElement&&this.openColumnMenu(o)};emitExpand(e){let t=new Set(this.expanded);t.has(e)?t.delete(e):t.add(e),this.dispatchEvent(new CustomEvent(ai,{...ve,detail:{expanded:[...t]}}))}handleKeyDown=e=>{let t=e.composedPath().find(n=>n instanceof HTMLElement&&n.getAttribute("part")==="column-menu-trigger");if(t&&(e.key==="ArrowDown"||e.key==="ArrowUp")){e.preventDefault(),this.openColumnMenu(t,e.key==="ArrowUp"?"last":"first");return}let r=e.composedPath()[0]??null;r?.getAttribute("part")==="drag-handle"&&(e.key==="ArrowUp"||e.key==="ArrowDown")&&(e.preventDefault(),this.keyboardReorder(r.getAttribute("data-row-key")??"",e.key==="ArrowUp"?-1:1))};activateSort(e){if(this.effectiveColumns.find(n=>n.id===e)?.sortable!==!0)return;let r=Zn(this.sort,e);this.dispatchEvent(new CustomEvent(ri,{...ve,detail:{sort:r}}))}keyboardReorder(e,t){let r=this.displayRows.findIndex(s=>E(this.rowKey,s)===e);if(r===-1)return;let n=r+t;if(n<0||n>=this.displayRows.length)return;let o=t===-1?n:n+1,a=o<this.displayRows.length?E(this.rowKey,this.displayRows[o]):null;this.emitReorder(e,a)}emitReorder(e,t){let r=this.resolveLabels(),n=this.displayRows.find(o=>E(this.rowKey,o)===e);this.announceText=n===void 0?"":r.reordered(this.rowName(n,this.displayRows.indexOf(n)),this.displayRows.indexOf(n)+1,this.displayRows.length),this.dispatchEvent(new CustomEvent(ii,{...ve,detail:{key:e,beforeKey:t}}))}applyColumnVisibility(e){this.dispatchEvent(new CustomEvent(ni,{...ve,detail:{hidden:e}}))}getVisibleColumnIds(){return this.effectiveColumns.filter(e=>!this.effectiveHidden.has(e.id)).map(e=>e.id)}scrollToRow(e,t={}){if(!this.displayRows.some(c=>E(this.rowKey,c)===e))return!1;let n=this.viewportElement(),o=this.headerElement();if(n===null||o===null)return!1;let a=this.getVirtualizer();a.configure({estimatedRowHeight:this.normalizedEstimatedRowHeight(),detailEstimate:160}),a.setRows(this.displayRows.map(c=>E(this.rowKey,c)),this.expandedSet());let s=t.align??"nearest",l=a.offsetForRow(e,s,this.geometryProvider.getViewportClientHeight(n),this.bodyScrollOffset(n,o));return l===void 0?!1:(this.isVirtualRenderingActive()&&(this.pendingScrollTarget={key:e,align:s}),this.writeBodyScrollOffset(n,o,l),this.updateVirtualWindow(),this.isVirtualRenderingActive()&&this.requestUpdate(),!0)}openColumnMenu(e,t="first"){if(this.menuLayer!==null)return;let r=this.effectiveColumns.filter(s=>s.hideable!==!1).map(s=>({id:s.id,label:s.label})),n=++this.menuOpenGeneration,o=qt().open({anchor:e,presentation:"popover",className:this.columnMenuPanelClass||void 0,trapFocus:!1,restoreFocus:!1}),a=document.createElement(ft);a.columns=r,a.hiddenColumns=[...this.effectiveHidden],a.initialFocus=t,a.addEventListener(ti,this.onColumnMenuCheck),a.addEventListener("mndwpaneldismiss",this.onColumnMenuDismiss),o.contentElement.appendChild(a),this.menuLayer=o,this.menuTrigger=e,this.columnMenuOpen=!0,a.updateComplete.then(()=>{this.menuLayer===o&&(o.reposition(),this.cancelMenuFocusRetry=fn(a,()=>a.focusInitialOption(),()=>this.menuLayer===o,()=>{}))}),o.closed.then(s=>{let l=this.menuLayer===o;l&&this.forgetColumnMenu(),n===this.menuOpenGeneration&&(l||this.menuLayer===null)&&(s==="escape"||s==="api"&&this.menuApiCloseHadFocus.get(o)===!0)&&this.restoreColumnMenuFocus(e)})}closeColumnMenu(e=!0){let t=this.menuLayer;t!==null&&(this.menuApiCloseHadFocus.set(t,e&&Q(t.contentElement,document.activeElement)),t.close()),this.forgetColumnMenu()}restoreColumnMenuFocus(e){let t=this.shadowRoot?.querySelector('[part="column-menu-trigger"]')??e;this.isConnected&&t.isConnected&&U()!==t&&t.focus()}forgetColumnMenu(){this.cancelMenuFocusRetry?.(),this.cancelMenuFocusRetry=null,this.menuLayer=null,this.menuTrigger=null,this.columnMenuOpen=!1}onColumnMenuCheck=e=>{let t=e.detail.hidden;if(this.hiddenColumns!==void 0){this.applyColumnVisibility(t);return}this.visibilityState.applyInternal(t),this.internalVisibilityNeedsReconcile=!0,this.requestUpdate(),this.applyColumnVisibility(t)};onColumnMenuDismiss=e=>{let t=e.detail,r=this.menuLayer;if(t.defer&&r){let o=this.menuTrigger,a=this.menuOpenGeneration,s=o===null?null:this.tabDestination(o,t.tabDirection??"forward");window.setTimeout(()=>{this.menuLayer===r&&(this.closeColumnMenu(!1),s!==null&&r.closed.then(()=>{a===this.menuOpenGeneration&&s.isConnected&&s.focus()}))},0);return}let n=this.menuTrigger;this.closeColumnMenu(),t.restoreFocus&&n?.focus()};tabDestination(e,t){let r=be(document.body),n=r.indexOf(e);if(n<0||r.length<2)return null;let a=(n+(t==="forward"?1:-1)+r.length)%r.length;return r[a]??null}};function Na(){function i(e){return e}return i}var $a=[[Tr,Ue],[kr,Ge],[_r,je],[Ut,qe],[Nr,Ye],[Fr,Xe],[Rr,Ke],[Ze,Je],[qr,it],[tt,et],[Wr,rt],[Pe,nt],[jr,at],[Ar,Be],[Xr,st],[Lr,We],[Jr,lt],[_e,dt],[G,ct],[Zr,ut],[Qr,ht],[Zt,mt],[vt,gt],[ft,bt]];function Zc(i){i?.initialLocale!==void 0&&Sr(i.initialLocale),i?.overlay&&Sn(dn(i.overlay)),i?.iconSpriteUrl!==void 0&&en(i.iconSpriteUrl);for(let[e,t]of $a)customElements.get(e)||customElements.define(e,t)}export{q as DETAIL_COL_ID,L as LocaleController,Tr as MNDW_BAR_CHART_TAG,kr as MNDW_BUTTON_TAG,_r as MNDW_CHECKBOX_TAG,ft as MNDW_COLUMN_MENU_TAG,ni as MNDW_COLUMN_VISIBILITY_CHANGE_EVENT,oi as MNDW_ERROR_EVENT,Ut as MNDW_FIELD_TAG,Ar as MNDW_HEAT_STRIP_TAG,Yi as MNDW_ICON_NAMES,Nr as MNDW_ICON_TAG,Fr as MNDW_INPUT_TAG,sn as MNDW_INPUT_TYPES,zt as MNDW_LABEL_CHANGE_EVENT,Rr as MNDW_LINE_CHART_TAG,Qe as MNDW_OPTION_CHANGE_EVENT,Ze as MNDW_OPTION_TAG,ai as MNDW_ROW_EXPAND_EVENT,ii as MNDW_ROW_REORDER_EVENT,qr as MNDW_SCROLL_AREA_TAG,jr as MNDW_SEGMENTED_TAG,ot as MNDW_SEGMENT_CHANGE_EVENT,Pe as MNDW_SEGMENT_TAG,Qt as MNDW_SELECTION_CHANGE_EVENT,tt as MNDW_SELECT_PANEL_TAG,Wr as MNDW_SELECT_TAG,Xr as MNDW_SLIDER_TAG,ri as MNDW_SORT_CHANGE_EVENT,Lr as MNDW_SPARKLINE_TAG,Jr as MNDW_SWITCH_TAG,vt as MNDW_TABLE_TAG,Zr as MNDW_TABS_TAG,_e as MNDW_TAB_PANEL_TAG,G as MNDW_TAB_TAG,Qr as MNDW_TEXTAREA_TAG,Zt as MNDW_TOOLTIP_TAG,Ko as MOBILE_OVERLAY_MAX_WIDTH,Ue as MndwBarChart,Ge as MndwButton,je as MndwCheckbox,bt as MndwColumnMenu,qe as MndwField,Be as MndwHeatStrip,Ye as MndwIcon,Xe as MndwInput,Ke as MndwLineChart,Je as MndwOption,it as MndwScrollArea,nt as MndwSegment,at as MndwSegmented,rt as MndwSelect,et as MndwSelectPanel,st as MndwSlider,We as MndwSparkline,lt as MndwSwitch,ct as MndwTab,dt as MndwTabPanel,gt as MndwTable,ut as MndwTabs,ht as MndwTextarea,mt as MndwTooltip,Wo as POPOVER_ANCHOR_GAP,Wt as POPOVER_FLIP_ORDER,jo as SELECT_ANCHOR_GAP,qo as SELECT_MOBILE_MAX_WIDTH,Hr as SELECT_VIEWPORT_PADDING,Go as VIEWPORT_PADDING,Br as availablePopoverHeight,Zo as coercePlacement,Na as column,Q as composedContains,Vr as computePopoverCoords,zr as computeTooltipCoords,Gt as createFocusTrap,Z as createGeneratedAttribute,N as createLocalizedProperty,U as deepActiveElement,Zc as defineMndwUi,yo as formatSpeed,xr as getMndwUiLocale,w as getMndwUiText,So as getSpeedUpperLimit,Jo as isMobileSheet,tn as mndwIconHref,ta as resolveSizing,Ur as selectPresentation,Sr as setMndwUiLocale,Or as subscribeMndwIconSprite,Cr as subscribeMndwUiLocale,be as tabbableElements};
1757
1772
  /*! Bundled license information:
1758
1773
 
1759
1774
  @lit/reactive-element/css-tag.js: