nish-ui 3.1.0 → 3.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 (56) hide show
  1. package/README.md +6 -3
  2. package/dist/chart.js +2 -2
  3. package/dist/elements-all.js +28 -28
  4. package/dist/elements-charts.d.ts +1 -1
  5. package/dist/elements-charts.js +22 -22
  6. package/dist/elements-data.js +2 -2
  7. package/dist/elements-forms.js +8 -8
  8. package/dist/elements.js +3 -3
  9. package/dist/esm/chart-values.js +2 -1
  10. package/dist/esm/combobox-filter.js +6 -5
  11. package/dist/esm/command-filter.js +32 -0
  12. package/dist/esm/components/accordion.js +2 -1
  13. package/dist/esm/components/app-shell.js +1 -1
  14. package/dist/esm/components/breadcrumbs.js +1 -1
  15. package/dist/esm/components/calendar-base.js +1 -1
  16. package/dist/esm/components/combobox.js +2 -2
  17. package/dist/esm/components/command.js +5 -5
  18. package/dist/esm/components/data-classes.js +18 -4
  19. package/dist/esm/components/display.js +4 -4
  20. package/dist/esm/components/feedback.js +1 -1
  21. package/dist/esm/components/file-dropzone.js +23 -1
  22. package/dist/esm/components/flow.js +4 -4
  23. package/dist/esm/components/forms-classes.js +1 -1
  24. package/dist/esm/components/forms.js +6 -4
  25. package/dist/esm/components/inbox.js +4 -1
  26. package/dist/esm/components/menu.js +4 -0
  27. package/dist/esm/components/multi-select.js +2 -2
  28. package/dist/esm/components/nav-classes.js +9 -0
  29. package/dist/esm/components/nav.js +2 -1
  30. package/dist/esm/components/primitives-classes.js +4 -4
  31. package/dist/esm/components/primitives.js +1 -1
  32. package/dist/esm/components/radio-group.js +1 -1
  33. package/dist/esm/components/resource-classes.js +7 -3
  34. package/dist/esm/components/resource.js +3 -2
  35. package/dist/esm/components/settings.js +5 -1
  36. package/dist/esm/components/tabs.js +3 -2
  37. package/dist/esm/components/toast-store.js +16 -4
  38. package/dist/esm/components/url-state.js +2 -1
  39. package/dist/esm/format.js +24 -2
  40. package/dist/esm/runtime.js +9 -2
  41. package/dist/esm/split-layout.js +2 -1
  42. package/dist/format.js +33 -5
  43. package/dist/inbox-client.d.ts +5 -1
  44. package/dist/inbox-client.js +0 -1
  45. package/dist/index.d.ts +7 -4
  46. package/dist/nish-components.css +11 -2
  47. package/dist/nish-components.min.css +1 -1
  48. package/dist/server/hono.d.ts +1 -1
  49. package/dist/server/hono.js +91 -7
  50. package/dist/server/index.d.ts +20 -12
  51. package/dist/server/index.js +117 -27
  52. package/dist/{spa-7myD4xvA.d.ts → spa-BfRDo38r.d.ts} +32 -4
  53. package/dist/split-layout.js +2 -2
  54. package/dist/theme.global.js +9 -4
  55. package/dist/theme.js +9 -3
  56. package/package.json +1 -1
package/dist/elements.js CHANGED
@@ -1,7 +1,7 @@
1
- var Xt=["emerald","indigo","amber","lime","rose","sky","violet","teal"],Wn=["accent","ok","loss","warn","info",...Xt],G={emerald:"#34d399",indigo:"#8b93ff",amber:"#fbbf24",lime:"#a3e635",rose:"#fb7185",sky:"#38bdf8",violet:"#c084fc",teal:"#2dd4bf"},Zt={emerald:"#046d4f",indigo:"#4e45e3",amber:"#9b4708",lime:"#41690d",rose:"#b8113a",sky:"#036499",violet:"#7e22ce",teal:"#0e6b64"},Jt=["#8b93ff","#34d399","#fbbf24","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"],Qt=["#6366f1","#059669","#c96d06","#f43f5e","#0284c7","#a855f7","#ea580c","#5a910c"],P=t=>Object.fromEntries(t.map((e,n)=>[`chart-${n+1}`,e])),en={dark:{label:"Dark",scheme:"dark",colors:{bg:"#0a0b0f",surface:"#111218",elevated:"#191b23",overlay:"#22252f",line:"#262935","line-strong":"#3a3e4d","line-control":"#666975",hi:"#ececf1",hi2:"#a8aab7",hi3:"#8a8d9b",ghost:"#6b6e7c",accent:"#8b93ff",accent2:"#c084fc","on-accent":"#0a0b0f",ok:"#34d399",loss:"#f87171",warn:"#fbbf24",info:"#38bdf8",scrim:"#000000","invert-bg":"#ececf1","invert-text":"#111218",...P(Jt),...G}},light:{label:"Light",scheme:"light",colors:{bg:"#f7f6f3",surface:"#ffffff",elevated:"#f1f0ec",overlay:"#e6e4de",line:"#e2e0da","line-strong":"#c9c6bd","line-control":"#8a8881",hi:"#17171c",hi2:"#4f515c",hi3:"#626470",ghost:"#8a8c98",accent:"#4338ca",accent2:"#7e22ce","on-accent":"#ffffff","on-accent2":"#ffffff","on-ok":"#0a0a0c","on-loss":"#ffffff","on-warn":"#0a0a0c","on-info":"#0a0a0c",ok:"#065f46","ok-fill":"#059669","loss-fill":"#dc2626","warn-fill":"#c96d06","info-fill":"#0284c7",loss:"#a91b1b",warn:"#92400e",info:"#075985",scrim:"#17171c","invert-bg":"#17171c","invert-text":"#f7f6f3",...P(Qt),...Zt}},slate:{label:"Slate",scheme:"dark",colors:{bg:"#18181b",surface:"#202024",elevated:"#2c2c32",overlay:"#36363d",line:"#3a3a42","line-strong":"#52525b","line-control":"#77777e",hi:"#f4f4f5",hi2:"#b8b8c0",hi3:"#a0a0a8",ghost:"#71717a",accent:"#a5b4fc",accent2:"#c084fc","on-accent":"#18181b",ok:"#4ade80",loss:"#fda4af",warn:"#facc15",info:"#38bdf8",scrim:"#000000","invert-bg":"#f4f4f5","invert-text":"#202024",...P(["#818cf8","#4ade80","#facc15","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"]),...G,indigo:"#9aa1ff",rose:"#fc8395",violet:"#c792fc"}},terminal:{label:"Terminal",scheme:"dark",colors:{bg:"#050807",surface:"#0c110e",elevated:"#141c17",overlay:"#1c2820",line:"#233028","line-strong":"#34483b","line-control":"#5c6c61",hi:"#d1fae5",hi2:"#8fc4a8",hi3:"#74a68b",ghost:"#4f7a62",accent:"#34d399",accent2:"#2dd4bf","on-accent":"#050807",ok:"#4ade80",loss:"#f87171",warn:"#fbbf24",info:"#67e8f9",scrim:"#000000","invert-bg":"#d1fae5","invert-text":"#0c110e",...P(["#34d399","#67e8f9","#fbbf24","#f87171","#a3e635","#c084fc","#fb923c","#2dd4bf"]),...G}},mocha:{label:"Mocha",scheme:"dark",colors:{bg:"#1c1917",surface:"#292524",elevated:"#393432",overlay:"#44403c",line:"#44403c","line-strong":"#57534e","line-control":"#83807c",hi:"#f5f0eb",hi2:"#c6c0bb",hi3:"#b2ada8",ghost:"#78716c",accent:"#fdba74",accent2:"#f472b6","on-accent":"#1c1917",ok:"#4ade80",loss:"#fca5a5",warn:"#facc15",info:"#7dd3fc",scrim:"#000000","invert-bg":"#f5f0eb","invert-text":"#292524",...P(["#fb923c","#4ade80","#facc15","#f472b6","#7dd3fc","#c4b5fd","#f87171","#bef264"]),...G,indigo:"#a9afff",rose:"#fc99a7",sky:"#3ebff8",violet:"#cfa2fd"}},ocean:{label:"Ocean",scheme:"dark",colors:{bg:"#020c18",surface:"#061528",elevated:"#0a243e",overlay:"#103658",line:"#123050","line-strong":"#1f4a72","line-control":"#507291",hi:"#e0f2fe",hi2:"#9ccde6",hi3:"#6fa9c6",ghost:"#3f7392",accent:"#38bdf8",accent2:"#a78bfa","on-accent":"#020c18",ok:"#34d399",loss:"#fb7185",warn:"#fbbf24",info:"#7dd3fc",scrim:"#000000","invert-bg":"#38bdf8","invert-text":"#020c18",...P(["#38bdf8","#34d399","#fbbf24","#fb7185","#a78bfa","#2dd4bf","#fb923c","#a3e635"]),...G}},contrast:{label:"High contrast",scheme:"dark",colors:{bg:"#000000",surface:"#080808",elevated:"#141414",overlay:"#222222",line:"#4a4a4a","line-strong":"#8a8a8a","line-control":"#8a8a8a",hi:"#ffffff",hi2:"#d4d4d4",hi3:"#bdbdbd",ghost:"#8f8f8f",accent:"#ffd60a",accent2:"#7dd3fc","on-accent":"#000000",ok:"#4ade80",loss:"#ff6b6b",warn:"#ffd60a",info:"#7dd3fc",scrim:"#000000","invert-bg":"#ffffff","invert-text":"#000000",...P(["#ffd60a","#4ade80","#7dd3fc","#ff6b6b","#c4b5fd","#fb923c","#f9a8d4","#bef264"]),...G}}},tn=t=>{let e=t.colors,n=Object.fromEntries(["ok","loss","warn","info"].flatMap(i=>[[`${i}-fill`,e[`${i}-fill`]??e[i]],[`on-${i}`,e[`on-${i}`]??e["on-accent"]]]));return{...t,colors:{...e,...n,"on-accent2":e["on-accent2"]??e["on-accent"]}}},B=Object.fromEntries(Object.entries(en).map(([t,e])=>[t,tn(e)])),Je="dark";var nn="3.1.0";var sn=Symbol.for("nish-ui.runtime.v1");function rn(){let t=globalThis;return t[sn]??={versions:new Set,slots:{}}}function on(t){t.versions.add(nn),t.versions.size>1&&!t.warned&&globalThis.process?.env?.NODE_ENV!=="production"&&(t.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...t.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var Qe=!1;function de(t,e){let n=rn();return Qe||(Qe=!0,on(n)),t in n.slots||(n.slots[t]=e()),n.slots[t]}function et(t){if(t==null)return null;let e=String(t),n=0,i=e.length;for(;n<i&&e.charCodeAt(n)<=32;)n++;for(;i>n&&e.charCodeAt(i-1)<=32;)i--;let s=e.slice(n,i).replace(/[\t\n\r]/g,"");if(s===""||s!==s.trim()||/[\u0000-\u001f\u007f]/.test(s))return null;let r=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(s);if(!r)return s;let o=r[1].toLowerCase();return o==="http"||o==="https"||o==="mailto"||o==="tel"?s:null}var q={theme:"Theme",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(t,e)=>`Theme: ${t}. Switch to ${e}`,themePreset:"Theme preset",themePresetPlaceholder:"Preset\u2026"};var tt={dismiss:"Dismiss",moreCount:t=>`${t} more`,copy:"Copy",copied:"Copied",legend:"Legend",noData:"No data",noDataNamed:t=>`${t}: no data`};var nt="nish-theme",it="nish.software",an=3600*24*365,F=()=>de("theme",()=>({extra:{},listeners:new Set,watching:!1,switchId:0})),ln=t=>{globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: ${t}`)};function me(){if(typeof document>"u")return nt;let t=document.documentElement.getAttribute("data-nish-storage-key");return t&&/^[A-Za-z0-9_-]+$/.test(t)?t:nt}var X=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function Me(t){return typeof t=="string"&&(X(B,t)||X(F().extra,t))}function cn(){if(typeof document>"u")return null;try{let t=document.cookie.match(new RegExp(`(?:^|;\\s*)${me()}=([a-z0-9-]+)`));return t?t[1]:null}catch{return null}}var st=(t,e)=>e===t||e.endsWith("."+t);function dn(t,e){let n=t.toLowerCase(),i=(e??"").trim().toLowerCase().replace(/^\./,"");return i?st(i,n)?i:null:st(it,n)?it:null}function hn(){return typeof location>"u"||typeof document>"u"?null:dn(location.hostname,document.documentElement.getAttribute("data-nish-domain"))}function z(){let t=null;try{t=cn()??localStorage.getItem(me())}catch{}return t==="system"||Me(t)?t:"system"}function un(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: light)").matches?"light":Je}function mn(){let t=document.documentElement.getAttribute("data-nish-themes");return t?t.split(/\s+/).filter(Me):null}function ct(t=z()){let e=t==="system"?un():t,n=typeof document>"u"?null:mn();return n&&!n.includes(e)&&(e=ue(e)),e}function ue(t){let{extra:e}=F();return X(B,t)?B[t].scheme:X(e,t)?e[t]:"dark"}function dt(t=z()){let e=ct(t),n=document.documentElement,i=n.getAttribute("data-theme");return i&&i!==e&&pn(n),n.setAttribute("data-theme",e),n.setAttribute("data-scheme",ue(e)),n.setAttribute("data-theme-choice",t),n.style.colorScheme=ue(e),vn(),F().listeners.forEach(s=>s(t,e)),e}function pn(t){let e=F(),n=++e.switchId;t.setAttribute("data-nish-theme-switching","");let i=()=>{e.switchId===n&&t.removeAttribute("data-nish-theme-switching")};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>requestAnimationFrame(i)):setTimeout(i,32)}function fn(t){if(t!=="system"&&!Me(t))return ln(`unknown theme "${String(t)}" ignored. Register it with registerThemes() first.`),ct(z());let e=me();try{localStorage.setItem(e,t)}catch{}try{let n=hn();if(n){let i=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${t}; Domain=.${n}; Path=/; Max-Age=${an}; SameSite=Lax${i}`}}catch{}return dt(t)}function gn(t){return getComputedStyle(document.documentElement).getPropertyValue(`--nish-${t}`).trim()}function vn(){let t=gn("bg");if(!t)return;let e=document.querySelector('meta[name="theme-color"][data-nish]')??document.querySelector('meta[name="theme-color"]:not([media]):not([data-nish-keep])');e||(e=document.createElement("meta"),e.name="theme-color",(document.head||document.documentElement).appendChild(e)),e.setAttribute("data-nish",""),e.content=t}function bn(){let t=F();if(t.watching||typeof window>"u")return;t.watching=!0;let e=()=>{let n=z();(n!==document.documentElement.getAttribute("data-theme-choice")||n==="system")&&dt(n)};typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: light)").addEventListener("change",e),window.addEventListener("storage",n=>{n.key===me()&&e()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function Sn(t){bn();let{listeners:e}=F();return e.add(t),()=>{e.delete(t)}}var he=["system","light","dark"];function En(){let t=ht(z());return fn(t),t}var rt="http://www.w3.org/2000/svg";function Ne(t,e,n={}){let i=document.createElementNS(rt,"svg"),s={width:String(t),height:String(t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false",...n};for(let r of Object.keys(s))i.setAttribute(r,s[r]);for(let[r,o]of e){let d=document.createElementNS(rt,r);for(let c of Object.keys(o))d.setAttribute(c,o[c]);i.appendChild(d)}return i}var ot={system:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}],["path",{d:"M8 21h8M12 17v4"}]],light:[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2M12 20v2m-7.07-2.93 1.41-1.41M17.66 6.34l1.41-1.41M2 12h2m16 0h2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41"}]],dark:[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9"}]]},yn=()=>({system:q.themeSystem,light:q.themeLight,dark:q.themeDark}),_n="set on another site";function ht(t){let e=he.indexOf(t);return he[(e+1)%he.length]}function Ce(t,e){return t==="system"||t==="light"||t==="dark"?e[t]:X(B,t)?B[t].label:t.charAt(0).toUpperCase()+t.slice(1)}function ut(t,e={}){let n={...yn(),...e.labels},i=e.strings?.themeToggleLabel??q.themeToggleLabel,s=e.elsewhereLabel??_n;t.tagName==="BUTTON"&&!t.getAttribute("type")&&t.setAttribute("type","button");let r=Object.keys(ot).map(l=>Ne(16,ot[l],{"data-icon":l}));if(e.showLabel){let l=document.createElement("span");l.setAttribute("data-theme-word",""),l.setAttribute("aria-hidden","true"),r.push(l)}t.replaceChildren(...r);let o=t.querySelector("[data-theme-word]"),d=l=>{let u=l==="system"||l==="light"||l==="dark"?l:ue(l);t.setAttribute("data-choice",l),t.querySelectorAll("svg[data-icon]").forEach(v=>{v.getAttribute("data-icon")===u?v.removeAttribute("display"):v.setAttribute("display","none")});let m=he.includes(l)?"":` (${s})`,g=i(`${Ce(l,n)}${m}`,Ce(ht(l),n));t.setAttribute("aria-label",g),t.setAttribute("title",g),o&&(o.textContent=Ce(l,n))},c=()=>{En()};t.addEventListener("click",c);let h=Sn(l=>d(l));return d(z()),()=>{t.removeEventListener("click",c),h()}}var at=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4M12 17h.01"}]],lt=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4M12 8h.01"}]],Tn={neutral:lt,info:lt,ok:[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]],warn:at,loss:at},wn=6e3,N=null,K=null;function mt(t,e={}){K?.(),(!N||!N.isConnected)&&(N=document.createElement("div"),N.setAttribute("role","status"),N.setAttribute("aria-live","polite"),N.className="nish-toast-region",document.body.appendChild(N));let n=N,i=document.createElement("div");i.className="nish-toast"+(e.tone&&e.tone!=="neutral"?` nish-toast--${e.tone}`:"");let s=document.createElement("span");s.className="nish-toast-icon",s.setAttribute("aria-hidden","true"),s.append(Ne(15,Tn[e.tone??"neutral"])),i.append(s);let r=document.createElement("p");r.className="nish-toast-body",r.append(typeof t=="string"?document.createTextNode(t):t),i.append(r);let o=null,d=e.duration==="sticky"?1/0:e.duration??wn,c=0,h=0,l=()=>{o!=null&&clearTimeout(o),o=null,i.remove(),K===l&&(K=null)},u=a=>{Number.isFinite(a)&&(c=Date.now(),o=setTimeout(l,a))},m=()=>{h+=1,!(h>1||o==null)&&(clearTimeout(o),o=null,d=Math.max(0,d-(Date.now()-c)))},g=()=>{h!==0&&(h-=1,h===0&&u(Math.max(d,1e3)))},v=e.action,_=v?.href!=null?et(v.href):null;if(v&&(v.href==null||_!=null)){let a=document.createElement(v.href!=null?"a":"button");a.className="nish-toast-action",a.textContent=v.label,_!=null?a.href=_:a.type="button",a.addEventListener("click",()=>{v.onClick?.(),l()}),i.append(a)}let p=document.createElement("button");return p.type="button",p.className="nish-toast-close",p.setAttribute("aria-label",e.dismissLabel??e.strings?.dismiss??tt.dismiss),p.append(Ne(14,[["path",{d:"M18 6 6 18M6 6l12 12"}]])),p.addEventListener("click",l),i.append(p),i.addEventListener("pointerenter",a=>a.pointerType==="mouse"&&m()),i.addEventListener("pointerleave",a=>a.pointerType==="mouse"&&g()),i.addEventListener("focusin",a=>!i.contains(a.relatedTarget)&&m()),i.addEventListener("focusout",a=>!i.contains(a.relatedTarget)&&g()),i.addEventListener("keydown",a=>{a.key==="Escape"&&l()}),setTimeout(()=>{K===l&&(n.append(i),u(d))},50),K=l,l}var xn=()=>typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function ke(t){if(typeof document>"u")return()=>{};let e=!1,n=!1;if(t.open)return()=>s();let i=document.activeElement instanceof HTMLElement?document.activeElement:null;function s(){if(e||!t.open)return;e=!0;let a,f=()=>{t.removeEventListener("animationend",T),a!==void 0&&clearTimeout(a),t.removeAttribute("data-closing"),t.style.transform="",t.style.transition="",e=!1,t.open&&t.close()},T=Kt=>{Kt.target===t&&f()};if(xn()){f();return}t.style.transform="",t.setAttribute("data-closing",""),t.addEventListener("animationend",T),a=setTimeout(f,260)}let r=a=>{a.preventDefault(),s()},o=a=>{a.key==="Escape"&&a.stopPropagation()},d=a=>{if(a.target===t){let f=t.getBoundingClientRect();a.clientX>=f.left&&a.clientX<=f.right&&a.clientY>=f.top&&a.clientY<=f.bottom||s();return}a.target instanceof Element&&a.target.closest("[data-sheet-close]")&&s()},c=0,h=0,l=0,u=0,m=1,g=a=>{if(a.pointerType==="mouse"||e||!a.isPrimary||typeof matchMedia<"u"&&matchMedia("(min-width: 640px)").matches)return;let f=t.getBoundingClientRect();!(a.target instanceof Element&&a.target.closest(".nish-sheet-header")!=null)&&a.clientY-f.top>28||(n=!0,c=h=a.clientY,l=a.timeStamp,u=0,m=f.height||1,t.style.transition="none",t.setPointerCapture?.(a.pointerId))},v=a=>{if(!n)return;let f=a.clientY-c,T=a.timeStamp-l;T>0&&(u=(a.clientY-h)/T),h=a.clientY,l=a.timeStamp,t.style.transform=`translateY(${f>=0?f:f*.3}px)`},_=a=>{if(!n)return;n=!1,t.releasePointerCapture?.(a.pointerId);let f=a.clientY-c;if(a.type!=="pointercancel"&&(f>m*.3||u>.5)){s();return}t.style.transition="transform 180ms var(--nish-ease-out, ease-out)",t.style.transform="",setTimeout(()=>{e||(t.style.transition="")},200)},p=()=>{t.removeEventListener("cancel",r),t.removeEventListener("keydown",o),t.removeEventListener("click",d),t.removeEventListener("pointerdown",g),t.removeEventListener("pointermove",v),t.removeEventListener("pointerup",_),t.removeEventListener("pointercancel",_),t.removeEventListener("close",p),i?.isConnected&&i.focus()};return t.addEventListener("cancel",r),t.addEventListener("keydown",o),t.addEventListener("click",d),t.addEventListener("pointerdown",g),t.addEventListener("pointermove",v),t.addEventListener("pointerup",_),t.addEventListener("pointercancel",_),t.addEventListener("close",p),t.showModal(),s}function pt(t,e){if(typeof document>"u")return()=>{};let n=document.documentElement,i=()=>{let r=t.offsetHeight;r>0?n.style.setProperty(e,`${r}px`):n.style.removeProperty(e)};i();let s;return typeof ResizeObserver<"u"?(s=new ResizeObserver(i),s.observe(t)):window.addEventListener("resize",i),()=>{s?.disconnect(),window.removeEventListener("resize",i),n.style.removeProperty(e)}}var ft=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var x=function(t,e,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n},E=function(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},W,pe,fe,Z,$e,J,ge,O,Q,M,ve,gt;var b={__proto__:null};b.enumerable=!0;Object.freeze(b);var Pe=(M=class{constructor(e,n={}){if(W.set(this,!1),pe.set(this,!1),fe.set(this,!1),Z.set(this,!1),$e.set(this,Date.now()),J.set(this,!1),ge.set(this,void 0),O.set(this,void 0),Q.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof n!="object"||!n)throw new Error('The "options" argument must be an object');let{bubbles:i,cancelable:s,composed:r}=n;x(this,W,!!s,"f"),x(this,pe,!!i,"f"),x(this,fe,!!r,"f"),x(this,ge,`${e}`,"f"),x(this,O,null,"f"),x(this,Q,!1,"f")}initEvent(e,n,i){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){x(this,Z,!0,"f")}get target(){return E(this,O,"f")}get currentTarget(){return E(this,O,"f")}get srcElement(){return E(this,O,"f")}get type(){return E(this,ge,"f")}get cancelable(){return E(this,W,"f")}get defaultPrevented(){return E(this,W,"f")&&E(this,Z,"f")}get timeStamp(){return E(this,$e,"f")}composedPath(){return E(this,Q,"f")?[E(this,O,"f")]:[]}get returnValue(){return!E(this,W,"f")||!E(this,Z,"f")}get bubbles(){return E(this,pe,"f")}get composed(){return E(this,fe,"f")}get eventPhase(){return E(this,Q,"f")?M.AT_TARGET:M.NONE}get cancelBubble(){return E(this,J,"f")}set cancelBubble(e){e&&x(this,J,!0,"f")}stopPropagation(){x(this,J,!0,"f")}get isTrusted(){return!1}},W=new WeakMap,pe=new WeakMap,fe=new WeakMap,Z=new WeakMap,$e=new WeakMap,J=new WeakMap,ge=new WeakMap,O=new WeakMap,Q=new WeakMap,M.NONE=0,M.CAPTURING_PHASE=1,M.AT_TARGET=2,M.BUBBLING_PHASE=3,M);Object.defineProperties(Pe.prototype,{initEvent:b,stopImmediatePropagation:b,preventDefault:b,target:b,currentTarget:b,srcElement:b,type:b,cancelable:b,defaultPrevented:b,timeStamp:b,composedPath:b,returnValue:b,bubbles:b,composed:b,eventPhase:b,cancelBubble:b,stopPropagation:b,isTrusted:b});var vt=(gt=class extends Pe{constructor(e,n={}){super(e,n),ve.set(this,void 0),x(this,ve,n?.detail??null,"f")}initCustomEvent(e,n,i,s){throw new Error("Method not implemented.")}get detail(){return E(this,ve,"f")}},ve=new WeakMap,gt);Object.defineProperties(vt.prototype,{detail:b});var A=Pe,Oe=vt;var y;var oi=(y=class{constructor(){this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""}get parentRule(){return null}get parentStyleSheet(){return this.__parentStyleSheet}get type(){return 0}},y.STYLE_RULE=1,y.CHARSET_RULE=2,y.IMPORT_RULE=3,y.MEDIA_RULE=4,y.FONT_FACE_RULE=5,y.PAGE_RULE=6,y.NAMESPACE_RULE=10,y.KEYFRAMES_RULE=7,y.KEYFRAME_RULE=8,y.SUPPORTS_RULE=12,y.COUNTER_STYLE_RULE=11,y.FONT_FEATURE_VALUES_RULE=14,y.MARGIN_RULE=9,y);globalThis.Event??=A;globalThis.CustomEvent??=Oe;var He=Symbol(),bt=t=>typeof t=="boolean"?t:t?.capture??!1,R={__proto__:null};R.enumerable=!0;Object.freeze(R);var be=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,n,i){if(n==null)return;let s=bt(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);if(r===void 0)r=new Map,s.set(e,r);else if(r.has(n))return;let o=typeof i=="object"&&i?i:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(e,n,i)),r.set(n,o??{})}removeEventListener(e,n,i){if(n==null)return;let s=bt(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);r!==void 0&&(r.delete(n),r.size||s.delete(e))}dispatchEvent(e){let n=this.__resolveFullEventPath();!e.composed&&this.__host&&(n=n.slice(0,n.indexOf(this.__host)));let i=!1,s=!1,r=A.NONE,o=null,d=null,c=null,h=e.stopPropagation,l=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??d},...R},srcElement:{get(){return e.target},...R},currentTarget:{get(){return c},...R},eventPhase:{get(){return r},...R},composedPath:{value:()=>n,...R},stopPropagation:{value:()=>{i=!0,h.call(e)},...R},stopImmediatePropagation:{value:()=>{s=!0,l.call(e)},...R}});let u=(p,a,f)=>{typeof p=="function"?p(e):typeof p?.handleEvent=="function"&&p.handleEvent(e),a.once&&f.delete(p)},m=()=>(c=null,r=A.NONE,!e.defaultPrevented),g=n.slice().reverse();o=!this.__host||!e.composed?this:null;let v=p=>{for(d=this;d.__host&&p.includes(d.__host);)d=d.__host};for(let p of g){!o&&(!d||d===p.__host)&&v(g.slice(g.indexOf(p))),c=p,r=p===e.target?A.AT_TARGET:A.CAPTURING_PHASE;let a=p.__captureEventListeners.get(e.type);if(a){for(let[f,T]of a)if(u(f,T,a),s)return m()}if(i)return m()}let _=e.bubbles?n:[this];d=null;for(let p of _){!o&&(!d||p===d.__host)&&v(_.slice(0,_.indexOf(p)+1)),c=p,r=p===e.target?A.AT_TARGET:A.BUBBLING_PHASE;let a=p.__eventListeners.get(e.type);if(a){for(let[f,T]of a)if(u(f,T,a),s)return m()}if(i)return m()}return m()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,yt,Ln]}};var St=new WeakMap,ee=t=>{let e=St.get(t);return e===void 0&&St.set(t,e=new Map),e},te=class extends be{getRootNode(e){return e?.composed?Ie:this.__host?.__shadowRoot??Ie}};var Et=class extends te{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var yt=new Et,Ie=yt;var _t=class extends te{constructor(e){if(super(),e!==He)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:Se,customElements:Ue,document:Ie,Document:Et,Element:Tt,EventTarget:be,HTMLElement:wt,Node:te,ShadowRoot:xt,window:this,Window:_t})}};var Tt=class extends te{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(ee(this)).map(([e,n])=>({name:e,value:n}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,n){ee(this).set(e,String(n))}removeAttribute(e){ee(this).delete(e)}toggleAttribute(e,n){if(this.hasAttribute(e)){if(n===void 0||!n)return this.removeAttribute(e),!1}else return n===void 0||n?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return ee(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let n=new xt(He,e);return n.__eventTargetParent=this,n.__host=this,this.__shadowRoot=n}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new ft(this);return this.__internals=e,e}getAttribute(e){return ee(this).get(e)??null}};var wt=class extends Tt{},De=wt;var xt=class extends te{get host(){return this.__host}constructor(e,n){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=n.mode}};globalThis.litServerRoot??=Object.defineProperty(new De,"localName",{get(){return"lit-server-root"}});function An(){let t,e;return{promise:new Promise((i,s)=>{t=i,e=s}),resolve:t,reject:e}}var Se=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,n){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
2
- Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);if(this.__reverseDefinitions.has(n))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(n)}`);n.__localName=e,this.__definitions.set(e,{ctor:n,observedAttributes:n.observedAttributes??[]}),this.__reverseDefinitions.set(n,e),this.__pendingWhenDefineds.get(e)?.resolve(n),this.__pendingWhenDefineds.delete(e)}get(e){return this.__definitions.get(e)?.ctor}getName(e){return this.__reverseDefinitions.get(e)??null}initialize(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(e){let n=this.__definitions.get(e);if(n)return n.ctor;let i=this.__pendingWhenDefineds.get(e);return i||(i=An(),this.__pendingWhenDefineds.set(e,i)),i.promise}},Rn=Se;var Ue=new Rn,Ln=new _t(He);var ne=globalThis,ye=ne.ShadowRoot&&(ne.ShadyCSS===void 0||ne.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rt=Symbol(),At=new WeakMap,Ee=class{constructor(e,n,i){if(this._$cssResult$=!0,i!==Rt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o,n=this.t;if(ye&&e===void 0){let i=n!==void 0&&n.length===1;i&&(e=At.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&At.set(n,e))}return e}toString(){return this.cssText}},Lt=t=>new Ee(typeof t=="string"?t:t+"",void 0,Rt);var Ct=(t,e)=>{if(ye)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of e){let i=document.createElement("style"),s=ne.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=n.cssText,t.appendChild(i)}},Ge=ye||ne.CSSStyleSheet===void 0?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(let i of e.cssRules)n+=i.cssText;return Lt(n)})(t):t;var{is:Cn,defineProperty:Nn,getOwnPropertyDescriptor:Mn,getOwnPropertyNames:kn,getOwnPropertySymbols:$n,getPrototypeOf:Pn}=Object,se=globalThis;se.customElements??=Ue;var Nt=se.trustedTypes,On=Nt?Nt.emptyScript:"",In=se.reactiveElementPolyfillSupport,ie=(t,e)=>t,Be={toAttribute(t,e){switch(e){case Boolean:t=t?On:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},kt=(t,e)=>!Cn(t,e),Mt={attribute:!0,type:String,converter:Be,reflect:!1,useDefault:!1,hasChanged:kt};Symbol.metadata??=Symbol("metadata"),se.litPropertyMetadata??=new WeakMap;var L=class extends(globalThis.HTMLElement??De){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=Mt){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){let i=Symbol(),s=this.getPropertyDescriptor(e,i,n);s!==void 0&&Nn(this.prototype,e,s)}}static getPropertyDescriptor(e,n,i){let{get:s,set:r}=Mn(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:s,set(o){let d=s?.call(this);r?.call(this,o),this.requestUpdate(e,d,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Mt}static _$Ei(){if(this.hasOwnProperty(ie("elementProperties")))return;let e=Pn(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ie("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ie("properties"))){let n=this.properties,i=[...kn(n),...$n(n)];for(let s of i)this.createProperty(s,n[s])}let e=this[Symbol.metadata];if(e!==null){let n=litPropertyMetadata.get(e);if(n!==void 0)for(let[i,s]of n)this.elementProperties.set(i,s)}this._$Eh=new Map;for(let[n,i]of this.elementProperties){let s=this._$Eu(n,i);s!==void 0&&this._$Eh.set(s,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let n=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let s of i)n.unshift(Ge(s))}else e!==void 0&&n.push(Ge(e));return n}static _$Eu(e,n){let i=n.attribute;return i===!1?void 0:typeof i=="string"?i: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,n=this.constructor.elementProperties;for(let i of n.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ct(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,n,i){this._$AK(e,i)}_$ET(e,n){let i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){let r=(i.converter?.toAttribute!==void 0?i.converter:Be).toAttribute(n,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,n){let i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){let r=i.getPropertyOptions(s),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:Be;this._$Em=s;let d=o.fromAttribute(n,r.type);this[s]=d??this._$Ej?.get(s)??d,this._$Em=null}}requestUpdate(e,n,i,s=!1,r){if(e!==void 0){let o=this.constructor;if(s===!1&&(r=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??kt)(r,n)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,n,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(n=void 0),this._$AL.set(e,n)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}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[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[s,r]of i){let{wrapped:o}=r,d=this[s];o!==!0||this._$AL.has(s)||d===void 0||this.C(s,void 0,r,d)}}let e=!1,n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(n)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.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(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};L.elementStyles=[],L.shadowRootOptions={mode:"open"},L[ie("elementProperties")]=new Map,L[ie("finalized")]=new Map,In?.({ReactiveElement:L}),(se.reactiveElementVersions??=[]).push("2.1.2");var Te=globalThis,$t=t=>t,_e=Te.trustedTypes,Pt=_e?_e.createPolicy("lit-html",{createHTML:t=>t}):void 0,Gt="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,Bt="?"+k,Hn=`<${Bt}>`,D=Te.document===void 0?{createTreeWalker:()=>({})}:document,oe=()=>D.createComment(""),ae=t=>t===null||typeof t!="object"&&typeof t!="function",qe=Array.isArray,Dn=t=>qe(t)||typeof t?.[Symbol.iterator]=="function",Fe=`[
1
+ var Xt=["emerald","indigo","amber","lime","rose","sky","violet","teal"],Vn=["accent","ok","loss","warn","info",...Xt],G={emerald:"#34d399",indigo:"#8b93ff",amber:"#fbbf24",lime:"#a3e635",rose:"#fb7185",sky:"#38bdf8",violet:"#c084fc",teal:"#2dd4bf"},Zt={emerald:"#046d4f",indigo:"#4e45e3",amber:"#9b4708",lime:"#41690d",rose:"#b8113a",sky:"#036499",violet:"#7e22ce",teal:"#0e6b64"},Jt=["#8b93ff","#34d399","#fbbf24","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"],Qt=["#6366f1","#059669","#c96d06","#f43f5e","#0284c7","#a855f7","#ea580c","#5a910c"],P=t=>Object.fromEntries(t.map((e,n)=>[`chart-${n+1}`,e])),en={dark:{label:"Dark",scheme:"dark",colors:{bg:"#0a0b0f",surface:"#111218",elevated:"#191b23",overlay:"#22252f",line:"#262935","line-strong":"#3a3e4d","line-control":"#666975",hi:"#ececf1",hi2:"#a8aab7",hi3:"#8a8d9b",ghost:"#6b6e7c",accent:"#8b93ff",accent2:"#c084fc","on-accent":"#0a0b0f",ok:"#34d399",loss:"#f87171",warn:"#fbbf24",info:"#38bdf8",scrim:"#000000","invert-bg":"#ececf1","invert-text":"#111218",...P(Jt),...G}},light:{label:"Light",scheme:"light",colors:{bg:"#f7f6f3",surface:"#ffffff",elevated:"#f1f0ec",overlay:"#e6e4de",line:"#e2e0da","line-strong":"#c9c6bd","line-control":"#8a8881",hi:"#17171c",hi2:"#4f515c",hi3:"#626470",ghost:"#8a8c98",accent:"#4338ca",accent2:"#7e22ce","on-accent":"#ffffff","on-accent2":"#ffffff","on-ok":"#0a0a0c","on-loss":"#ffffff","on-warn":"#0a0a0c","on-info":"#0a0a0c",ok:"#065f46","ok-fill":"#059669","loss-fill":"#dc2626","warn-fill":"#c96d06","info-fill":"#0284c7",loss:"#a91b1b",warn:"#92400e",info:"#075985",scrim:"#17171c","invert-bg":"#17171c","invert-text":"#f7f6f3",...P(Qt),...Zt}},slate:{label:"Slate",scheme:"dark",colors:{bg:"#18181b",surface:"#202024",elevated:"#2c2c32",overlay:"#36363d",line:"#3a3a42","line-strong":"#52525b","line-control":"#77777e",hi:"#f4f4f5",hi2:"#b8b8c0",hi3:"#a0a0a8",ghost:"#71717a",accent:"#a5b4fc",accent2:"#c084fc","on-accent":"#18181b",ok:"#4ade80",loss:"#fda4af",warn:"#facc15",info:"#38bdf8",scrim:"#000000","invert-bg":"#f4f4f5","invert-text":"#202024",...P(["#818cf8","#4ade80","#facc15","#fb7185","#38bdf8","#c084fc","#fb923c","#a3e635"]),...G,indigo:"#9aa1ff",rose:"#fc8395",violet:"#c792fc"}},terminal:{label:"Terminal",scheme:"dark",colors:{bg:"#050807",surface:"#0c110e",elevated:"#141c17",overlay:"#1c2820",line:"#233028","line-strong":"#34483b","line-control":"#5c6c61",hi:"#d1fae5",hi2:"#8fc4a8",hi3:"#74a68b",ghost:"#4f7a62",accent:"#34d399",accent2:"#2dd4bf","on-accent":"#050807",ok:"#4ade80",loss:"#f87171",warn:"#fbbf24",info:"#67e8f9",scrim:"#000000","invert-bg":"#d1fae5","invert-text":"#0c110e",...P(["#34d399","#67e8f9","#fbbf24","#f87171","#a3e635","#c084fc","#fb923c","#2dd4bf"]),...G}},mocha:{label:"Mocha",scheme:"dark",colors:{bg:"#1c1917",surface:"#292524",elevated:"#393432",overlay:"#44403c",line:"#44403c","line-strong":"#57534e","line-control":"#83807c",hi:"#f5f0eb",hi2:"#c6c0bb",hi3:"#b2ada8",ghost:"#78716c",accent:"#fdba74",accent2:"#f472b6","on-accent":"#1c1917",ok:"#4ade80",loss:"#fca5a5",warn:"#facc15",info:"#7dd3fc",scrim:"#000000","invert-bg":"#f5f0eb","invert-text":"#292524",...P(["#fb923c","#4ade80","#facc15","#f472b6","#7dd3fc","#c4b5fd","#f87171","#bef264"]),...G,indigo:"#a9afff",rose:"#fc99a7",sky:"#3ebff8",violet:"#cfa2fd"}},ocean:{label:"Ocean",scheme:"dark",colors:{bg:"#020c18",surface:"#061528",elevated:"#0a243e",overlay:"#103658",line:"#123050","line-strong":"#1f4a72","line-control":"#507291",hi:"#e0f2fe",hi2:"#9ccde6",hi3:"#6fa9c6",ghost:"#3f7392",accent:"#38bdf8",accent2:"#a78bfa","on-accent":"#020c18",ok:"#34d399",loss:"#fb7185",warn:"#fbbf24",info:"#7dd3fc",scrim:"#000000","invert-bg":"#38bdf8","invert-text":"#020c18",...P(["#38bdf8","#34d399","#fbbf24","#fb7185","#a78bfa","#2dd4bf","#fb923c","#a3e635"]),...G}},contrast:{label:"High contrast",scheme:"dark",colors:{bg:"#000000",surface:"#080808",elevated:"#141414",overlay:"#222222",line:"#4a4a4a","line-strong":"#8a8a8a","line-control":"#8a8a8a",hi:"#ffffff",hi2:"#d4d4d4",hi3:"#bdbdbd",ghost:"#8f8f8f",accent:"#ffd60a",accent2:"#7dd3fc","on-accent":"#000000",ok:"#4ade80",loss:"#ff6b6b",warn:"#ffd60a",info:"#7dd3fc",scrim:"#000000","invert-bg":"#ffffff","invert-text":"#000000",...P(["#ffd60a","#4ade80","#7dd3fc","#ff6b6b","#c4b5fd","#fb923c","#f9a8d4","#bef264"]),...G}}},tn=t=>{let e=t.colors,n=Object.fromEntries(["ok","loss","warn","info"].flatMap(i=>[[`${i}-fill`,e[`${i}-fill`]??e[i]],[`on-${i}`,e[`on-${i}`]??e["on-accent"]]]));return{...t,colors:{...e,...n,"on-accent2":e["on-accent2"]??e["on-accent"]}}},B=Object.fromEntries(Object.entries(en).map(([t,e])=>[t,tn(e)])),Je="dark";var nn="3.2.0";var sn=Symbol.for("nish-ui.runtime.v1");function rn(){let t=globalThis;return t[sn]??={versions:new Set,slots:{}}}function on(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}function an(t){t.versions.add(nn),t.versions.size>1&&!t.warned&&on()&&(t.warned=!0,console.warn(`nish-ui: two versions are loaded on this page (${[...t.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`))}var Qe=!1;function de(t,e){let n=rn();return Qe||(Qe=!0,an(n)),t in n.slots||(n.slots[t]=e()),n.slots[t]}function et(t){if(t==null)return null;let e=String(t),n=0,i=e.length;for(;n<i&&e.charCodeAt(n)<=32;)n++;for(;i>n&&e.charCodeAt(i-1)<=32;)i--;let s=e.slice(n,i).replace(/[\t\n\r]/g,"");if(s===""||s!==s.trim()||/[\u0000-\u001f\u007f]/.test(s))return null;let r=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(s);if(!r)return s;let o=r[1].toLowerCase();return o==="http"||o==="https"||o==="mailto"||o==="tel"?s:null}var q={theme:"Theme",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(t,e)=>`Theme: ${t}. Switch to ${e}`,themePreset:"Theme preset",themePresetPlaceholder:"Preset\u2026"};var tt={dismiss:"Dismiss",moreCount:t=>`${t} more`,copy:"Copy",copied:"Copied",legend:"Legend",noData:"No data",noDataNamed:t=>`${t}: no data`};var nt="nish-theme",it="nish.software",ln=3600*24*365,F=()=>de("theme",()=>({extra:{},listeners:new Set,watching:!1,switchId:0})),cn=t=>{globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`nish-ui: ${t}`)};function me(){if(typeof document>"u")return nt;let t=document.documentElement.getAttribute("data-nish-storage-key");return t&&/^[A-Za-z0-9_-]+$/.test(t)?t:nt}var X=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function Me(t){return typeof t=="string"&&(X(B,t)||X(F().extra,t))}function dn(){if(typeof document>"u")return null;try{let t=document.cookie.match(new RegExp(`(?:^|;\\s*)${me()}=([a-z0-9-]+)`));return t?t[1]:null}catch{return null}}var st=(t,e)=>e===t||e.endsWith("."+t);function hn(t,e){let n=t.toLowerCase(),i=(e??"").trim().toLowerCase().replace(/^\./,"");return i?st(i,n)?i:null:st(it,n)?it:null}function un(){return typeof location>"u"||typeof document>"u"?null:hn(location.hostname,document.documentElement.getAttribute("data-nish-domain"))}function z(){let t=null;try{t=dn()??localStorage.getItem(me())}catch{}return t==="system"||Me(t)?t:"system"}function mn(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: light)").matches?"light":Je}function pn(){let t=document.documentElement.getAttribute("data-nish-themes");return t?t.split(/\s+/).filter(Me):null}function ct(t=z()){let e=t==="system"?mn():t,n=typeof document>"u"?null:pn();return n&&!n.includes(e)&&(e=ue(e)),e}function ue(t){let{extra:e}=F();return X(B,t)?B[t].scheme:X(e,t)?e[t]:"dark"}function dt(t=z()){let e=ct(t),n=document.documentElement,i=n.getAttribute("data-theme");return i&&i!==e&&fn(n),n.setAttribute("data-theme",e),n.setAttribute("data-scheme",ue(e)),n.setAttribute("data-theme-choice",t),n.style.colorScheme=ue(e),bn(),F().listeners.forEach(s=>s(t,e)),e}function fn(t){let e=F(),n=++e.switchId;t.setAttribute("data-nish-theme-switching","");let i=()=>{e.switchId===n&&t.removeAttribute("data-nish-theme-switching")};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>requestAnimationFrame(i)):setTimeout(i,32)}function gn(t){if(t!=="system"&&!Me(t))return cn(`unknown theme "${String(t)}" ignored. Register it with registerThemes() first.`),ct(z());let e=me();try{localStorage.setItem(e,t)}catch{}try{let n=un();if(n){let i=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${t}; Domain=.${n}; Path=/; Max-Age=${ln}; SameSite=Lax${i}`}}catch{}return dt(t)}function vn(t){return getComputedStyle(document.documentElement).getPropertyValue(`--nish-${t}`).trim()}function bn(){let t=vn("bg");if(!t)return;let e=document.querySelector('meta[name="theme-color"][data-nish]')??document.querySelector('meta[name="theme-color"]:not([media]):not([data-nish-keep])');e||(e=document.createElement("meta"),e.name="theme-color",(document.head||document.documentElement).appendChild(e)),e.setAttribute("data-nish",""),e.content=t}function Sn(){let t=F();if(t.watching||typeof window>"u")return;t.watching=!0;let e=()=>{let n=z();(n!==document.documentElement.getAttribute("data-theme-choice")||n==="system")&&dt(n)};typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: light)").addEventListener("change",e),window.addEventListener("storage",n=>{n.key===me()&&e()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}function En(t){Sn();let{listeners:e}=F();return e.add(t),()=>{e.delete(t)}}var he=["system","light","dark"];function yn(){let t=ht(z());return gn(t),t}var rt="http://www.w3.org/2000/svg";function Ne(t,e,n={}){let i=document.createElementNS(rt,"svg"),s={width:String(t),height:String(t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false",...n};for(let r of Object.keys(s))i.setAttribute(r,s[r]);for(let[r,o]of e){let d=document.createElementNS(rt,r);for(let c of Object.keys(o))d.setAttribute(c,o[c]);i.appendChild(d)}return i}var ot={system:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}],["path",{d:"M8 21h8M12 17v4"}]],light:[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2M12 20v2m-7.07-2.93 1.41-1.41M17.66 6.34l1.41-1.41M2 12h2m16 0h2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41"}]],dark:[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9"}]]},_n=()=>({system:q.themeSystem,light:q.themeLight,dark:q.themeDark}),Tn="set on another site";function ht(t){let e=he.indexOf(t);return he[(e+1)%he.length]}function Ce(t,e){return t==="system"||t==="light"||t==="dark"?e[t]:X(B,t)?B[t].label:t.charAt(0).toUpperCase()+t.slice(1)}function ut(t,e={}){let n={..._n(),...e.labels},i=e.strings?.themeToggleLabel??q.themeToggleLabel,s=e.elsewhereLabel??Tn;t.tagName==="BUTTON"&&!t.getAttribute("type")&&t.setAttribute("type","button");let r=Object.keys(ot).map(l=>Ne(16,ot[l],{"data-icon":l}));if(e.showLabel){let l=document.createElement("span");l.setAttribute("data-theme-word",""),l.setAttribute("aria-hidden","true"),r.push(l)}t.replaceChildren(...r);let o=t.querySelector("[data-theme-word]"),d=l=>{let u=l==="system"||l==="light"||l==="dark"?l:ue(l);t.setAttribute("data-choice",l),t.querySelectorAll("svg[data-icon]").forEach(v=>{v.getAttribute("data-icon")===u?v.removeAttribute("display"):v.setAttribute("display","none")});let m=he.includes(l)?"":` (${s})`,g=i(`${Ce(l,n)}${m}`,Ce(ht(l),n));t.setAttribute("aria-label",g),t.setAttribute("title",g),o&&(o.textContent=Ce(l,n))},c=()=>{yn()};t.addEventListener("click",c);let h=En(l=>d(l));return d(z()),()=>{t.removeEventListener("click",c),h()}}var at=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4M12 17h.01"}]],lt=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4M12 8h.01"}]],wn={neutral:lt,info:lt,ok:[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]],warn:at,loss:at},xn=6e3,N=null,K=null;function mt(t,e={}){K?.(),(!N||!N.isConnected)&&(N=document.createElement("div"),N.setAttribute("role","status"),N.setAttribute("aria-live","polite"),N.className="nish-toast-region",document.body.appendChild(N));let n=N,i=document.createElement("div");i.className="nish-toast"+(e.tone&&e.tone!=="neutral"?` nish-toast--${e.tone}`:"");let s=document.createElement("span");s.className="nish-toast-icon",s.setAttribute("aria-hidden","true"),s.append(Ne(15,wn[e.tone??"neutral"])),i.append(s);let r=document.createElement("p");r.className="nish-toast-body",r.append(typeof t=="string"?document.createTextNode(t):t),i.append(r);let o=null,d=e.duration==="sticky"?1/0:e.duration??xn,c=0,h=0,l=()=>{o!=null&&clearTimeout(o),o=null,i.remove(),K===l&&(K=null)},u=a=>{Number.isFinite(a)&&(c=Date.now(),o=setTimeout(l,a))},m=()=>{h+=1,!(h>1||o==null)&&(clearTimeout(o),o=null,d=Math.max(0,d-(Date.now()-c)))},g=()=>{h!==0&&(h-=1,h===0&&u(Math.max(d,1e3)))},v=e.action,_=v?.href!=null?et(v.href):null;if(v&&(v.href==null||_!=null)){let a=document.createElement(v.href!=null?"a":"button");a.className="nish-toast-action",a.textContent=v.label,_!=null?a.href=_:a.type="button",a.addEventListener("click",()=>{v.onClick?.(),l()}),i.append(a)}let p=document.createElement("button");return p.type="button",p.className="nish-toast-close",p.setAttribute("aria-label",e.dismissLabel??e.strings?.dismiss??tt.dismiss),p.append(Ne(14,[["path",{d:"M18 6 6 18M6 6l12 12"}]])),p.addEventListener("click",l),i.append(p),i.addEventListener("pointerenter",a=>a.pointerType==="mouse"&&m()),i.addEventListener("pointerleave",a=>a.pointerType==="mouse"&&g()),i.addEventListener("focusin",a=>!i.contains(a.relatedTarget)&&m()),i.addEventListener("focusout",a=>!i.contains(a.relatedTarget)&&g()),i.addEventListener("keydown",a=>{a.key==="Escape"&&l()}),setTimeout(()=>{K===l&&(n.append(i),u(d))},50),K=l,l}var An=()=>typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function ke(t){if(typeof document>"u")return()=>{};let e=!1,n=!1;if(t.open)return()=>s();let i=document.activeElement instanceof HTMLElement?document.activeElement:null;function s(){if(e||!t.open)return;e=!0;let a,f=()=>{t.removeEventListener("animationend",T),a!==void 0&&clearTimeout(a),t.removeAttribute("data-closing"),t.style.transform="",t.style.transition="",e=!1,t.open&&t.close()},T=Kt=>{Kt.target===t&&f()};if(An()){f();return}t.style.transform="",t.setAttribute("data-closing",""),t.addEventListener("animationend",T),a=setTimeout(f,260)}let r=a=>{a.preventDefault(),s()},o=a=>{a.key==="Escape"&&a.stopPropagation()},d=a=>{if(a.target===t){let f=t.getBoundingClientRect();a.clientX>=f.left&&a.clientX<=f.right&&a.clientY>=f.top&&a.clientY<=f.bottom||s();return}a.target instanceof Element&&a.target.closest("[data-sheet-close]")&&s()},c=0,h=0,l=0,u=0,m=1,g=a=>{if(a.pointerType==="mouse"||e||!a.isPrimary||typeof matchMedia<"u"&&matchMedia("(min-width: 640px)").matches)return;let f=t.getBoundingClientRect();!(a.target instanceof Element&&a.target.closest(".nish-sheet-header")!=null)&&a.clientY-f.top>28||(n=!0,c=h=a.clientY,l=a.timeStamp,u=0,m=f.height||1,t.style.transition="none",t.setPointerCapture?.(a.pointerId))},v=a=>{if(!n)return;let f=a.clientY-c,T=a.timeStamp-l;T>0&&(u=(a.clientY-h)/T),h=a.clientY,l=a.timeStamp,t.style.transform=`translateY(${f>=0?f:f*.3}px)`},_=a=>{if(!n)return;n=!1,t.releasePointerCapture?.(a.pointerId);let f=a.clientY-c;if(a.type!=="pointercancel"&&(f>m*.3||u>.5)){s();return}t.style.transition="transform 180ms var(--nish-ease-out, ease-out)",t.style.transform="",setTimeout(()=>{e||(t.style.transition="")},200)},p=()=>{t.removeEventListener("cancel",r),t.removeEventListener("keydown",o),t.removeEventListener("click",d),t.removeEventListener("pointerdown",g),t.removeEventListener("pointermove",v),t.removeEventListener("pointerup",_),t.removeEventListener("pointercancel",_),t.removeEventListener("close",p),i?.isConnected&&i.focus()};return t.addEventListener("cancel",r),t.addEventListener("keydown",o),t.addEventListener("click",d),t.addEventListener("pointerdown",g),t.addEventListener("pointermove",v),t.addEventListener("pointerup",_),t.addEventListener("pointercancel",_),t.addEventListener("close",p),t.showModal(),s}function pt(t,e){if(typeof document>"u")return()=>{};let n=document.documentElement,i=()=>{let r=t.offsetHeight;r>0?n.style.setProperty(e,`${r}px`):n.style.removeProperty(e)};i();let s;return typeof ResizeObserver<"u"?(s=new ResizeObserver(i),s.observe(t)):window.addEventListener("resize",i),()=>{s?.disconnect(),window.removeEventListener("resize",i),n.style.removeProperty(e)}}var ft=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var x=function(t,e,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n},E=function(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},W,pe,fe,Z,$e,J,ge,O,Q,M,ve,gt;var b={__proto__:null};b.enumerable=!0;Object.freeze(b);var Pe=(M=class{constructor(e,n={}){if(W.set(this,!1),pe.set(this,!1),fe.set(this,!1),Z.set(this,!1),$e.set(this,Date.now()),J.set(this,!1),ge.set(this,void 0),O.set(this,void 0),Q.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof n!="object"||!n)throw new Error('The "options" argument must be an object');let{bubbles:i,cancelable:s,composed:r}=n;x(this,W,!!s,"f"),x(this,pe,!!i,"f"),x(this,fe,!!r,"f"),x(this,ge,`${e}`,"f"),x(this,O,null,"f"),x(this,Q,!1,"f")}initEvent(e,n,i){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){x(this,Z,!0,"f")}get target(){return E(this,O,"f")}get currentTarget(){return E(this,O,"f")}get srcElement(){return E(this,O,"f")}get type(){return E(this,ge,"f")}get cancelable(){return E(this,W,"f")}get defaultPrevented(){return E(this,W,"f")&&E(this,Z,"f")}get timeStamp(){return E(this,$e,"f")}composedPath(){return E(this,Q,"f")?[E(this,O,"f")]:[]}get returnValue(){return!E(this,W,"f")||!E(this,Z,"f")}get bubbles(){return E(this,pe,"f")}get composed(){return E(this,fe,"f")}get eventPhase(){return E(this,Q,"f")?M.AT_TARGET:M.NONE}get cancelBubble(){return E(this,J,"f")}set cancelBubble(e){e&&x(this,J,!0,"f")}stopPropagation(){x(this,J,!0,"f")}get isTrusted(){return!1}},W=new WeakMap,pe=new WeakMap,fe=new WeakMap,Z=new WeakMap,$e=new WeakMap,J=new WeakMap,ge=new WeakMap,O=new WeakMap,Q=new WeakMap,M.NONE=0,M.CAPTURING_PHASE=1,M.AT_TARGET=2,M.BUBBLING_PHASE=3,M);Object.defineProperties(Pe.prototype,{initEvent:b,stopImmediatePropagation:b,preventDefault:b,target:b,currentTarget:b,srcElement:b,type:b,cancelable:b,defaultPrevented:b,timeStamp:b,composedPath:b,returnValue:b,bubbles:b,composed:b,eventPhase:b,cancelBubble:b,stopPropagation:b,isTrusted:b});var vt=(gt=class extends Pe{constructor(e,n={}){super(e,n),ve.set(this,void 0),x(this,ve,n?.detail??null,"f")}initCustomEvent(e,n,i,s){throw new Error("Method not implemented.")}get detail(){return E(this,ve,"f")}},ve=new WeakMap,gt);Object.defineProperties(vt.prototype,{detail:b});var A=Pe,Oe=vt;var y;var ai=(y=class{constructor(){this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""}get parentRule(){return null}get parentStyleSheet(){return this.__parentStyleSheet}get type(){return 0}},y.STYLE_RULE=1,y.CHARSET_RULE=2,y.IMPORT_RULE=3,y.MEDIA_RULE=4,y.FONT_FACE_RULE=5,y.PAGE_RULE=6,y.NAMESPACE_RULE=10,y.KEYFRAMES_RULE=7,y.KEYFRAME_RULE=8,y.SUPPORTS_RULE=12,y.COUNTER_STYLE_RULE=11,y.FONT_FEATURE_VALUES_RULE=14,y.MARGIN_RULE=9,y);globalThis.Event??=A;globalThis.CustomEvent??=Oe;var He=Symbol(),bt=t=>typeof t=="boolean"?t:t?.capture??!1,R={__proto__:null};R.enumerable=!0;Object.freeze(R);var be=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,n,i){if(n==null)return;let s=bt(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);if(r===void 0)r=new Map,s.set(e,r);else if(r.has(n))return;let o=typeof i=="object"&&i?i:{};o.signal?.addEventListener("abort",()=>this.removeEventListener(e,n,i)),r.set(n,o??{})}removeEventListener(e,n,i){if(n==null)return;let s=bt(i)?this.__captureEventListeners:this.__eventListeners,r=s.get(e);r!==void 0&&(r.delete(n),r.size||s.delete(e))}dispatchEvent(e){let n=this.__resolveFullEventPath();!e.composed&&this.__host&&(n=n.slice(0,n.indexOf(this.__host)));let i=!1,s=!1,r=A.NONE,o=null,d=null,c=null,h=e.stopPropagation,l=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return o??d},...R},srcElement:{get(){return e.target},...R},currentTarget:{get(){return c},...R},eventPhase:{get(){return r},...R},composedPath:{value:()=>n,...R},stopPropagation:{value:()=>{i=!0,h.call(e)},...R},stopImmediatePropagation:{value:()=>{s=!0,l.call(e)},...R}});let u=(p,a,f)=>{typeof p=="function"?p(e):typeof p?.handleEvent=="function"&&p.handleEvent(e),a.once&&f.delete(p)},m=()=>(c=null,r=A.NONE,!e.defaultPrevented),g=n.slice().reverse();o=!this.__host||!e.composed?this:null;let v=p=>{for(d=this;d.__host&&p.includes(d.__host);)d=d.__host};for(let p of g){!o&&(!d||d===p.__host)&&v(g.slice(g.indexOf(p))),c=p,r=p===e.target?A.AT_TARGET:A.CAPTURING_PHASE;let a=p.__captureEventListeners.get(e.type);if(a){for(let[f,T]of a)if(u(f,T,a),s)return m()}if(i)return m()}let _=e.bubbles?n:[this];d=null;for(let p of _){!o&&(!d||p===d.__host)&&v(_.slice(0,_.indexOf(p)+1)),c=p,r=p===e.target?A.AT_TARGET:A.BUBBLING_PHASE;let a=p.__eventListeners.get(e.type);if(a){for(let[f,T]of a)if(u(f,T,a),s)return m()}if(i)return m()}return m()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,yt,Cn]}};var St=new WeakMap,ee=t=>{let e=St.get(t);return e===void 0&&St.set(t,e=new Map),e},te=class extends be{getRootNode(e){return e?.composed?Ie:this.__host?.__shadowRoot??Ie}};var Et=class extends te{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var yt=new Et,Ie=yt;var _t=class extends te{constructor(e){if(super(),e!==He)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:Se,customElements:Ue,document:Ie,Document:Et,Element:Tt,EventTarget:be,HTMLElement:wt,Node:te,ShadowRoot:xt,window:this,Window:_t})}};var Tt=class extends te{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(ee(this)).map(([e,n])=>({name:e,value:n}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,n){ee(this).set(e,String(n))}removeAttribute(e){ee(this).delete(e)}toggleAttribute(e,n){if(this.hasAttribute(e)){if(n===void 0||!n)return this.removeAttribute(e),!1}else return n===void 0||n?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return ee(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let n=new xt(He,e);return n.__eventTargetParent=this,n.__host=this,this.__shadowRoot=n}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new ft(this);return this.__internals=e,e}getAttribute(e){return ee(this).get(e)??null}};var wt=class extends Tt{},De=wt;var xt=class extends te{get host(){return this.__host}constructor(e,n){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=n.mode}};globalThis.litServerRoot??=Object.defineProperty(new De,"localName",{get(){return"lit-server-root"}});function Rn(){let t,e;return{promise:new Promise((i,s)=>{t=i,e=s}),resolve:t,reject:e}}var Se=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,n){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
2
+ Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);if(this.__reverseDefinitions.has(n))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(n)}`);n.__localName=e,this.__definitions.set(e,{ctor:n,observedAttributes:n.observedAttributes??[]}),this.__reverseDefinitions.set(n,e),this.__pendingWhenDefineds.get(e)?.resolve(n),this.__pendingWhenDefineds.delete(e)}get(e){return this.__definitions.get(e)?.ctor}getName(e){return this.__reverseDefinitions.get(e)??null}initialize(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(e){let n=this.__definitions.get(e);if(n)return n.ctor;let i=this.__pendingWhenDefineds.get(e);return i||(i=Rn(),this.__pendingWhenDefineds.set(e,i)),i.promise}},Ln=Se;var Ue=new Ln,Cn=new _t(He);var ne=globalThis,ye=ne.ShadowRoot&&(ne.ShadyCSS===void 0||ne.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rt=Symbol(),At=new WeakMap,Ee=class{constructor(e,n,i){if(this._$cssResult$=!0,i!==Rt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o,n=this.t;if(ye&&e===void 0){let i=n!==void 0&&n.length===1;i&&(e=At.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&At.set(n,e))}return e}toString(){return this.cssText}},Lt=t=>new Ee(typeof t=="string"?t:t+"",void 0,Rt);var Ct=(t,e)=>{if(ye)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of e){let i=document.createElement("style"),s=ne.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=n.cssText,t.appendChild(i)}},Ge=ye||ne.CSSStyleSheet===void 0?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(let i of e.cssRules)n+=i.cssText;return Lt(n)})(t):t;var{is:Nn,defineProperty:Mn,getOwnPropertyDescriptor:kn,getOwnPropertyNames:$n,getOwnPropertySymbols:Pn,getPrototypeOf:On}=Object,se=globalThis;se.customElements??=Ue;var Nt=se.trustedTypes,In=Nt?Nt.emptyScript:"",Hn=se.reactiveElementPolyfillSupport,ie=(t,e)=>t,Be={toAttribute(t,e){switch(e){case Boolean:t=t?In:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},kt=(t,e)=>!Nn(t,e),Mt={attribute:!0,type:String,converter:Be,reflect:!1,useDefault:!1,hasChanged:kt};Symbol.metadata??=Symbol("metadata"),se.litPropertyMetadata??=new WeakMap;var L=class extends(globalThis.HTMLElement??De){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=Mt){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){let i=Symbol(),s=this.getPropertyDescriptor(e,i,n);s!==void 0&&Mn(this.prototype,e,s)}}static getPropertyDescriptor(e,n,i){let{get:s,set:r}=kn(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:s,set(o){let d=s?.call(this);r?.call(this,o),this.requestUpdate(e,d,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Mt}static _$Ei(){if(this.hasOwnProperty(ie("elementProperties")))return;let e=On(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ie("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ie("properties"))){let n=this.properties,i=[...$n(n),...Pn(n)];for(let s of i)this.createProperty(s,n[s])}let e=this[Symbol.metadata];if(e!==null){let n=litPropertyMetadata.get(e);if(n!==void 0)for(let[i,s]of n)this.elementProperties.set(i,s)}this._$Eh=new Map;for(let[n,i]of this.elementProperties){let s=this._$Eu(n,i);s!==void 0&&this._$Eh.set(s,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let n=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let s of i)n.unshift(Ge(s))}else e!==void 0&&n.push(Ge(e));return n}static _$Eu(e,n){let i=n.attribute;return i===!1?void 0:typeof i=="string"?i: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,n=this.constructor.elementProperties;for(let i of n.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ct(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,n,i){this._$AK(e,i)}_$ET(e,n){let i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){let r=(i.converter?.toAttribute!==void 0?i.converter:Be).toAttribute(n,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,n){let i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){let r=i.getPropertyOptions(s),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:Be;this._$Em=s;let d=o.fromAttribute(n,r.type);this[s]=d??this._$Ej?.get(s)??d,this._$Em=null}}requestUpdate(e,n,i,s=!1,r){if(e!==void 0){let o=this.constructor;if(s===!1&&(r=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??kt)(r,n)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,n,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(n=void 0),this._$AL.set(e,n)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}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[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[s,r]of i){let{wrapped:o}=r,d=this[s];o!==!0||this._$AL.has(s)||d===void 0||this.C(s,void 0,r,d)}}let e=!1,n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(n)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.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(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};L.elementStyles=[],L.shadowRootOptions={mode:"open"},L[ie("elementProperties")]=new Map,L[ie("finalized")]=new Map,Hn?.({ReactiveElement:L}),(se.reactiveElementVersions??=[]).push("2.1.2");var Te=globalThis,$t=t=>t,_e=Te.trustedTypes,Pt=_e?_e.createPolicy("lit-html",{createHTML:t=>t}):void 0,Gt="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,Bt="?"+k,Dn=`<${Bt}>`,D=Te.document===void 0?{createTreeWalker:()=>({})}:document,oe=()=>D.createComment(""),ae=t=>t===null||typeof t!="object"&&typeof t!="function",qe=Array.isArray,Un=t=>qe(t)||typeof t?.[Symbol.iterator]=="function",Fe=`[
3
3
  \f\r]`,re=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ot=/-->/g,It=/>/g,I=RegExp(`>|${Fe}(?:([^\\s"'>=/]+)(${Fe}*=${Fe}*(?:[^
4
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ht=/'/g,Dt=/"/g,Ft=/^(?:script|style|textarea|title)$/i,Ke=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),Gi=Ke(1),Bi=Ke(2),Fi=Ke(3),U=Symbol.for("lit-noChange"),S=Symbol.for("lit-nothing"),Ut=new WeakMap,H=D.createTreeWalker(D,129);function zt(t,e){if(!qe(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Pt!==void 0?Pt.createHTML(e):e}var Un=(t,e)=>{let n=t.length-1,i=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=re;for(let d=0;d<n;d++){let c=t[d],h,l,u=-1,m=0;for(;m<c.length&&(o.lastIndex=m,l=o.exec(c),l!==null);)m=o.lastIndex,o===re?l[1]==="!--"?o=Ot:l[1]!==void 0?o=It:l[2]!==void 0?(Ft.test(l[2])&&(s=RegExp("</"+l[2],"g")),o=I):l[3]!==void 0&&(o=I):o===I?l[0]===">"?(o=s??re,u=-1):l[1]===void 0?u=-2:(u=o.lastIndex-l[2].length,h=l[1],o=l[3]===void 0?I:l[3]==='"'?Dt:Ht):o===Dt||o===Ht?o=I:o===Ot||o===It?o=re:(o=I,s=void 0);let g=o===I&&t[d+1].startsWith("/>")?" ":"";r+=o===re?c+Hn:u>=0?(i.push(h),c.slice(0,u)+Gt+c.slice(u)+k+g):c+k+(u===-2?d:g)}return[zt(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},le=class t{constructor({strings:e,_$litType$:n},i){let s;this.parts=[];let r=0,o=0,d=e.length-1,c=this.parts,[h,l]=Un(e,n);if(this.el=t.createElement(h,i),H.currentNode=this.el.content,n===2||n===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=H.nextNode())!==null&&c.length<d;){if(s.nodeType===1){if(s.hasAttributes())for(let u of s.getAttributeNames())if(u.endsWith(Gt)){let m=l[o++],g=s.getAttribute(u).split(k),v=/([.?@])?(.*)/.exec(m);c.push({type:1,index:r,name:v[2],strings:g,ctor:v[1]==="."?We:v[1]==="?"?Ve:v[1]==="@"?je:j}),s.removeAttribute(u)}else u.startsWith(k)&&(c.push({type:6,index:r}),s.removeAttribute(u));if(Ft.test(s.tagName)){let u=s.textContent.split(k),m=u.length-1;if(m>0){s.textContent=_e?_e.emptyScript:"";for(let g=0;g<m;g++)s.append(u[g],oe()),H.nextNode(),c.push({type:2,index:++r});s.append(u[m],oe())}}}else if(s.nodeType===8)if(s.data===Bt)c.push({type:2,index:r});else{let u=-1;for(;(u=s.data.indexOf(k,u+1))!==-1;)c.push({type:7,index:r}),u+=k.length-1}r++}}static createElement(e,n){let i=D.createElement("template");return i.innerHTML=e,i}};function V(t,e,n=t,i){if(e===U)return e;let s=i!==void 0?n._$Co?.[i]:n._$Cl,r=ae(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(t),s._$AT(t,n,i)),i!==void 0?(n._$Co??=[])[i]=s:n._$Cl=s),s!==void 0&&(e=V(t,s._$AS(t,e.values),s,i)),e}var ze=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:n},parts:i}=this._$AD,s=(e?.creationScope??D).importNode(n,!0);H.currentNode=s;let r=H.nextNode(),o=0,d=0,c=i[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new ce(r,r.nextSibling,this,e):c.type===1?h=new c.ctor(r,c.name,c.strings,this,e):c.type===6&&(h=new Ye(r,this,e)),this._$AV.push(h),c=i[++d]}o!==c?.index&&(r=H.nextNode(),o++)}return H.currentNode=D,s}p(e){let n=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,n),n+=i.strings.length-2):i._$AI(e[n])),n++}},ce=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,i,s){this.type=2,this._$AH=S,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=V(this,e,n),ae(e)?e===S||e==null||e===""?(this._$AH!==S&&this._$AR(),this._$AH=S):e!==this._$AH&&e!==U&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Dn(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!==S&&ae(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.createTextNode(e)),this._$AH=e}$(e){let{values:n,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=le.createElement(zt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(n);else{let r=new ze(s,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Ut.get(e.strings);return n===void 0&&Ut.set(e.strings,n=new le(e)),n}k(e){qe(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,i,s=0;for(let r of e)s===n.length?n.push(i=new t(this.O(oe()),this.O(oe()),this,this.options)):i=n[s],i._$AI(r),s++;s<n.length&&(this._$AR(i&&i._$AB.nextSibling,s),n.length=s)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){let i=$t(e).nextSibling;$t(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,i,s,r){this.type=1,this._$AH=S,this._$AN=void 0,this.element=e,this.name=n,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=S}_$AI(e,n=this,i,s){let r=this.strings,o=!1;if(r===void 0)e=V(this,e,n,0),o=!ae(e)||e!==this._$AH&&e!==U,o&&(this._$AH=e);else{let d=e,c,h;for(e=r[0],c=0;c<r.length-1;c++)h=V(this,d[i+c],n,c),h===U&&(h=this._$AH[c]),o||=!ae(h)||h!==this._$AH[c],h===S?e=S:e!==S&&(e+=(h??"")+r[c+1]),this._$AH[c]=h}o&&!s&&this.j(e)}j(e){e===S?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},We=class extends j{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===S?void 0:e}},Ve=class extends j{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==S)}},je=class extends j{constructor(e,n,i,s,r){super(e,n,i,s,r),this.type=5}_$AI(e,n=this){if((e=V(this,e,n,0)??S)===U)return;let i=this._$AH,s=e===S&&i!==S||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==S&&(i===S||s);s&&this.element.removeEventListener(this.name,this,i),r&&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)}},Ye=class{constructor(e,n,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){V(this,e)}};var Gn=Te.litHtmlPolyfillSupport;Gn?.(le,ce),(Te.litHtmlVersions??=[]).push("3.3.3");var Wt=(t,e,n)=>{let i=n?.renderBefore??e,s=i._$litPart$;if(s===void 0){let r=n?.renderBefore??null;i._$litPart$=s=new ce(e.insertBefore(oe(),r),r,void 0,n??{})}return s._$AI(t),s};var Xe=globalThis,$=class extends L{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 n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Wt(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return U}};$._$litElement$=!0,$.finalized=!0,Xe.litElementHydrateSupport?.({LitElement:$});var Bn=Xe.litElementPolyfillSupport;Bn?.({LitElement:$});(Xe.litElementVersions??=[]).push("4.2.2");var we={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:t=>`${t} result${t===1?"":"s"}`,noMatches:"No matches",searching:"Searching\u2026",clear:"Clear",copy:"Copy",copied:"Copied",copyManual:"Press Ctrl+C",optional:"Optional",sections:"Sections",onThisPage:"On this page",filters:"Filters",clearFilters:"Clear filters",showResults:"Show results",activeCount:t=>`${t} active`,remove:"Remove",removeNamed:t=>`Remove ${t}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:t=>`${t}: no data`,seriesNumber:t=>`Series ${t}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(t,e)=>`Theme: ${t}. Switch to ${e}`,themeElsewhere:"set on another site"};function Ze(){return de("element-strings",()=>({values:{...we},listeners:new Set}))}function Fn(t){let e=Ze(),n={...e.values};for(let[i,s]of Object.entries(t))s!==void 0&&Object.hasOwn(we,i)&&(n[i]=s);e.values=n;for(let i of Array.from(e.listeners))i()}function Y(){let t=Ze(),e=t.values;return Object.keys(we).some(i=>e[i]===void 0)&&(t.values={...we,...Object.fromEntries(Object.entries(e).filter(([,i])=>i!==void 0))}),t.values}function Vt(t){let e=Ze().listeners;return e.add(t),()=>{e.delete(t)}}var w=class extends ${#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=Vt(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function jt(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}function C(t,e){customElements.get(t)||customElements.define(t,e)}function Yt(t,e){let n=null,i=()=>Array.from(t.querySelectorAll(":scope > a")),s=()=>{let o=location.pathname,d=null,c=-1;for(let h of i()){if(e?.(h),!h.getAttribute("href"))continue;let l;try{l=new URL(h.getAttribute("href"),location.href)}catch{continue}if(l.origin!==location.origin)continue;let u=h.getAttribute("href").trim();if(u==="#"||u.startsWith("?")||l.pathname===location.pathname&&!l.hash&&u.startsWith("#"))continue;if(l.hash&&l.pathname===location.pathname){l.hash===location.hash&&(d=h,c=1/0);continue}let m=l.pathname;(m==="/"?o==="/":o===m||o.startsWith(m.endsWith("/")?m:`${m}/`))&&m.length>c&&(d=h,c=m.length)}if(!d){n?.removeAttribute("aria-current"),n=null;return}for(let h of i())h.removeAttribute("aria-current");d.setAttribute("aria-current","page"),n=d},r=new MutationObserver(()=>{r.disconnect(),s(),r.observe(t,{childList:!0})});return s(),window.addEventListener("popstate",s),window.addEventListener("hashchange",s),r.observe(t,{childList:!0}),()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),r.disconnect()}}var xe=class extends w{static properties={label:{type:String,reflect:!0},lg:{type:Boolean,reflect:!0}};#e=null;#t=null;#n=null;constructor(){super(),this.label="",this.lg=!1}connectedCallback(){super.connectedCallback(),jt(()=>this.#s())}#s(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-bottom-nav");if(!e){for(e=document.createElement("nav"),e.className="nish-bottom-nav";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#i(),this.#n=Yt(e,n=>n.classList.add("nish-bottom-nav-item")),this.#t=pt(e,"--nish-bottom-nav-h")}disconnectedCallback(){super.disconnectedCallback(),this.#e=null,this.#n?.(),this.#n=null,this.#t?.(),this.#t=null}updated(e){this.#i()}#i(){this.#e&&(this.#e.setAttribute("aria-label",this.label||Y().sections),this.#e.classList.toggle("nish-bottom-nav--lg",this.lg))}};C("nish-bottom-nav",xe);var qt=0,Ae=class extends w{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;opener=null;value="";waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.value="",this.open=!1,this.dialog.close())}show(){this.open=!0}close(e=""){this.dialog?.open&&(this.value=e),this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let n=e.target.closest("[data-dialog-open]");n&&n.getAttribute("data-dialog-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-dialog",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("click",this.onDialogClick),e.addEventListener("keydown",this.onKey),e.addEventListener("cancel",this.onCancel),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let n=e.querySelector(".nish-dialog-title"),i=e.querySelector(".nish-dialog-body");n?(n.id||(n.id=`nish-dialog-title-${++qt}`),e.setAttribute("aria-labelledby",n.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label")),i?(i.id||(i.id=`nish-dialog-body-${++qt}`),e.setAttribute("aria-describedby",i.id)):e.removeAttribute("aria-describedby")}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?(this.opener=document.activeElement instanceof HTMLElement?document.activeElement:null,e.returnValue="",e.showModal()):!this.open&&e.open&&e.close())}onDialogClick=e=>{let n=this.dialog;if(n){if(e.target===n){let i=n.getBoundingClientRect();e.clientX>=i.left&&e.clientX<=i.right&&e.clientY>=i.top&&e.clientY<=i.bottom||this.close();return}if(e.target instanceof Element){let i=e.target.closest("[data-dialog-close]");i&&i.closest("dialog")===n&&this.close(i.getAttribute("value")??"")}}};onKey=e=>{e.key==="Escape"&&e.stopPropagation()};onCancel=e=>{e.preventDefault(),this.close()};onDialogClose=()=>{let e=this.value||this.dialog?.returnValue||"";this.value="",this.open&&(this.open=!1);let n=this.opener;this.opener=null,n?.isConnected&&n.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0,detail:{value:e}}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};C("nish-dialog",Ae);var zn=0,Re=class extends w{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;closeSheet=null;waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.open=!1,this.dialog.close())}show(){this.open=!0}close(){this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let n=e.target.closest("[data-sheet-open]");n&&n.getAttribute("data-sheet-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-sheet",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let n=e.querySelector(".nish-sheet-title");n?(n.id||(n.id=`nish-sheet-title-${++zn}`),e.setAttribute("aria-labelledby",n.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"))}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?this.closeSheet=ke(e):this.open&&e.hasAttribute("data-closing")?this.reopen=!0:!this.open&&e.open&&(this.reopen=!1,this.closeSheet?.()))}reopen=!1;onDialogClose=()=>{if(this.closeSheet=null,this.reopen){this.reopen=!1,setTimeout(()=>{this.open&&this.isConnected&&this.dialog&&!this.dialog.open&&(this.closeSheet=ke(this.dialog))},0);return}this.open&&(this.open=!1),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};C("nish-sheet",Re);var Le=class extends w{static properties={labelled:{type:Boolean,reflect:!0},pill:{type:Boolean,reflect:!0},labelSystem:{attribute:"label-system"},labelLight:{attribute:"label-light"},labelDark:{attribute:"label-dark"}};#e=null;#t=null;constructor(){super(),this.labelled=!1,this.pill=!1}connectedCallback(){super.connectedCallback(),this.#o()}disconnectedCallback(){super.disconnectedCallback(),this.#r()}updated(e){this.#e&&this.#n!==this.#i()&&this.#o()}#n="";#s(){let e=Y();return[this.labelSystem||e.themeSystem,this.labelLight||e.themeLight,this.labelDark||e.themeDark]}#i(){let e=Y();return JSON.stringify([this.labelled,this.pill,...this.#s(),e.themeToggleLabel?.("{a}","{b}"),e.themeElsewhere])}#r(){this.#t?.(),this.#t=null,this.#e?.remove(),this.#e=null}#o(){this.#r(),this.#n=this.#i();let e=document.createElement("button");e.className="nish-theme-btn",e.classList.toggle("nish-theme-btn--labelled",this.labelled),e.classList.toggle("nish-theme-btn--pill",this.pill),this.prepend(e),this.#e=e;let[n,i,s]=this.#s(),r={system:n,light:i,dark:s},o=Y();this.#t=ut(e,{showLabel:this.labelled,labels:r,...o.themeToggleLabel?{strings:{themeToggleLabel:o.themeToggleLabel}}:{},...o.themeElsewhere?{elsewhereLabel:o.themeElsewhere}:{}})}};C("nish-theme-toggle",Le);export{xe as NishBottomNav,Ae as NishDialog,w as NishElement,Re as NishSheet,Le as NishThemeToggle,Fn as configureStrings,C as define,mt as toast};
4
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ht=/'/g,Dt=/"/g,Ft=/^(?:script|style|textarea|title)$/i,Ke=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),Bi=Ke(1),Fi=Ke(2),zi=Ke(3),U=Symbol.for("lit-noChange"),S=Symbol.for("lit-nothing"),Ut=new WeakMap,H=D.createTreeWalker(D,129);function zt(t,e){if(!qe(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Pt!==void 0?Pt.createHTML(e):e}var Gn=(t,e)=>{let n=t.length-1,i=[],s,r=e===2?"<svg>":e===3?"<math>":"",o=re;for(let d=0;d<n;d++){let c=t[d],h,l,u=-1,m=0;for(;m<c.length&&(o.lastIndex=m,l=o.exec(c),l!==null);)m=o.lastIndex,o===re?l[1]==="!--"?o=Ot:l[1]!==void 0?o=It:l[2]!==void 0?(Ft.test(l[2])&&(s=RegExp("</"+l[2],"g")),o=I):l[3]!==void 0&&(o=I):o===I?l[0]===">"?(o=s??re,u=-1):l[1]===void 0?u=-2:(u=o.lastIndex-l[2].length,h=l[1],o=l[3]===void 0?I:l[3]==='"'?Dt:Ht):o===Dt||o===Ht?o=I:o===Ot||o===It?o=re:(o=I,s=void 0);let g=o===I&&t[d+1].startsWith("/>")?" ":"";r+=o===re?c+Dn:u>=0?(i.push(h),c.slice(0,u)+Gt+c.slice(u)+k+g):c+k+(u===-2?d:g)}return[zt(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},le=class t{constructor({strings:e,_$litType$:n},i){let s;this.parts=[];let r=0,o=0,d=e.length-1,c=this.parts,[h,l]=Gn(e,n);if(this.el=t.createElement(h,i),H.currentNode=this.el.content,n===2||n===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=H.nextNode())!==null&&c.length<d;){if(s.nodeType===1){if(s.hasAttributes())for(let u of s.getAttributeNames())if(u.endsWith(Gt)){let m=l[o++],g=s.getAttribute(u).split(k),v=/([.?@])?(.*)/.exec(m);c.push({type:1,index:r,name:v[2],strings:g,ctor:v[1]==="."?We:v[1]==="?"?Ve:v[1]==="@"?je:j}),s.removeAttribute(u)}else u.startsWith(k)&&(c.push({type:6,index:r}),s.removeAttribute(u));if(Ft.test(s.tagName)){let u=s.textContent.split(k),m=u.length-1;if(m>0){s.textContent=_e?_e.emptyScript:"";for(let g=0;g<m;g++)s.append(u[g],oe()),H.nextNode(),c.push({type:2,index:++r});s.append(u[m],oe())}}}else if(s.nodeType===8)if(s.data===Bt)c.push({type:2,index:r});else{let u=-1;for(;(u=s.data.indexOf(k,u+1))!==-1;)c.push({type:7,index:r}),u+=k.length-1}r++}}static createElement(e,n){let i=D.createElement("template");return i.innerHTML=e,i}};function V(t,e,n=t,i){if(e===U)return e;let s=i!==void 0?n._$Co?.[i]:n._$Cl,r=ae(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(t),s._$AT(t,n,i)),i!==void 0?(n._$Co??=[])[i]=s:n._$Cl=s),s!==void 0&&(e=V(t,s._$AS(t,e.values),s,i)),e}var ze=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:n},parts:i}=this._$AD,s=(e?.creationScope??D).importNode(n,!0);H.currentNode=s;let r=H.nextNode(),o=0,d=0,c=i[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new ce(r,r.nextSibling,this,e):c.type===1?h=new c.ctor(r,c.name,c.strings,this,e):c.type===6&&(h=new Ye(r,this,e)),this._$AV.push(h),c=i[++d]}o!==c?.index&&(r=H.nextNode(),o++)}return H.currentNode=D,s}p(e){let n=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,n),n+=i.strings.length-2):i._$AI(e[n])),n++}},ce=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,i,s){this.type=2,this._$AH=S,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=V(this,e,n),ae(e)?e===S||e==null||e===""?(this._$AH!==S&&this._$AR(),this._$AH=S):e!==this._$AH&&e!==U&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Un(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!==S&&ae(this._$AH)?this._$AA.nextSibling.data=e:this.T(D.createTextNode(e)),this._$AH=e}$(e){let{values:n,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=le.createElement(zt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(n);else{let r=new ze(s,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Ut.get(e.strings);return n===void 0&&Ut.set(e.strings,n=new le(e)),n}k(e){qe(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,i,s=0;for(let r of e)s===n.length?n.push(i=new t(this.O(oe()),this.O(oe()),this,this.options)):i=n[s],i._$AI(r),s++;s<n.length&&(this._$AR(i&&i._$AB.nextSibling,s),n.length=s)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){let i=$t(e).nextSibling;$t(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,i,s,r){this.type=1,this._$AH=S,this._$AN=void 0,this.element=e,this.name=n,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=S}_$AI(e,n=this,i,s){let r=this.strings,o=!1;if(r===void 0)e=V(this,e,n,0),o=!ae(e)||e!==this._$AH&&e!==U,o&&(this._$AH=e);else{let d=e,c,h;for(e=r[0],c=0;c<r.length-1;c++)h=V(this,d[i+c],n,c),h===U&&(h=this._$AH[c]),o||=!ae(h)||h!==this._$AH[c],h===S?e=S:e!==S&&(e+=(h??"")+r[c+1]),this._$AH[c]=h}o&&!s&&this.j(e)}j(e){e===S?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},We=class extends j{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===S?void 0:e}},Ve=class extends j{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==S)}},je=class extends j{constructor(e,n,i,s,r){super(e,n,i,s,r),this.type=5}_$AI(e,n=this){if((e=V(this,e,n,0)??S)===U)return;let i=this._$AH,s=e===S&&i!==S||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==S&&(i===S||s);s&&this.element.removeEventListener(this.name,this,i),r&&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)}},Ye=class{constructor(e,n,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){V(this,e)}};var Bn=Te.litHtmlPolyfillSupport;Bn?.(le,ce),(Te.litHtmlVersions??=[]).push("3.3.3");var Wt=(t,e,n)=>{let i=n?.renderBefore??e,s=i._$litPart$;if(s===void 0){let r=n?.renderBefore??null;i._$litPart$=s=new ce(e.insertBefore(oe(),r),r,void 0,n??{})}return s._$AI(t),s};var Xe=globalThis,$=class extends L{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 n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Wt(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return U}};$._$litElement$=!0,$.finalized=!0,Xe.litElementHydrateSupport?.({LitElement:$});var Fn=Xe.litElementPolyfillSupport;Fn?.({LitElement:$});(Xe.litElementVersions??=[]).push("4.2.2");var we={close:"Close",search:"Search",searchPlaceholder:"Search\u2026",noResults:"No results",results:"Results",resultCount:t=>`${t} result${t===1?"":"s"}`,noMatches:"No matches",searching:"Searching\u2026",clear:"Clear",copy:"Copy",copied:"Copied",copyManual:"Press Ctrl+C",optional:"Optional",sections:"Sections",onThisPage:"On this page",filters:"Filters",clearFilters:"Clear filters",showResults:"Show results",activeCount:t=>`${t} active`,remove:"Remove",removeNamed:t=>`Remove ${t}`,resizeColumns:"Resize columns",resizeRows:"Resize rows",legend:"Legend",noDataYet:"No data yet",noDataNamed:t=>`${t}: no data`,seriesNumber:t=>`Series ${t}`,trend:"Trend",themeSystem:"System",themeLight:"Light",themeDark:"Dark",themeToggleLabel:(t,e)=>`Theme: ${t}. Switch to ${e}`,themeElsewhere:"set on another site"};function Ze(){return de("element-strings",()=>({values:{...we},listeners:new Set}))}function zn(t){let e=Ze(),n={...e.values};for(let[i,s]of Object.entries(t))s!==void 0&&Object.hasOwn(we,i)&&(n[i]=s);e.values=n;for(let i of Array.from(e.listeners))i()}function Y(){let t=Ze(),e=t.values;return Object.keys(we).some(i=>e[i]===void 0)&&(t.values={...we,...Object.fromEntries(Object.entries(e).filter(([,i])=>i!==void 0))}),t.values}function Vt(t){let e=Ze().listeners;return e.add(t),()=>{e.delete(t)}}var w=class extends ${#e=null;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#e??=Vt(()=>this.stringsChanged())}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}stringsChanged(){this.requestUpdate()}};function jt(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}function C(t,e){customElements.get(t)||customElements.define(t,e)}function Yt(t,e){let n=null,i=()=>Array.from(t.querySelectorAll(":scope > a")),s=()=>{let o=location.pathname,d=null,c=-1;for(let h of i()){if(e?.(h),!h.getAttribute("href"))continue;let l;try{l=new URL(h.getAttribute("href"),location.href)}catch{continue}if(l.origin!==location.origin)continue;let u=h.getAttribute("href").trim();if(u==="#"||u.startsWith("?")||l.pathname===location.pathname&&!l.hash&&u.startsWith("#"))continue;if(l.hash&&l.pathname===location.pathname){l.hash===location.hash&&(d=h,c=1/0);continue}let m=l.pathname;(m==="/"?o==="/":o===m||o.startsWith(m.endsWith("/")?m:`${m}/`))&&m.length>c&&(d=h,c=m.length)}if(!d){n?.removeAttribute("aria-current"),n=null;return}for(let h of i())h.removeAttribute("aria-current");d.setAttribute("aria-current","page"),n=d},r=new MutationObserver(()=>{r.disconnect(),s(),r.observe(t,{childList:!0})});return s(),window.addEventListener("popstate",s),window.addEventListener("hashchange",s),r.observe(t,{childList:!0}),()=>{window.removeEventListener("popstate",s),window.removeEventListener("hashchange",s),r.disconnect()}}var xe=class extends w{static properties={label:{type:String,reflect:!0},lg:{type:Boolean,reflect:!0}};#e=null;#t=null;#n=null;constructor(){super(),this.label="",this.lg=!1}connectedCallback(){super.connectedCallback(),jt(()=>this.#s())}#s(){if(!this.isConnected||this.#e)return;let e=this.querySelector(":scope > nav.nish-bottom-nav");if(!e){for(e=document.createElement("nav"),e.className="nish-bottom-nav";this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e)}this.#e=e,this.#i(),this.#n=Yt(e,n=>n.classList.add("nish-bottom-nav-item")),this.#t=pt(e,"--nish-bottom-nav-h")}disconnectedCallback(){super.disconnectedCallback(),this.#e=null,this.#n?.(),this.#n=null,this.#t?.(),this.#t=null}updated(e){this.#i()}#i(){this.#e&&(this.#e.setAttribute("aria-label",this.label||Y().sections),this.#e.classList.toggle("nish-bottom-nav--lg",this.lg))}};C("nish-bottom-nav",xe);var qt=0,Ae=class extends w{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;opener=null;value="";waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.value="",this.open=!1,this.dialog.close())}show(){this.open=!0}close(e=""){this.dialog?.open&&(this.value=e),this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let n=e.target.closest("[data-dialog-open]");n&&n.getAttribute("data-dialog-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-dialog",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("click",this.onDialogClick),e.addEventListener("keydown",this.onKey),e.addEventListener("cancel",this.onCancel),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let n=e.querySelector(".nish-dialog-title"),i=e.querySelector(".nish-dialog-body");n?(n.id||(n.id=`nish-dialog-title-${++qt}`),e.setAttribute("aria-labelledby",n.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label")),i?(i.id||(i.id=`nish-dialog-body-${++qt}`),e.setAttribute("aria-describedby",i.id)):e.removeAttribute("aria-describedby")}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?(this.opener=document.activeElement instanceof HTMLElement?document.activeElement:null,e.returnValue="",e.showModal()):!this.open&&e.open&&e.close())}onDialogClick=e=>{let n=this.dialog;if(n){if(e.target===n){let i=n.getBoundingClientRect();e.clientX>=i.left&&e.clientX<=i.right&&e.clientY>=i.top&&e.clientY<=i.bottom||this.close();return}if(e.target instanceof Element){let i=e.target.closest("[data-dialog-close]");i&&i.closest("dialog")===n&&this.close(i.getAttribute("value")??"")}}};onKey=e=>{e.key==="Escape"&&e.stopPropagation()};onCancel=e=>{e.preventDefault(),this.close()};onDialogClose=()=>{let e=this.value||this.dialog?.returnValue||"";this.value="",this.open&&(this.open=!1);let n=this.opener;this.opener=null,n?.isConnected&&n.focus(),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0,detail:{value:e}}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};C("nish-dialog",Ae);var Wn=0,Re=class extends w{static properties={open:{type:Boolean,reflect:!0},label:{type:String}};dialog=null;closeSheet=null;waiting=!1;constructor(){super(),this.open=!1,this.label=null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onTrigger),this.wrap()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onTrigger),this.dialog?.open&&(this.open=!1,this.dialog.close())}show(){this.open=!0}close(){this.open=!1}onTrigger=e=>{if(!this.id||!(e.target instanceof Element))return;let n=e.target.closest("[data-sheet-open]");n&&n.getAttribute("data-sheet-open")===this.id&&this.show()};wrap(){if(this.dialog){this.syncLabel(),this.syncOpen();return}if(document.readyState==="loading"){this.waiting||(this.waiting=!0,document.addEventListener("DOMContentLoaded",()=>{this.waiting=!1,this.isConnected&&this.wrap()},{once:!0}));return}let e=document.createElement("dialog");e.className="nish-sheet",e.append(...Array.from(this.childNodes)),this.append(e),e.addEventListener("close",this.onDialogClose),this.dialog=e,this.syncLabel(),this.syncOpen()}syncLabel(){let e=this.dialog;if(!e)return;let n=e.querySelector(".nish-sheet-title");n?(n.id||(n.id=`nish-sheet-title-${++Wn}`),e.setAttribute("aria-labelledby",n.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.label?e.setAttribute("aria-label",this.label):e.removeAttribute("aria-label"))}syncOpen(){let e=this.dialog;!e||!this.isConnected||(this.open&&!e.open?this.closeSheet=ke(e):this.open&&e.hasAttribute("data-closing")?this.reopen=!0:!this.open&&e.open&&(this.reopen=!1,this.closeSheet?.()))}reopen=!1;onDialogClose=()=>{if(this.closeSheet=null,this.reopen){this.reopen=!1,setTimeout(()=>{this.open&&this.isConnected&&this.dialog&&!this.dialog.open&&(this.closeSheet=ke(this.dialog))},0);return}this.open&&(this.open=!1),this.dispatchEvent(new CustomEvent("nish-close",{bubbles:!0}))};updated(e){e.has("label")&&this.syncLabel(),e.has("open")&&this.syncOpen()}};C("nish-sheet",Re);var Le=class extends w{static properties={labelled:{type:Boolean,reflect:!0},pill:{type:Boolean,reflect:!0},labelSystem:{attribute:"label-system"},labelLight:{attribute:"label-light"},labelDark:{attribute:"label-dark"}};#e=null;#t=null;constructor(){super(),this.labelled=!1,this.pill=!1}connectedCallback(){super.connectedCallback(),this.#o()}disconnectedCallback(){super.disconnectedCallback(),this.#r()}updated(e){this.#e&&this.#n!==this.#i()&&this.#o()}#n="";#s(){let e=Y();return[this.labelSystem||e.themeSystem,this.labelLight||e.themeLight,this.labelDark||e.themeDark]}#i(){let e=Y();return JSON.stringify([this.labelled,this.pill,...this.#s(),e.themeToggleLabel?.("{a}","{b}"),e.themeElsewhere])}#r(){this.#t?.(),this.#t=null,this.#e?.remove(),this.#e=null}#o(){this.#r(),this.#n=this.#i();let e=document.createElement("button");e.className="nish-theme-btn",e.classList.toggle("nish-theme-btn--labelled",this.labelled),e.classList.toggle("nish-theme-btn--pill",this.pill),this.prepend(e),this.#e=e;let[n,i,s]=this.#s(),r={system:n,light:i,dark:s},o=Y();this.#t=ut(e,{showLabel:this.labelled,labels:r,...o.themeToggleLabel?{strings:{themeToggleLabel:o.themeToggleLabel}}:{},...o.themeElsewhere?{elsewhereLabel:o.themeElsewhere}:{}})}};C("nish-theme-toggle",Le);export{xe as NishBottomNav,Ae as NishDialog,w as NishElement,Re as NishSheet,Le as NishThemeToggle,zn as configureStrings,C as define,mt as toast};
5
5
  /*! Bundled license information:
6
6
 
7
7
  @lit-labs/ssr-dom-shim/lib/element-internals.js:
@@ -1,7 +1,8 @@
1
1
  // src/chart-values.ts
2
2
  import { readToken } from "./theme.js";
3
3
  function seriesColor(i) {
4
- const n = (Math.trunc(i) % 8 + 8) % 8;
4
+ const k = Number.isFinite(i) ? Math.trunc(i) : 0;
5
+ const n = (k % 8 + 8) % 8;
5
6
  return `var(--nish-chart-${n + 1})`;
6
7
  }
7
8
  var CHART = {
@@ -1,13 +1,14 @@
1
1
  // src/combobox-filter.ts
2
2
  var COMBOBOX_MAX_SHOWN = 50;
3
3
  var COMBOBOX_DEBOUNCE_MS = 200;
4
- var defaultComboboxFilter = (o, q) => {
5
- const needle = q.trim().toLowerCase();
4
+ var defaultComboboxFilter = (o, q) => matchesComboboxNeedle(o.label.toLowerCase(), o.hint?.toLowerCase(), q.trim().toLowerCase());
5
+ function matchesComboboxNeedle(labelLower, hintLower, needle) {
6
6
  if (!needle) return true;
7
- return o.label.toLowerCase().includes(needle) || (o.hint?.toLowerCase().includes(needle) ?? false);
8
- };
7
+ return labelLower.includes(needle) || (hintLower?.includes(needle) ?? false);
8
+ }
9
9
  export {
10
10
  COMBOBOX_DEBOUNCE_MS,
11
11
  COMBOBOX_MAX_SHOWN,
12
- defaultComboboxFilter
12
+ defaultComboboxFilter,
13
+ matchesComboboxNeedle
13
14
  };
@@ -0,0 +1,32 @@
1
+ // src/command-filter.ts
2
+ var COMMAND_MAX_RESULTS = 50;
3
+ var COMMAND_QUERY_DEBOUNCE_MS = 200;
4
+ function matchesCommandQuery(item, query) {
5
+ const words = query.trim().toLowerCase().split(/\s+/).filter(Boolean);
6
+ if (words.length === 0) return true;
7
+ const haystack = [item.label, item.hint ?? "", ...item.keywords ?? []].join("\n").toLowerCase();
8
+ return words.every((w) => haystack.includes(w));
9
+ }
10
+ function filterCommandItems(items, query) {
11
+ const order = [];
12
+ const buckets = /* @__PURE__ */ new Map();
13
+ for (const item of items) {
14
+ if (!matchesCommandQuery(item, query)) continue;
15
+ const g = item.group ?? null;
16
+ let bucket = buckets.get(g);
17
+ if (!bucket) {
18
+ bucket = [];
19
+ buckets.set(g, bucket);
20
+ order.push(g);
21
+ }
22
+ bucket.push(item);
23
+ }
24
+ order.sort((a, b) => a === null ? -1 : b === null ? 1 : 0);
25
+ return order.flatMap((g) => buckets.get(g)).slice(0, COMMAND_MAX_RESULTS);
26
+ }
27
+ export {
28
+ COMMAND_MAX_RESULTS,
29
+ COMMAND_QUERY_DEBOUNCE_MS,
30
+ filterCommandItems,
31
+ matchesCommandQuery
32
+ };
@@ -70,7 +70,8 @@ function AccordionItem({ value, title, children, disabled: disabledProp = false,
70
70
  if (!ctx) throw new Error("AccordionItem must be used inside an Accordion");
71
71
  const disabled = disabledProp || ctx.disabled;
72
72
  const isOpen = ctx.open.includes(value);
73
- const slug = `${ctx.idBase}-${value}`;
73
+ const itemId = useId().replace(/:/g, "");
74
+ const slug = `${ctx.idBase}-${itemId}`;
74
75
  const triggerId = `${slug}-trigger`;
75
76
  const panelId = `${slug}-panel`;
76
77
  function onKeyDown(e) {
@@ -164,7 +164,7 @@ function AppShell({
164
164
  const moreMenu = showMoreMenu ? /* @__PURE__ */ jsx("div", { className: hasNav && !headerMode ? "hidden md:inline-flex" : "inline-flex", children: moreMenuNode() }) : null;
165
165
  const hubHref = hub ? safeUrl(hub.href) : null;
166
166
  const hubPill = hub && hubHref != null ? /* @__PURE__ */ jsxs("a", { className: "nish-pill-link", href: hubHref, title: hub.title ?? strings.hubTitle, children: [
167
- /* @__PURE__ */ jsx("span", { className: "inline-block rtl:-scale-x-100", children: "\u2190" }),
167
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-block rtl:-scale-x-100", children: "\u2190" }),
168
168
  " ",
169
169
  /* @__PURE__ */ jsx("span", { className: "nish-pill-link-label", children: hub.label })
170
170
  ] }) : null;
@@ -11,7 +11,7 @@ import { SHELL_STRINGS, PAGING_STRINGS } from "./strings.js";
11
11
  import { Fragment as Fragment2, jsx, jsxs } from "react/jsx-runtime";
12
12
  var LINK = cn(
13
13
  "inline-flex items-center rounded text-th-hi3 transition-colors duration-150 hover:text-th-hi hover:underline",
14
- "pointer-coarse:min-h-11"
14
+ "pointer-coarse:min-h-11 pointer-coarse:min-w-11 pointer-coarse:justify-center"
15
15
  );
16
16
  var CURRENT = "inline-flex items-center font-medium text-th-hi pointer-coarse:min-h-11";
17
17
  function Chevron() {
@@ -104,7 +104,7 @@ function CalendarBase({
104
104
  const setMonth = (raw) => {
105
105
  const next = clampIso(raw, "0001-01", "9999-12");
106
106
  if (next === shown) return;
107
- if (monthProp === void 0) setOwnMonth(next);
107
+ if (monthControlled === null) setOwnMonth(next);
108
108
  onMonthChange?.(next);
109
109
  };
110
110
  const disabled = (iso) => !inRange(iso, min, max) || isDateDisabled?.(iso) === true;
@@ -9,7 +9,7 @@ import { fieldClass } from "./primitives.js";
9
9
  import { useStrings } from "./provider.js";
10
10
  import { FIELD_STRINGS } from "./strings.js";
11
11
  import { indexComboboxOptions, setRef } from "./forms-classes.js";
12
- import { COMBOBOX_DEBOUNCE_MS, COMBOBOX_MAX_SHOWN } from "../combobox-filter.js";
12
+ import { COMBOBOX_DEBOUNCE_MS, COMBOBOX_MAX_SHOWN, matchesComboboxNeedle } from "../combobox-filter.js";
13
13
  import { jsx, jsxs } from "react/jsx-runtime";
14
14
  var MAX_SHOWN = COMBOBOX_MAX_SHOWN;
15
15
  var DEBOUNCE_MS = COMBOBOX_DEBOUNCE_MS;
@@ -76,7 +76,7 @@ function Combobox({
76
76
  if (dirty && !serverFiltered) {
77
77
  if (filter) {
78
78
  if (!filter(it.option, text)) continue;
79
- } else if (needle && !it.label.includes(needle) && !(it.hint?.includes(needle) ?? false)) continue;
79
+ } else if (!matchesComboboxNeedle(it.label, it.hint, needle)) continue;
80
80
  }
81
81
  out.push(it.option);
82
82
  }
@@ -9,6 +9,7 @@ import {
9
9
  useState
10
10
  } from "react";
11
11
  import { cn } from "../cn.js";
12
+ import { COMMAND_MAX_RESULTS } from "../command-filter.js";
12
13
  import { safeUrl } from "../url.js";
13
14
  import { XIcon } from "./icons.js";
14
15
  import { Modal } from "./modal.js";
@@ -17,7 +18,6 @@ import { useLatest } from "./latest.js";
17
18
  import { useStrings } from "./provider.js";
18
19
  import { COMMAND_STRINGS, FIELD_STRINGS, OVERLAY_STRINGS } from "./strings.js";
19
20
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
20
- var MAX_RESULTS = 50;
21
21
  function indexItems(items) {
22
22
  return items.map((item) => ({ item, label: item.label.toLowerCase(), keywords: (item.keywords ?? []).map((k) => k.toLowerCase()) }));
23
23
  }
@@ -53,7 +53,7 @@ function matchText(text, q) {
53
53
  }
54
54
  function rankItems(items, query) {
55
55
  const q = query.trim().toLowerCase();
56
- if (!q) return items.slice(0, MAX_RESULTS).map(({ item }) => ({ item, marks: [] }));
56
+ if (!q) return items.slice(0, COMMAND_MAX_RESULTS).map(({ item }) => ({ item, marks: [] }));
57
57
  const scored = [];
58
58
  items.forEach(({ item, label: lower, keywords }, order) => {
59
59
  const label = matchText(lower, q);
@@ -69,7 +69,7 @@ function rankItems(items, query) {
69
69
  if (best !== null) scored.push({ r: { item, marks: [] }, score: 4 + best, order });
70
70
  });
71
71
  scored.sort((a, b) => a.score - b.score || a.order - b.order);
72
- return scored.slice(0, MAX_RESULTS).map((s) => s.r);
72
+ return scored.slice(0, COMMAND_MAX_RESULTS).map((s) => s.r);
73
73
  }
74
74
  function groupRows(rows) {
75
75
  const order = [];
@@ -207,7 +207,7 @@ function PaletteDialog({ onClose, items, placeholder, emptyText, resultsLabel, e
207
207
  res = [];
208
208
  }
209
209
  if (Array.isArray(res)) {
210
- setDynamic(res.slice(0, MAX_RESULTS));
210
+ setDynamic(res.slice(0, COMMAND_MAX_RESULTS));
211
211
  setPending(false);
212
212
  return;
213
213
  }
@@ -215,7 +215,7 @@ function PaletteDialog({ onClose, items, placeholder, emptyText, resultsLabel, e
215
215
  res.then(
216
216
  (r) => {
217
217
  if (stale) return;
218
- setDynamic(r.slice(0, MAX_RESULTS));
218
+ setDynamic(r.slice(0, COMMAND_MAX_RESULTS));
219
219
  setPending(false);
220
220
  },
221
221
  () => {
@@ -45,13 +45,26 @@ var tableInternals = { ALIGN, STICKY_COL, WRAP, STICKY, TABLE, ZEBRA, TH, TD, PA
45
45
  function mergeRefs(...refs) {
46
46
  return (node) => {
47
47
  const cleanups = [];
48
+ const withCleanup = /* @__PURE__ */ new Set();
48
49
  for (const ref of refs) {
49
50
  if (typeof ref === "function") {
50
51
  const out = ref(node);
51
- if (typeof out === "function") cleanups.push(out);
52
+ if (typeof out === "function") {
53
+ cleanups.push(out);
54
+ withCleanup.add(ref);
55
+ }
52
56
  } else if (ref) ref.current = node;
53
57
  }
54
- if (cleanups.length) return () => cleanups.forEach((fn) => fn());
58
+ if (cleanups.length) {
59
+ return () => {
60
+ for (const ref of refs) {
61
+ if (typeof ref === "function") {
62
+ if (!withCleanup.has(ref)) ref(null);
63
+ } else if (ref) ref.current = null;
64
+ }
65
+ cleanups.forEach((fn) => fn());
66
+ };
67
+ }
55
68
  };
56
69
  }
57
70
  var COLLATOR = /* @__PURE__ */ new Intl.Collator(void 0, { numeric: true, sensitivity: "base" });
@@ -132,8 +145,9 @@ function chartNumber(v, locale = "en-US") {
132
145
  };
133
146
  NUMBER_FORMATS.set(locale, f);
134
147
  }
135
- if (Math.abs(v) >= 1e3) return f.whole.format(v);
136
- return f.small.format(Math.round(v * 100) / 100 || 0);
148
+ const r = Math.round(v * 100) / 100 || 0;
149
+ if (Math.abs(r) >= 1e3) return f.whole.format(r);
150
+ return f.small.format(r);
137
151
  }
138
152
  var warned = /* @__PURE__ */ new Set();
139
153
  function warnOnce(key, message) {
@@ -273,7 +273,7 @@ function Meter({
273
273
  track === "overlay" ? "bg-th-overlay" : "bg-th-elevated",
274
274
  "forced-colors:border forced-colors:border-[CanvasText] forced-colors:bg-[Canvas]",
275
275
  vertical ? cn("h-full", METER_THICK_V[size]) : cn("w-full", METER_THICK[size]),
276
- !showValue && className
276
+ (!showValue || vertical) && className
277
277
  ),
278
278
  children: /* @__PURE__ */ jsx(
279
279
  "div",
@@ -601,7 +601,7 @@ function AppHeader({
601
601
  /* @__PURE__ */ jsx("span", { className: cn("truncate", hideName && "max-sm:sr-only"), children: name })
602
602
  ] });
603
603
  const markClass = "inline-flex min-w-0 items-center gap-2 text-xl font-bold tracking-tight text-th-hi";
604
- const pillArrow = /* @__PURE__ */ jsx("span", { className: "inline-block rtl:-scale-x-100", children: "\u2190" });
604
+ const pillArrow = /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-block rtl:-scale-x-100", children: "\u2190" });
605
605
  return /* @__PURE__ */ jsxs(
606
606
  "header",
607
607
  {
@@ -720,7 +720,7 @@ function ChartLegend({ items, marker = "line", label, className, ref, ...rest })
720
720
  "aria-label": label ?? strings.legend,
721
721
  className: cn("flex flex-wrap gap-x-4 gap-y-1 text-xs text-th-hi2", className),
722
722
  ...rest,
723
- children: items.map((it) => /* @__PURE__ */ jsxs("li", { className: "inline-flex items-center gap-1.5", children: [
723
+ children: items.map((it, i) => /* @__PURE__ */ jsxs("li", { className: "inline-flex items-center gap-1.5", children: [
724
724
  /* @__PURE__ */ jsx(
725
725
  "i",
726
726
  {
@@ -734,7 +734,7 @@ function ChartLegend({ items, marker = "line", label, className, ref, ...rest })
734
734
  }
735
735
  ),
736
736
  it.label
737
- ] }, it.label))
737
+ ] }, `${it.label}-${i}`))
738
738
  }
739
739
  );
740
740
  }
@@ -14,7 +14,7 @@ function SkeletonRows({ rows = 5, height = 56, gap = "md", label, className, row
14
14
  const s = useStrings(STATUS_STRINGS);
15
15
  return /* @__PURE__ */ jsxs("div", { ...rest, ref, role: "status", className: cn("grid", gap === "sm" ? "gap-1.5" : "gap-2.5", className), children: [
16
16
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: label ?? s.loading }),
17
- Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsx(Skeleton, { className: cn("w-full rounded-xl", rowClassName), style: rowClassName && /\bh-/.test(rowClassName) ? void 0 : { height } }, i))
17
+ Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsx(Skeleton, { className: cn("w-full rounded-xl", rowClassName), style: rowClassName && /(^|\s)([\w-]+:)*(h|size)-/.test(rowClassName) ? void 0 : { height } }, i))
18
18
  ] });
19
19
  }
20
20
  var SPINNER_SIZE = { xs: 12, sm: 14, md: 16, lg: 24 };
@@ -8,13 +8,35 @@ import { IconButton } from "./primitives.js";
8
8
  import { useStrings } from "./provider.js";
9
9
  import { FILE_STRINGS } from "./strings.js";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
+ var EXT_TYPES = {
12
+ jpg: "image/jpeg",
13
+ jpeg: "image/jpeg",
14
+ png: "image/png",
15
+ gif: "image/gif",
16
+ webp: "image/webp",
17
+ heic: "image/heic",
18
+ heif: "image/heif",
19
+ avif: "image/avif",
20
+ svg: "image/svg+xml",
21
+ pdf: "application/pdf",
22
+ mp4: "video/mp4",
23
+ mov: "video/quicktime",
24
+ webm: "video/webm",
25
+ mp3: "audio/mpeg",
26
+ wav: "audio/wav",
27
+ m4a: "audio/mp4",
28
+ txt: "text/plain",
29
+ csv: "text/csv",
30
+ json: "application/json"
31
+ };
11
32
  function matchesAccept(file, accept) {
12
33
  const tokens = (accept ?? "").split(",").map((t) => t.trim().toLowerCase()).filter(Boolean);
13
34
  if (tokens.length === 0) return true;
14
35
  const fileName = file.name.toLowerCase();
15
- const type = file.type.toLowerCase();
36
+ const type = file.type.toLowerCase() || EXT_TYPES[fileName.split(".").pop() ?? ""] || "";
16
37
  return tokens.some((t) => {
17
38
  if (t.startsWith(".")) return fileName.endsWith(t);
39
+ if (!type) return t.endsWith("/*");
18
40
  if (t.endsWith("/*")) return type.startsWith(t.slice(0, -1));
19
41
  return type === t;
20
42
  });