staffa 0.9.0 → 0.10.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 (60) hide show
  1. package/README.md +106 -48
  2. package/dist/components/autocomplete.js +1 -1
  3. package/dist/components/box.d.ts +8 -16
  4. package/dist/components/box.js +21 -27
  5. package/dist/components/button.d.ts +40 -0
  6. package/dist/components/button.js +85 -12
  7. package/dist/components/buttonChooser.js +1 -1
  8. package/dist/components/checkbox.js +3 -3
  9. package/dist/components/field.js +3 -3
  10. package/dist/components/main.d.ts +134 -71
  11. package/dist/components/main.js +245 -174
  12. package/dist/components/menu.d.ts +72 -14
  13. package/dist/components/menu.js +231 -34
  14. package/dist/components/pages.d.ts +638 -0
  15. package/dist/components/pages.js +1510 -0
  16. package/dist/components/panels.d.ts +448 -225
  17. package/dist/components/panels.js +819 -435
  18. package/dist/components/tabs.d.ts +37 -0
  19. package/dist/components/tabs.js +128 -69
  20. package/dist/core.d.ts +1 -1
  21. package/dist/core.js +1 -1
  22. package/dist/glyphs.d.ts +24 -0
  23. package/dist/glyphs.js +25 -0
  24. package/dist/index.d.ts +4 -4
  25. package/dist/index.js +3 -4
  26. package/dist/staffa.esm.js +1 -1
  27. package/dist/theme.d.ts +67 -0
  28. package/dist/theme.js +12 -2
  29. package/package.json +2 -2
  30. package/skill/BoxOptions.md +7 -12
  31. package/skill/IconButtonOptions.md +41 -0
  32. package/skill/MainOptions.md +106 -58
  33. package/skill/MenuItem.md +16 -1
  34. package/skill/MenuListOptions.md +24 -0
  35. package/skill/MenuOptions.md +3 -2
  36. package/skill/Panel.md +190 -0
  37. package/skill/PanelStack.md +106 -0
  38. package/skill/SKILL.md +172 -64
  39. package/skill/ScrollStripOptions.md +21 -0
  40. package/skill/box.md +1 -4
  41. package/skill/closeNav.md +3 -3
  42. package/skill/iconButton.md +27 -0
  43. package/skill/main.md +13 -9
  44. package/skill/menu.md +29 -0
  45. package/skill/scrollStrip.md +28 -0
  46. package/src/components/autocomplete.ts +1 -1
  47. package/src/components/box.ts +29 -39
  48. package/src/components/button.ts +109 -8
  49. package/src/components/buttonChooser.ts +1 -1
  50. package/src/components/checkbox.ts +3 -3
  51. package/src/components/field.ts +3 -3
  52. package/src/components/main.ts +381 -188
  53. package/src/components/menu.ts +265 -37
  54. package/src/components/panels.ts +1136 -526
  55. package/src/components/tabs.ts +134 -68
  56. package/src/core.ts +1 -1
  57. package/src/index.ts +4 -4
  58. package/src/theme.ts +14 -3
  59. package/skill/Page.md +0 -119
  60. package/skill/panels.md +0 -10
@@ -1 +1 @@
1
- import S from"aberdeen";var pe="staffa:darkMode",$e=S.proxy({value:Ie()});function Ie(){try{let e=localStorage.getItem(pe);if(e==="dark")return!0;if(e==="light")return!1}catch{}}function Be(e){$e.value=e;try{e===void 0?localStorage.removeItem(pe):localStorage.setItem(pe,e?"dark":"light")}catch{}}function ke(e=!1){let t=$e.value;return t===void 0&&!e?S.darkMode():t}S(()=>{ke()?S.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#0e0f12 --s-text:#e9eaec",".s-s.neutral":"--s-bg:#191b1f --s-text:#e9eaec",".s-s.neutral .s-s.neutral":"--s-bg:#23262b"}):S.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#eef0f3 --s-text:#1d1f24",".s-s.neutral, .s-s.neutral":"--s-bg:#ffffff --s-text:#1d1f24",".s-s.neutral .s-s.neutral":"--s-bg:#f6f7f9"})});S.setSpacingCssVars(1.1);S.insertGlobalCss({"*, *::before, *::after":"box-sizing:border-box",html:"text-size-adjust:100%",body:"m:0 p:$3 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased background-color:$s-bg text:$s-text",a:"color: $s-link-fg; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;","a:hover":"filter: brightness(1.15)","input, button, textarea, select, optgroup":"font:inherit color:inherit","input:where(:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=image],[type=submit],[type=button],[type=reset],[type=hidden])), textarea, select":"background:$s-bg border: 1px solid $s-faint; r:$s-radius-sm padding: 0.45em 0.65em; max-width:100%","input:where([type=checkbox],[type=radio])":"width:1.15em height:1.15em cursor:pointer","input[type=range]":"appearance:none background:transparent cursor:pointer vertical-align:middle","input[type=range]::-webkit-slider-runnable-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-progress":"height:4px r:99px background:$s-accent","input[type=range]::-webkit-slider-thumb":"appearance:none width:16px height:16px margin-top:-6px r:50% background:$s-accent","input[type=range]::-moz-range-thumb":"width:16px height:16px border:0 r:50% background:$s-accent","input[type=file]":"cursor:pointer",progress:"appearance:none border:0 height:6px r:99px background:$s-faint overflow:hidden vertical-align:middle","progress::-webkit-progress-bar":"background:$s-faint r:99px","progress::-webkit-progress-value":"background:$s-accent r:99px","progress::-moz-progress-bar":"background:$s-accent r:99px",meter:"vertical-align:middle",fieldset:"border: 1px solid $s-faint; r:$s-radius-sm padding:$2 min-width:0",legend:"padding: 0 $1; font-weight:600","code, kbd, samp, pre":"font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;",code:"background: color-mix(in oklab, $s-text, $s-bg 86%); padding: 0.12em 0.34em; r:4px font-size:0.9em",pre:"background: color-mix(in oklab, $s-text, $s-bg 92%); p:$3 r: $s-radius; overflow:auto","pre code":"background:transparent p:0","img, svg, video, canvas":"max-width:100% h:auto",hr:"border:0 border-top: 1px solid $s-faint;","::placeholder":"color: $s-muted; opacity:1",":focus-visible":"outline: 2px solid $s-focus; outline-offset:2px",small:"color:$s-muted font-size:0.9em","@media (prefers-reduced-motion: reduce)":{"*, *::before, *::after":"transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important;"},":root":"--s-primary:#00a884 --s-danger:#dc5b41 --s-success:#00a884 --s-warning:#ef6b00 --s-link:#3f8cd8 --s-radius-sm:6px --s-radius:12px --s-radius-lg:18px --s-focus: color-mix(in srgb, $s-primary 38%, transparent); --s-gradient: linear-gradient(135deg, color-mix(in oklab, $s-primary, white 16%), color-mix(in oklab, $s-primary, black 14%));",":root, .s-s.neutral":"--s-accent:$s-primary --s-link-fg:$s-link",".s-s:not(.neutral)":"--s-bg:$s-primary border:0 --s-text:#eee --s-accent:#fff --s-link-fg:#eef --s-muted: color-mix(in srgb, #fff 70%, transparent); --s-faint: color-mix(in srgb, #fff 30%, transparent);",".s-s.danger":"--s-bg:$s-danger",".s-s.success":"--s-bg:$s-success",".s-s.warning":"--s-bg:$s-warning",".s-s.link":"--s-bg:$s-link",".s-s.primary":"--s-bg:$s-primary",":root, .s-s":"--s-muted: color-mix(in oklab, $s-text, $s-bg 42%); --s-faint: color-mix(in oklab, $s-text, $s-bg 80%); color:$s-text accent-color:$s-accent scrollbar-width:thin scrollbar-color: $s-faint transparent;",".s-s, body":"background: linear-gradient(170deg, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%));",".s-s":"r:$s-radius",":where(.s-s.neutral)":"border: 1px solid $s-faint;",".s-s::-webkit-scrollbar, .s-s ::-webkit-scrollbar":"width:10px height:10px",".s-s::-webkit-scrollbar-track, .s-s ::-webkit-scrollbar-track":"background:transparent",".s-s::-webkit-scrollbar-thumb, .s-s ::-webkit-scrollbar-thumb":"background:$s-faint border-radius:99px border: 2px solid transparent; background-clip:padding-box",".s-s.shadow.neutral:not(.s-btn)":"box-shadow: 0 4px 14px rgba(0,0,0,0.13);",".s-s.extra-shadow.neutral:not(.s-btn)":"box-shadow: 0 18px 50px rgba(0,0,0,0.28);",".s-s.shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 4px 14px color-mix(in srgb, $s-bg 30%, transparent);",".s-s.extra-shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 14px 40px color-mix(in srgb, $s-bg 40%, transparent);",".s-s.no-shadow":"box-shadow: none !important;",".s-s:not(.neutral).tonal, .s-s:not(.neutral).outlined":"--s-text:$s-bg --s-accent:$s-bg --s-link-fg:$s-bg --s-faint: color-mix(in srgb, $s-bg 30%, transparent); --s-muted: color-mix(in srgb, $s-bg 70%, transparent);",".s-s:not(.neutral).tonal":"background: color-mix(in srgb, $s-bg 15%, transparent); border: 1px solid $s-faint;",".s-s:not(.neutral).outlined":"background: transparent; border: 1px solid color-mix(in srgb, $s-bg 45%, transparent);",".s-s:not(.neutral) .s-s.tonal, .s-s:not(.neutral) .s-s.outlined":"--s-text:#fff --s-accent:#fff --s-link-fg:#fff background: linear-gradient(170deg, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%)); border-color: transparent;"});S.insertGlobalCss({".s-preload, .s-preload *, .s-preload *::before, .s-preload *::after":"transition: none !important; animation: none !important;"});if(typeof document<"u"&&typeof requestAnimationFrame=="function"){let e=document.documentElement;e.classList.add("s-preload"),requestAnimationFrame(()=>requestAnimationFrame(()=>e.classList.remove("s-preload")))}S.insertGlobalCss({":disabled, [aria-disabled=true]":"opacity:0.45 filter:saturate(0.6) user-select:none",":disabled, [aria-disabled=true], :disabled *, [aria-disabled=true] *":"pointer-events:none cursor:not-allowed"});var De="p, ul, ol, dl, blockquote, pre, table, figure, hr, h1, h2, h3, h4, h5, h6";S.insertGlobalCss({[`${De}`]:{"&":"margin:0","&:not(:first-child)":"margin-top:$3"},"h1, h2, h3, h4, h5, h6":{"&":"line-height:1.15 font-weight:700 text-wrap:balance","&:not(:first-child)":"margin-top:1.4em"},h1:"font-size:2em font-weight:800 letter-spacing:-0.022em",h2:"font-size:1.55em letter-spacing:-0.018em",h3:"font-size:1.3em letter-spacing:-0.011em",h4:"font-size:1.1em",h5:"font-size:0.95em letter-spacing:0.005em",h6:"font-size:0.8em fg:$s-muted text-transform:uppercase letter-spacing:0.07em","ul, ol":{"&":"padding-left:1.5em","> li:not(:first-child), li > &:not(:first-child)":"margin-top:$1"},blockquote:"border-left: 3px solid $s-faint; padding-left: $3; fg: $s-muted",table:"border-collapse:collapse","th, td":"text-align:left padding: $1 $2; border-bottom: 1px solid $s-faint; vertical-align:top",th:"font-weight:600","thead th":"border-bottom: 2px solid $s-faint;",dt:"font-weight:600",dd:"margin-left: 1.5em",figcaption:"fg:$s-muted font-size:0.9em margin-top:$1 text-align:center"});import d from"aberdeen";import Ee from"aberdeen";var U=640,Ge=0;function F(e="s"){return`${e}-${++Ge}`}function f(e,...t){e!=null&&(typeof e=="function"?e(...t):Ee("rich=",e))}var je="a[href], button, input, select, textarea, [tabindex]";function V(e,t){let n=i=>i instanceof HTMLElement&&!i.hasAttribute("disabled")&&i.getAttribute("aria-disabled")!=="true"&&i.tabIndex>=0&&i.getClientRects().length>0,o=(t?[...e.querySelectorAll(t)].find(n):void 0)??[...e.querySelectorAll(je)].find(n);return o?.focus(),o!=null}function I(e){queueMicrotask(()=>Ee(e))}import T from"aberdeen";T.insertGlobalCss({".s-field":{"&":"display:flex flex-direction:column gap:$1","> label":"font-weight:600 font-size:0.9em fg:$s-text user-select:none"},".s-req":"fg:$s-danger margin-left:2px",".s-help":"font-size:0.82em fg:$s-muted",".s-error":"font-size:0.82em fg:$s-danger",".s-input":{"&":"w:100% background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;","&:hover:not(:disabled)":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","&:focus-visible":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none","&[aria-invalid=true]":"border-color:$s-danger"}});function B(e,t){let n=e.id??F("field"),o=()=>!!e.error;T("div.s-field",e.attrs,()=>{T(()=>{e.label!=null&&T(`label for=${n}`,()=>{f(e.label),e.required&&T("span.s-req aria-hidden=true #*")})}),t(n,o),T(()=>{e.help!=null&&!e.error&&T("div.s-help",()=>f(e.help))}),T(()=>{e.error&&T("div.s-error role=alert #",e.error)})})}function Y(e,t,n,o){T(`id=${t}`),e.name&&T(`name=${e.name}`),T(()=>{e.disabled&&T("disabled=true")}),T(()=>{e.required&&T("aria-required=true")}),T(()=>T("aria-invalid=",n()?"true":"false")),o&&T("bind=",o)}d.insertGlobalCss({".s-ac":{"&":"position:relative","> .s-control":"display:flex flex-wrap:wrap align-items:center gap:$1 background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.3em 0.4em; cursor:text; transition: border-color 0.15s, box-shadow 0.15s;","> .s-control:hover":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","> .s-control:focus-within":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus;","&[aria-invalid=true] > .s-control":"border-color:$s-danger",".s-chip":"display:inline-flex align-items:center gap:$1 font-size:0.85em background: color-mix(in oklab, $s-bg, $s-text 10%); border: 1px solid $s-faint; r:$s-radius padding: 0.1em 0.2em 0.1em 0.5em;",".s-chip > button":"cursor:pointer border:0 background:transparent fg:$s-muted font-size:1.1em line-height:1 padding: 0 0.2em; r:4px",".s-chip > button:hover":"fg:$s-text background:$s-faint",input:"flex:1 min-width:6ch border:0 background:transparent color:inherit outline:none padding:0.25em","> .s-menu":"position:absolute top:100% left:0 right:0 z-index:20 margin-top:4px max-height:15rem overflow-y:auto list-style:none p:$1 margin-bottom:0","> .s-menu li":"margin:0",".s-option":"padding: 0.45em 0.6em; r:6px cursor:pointer transition: background 0.1s;",".s-option[aria-selected=true]":"background: color-mix(in srgb, $s-text 10%, transparent);",".s-add":"fg:$s-accent font-style:italic",".s-empty":"padding: 0.45em 0.6em; fg:$s-muted"}});function We(e){return typeof e=="string"?{value:e,label:e}:{value:e.value,label:e.label??e.value}}function Ne(e){let t=F("ac-menu"),n=d.proxy({query:"",open:!1,active:0}),o=()=>(typeof e.options=="function"?e.options():e.options).map(We),i=()=>{let u=e.bind?.value;return u==null||u===""?[]:Array.isArray(u)?u:[u]},r=u=>o().find(b=>b.value===u)?.label??u;if(!e.multi){let u=e.bind?d.peek(e.bind,"value"):void 0;typeof u=="string"&&u&&(n.query=d.peek(()=>r(u)))}let s=()=>{let u=new Set(i()),b=o();e.multi&&(b=b.filter(m=>!u.has(m.value)));let c=n.query.trim().toLowerCase();return c&&(b=b.filter(m=>m.label.toLowerCase().includes(c))),b},a=(u,b)=>{if(e.multi){let c=Array.isArray(e.bind?.value)?[...e.bind.value]:[];c.includes(u)||c.push(u),e.bind&&(e.bind.value=c),n.query=""}else e.bind&&(e.bind.value=u),n.query=r(u),n.open=!1;n.active=0,b?.focus()},l=u=>{if(!e.bind)return;let b=e.bind.value??[];e.bind.value=b.filter(c=>c!==u)};B(e,(u,b)=>{d("div.s-ac",e.inputAttrs,()=>{d(()=>d("aria-invalid=",b()?"true":"false"));let c;d("div.s-control",()=>{d("click=",()=>c?.focus()),d(()=>{if(e.multi)for(let m of i())d("span.s-chip",()=>{d("span #",d.peek(()=>r(m))),d("button type=button aria-label=",`Remove ${m}`,()=>{d("#\xD7"),d("click=",x=>{x.stopPropagation(),l(m),c?.focus()})})})}),c=d("input type=text role=combobox autocomplete=off",()=>{d(`id=${u} aria-controls=${t} aria-autocomplete=list`),e.placeholder!=null&&d("placeholder=",e.placeholder),e.disabled&&d("disabled=true"),e.required&&d("aria-required=true"),d("bind=",d.ref(n,"query")),d(()=>d("aria-expanded=",n.open?"true":"false")),d(()=>{let x=s()[n.active];d("aria-activedescendant=",n.open&&x?`${t}-opt-${n.active}`:"")}),d("input=",()=>{n.open=!0,n.active=0}),d("focus=",()=>{n.open=!0}),d("blur=",()=>{setTimeout(()=>y(),150)}),d("keydown=",m=>g(m,c))})}),d(()=>{if(!n.open)return;let m=s(),x=n.query.trim(),z=e.allowCustom!==!1&&x!==""&&!m.some(X=>X.label.toLowerCase()===x.toLowerCase());d("ul.s-menu.s-s.neutral.shadow role=listbox",`id=${t}`,()=>{m.forEach((X,ue)=>{d("li.s-option role=option",`id=${t}-opt-${ue}`,()=>{d(()=>d("aria-selected=",n.active===ue?"true":"false")),d("#",X.label),d("mousedown=",Fe=>Fe.preventDefault()),d("click=",()=>a(X.value,c)),d("mousemove=",()=>{n.active=ue})})}),z&&d("li.s-option.s-add role=option",()=>{d("#",`Add "${x}"`),d("mousedown=",X=>X.preventDefault()),d("click=",()=>a(x,c))}),m.length===0&&!z&&d("li.s-empty #No matches")})}),d(()=>{if(e.name)if(e.multi)for(let m of i())d("input type=hidden",()=>{d("name=",e.name),d("value=",m)});else d("input type=hidden",()=>{d("name=",e.name),d("value=",i()[0]??"")})})})});function g(u,b){let c=s(),m=c.length-1;if(u.key==="ArrowDown")u.preventDefault(),n.open=!0,n.active=Math.min(m,n.active+1);else if(u.key==="ArrowUp")u.preventDefault(),n.active=Math.max(0,n.active-1);else if(u.key==="Enter"){u.preventDefault();let x=c[n.active];x?a(x.value,b):e.allowCustom!==!1&&n.query.trim()?a(n.query.trim(),b):n.open&&(n.open=!1)}else if(u.key==="Escape")n.open&&(u.preventDefault(),n.open=!1,e.multi||(n.query=r(i()[0]??"")));else if(u.key==="Backspace"&&e.multi&&n.query===""){let x=i();x.length&&l(x[x.length-1])}}function y(){n.open=!1,e.multi?n.query="":e.allowCustom!==!1&&n.query.trim()?a(n.query.trim()):n.query=r(i()[0]??"")}}import L from"aberdeen";import h from"aberdeen";import*as k from"aberdeen/route";var me={integer(e){if(!/^(0|-?[1-9]\d*)$/.test(e))return;let t=Number(e);return Number.isSafeInteger(t)?t:void 0}};function j(e){let t=String(e).replace(/\/+$/,"");return t.startsWith("/")||(t=`/${t}`),t}function Z(e){let t=j(e);return t==="/"?[]:t.slice(1).split("/")}function Ae(e){let t=Z(e),n=t.map((o,i)=>{if(!o.startsWith("[")||!o.endsWith("]"))return{kind:"lit",value:o};let r=/^\[\.\.\.([A-Za-z_$][\w$]*)\]$/.exec(o);if(r){if(i!==t.length-1)throw new Error(`Staffa: "${o}" must be the last segment of route "${e}"`);return{kind:"rest",name:r[1]}}let s=/^\[([A-Za-z_$][\w$]*)(?:=([A-Za-z_$][\w$]*))?\]$/.exec(o);if(!s)throw new Error(`Staffa: malformed param "${o}" in route "${e}"`);let[,a,l]=s;if(l&&!(l in me))throw new Error(`Staffa: unknown matcher "${l}" in route "${e}" (known: ${Object.keys(me).join(", ")})`);return{kind:"param",name:a,matcher:l}});return{key:e,segs:n}}function Ke(e){try{return decodeURIComponent(e)}catch{return e}}function fe(e,t){let n={};for(let o=0;o<e.segs.length;o++){let i=e.segs[o];if(i.kind==="rest")return o>=t.length?null:(n[i.name]=t.slice(o).join("/"),n);if(o>=t.length)return null;let r=t[o];if(i.kind==="lit"){if(r!==i.value)return null}else if(i.matcher){let s=me[i.matcher](r);if(s===void 0)return null;n[i.name]=s}else n[i.name]=Ke(r)}return e.segs.length===t.length?n:null}var Oe=450,_e=300,Xe=1280,ae=24,Ue=360,Te=2;h.insertGlobalCss({":root":`--s-panel-ms:${Oe}ms`,".s-panels":"flex:1 min-width:0 min-height:0 position:relative overflow:hidden isolation:isolate",".s-panel":{"&":"position:absolute top:0 bottom:0 left:0 display:flex flex-direction:column visibility:visible transition: left var(--s-panel-ms) ease, transform var(--s-panel-ms) ease-out, opacity var(--s-panel-ms) linear, visibility 0s;","> .s-content":"flex:1 min-height:0 overflow-y:auto overflow-x:hidden p:$3","> .s-content.s-scroll-y":"margin-right:$3","&.s-panel-sep::before":`content:'' position:absolute left:-${ae/2}px top:0.6rem bottom:0.6rem width:1px background: linear-gradient(to bottom, transparent, $s-faint 18%, $s-faint 82%, transparent);`,"&.s-panel-enter":"opacity:0 transition:none transform: translateX(8cqw);","&.s-panel-closing":"opacity:0 pointer-events:none transform: translateX(8cqw);","&.s-panel-hidden":"opacity:0 visibility:hidden transform: translateX(-8cqw); transition: left var(--s-panel-ms) ease, transform var(--s-panel-ms) ease-out, opacity var(--s-panel-ms) linear, visibility var(--s-panel-ms);"},".s-main.s-shell-snap .s-panel":"transition:none",[`@container (max-width: ${U}px)`]:{".s-panel > .s-content.s-scroll-y":"margin-right:0"},".s-panel-loading":{"&":"position:absolute inset:0 display:flex align-items:center justify-content:center gap:$1 pointer-events:none",i:"width:0.5rem height:0.5rem r:50% background:$s-muted opacity:0.45 animation: s-panel-pulse 1s ease-in-out infinite;","i:nth-child(2)":"animation-delay:0.15s","i:nth-child(3)":"animation-delay:0.3s"},"@keyframes s-panel-pulse":{"0%, 100%":"opacity:0.25 transform:scale(0.8)","50%":"opacity:0.7 transform:scale(1)"}});var P=null,le=class{compiled;ancestors;opts;live=[];byId=new Map;nextId=1;$ids=h.proxy({});$state=h.proxy({paths:[],topId:0});containerEl;geom;lastBodyW=-1;layoutQueued=!1;timers=new Set;intent=null;settling=null;queued=null;constructor(t){if(P)throw new Error("Staffa: only one routed S.main() (one with `routes`) can be active at a time");P=this,this.opts=t,this.compiled=Object.entries(t.routes).map(([o,i])=>({...Ae(o),draw:i})),this.ancestors=Object.entries(t.ancestors??{}).filter(o=>o[1]!=null).map(([o,i])=>({...Ae(o),fn:i}));let n=k.setGuard((o,i)=>{let r=n?n(o,i):!0;return r===!1?!1:r===!0?this.checkChange(o):r.then(s=>s===!1?!1:this.checkChange(o))});h(()=>{let o=this.computeTarget();h.peek(()=>this.propose(o))}),this.interceptLinks(),this.watchTitle(),h.clean(()=>{for(let o of this.timers)clearTimeout(o);this.timers.clear(),this.queued?.settle(!1),this.queued=null,k.setGuard(n),P===this&&(P=null)})}resolve(t){let n=Z(t);for(let o of this.compiled){let i=fe(o,n);if(i)return{draw:o.draw,params:i}}return{draw:this.opts.notFound??Je,params:{}}}matches(t){let n=Z(t);return this.compiled.some(o=>fe(o,n)!=null)}deriveStack(t){let n=j(t),o=this.askAncestors(n),i=o?o.map(j):this.prefixesOf(n),r=[];for(let s of i)s!==n&&!r.includes(s)&&this.matches(s)&&r.push(s);return r.push(n),r}askAncestors(t){let n=Z(t);for(let o of this.ancestors){let i=fe(o,n);if(i)return o.fn(i,t)??void 0}}prefixesOf(t){let n=Z(t),o=[];for(let i=1;i<n.length;i++)o.push("/"+n.slice(0,i).join("/"));return o}targetFor(t,n){return Array.isArray(n)?n.map(String).concat(j(t)):this.deriveStack(t)}computeTarget(){return this.targetFor(k.current.path,k.current.state.panels)}checkChange(t){let n=this.removedBy(this.targetFor(t.path,t.state.panels));return n.length?Ye(n):!0}paths(){return this.live.map(t=>t.path)}removedBy(t){return this.live.filter(n=>!t.includes(n.path))}propose(t){Qe(this.paths(),t)||this.commit(t,h.peek(k.current,"nav"))}commit(t,n){this.geom=void 0;let o=new Map(this.live.map(r=>[r.path,r])),i=[];for(let r of t){let s=o.get(r);if(s){o.delete(r),i.push(s);continue}let a=this.createEntry(r,i.length);n!=="load"&&n!=="back"&&(a.enter=!0),i.push(a),this.byId.set(a.id,a)}for(let r of o.values())this.beginClose(r);this.live=i,h.merge(this.$state,{paths:this.paths(),topId:this.live.length?this.live[this.live.length-1].id:0});for(let r of this.live)this.$ids[String(r.id)]=r.order;this.scheduleLayout()}createEntry(t,n){let{draw:o,params:i}=this.resolve(t),r={id:this.nextId++,order:n,path:t,draw:o,$ui:h.proxy({holding:!1}),layout:"medium",width:0};return r.$page=h.proxy({params:i,path:t,close:()=>this.closePath(r.path)}),r}beginClose(t){t.closing=!0,t.el&&(t.el.style.zIndex=String(Te*this.live.indexOf(t))),this.byId.delete(t.id),delete this.$ids[String(t.id)]}playExit(t,n){if(!t.closing){n.remove();return}n.classList.add("s-panel-closing"),n.setAttribute("inert","");let o=()=>{clearTimeout(i),this.timers.delete(i),n.remove()};n.addEventListener("transitionend",r=>{r.target===n&&r.propertyName==="opacity"&&o()});let i=setTimeout(o,Oe+80);this.timers.add(i)}intended(){return this.intent??this.paths()}issue(t,n){return this.intent=t,this.settling?(this.queued?.settle(!1),new Promise(o=>{this.queued={run:n,settle:o}})):this.start(n)}start(t){let n=i=>{this.settling=null;let r=this.queued;return this.queued=null,i&&r?this.start(r.run).then(r.settle,()=>r.settle(!1)):(this.intent=null,r?.settle(!1)),i},o=Promise.resolve(t()).then(n,i=>(console.error(i),n(!1)));return this.settling=o,o}goBackTo(t){return this.issue(t,()=>k.back({path:t[t.length-1]},{state:{panels:t.slice(0,-1)}}))}closeDownTo(t){let n=this.intended();return t<0||t>=n.length-1?Promise.resolve(!1):this.goBackTo(n.slice(0,t+1))}closeTop(){return this.closeDownTo(this.intended().length-2)}closePath(t){let n=this.intended(),o=n.indexOf(j(t));if(o<0)return Promise.resolve(!1);if(o===n.length-1)return this.closeDownTo(o-1);let i=n.filter((r,s)=>s!==o);return this.issue(i,()=>k.go({path:i[i.length-1],search:h.peek(()=>({...k.current.search})),hash:h.peek(k.current,"hash"),state:{panels:i.slice(0,-1)}}))}closePanelEl(t){let n=this.live.find(o=>o.el===t);return n?this.closePath(n.path):Promise.resolve(!1)}navigate(t,n,o=!1,i){let r;try{r=new URL(t,location.href)}catch{return}let s=j(r.pathname),a=Object.fromEntries(new URLSearchParams(r.search)),l=r.hash,g=this.intended(),y=g.indexOf(s);if(y>=0&&y<g.length-1&&!i){this.closeDownTo(y);return}if(y>=0&&!i){if(r.search===location.search&&(r.hash||"")===(location.hash||""))return;this.issue(g,()=>k.go({path:s,search:a,hash:l,state:{panels:g.slice(0,-1)}}));return}let u=n==null?-1:g.indexOf(n),b=i?i.map(j).filter(c=>c!==s):u<0?this.deriveStack(s).slice(0,-1):g.slice(0,o?u:u+1);this.issue([...b,s],()=>k.go({path:s,search:a,hash:l,state:{panels:b}}))}pushPath(t,n){let o=this.intended();this.navigate(t,o[o.length-1]??null,n)}openPath(t,n){this.navigate(t,null,!1,n)}interceptLinks(){k.interceptLinks((t,n)=>{let o=n.closest(".s-panel"),i=o?this.live.find(r=>r.el===o):void 0;return this.navigate(t.href,i?.path??null,n.getAttribute("data-panel")==="replace"),!0})}watchTitle(){let t=document.title;h(()=>{let o=this.byId.get(this.$state.topId)?.$page.title,i=typeof this.opts.title=="string"?this.opts.title:void 0,r=o&&i?`${o} \xB7 ${i}`:o||i;r&&(document.title=r)}),h.clean(()=>{document.title=t})}drawStack(){let t=h("div.s-panels role=main",()=>{this.containerEl=h(),h.onEach(this.$ids,(n,o)=>this.drawPanel(Number(o)),(n,o)=>[n,Number(o)])});if(typeof ResizeObserver<"u"){let n=new ResizeObserver(()=>this.layout());n.observe(t);let o=t.parentElement?.parentElement;o&&n.observe(o),h.clean(()=>n.disconnect())}h.clean(()=>{this.containerEl===t&&(this.containerEl=void 0)}),this.scheduleLayout()}drawPanel(t){let n=this.byId.get(t);if(!n)return;let o;h(()=>{let i=n.$page.layout;n.layout=i==="small"||i==="large"?i:"medium";let r=this.roomFor(n.layout);r&&(n.width=r,o&&(o.style.width=`${r}px`,this.scheduleLayout()))}),o=h(`section.s-panel${n.width?` w:${n.width}px`:""}`,"destroy=",i=>this.playExit(n,i),()=>{let i=h("div.s-content",()=>{n.draw(n.$page),k.persistScroll(n.path)});Ze(i),h(()=>{!n.$page.loading||n.$ui.holding||h("div.s-panel-loading aria-hidden=true",()=>{h("i"),h("i"),h("i")})})}),n.el=o,n.placed=!1,o.style.transition="none",h.clean(()=>{n.el===o&&(n.el=void 0)}),h(()=>{n.$page.loading,this.scheduleLayout()}),this.scheduleLayout()}scheduleLayout(){this.layoutQueued||(this.layoutQueued=!0,requestAnimationFrame(()=>{this.layoutQueued=!1,this.layout()}))}measure(){let t=this.containerEl,n=t?.parentElement,o=n?.parentElement;if(!t||!n||!o)return;let i=o.getBoundingClientRect().width;if(!i)return;let r=0;for(let l of n.children)l!==t&&(r+=l.getBoundingClientRect().width);let s=Math.max(0,Math.min(Xe,i)-r),a=(s-ae)/2;return{total:i,chrome:r,small:a>=Ue?a:s,medium:s,large:Math.max(0,i-r)}}geometry(){return this.geom??=this.measure()}roomFor(t){return this.geometry()?.[t]??0}layout(){let t=this.containerEl,n=t?.closest(".s-main");if(!t||!n)return;let o=this.live.length;if(!o||this.live.some(c=>!c.el))return;this.geom=void 0;let i=this.geometry();if(!i)return;let r=this.opts.stacking!==!1,s=this.lastBodyW!==i.total;s&&(this.lastBodyW=i.total,n.classList.add("s-shell-snap"));let a=c=>i[c.layout],l=o-1,g=a(this.live[l]);if(r)for(let c=o-2;c>=0;c--){let m=g+ae+a(this.live[c]);if(m>i.large)break;g=m,l=c}let y=Math.min(i.large,Math.max(i.medium,g));for(let c=l;c<o;c++)this.live[c].width=a(this.live[c]);for(let c of this.live)c.width||(c.width=a(c));n.style.setProperty("--s-shell-w",`${i.chrome+y}px`);let u=[],b=0;for(let c=0;c<o;c++){let m=this.live[c],x=m.el,z=c>=l;Ve(x,z?b:0,m.width,Te*c+1),z&&(b+=m.width+ae),x.classList.toggle("s-panel-sep",z&&c>l),x.classList.toggle("s-panel-hidden",!z),x.toggleAttribute("inert",!z),!m.placed&&(u.push(m),!h.peek(m.$page,"loading")||m.holdDone?m.$ui.holding=!1:m.$ui.holding||(m.$ui.holding=!0,this.holdEnter(m)),m.enter&&z&&x.classList.add("s-panel-enter"))}(u.length||s)&&t.offsetWidth,s&&n.classList.remove("s-shell-snap");for(let c of u)c.$ui.holding||(c.el.style.transition="",c.el.classList.remove("s-panel-enter"),c.enter=!1,c.placed=!0)}holdEnter(t){let n=setTimeout(()=>{this.timers.delete(n),t.holdDone=!0,t.$ui.holding&&(t.$ui.holding=!1,this.scheduleLayout())},_e);this.timers.add(n)}};function Ve(e,t,n,o){e.style.left=`${t}px`,e.style.width=`${n}px`,e.style.zIndex=String(o)}function Ye(e){let t=[...e].reverse(),n=0,o=()=>{for(;n<t.length;){let i=h.peek(t[n++].$page,"requestClose");if(!i)continue;let r;try{r=i()}catch(s){return console.error(s),!1}if(r===!1)return!1;if(r!==!0)return Promise.resolve(r).then(s=>s===!1?!1:o())}return!0};return o()}function Qe(e,t){return e.length===t.length&&e.every((n,o)=>n===t[o])}function Je(e){h("p fg:$s-muted",()=>h("#",`No page at ${e.path}`))}function Ze(e){if(typeof ResizeObserver>"u")return;let t=()=>e.classList.toggle("s-scroll-y",e.offsetWidth>e.clientWidth),n=new ResizeObserver(t);n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild),t(),h.clean(()=>n.disconnect())}var et={push(e){se().pushPath(e,!1)},replace(e){se().pushPath(e,!0)},open(e,t){se().openPath(e,t)},close(e){let t=se();return e==null?t.closeTop():t.closePath(e)},get stack(){return P?P.$state.paths:[]}};function se(){if(!P)throw new Error("Staffa: S.panels needs a routed S.main() (one with `routes`) to be mounted");return P}function Me(e){let t=e?.closest(".s-panel");return!P||!t?(console.warn("Staffa: `close: true` needs to be drawn inside a panel of a routed S.main()"),Promise.resolve(!1)):P.closePanelEl(t)}L.insertGlobalCss({".s-box":{"&":"display:flex flex-direction:column overflow:hidden r: $s-radius-lg; position:relative","&:not(:first-child)":"margin-top: $3","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0","> div":"p:$3 gap:$3",".s-box-close":"flex-shrink:0 margin-left:auto display:flex align-items:center justify-content:center width:1.6rem height:1.6rem p:0 border:0 background:transparent cursor:pointer fg:$s-muted font-size:0.95rem line-height:1 r:$s-radius-sm transition: color 0.12s, background 0.12s;",".s-box-close:hover":"fg:$s-text background: color-mix(in srgb, $s-text 8%, transparent);","> .s-box-close":"position:absolute top:$2 right:$2 z-index:1"}});function tt(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e;L("section.s-box.s-s.neutral.shadow",t.attrs,()=>{L(()=>{t.header!=null?L("header.s-s.neutral",t.headerAttrs,()=>{f(t.header),t.close&&Se(t.close)}):t.close&&Se(t.close)}),L("div",t.contentAttrs,()=>{f(t.content)}),L(()=>{t.footer!=null&&L("footer.s-s.neutral",t.footerAttrs,()=>f(t.footer))})})}function Se(e){L("button.s-box-close type=button aria-label=Close",()=>{L("click=",t=>{typeof e=="function"?e():Me(t.currentTarget)}),L("span aria-hidden=true #\u2715")})}import D from"aberdeen";D.insertGlobalCss({".s-btn":{"&":"display:inline-flex align-items:center justify-content:center gap:$2 font-weight:450 line-height:1.1 white-space:nowrap cursor:pointer text-decoration:none padding: $m2 $m3; transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;","&:focus-visible":"outline: 3px solid $s-focus; outline-offset: 1px;","&:hover":"filter: brightness(1.06)","&.tonal:hover, &.outlined:hover":"background: color-mix(in srgb, $s-bg 24%, transparent);","&.neutral:hover":"filter:none background: color-mix(in srgb, $s-text 8%, $s-bg);","&:active:not(:disabled)":"transform: translateY(1px)","&.small, .small > &":"padding: $m1 $m2; font-size:0.85em border-radius:$s-radius-sm","&.large, .large > &":"font-size:1.4em border-radius:$s-radius-lg"}});function O(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e,n=t.href!=null?"a":"button";D(`${n}.s-btn.s-s.shadow`,t.attrs,()=>{t.href!=null?(D(`href=${t.href} role=button`),t.disabled&&D("aria-disabled=true")):(D("type=",t.type??"button"),t.disabled&&D("disabled=true")),t.ariaLabel&&D("aria-label=",t.ariaLabel),t.click&&D("click=",t.click),f(t.icon),f(t.content)})}import he from"aberdeen";import Pe from"aberdeen";Pe.insertGlobalCss({".s-bgroup":{"&":"display:inline-flex align-items:stretch","&.s-spaced":"gap:$2 flex-wrap:wrap","&.s-vertical":"flex-direction:column","&.s-attached":"gap:0","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child)":"margin-left:-1px","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached:not(.s-vertical) > .s-btn:first-child:not(:last-child)":"border-top-right-radius:0 border-bottom-right-radius:0","&.s-attached:not(.s-vertical) > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-bottom-left-radius:0","&.s-attached.s-vertical > .s-btn:not(:first-child)":"margin-top:-1px","&.s-attached.s-vertical > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached.s-vertical > .s-btn:first-child:not(:last-child)":"border-bottom-left-radius:0 border-bottom-right-radius:0","&.s-attached.s-vertical > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-top-right-radius:0","&.s-attached > .s-btn:hover, &.s-attached > .s-btn:focus-visible":"z-index:1"}});function W(e={}){let n=`.s-${e.layout??"attached"}${e.vertical?".s-vertical":""}`;Pe(`div.s-bgroup${n} role=group`,e.attrs,()=>{if(e.buttons)for(let o of e.buttons)O(o);f(e.content)})}function nt(e){he(()=>{let t=e.bind.value;W({attrs:e.attrs,buttons:Object.entries(e.options).map(([n,o])=>({content:o,ariaLabel:typeof o=="function"?n:void 0,attrs:t===n?".primary":".neutral",click:()=>{e.bind.value=e.allowDeselect&&t===n?void 0:n}}))})}),e.name&&he(()=>he(`input type=hidden name=${e.name} value=`,e.bind.value??""))}import E from"aberdeen";E.insertGlobalCss({".s-check":{"&":"display:flex flex-direction:column gap:$1","> label":"display:flex align-items:center gap:$2 cursor:pointer user-select:none","> label:has(input:disabled)":"cursor:not-allowed opacity:0.45 filter:saturate(0.6)",input:"cursor:inherit m:0"}});function ot(e={}){let t=e.id??F("check");E("div.s-check",e.attrs,()=>{E(`label for=${t}`,()=>{E("input type=checkbox",e.inputAttrs,()=>{E(`id=${t}`),e.name&&E(`name=${e.name}`),e.checked&&!e.bind&&E("checked=true"),e.change&&E("change=",e.change),E(()=>{e.disabled&&E("disabled=true")}),E(()=>{e.required&&E("aria-required=true")}),e.bind&&E("bind=",e.bind)}),E(()=>{e.label!=null&&f(e.label),e.required&&E("span.s-req aria-hidden=true #*")})}),E(()=>{e.help!=null&&!e.error&&E("div.s-help",()=>f(e.help))}),E(()=>{e.error&&E("div.s-error role=alert #",e.error)})})}import N from"aberdeen";N.insertGlobalCss({".s-form":{"&":"display:flex flex-direction:column gap:$3","&.grid":"display:grid grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap:$3","&.grid > .s-wide, &.grid > footer":"grid-column: 1 / -1;","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 flex-wrap:wrap margin-top:$1"}});function it(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e;N("form.s-form",t.attrs,()=>{N(()=>{N(".grid=",t.layout==="grid")}),N("submit=",n=>{if(n.preventDefault(),t.submit){let o=new FormData(n.target),i={};for(let r of new Set(o.keys())){let s=o.getAll(r);i[r]=s.length===1?s[0]:s}t.submit(i,n)}}),f(t.content),N(()=>{t.actions&&N("footer",t.actionsAttrs,()=>f(t.actions))})})}import p from"aberdeen";import{current as Re}from"aberdeen/route";import A from"aberdeen";import{matchCurrent as at,current as Le}from"aberdeen/route";import rt from"aberdeen";var ee={size:24,color:"currentColor",strokeWidth:2,cap:"round",join:"round"};function st(e,t){let n=t.size??ee.size,o=rt('svg.s-icon aria-hidden=true viewBox="0 0 24 24" fill=none',"width=",n,"height=",n,"stroke=",t.color??ee.color,"stroke-width=",t.strokeWidth??ee.strokeWidth,"stroke-linecap=",t.cap??ee.cap,"stroke-linejoin=",t.join??ee.join,t.attrs);o.innerHTML=e}function Q(e){return(t={})=>st(e,t)}var ge=Q('<path d="M4 6h16"/><path d="M4 12h16"/><path d="M4 18h16"/>'),Ce=Q('<path d="M18 6 6 18"/><path d="m6 6 12 12"/>');A.insertGlobalCss({".s-menu-list":"position:fixed z-index:350 min-width:10rem display:flex flex-direction:column p:$1 r:$s-radius-lg overflow-y:auto max-height:min(80vh,28rem) transition: opacity 0.15s, transform 0.15s;",".s-menu-list.hidden":"opacity:0 pointer-events:none transform:translateY(-6px)",".s-menu-item":"display:flex align-items:center gap:$2 w:100% outline:0 padding: $m2 0; line-height:1.1 r:$s-radius cursor:pointer text-align:left font-weight:450 font-size:0.9em border:0 background:transparent fg:$s-text text-decoration:none transition: color 0.12s, transform 0.12s, text-shadow 0.12s;",".s-menu-item:focus-visible:not([aria-current=page]), .s-menu-item:hover:not([aria-disabled=true]):not([aria-current=page])":"filter:none color: color-mix(in lab, $s-primary 33%, $s-text);",".s-menu-item[aria-current=page]":"color:$s-accent filter:none",".s-menu-item[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none",".s-menu-icon":"flex-shrink:0","hr.s-menu-sep":"border:0 height:1px margin: $1 0.6rem; background: linear-gradient(to right, transparent, $s-faint 18%, $s-faint 82%, transparent);"});function de(e,t){A("keydown=",n=>{if(n.key==="Enter"&&n.target.tagName==="A"){queueMicrotask(()=>t?.());return}if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"&&n.key!=="Home"&&n.key!=="End")return;n.preventDefault();let i=[...n.currentTarget.querySelectorAll(".s-menu-item")].filter(l=>l.getAttribute("aria-disabled")!=="true");if(!i.length)return;let r=i.indexOf(document.activeElement),s=n.key==="ArrowUp"?-1:1,a=n.key==="Home"?0:n.key==="End"?i.length-1:r<0?s>0?0:i.length-1:(r+s+i.length)%i.length;i[a].focus()});for(let n of e){if(typeof n=="string"||typeof n=="function"){f(n);continue}if("separator"in n){A("hr.s-menu-sep");continue}A(n.href?"a.s-menu-item":"button.s-menu-item type=button",n.attrs,()=>{n.href&&(A("href=",n.href),n.target&&A("target=",n.target),A(()=>{at(n.href)&&A("aria-current=page")})),n.disabled&&A("aria-disabled=true"),A("click=",o=>{if(n.disabled){o.preventDefault();return}t?.(),n.click?.(o)}),n.icon&&A("span.s-menu-icon",()=>f(n.icon)),f(n.label)})}}var G=A.proxy({opts:null});function q(){let e=G.opts?.anchor;G.opts=null,e?.focus()}function te(e){let t=G.opts;return t!=null&&(e==null||t.anchor===e)}function ne(e){te(e)&&q()}function lt(e,t){let n=e.offsetWidth,o=e.offsetHeight,i=window.innerWidth,r=window.innerHeight,s=4,a=t.left;a+n>i-8&&(a=Math.max(8,t.right-n));let l=t.bottom+s;l+o>r-8&&t.top-o-s>=8&&(l=t.top-o-s),e.style.left=Math.max(8,a)+"px",e.style.top=Math.max(8,l)+"px"}I(()=>{let e=G.opts;if(!e)return;let t=A("div.s-menu-list.s-s.neutral.shadow create=hidden destroy=hidden",e.dropdownAttrs,()=>{de(e.items,q)}),n=r=>{let s=r.target;!t.contains(s)&&(e.closeOnAnchorClick||!e.anchor.contains(s))&&q()},o=r=>{(r.key==="Escape"||r.key==="Tab")&&(r.preventDefault(),q())},i=A.peek(Le,"path");A(()=>{Le.path!==i&&q()}),document.addEventListener("click",n,!0),document.addEventListener("keydown",o,!0),A.clean(()=>{document.removeEventListener("click",n,!0),document.removeEventListener("keydown",o,!0)}),requestAnimationFrame(()=>{if(!document.body.contains(t))return;let r=e.at?{left:e.at.x,right:e.at.x,top:e.at.y,bottom:e.at.y}:e.anchor.getBoundingClientRect();lt(t,r),V(t,".s-menu-item[aria-current=page]")})});function oe(e){return G.opts=e,q}function dt(e){let t=null;A.clean(()=>{G.opts?.anchor===t&&q()}),A("contextmenu=",n=>{n.preventDefault(),t=n.currentTarget,oe({items:e.items,anchor:t,at:{x:n.clientX,y:n.clientY},closeOnAnchorClick:!0,dropdownAttrs:e.dropdownAttrs})})}function ct(e){let t=null;A.clean(()=>{G.opts?.anchor===t&&q()}),O({icon:()=>ge({size:"1.4em"}),...e.button?.content==null?{ariaLabel:"Open menu"}:null,attrs:".neutral",...e.button,click:n=>{if(t=n.currentTarget,G.opts?.anchor===t){q();return}oe({items:e.items,anchor:t,dropdownAttrs:e.dropdownAttrs})}})}import v from"aberdeen";import K from"aberdeen";function be(e={}){B(e,(t,n)=>{K("input.s-input",e.inputAttrs,()=>{K("type=",e.type??"text"),e.placeholder!=null&&K("placeholder=",e.placeholder),e.autocomplete!=null&&K("autocomplete=",e.autocomplete),e.value!=null&&!e.bind&&K("value=",e.value),e.input&&K("input=",e.input),e.change&&K("change=",e.change),Y(e,t,n,e.bind)})})}v.insertGlobalCss({".s-backdrop":{"&":"position:fixed inset:0 z-index:200 display:block background: rgba(0,0,0,0.55); transition: opacity 0.4s ease-in-out;","&.hidden":"opacity:0 pointer-events:none"},".s-dialog":{"&":"position:fixed z-index:200 top:50% left:50% display:flex flex-direction:column transform:translate(-50%,-50%) min-width:20rem max-width:min(90vw,44rem) max-height:min(88vh,800px) r: $s-radius-lg; overflow:hidden transition: opacity 0.2s ease-out, transform 0.2s ease-out;","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600 flex-shrink:0","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0 flex-shrink:0","> div":"p:$3 gap:$3 display:flex flex-direction:column overflow-y:auto flex:1 min-height:0","&.hidden":"opacity:0 pointer-events:none transform: translate(-50%, calc(-50% + 20px)); pointer-events:none"}});var _=v.proxy({}),ve=0,He=v.derive(()=>{let e=Object.keys(_);if(e.length)return e[e.length-1]});function ye(){return He.value!=null}I(()=>{v.onEach(_,({resolve:e,opts:t},n)=>{let o=()=>{delete _[n]};v.clean(()=>{t.onClose?.(),e()});let i=v.derive(()=>He.value!=n);v("div.s-backdrop create=hidden destroy=hidden .hidden=",i,"click=",()=>{t.allowCancel!==!1&&o()});let r=v("div.s-dialog.neutral.s-s.extra-shadow create=hidden destroy=hidden",t.attrs,()=>{v(()=>{t.header!=null&&v("header.s-s.neutral",t.headerAttrs,()=>f(t.header))}),v("div",t.contentAttrs,()=>{f(t.content,o)}),v(()=>{t.footer!=null&&v("footer.s-s.neutral",t.footerAttrs,()=>f(t.footer))})});requestAnimationFrame(()=>{document.body.contains(r)&&V(r)})})});function ce(e){ve||document.addEventListener("keydown",n=>{if(n.key!=="Escape"||n.defaultPrevented)return;let o=v.unproxy(_);for(let i=ve;i>0;i--)if(o[i]){n.preventDefault(),o[i].opts.allowCancel!==!1&&delete _[i];break}});let t=++ve;return e.cancelWithScope!==!1&&v.clean(()=>{delete _[t]}),new Promise(n=>{_[t]={resolve:n,opts:e}})}function ut(e,t={}){return ce({header:"Alert",allowCancel:!0,content:n=>{v("p",()=>{v("#",e)}),W({layout:"spaced",attrs:"align-self:flex-end",content:()=>{O({content:"OK",click:n})}})},...t})}function pt(e,t={}){return new Promise(n=>{let o=!1;ce({header:"Confirm",allowCancel:!0,content:i=>{v("p",()=>{v("#",e)}),W({layout:"spaced",attrs:"align-self:flex-end",content:()=>{O({content:"Cancel",attrs:".neutral",click:i}),O({content:"OK",click:()=>{o=!0,i()}})}})},...t,onClose:()=>{n(o),t.onClose?.()}})})}function ft(e,t="",n={}){return new Promise(o=>{let i=null;ce({header:"Input",allowCancel:!0,content:r=>{v("p",()=>{v("#",e)});let s=v.proxy({value:t});v("form display:contents",()=>{v("submit=",a=>{a.preventDefault(),i=s.value,r()}),be({bind:v.ref(s,"value")}),W({layout:"spaced",attrs:"align-self:flex-end",content:()=>{O({content:"Cancel",attrs:".neutral",type:"button",click:r}),O({content:"OK",type:"submit"})}})})},...n,onClose:()=>{o(i),n.onClose?.()}})})}p.insertGlobalCss({".s-main":{"&":"display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size","body > &":"margin: calc(-1 * $3)","> header":"border:0 border-bottom: 1px solid $s-faint; r:0 position:sticky top:0 z-index:10","> footer":"border-top: 1px solid $s-faint; fg:$s-muted","> header > .s-bar, > footer > .s-bar":"display:flex align-items:center width:100% margin-inline:auto gap:$3 padding: $2 $3;","> header .s-header-icon":"display:flex align-items:center font-size:1.4em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent;","> header .s-titles":"display:flex flex-direction:column min-width:0 flex:1","> header .s-title":"font-weight:800 font-size:1.1em line-height:1.2 overflow:hidden text-overflow:ellipsis white-space:nowrap letter-spacing:-0.01em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent; width:fit-content max-width:100%","> header .s-subtitle":"fg:$s-muted font-size:0.85em overflow:hidden text-overflow:ellipsis white-space:nowrap","> header .s-menu":"display:flex align-items:center gap:$2",".s-body":"flex:1 overflow:hidden display:flex flex-direction:row min-height:0 justify-content:center position:relative",".s-body-inner":"flex:1 min-width:0 display:flex flex-direction:row min-height:0","&.s-nav-right .s-body-inner":"flex-direction:row-reverse",".s-nav-sep":"width:1px flex-shrink:0 align-self:stretch margin: 0.6rem 0; border:0 background: linear-gradient(to bottom, transparent, $s-faint 18%, $s-faint 82%, transparent);",".s-body main":"flex:1 min-width:0 min-height:0 overflow-x:hidden overflow-y:auto display:flex flex-direction:column transition: transform 0.3s ease;",".s-body main.s-slide-in":"transform: translateX(100%); transition:none",".s-body main > .s-content":"width:100% flex:1 p:$3",".s-body main.s-scroll-y":"margin-right:$3","&.s-routed > .s-body > .s-body-inner":"max-width: var(--s-shell-w, 100%);","&.s-routed > header > .s-bar":"max-width: var(--s-shell-w, 100%);","&.s-routed > footer > .s-bar":"max-width: var(--s-shell-w, 100%);","&.s-routed > .s-body > .s-body-inner, &.s-routed > header > .s-bar, &.s-routed > footer > .s-bar":"transition: max-width var(--s-panel-ms) ease;","&.s-routed.s-shell-snap > .s-body > .s-body-inner, &.s-routed.s-shell-snap > header > .s-bar, &.s-routed.s-shell-snap > footer > .s-bar":"transition:none"},".s-nav-panel":{"&":"display:flex flex-direction:column overflow-y:auto flex-shrink:0 max-width:228px padding:$3 gap:$1"},".s-nav-page":{"&":"position:absolute inset:0 z-index:5 display:flex flex-direction:column overflow-y:auto overscroll-behavior:contain border:0 r:0 padding:$2 gap:$1 transition: transform 0.3s ease;","&.s-nav-page-off":"transform:translateX(-100%) pointer-events:none",".s-menu-item":"padding: $2 $3; min-height:3rem font-size:1.05em gap:$3"},".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:none",".s-main.s-nav-btn-only .s-nav-panel":"display:none",".s-main.s-nav-btn-only .s-nav-trigger":"display:flex",[`@container (max-width: ${U}px)`]:{".s-main.s-nav-left .s-nav-panel, .s-main.s-nav-right .s-nav-panel, .s-main .s-nav-sep":"display:none",".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:flex",".s-content > .s-box":"margin-inline: calc(-1 * $3); r:0 border-inline:0",".s-main .s-body main.s-scroll-y":"margin-right:0"}});function mt(e={}){let t=e.nav,n=e.navPosition??"left",o=p.proxy({open:!1}),i=e.routes;if(i!=null&&e.content!=null)throw new Error("Staffa: S.main() takes either `content` or `routes`, not both");let r=i?new le({routes:i,notFound:e.notFound,ancestors:e.ancestors,stacking:e.stacking,title:e.title}):null,s=r?null:e.maxWidth,a=p(`div.s-main${r?".s-routed":""}`,e.attrs,()=>{p(()=>{t==null||!t.items.length||p(n==="button"?".s-nav-btn-only":`.s-nav-${n}`)}),p(()=>{(e.title!=null||e.subtitle!=null||e.icon!=null||e.menu!=null||t!=null&&t.items.length>0)&&p("header.s-s.neutral",e.topbarAttrs,()=>{p("div.s-bar",()=>{p(()=>{s!=null&&p("max-width:",s)}),p(()=>{t==null||!t.items.length||p("div.s-nav-trigger",()=>gt(t,o))}),p(()=>{e.icon!=null&&p("div.s-header-icon",()=>f(e.icon))}),p("div.s-titles",()=>{p(()=>{e.title!=null&&p("div.s-title",()=>f(e.title))}),p(()=>{e.subtitle!=null&&p("div.s-subtitle",()=>f(e.subtitle))})}),p(()=>{e.menu&&p("div.s-menu",()=>f(e.menu))})})})}),p("div.s-body",()=>{p("div.s-body-inner",()=>{p(()=>{s!=null&&p("max-width:",s)}),p(()=>{t==null||!t.items.length||n==="button"||(p(`nav.s-nav-panel.s-nav-${n}`,e.navAttrs,()=>{de(t.items)}),p("div.s-nav-sep aria-hidden=true"))}),yt(e,r)}),p(()=>{t!=null&&t.items.length&&o.open&&bt(t,e.navPageAttrs,o)})}),p(()=>{e.footer!=null&&p("footer",()=>{p("div.s-bar",()=>{p(()=>{s!=null&&p("max-width:",s)}),f(e.footer)})})})});if(t!=null||r){let l=g=>{if(g.key!=="Escape"||g.defaultPrevented||ye()||te())return;let y=a.querySelector(".s-nav-trigger button");if(o.open){g.preventDefault(),o.open=!1,y?.focus();return}if(r&&r.$state.paths.length>1){g.preventDefault(),r.closeTop();return}let u=a.querySelector(".s-nav-panel");if(u?.offsetParent!=null){let b=u.querySelector("[aria-current=page]")??u.querySelector(".s-menu-item:not([aria-disabled=true])");b&&(g.preventDefault(),b.focus());return}y&&(g.preventDefault(),y.click())};document.addEventListener("keydown",l),p.clean(()=>document.removeEventListener("keydown",l))}}var ie=null;function ht(){ie?.()}function gt(e,t){let n=null;p.clean(()=>{n&&ne(n)});let o=()=>{n&&ne(n)};O({icon:()=>p(()=>(t.open?Ce:ge)({size:"1.5em"})),ariaLabel:"Open navigation",attrs:".neutral .small",...e.button,click:i=>{n=i.currentTarget;let r=n.closest(".s-main");if(r!=null&&r.clientWidth<=U){t.open=!t.open;return}te(n)?ne(n):(ie=o,oe({items:e.items,anchor:n,dropdownAttrs:e.dropdownAttrs}))}})}function bt(e,t,n){let o=!1,i=()=>{o=!0,n.open=!1},r=p("nav.s-nav-page.s-s.neutral aria-label=Navigation create=s-nav-page-off destroy=s-nav-page-off",t,()=>de(e.items,i));ie=i,p.clean(()=>{ie===i&&(ie=null)});let s=p.peek(Re,"path");p(()=>{Re.path!==s&&i()});let a=r.closest(".s-main"),l=r.parentElement?.querySelector(":scope > .s-body-inner"),g=l?.querySelector(":scope > main");if(l?.setAttribute("inert",""),a!=null&&typeof ResizeObserver<"u"){let y=new ResizeObserver(()=>{a.clientWidth>U&&(n.open=!1)});y.observe(a),p.clean(()=>y.disconnect())}p.clean(()=>{l?.removeAttribute("inert"),o&&(g&&vt(g),a?.querySelector(".s-nav-trigger button")?.focus())}),requestAnimationFrame(()=>{document.body.contains(r)&&V(r,".s-menu-item[aria-current=page]")})}function vt(e){e.classList.add("s-slide-in"),e.offsetWidth,e.classList.remove("s-slide-in")}function yt(e,t){if(t){t.drawStack();return}let n=p("main",()=>{p("div.s-content",e.contentAttrs,()=>{f(e.content)})});xt(n)}function xt(e){if(typeof ResizeObserver>"u")return;let t=()=>e.classList.toggle("s-scroll-y",e.offsetWidth>e.clientWidth),n=new ResizeObserver(t);n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild),t(),p.clean(()=>n.disconnect())}import M from"aberdeen";M.insertGlobalCss({".s-select_wrap":{"&":"position:relative display:block",select:"w:100% cursor:pointer padding-right:2.2em; appearance:none","&::after":"content: '\u25BE'; position:absolute right:0.7em top:50%; transform: translateY(-50%); pointer-events:none fg:$s-muted font-size:0.85em"}});function wt(e){B(e,(t,n)=>{M("div.s-select_wrap",e.inputAttrs,()=>{M("select.s-input",()=>{Y(e,t,n),M("change=",o=>{e.bind&&(e.bind.value=o.target.value)}),M(()=>{let o=typeof e.options=="function"?e.options():e.options,i=e.bind?.value??"";e.placeholder!=null&&M("option",()=>{M("value= disabled=true hidden=true"),i||M("selected=true"),M("#",e.placeholder)});for(let r of o){let s=typeof r=="string"?{value:r,label:r}:{value:r.value,label:r.label??r.value};M("option",()=>{M("value=",s.value),s.value===i&&M("selected=true"),M("#",s.label)})}})})})})}import w from"aberdeen";var $t=Q('<path d="m15 18-6-6 6-6"/>'),kt=Q('<path d="m9 18 6-6-6-6"/>');w.insertGlobalCss({".s-tabs":{"&":"display:flex flex-direction:column gap:$3",".s-tabbar":"position:relative display:flex border-bottom: 1px solid $s-faint;",".s-tablist":"display:flex gap:$1 align-items:stretch flex:1 min-width:0 overflow-x:auto overflow-y:hidden scrollbar-width:none scroll-behavior:smooth margin-bottom:-1px",".s-tablist::-webkit-scrollbar":"display:none",".s-tab":"display:inline-flex align-items:center gap:$2 cursor:pointer background:transparent border:0 color: $s-muted; font-weight:600 padding: 0.6em 0.9em; white-space:nowrap border-bottom: 3px solid transparent; transition: color 0.15s, background 0.15s, border-color 0.15s;",".s-tab:hover:not(:disabled), .s-tab[aria-selected=true]":"color: $s-text;",".s-tab:focus-visible":"outline:none box-shadow: inset 0 0 0 2px $s-focus; r: $s-radius;",".s-tab[aria-selected=true]":"border-image: $s-gradient 1;",".s-tabscroll":"position:absolute top:0 bottom:0 z-index:1 display:none align-items:center justify-content:center width:2.4em border:0 padding:0 cursor:pointer fg:$s-muted transition: color 0.15s;",".s-tabscroll:hover":"fg:$s-text",".s-tabscroll-left":"left:0 justify-content:flex-start background: linear-gradient(to right, $s-bg 45%, transparent)",".s-tabscroll-right":"right:0 justify-content:flex-end background: linear-gradient(to left, $s-bg 45%, transparent)",".s-tabbar.s-can-left > .s-tabscroll-left, .s-tabbar.s-can-right > .s-tabscroll-right":"display:flex",".s-tabpanel":"display:block"}});function Et(e){let t=F("tabs"),n=(r,s)=>r.id??String(s),o=e.bind??w.proxy(n(e.tabs[0]??{label:""},0));e.tabs.length>0&&!e.tabs.some((r,s)=>n(r,s)===w.peek(()=>o.value))&&(o.value=n(e.tabs[0],0));let i=(r,s)=>{r.disabled||(o.value=n(r,s))};w("div.s-tabs",e.attrs,()=>{w("div.s-tabbar",()=>{let r=w("div.s-tablist role=tablist",()=>{e.tabs.forEach((s,a)=>{let l=n(s,a),g=w("button.s-tab type=button role=tab",()=>{w(`id=${t}-tab-${l} aria-controls=${t}-panel-${l}`),w(()=>{let y=o.value===l;w("aria-selected=",y?"true":"false"),w("tabindex=",y?"0":"-1"),y&&requestAnimationFrame(()=>Tt(g))}),s.disabled&&w("disabled=true"),w("click=",()=>i(s,a)),w("keydown=",y=>Ot(y,e.tabs,a,i)),f(s.icon),f(s.label)})})});ze(r,-1),ze(r,1),At(r)}),w("div.s-tabpanel role=tabpanel",e.contentAttrs,()=>{w(()=>{let r=o.value,s=e.tabs.findIndex((l,g)=>n(l,g)===r),a=e.tabs[s]??e.tabs[0];a&&(w(`id=${t}-panel-${n(a,s)} aria-labelledby=${t}-tab-${n(a,s)}`),f(a.content))})})})}function ze(e,t){w(`button.s-tabscroll.s-tabscroll-${t<0?"left":"right"} type=button`,()=>{w("tabindex=-1 aria-hidden=true"),w("click=",()=>e.scrollBy({left:t*e.clientWidth*.8,behavior:"smooth"})),(t<0?$t:kt)({size:"1.1em"})})}function At(e){let t=e.parentElement;if(!t||typeof ResizeObserver>"u")return;let n=()=>{let i=e.scrollWidth-e.clientWidth;t.classList.toggle("s-can-left",e.scrollLeft>1),t.classList.toggle("s-can-right",e.scrollLeft<i-1)};e.addEventListener("scroll",n,{passive:!0});let o=new ResizeObserver(n);o.observe(e);for(let i of Array.from(e.children))o.observe(i);n(),w.clean(()=>{e.removeEventListener("scroll",n),o.disconnect()})}function Tt(e){let t=e.parentElement;if(!t||!e.isConnected)return;let n=parseFloat(getComputedStyle(t).fontSize)*2.6,o=e.getBoundingClientRect(),i=t.getBoundingClientRect();o.left<i.left+n?t.scrollBy({left:o.left-i.left-n,behavior:"smooth"}):o.right>i.right-n&&t.scrollBy({left:o.right-i.right+n,behavior:"smooth"})}function Ot(e,t,n,o){let i=n;if(e.key==="ArrowRight"||e.key==="ArrowDown")i=(n+1)%t.length;else if(e.key==="ArrowLeft"||e.key==="ArrowUp")i=(n-1+t.length)%t.length;else if(e.key==="Home")i=0;else if(e.key==="End")i=t.length-1;else return;e.preventDefault();let r=i>=n?1:-1;for(let s=0;s<t.length;s++){let a=t[i];if(a&&!a.disabled){o(a,i),e.currentTarget?.parentElement?.children[i]?.focus();return}i=(i+r+t.length)%t.length}}import C from"aberdeen";C.insertGlobalCss({"textarea.s-input":"resize:vertical min-height:3em line-height:1.45","textarea.s-input.s-autoGrow":"resize:none min-height:2.5em overflow-y:hidden"});function Mt(e={}){let t=e.autoGrow!==!1;B(e,(n,o)=>{let i=C("textarea.s-input",e.inputAttrs,()=>{t?(C(".s-autoGrow"),C("input=",r=>{qe(r.currentTarget),e.input&&e.input(r)})):(C("rows=",e.rows??4),C("resize:",e.resize??"vertical"),e.input&&C("input=",e.input)),e.placeholder!=null&&C("placeholder=",e.placeholder),e.value!=null&&!e.bind&&C("value=",e.value),e.change&&C("change=",e.change),Y(e,n,o,e.bind)});t&&requestAnimationFrame(()=>qe(i))})}function qe(e){e.style.height="auto",e.style.height=`${e.scrollHeight}px`}import $ from"aberdeen";import{grow as St,shrink as Pt}from"aberdeen/transitions";$.insertGlobalCss({".s-toasts":"position:fixed bottom:$3 right:$3 z-index:400 display:flex flex-direction:column gap:$2 pointer-events:none max-width:min(90vw,24rem) w:24rem",".s-toast":{"&":"display:flex align-items:flex-start gap:$2 padding: $3; pointer-events:auto position:relative overflow:hidden",".s-toast-body":"display:flex flex-direction:column gap:$1 flex:1 min-width:0",".s-toast-title":"font-weight:700 line-height:1.3",".s-toast-close":"cursor:pointer border:0 background:transparent fg:$s-muted font-size:1.1em line-height:1 padding: 0 0.15em; r:4px flex-shrink:0 align-self:flex-start",".s-toast-close:hover":"fg:$s-text",".s-toast-close:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-text",".s-toast-progress":"position:absolute bottom:0 left:0 right:0 height:2px background:$s-accent width:100%"}});var Lt=0,re=$.proxy({});I(()=>{$.peek(()=>$.isEmpty(re))&&$.isEmpty(re)||$("div.s-toasts",()=>{$.onEach(re,e=>{let{opts:t,id:n}=e,o=t.type==="danger"||t.type==="warning"?"alert":"status",i=t.type==null||t.type==="neutral"?"neutral":t.type,r=t.duration??6e3,s,a=null,l=()=>{clearTimeout(s),a&&(a.style.transition="none",a.style.width="100%",a.offsetWidth,a.style.transition=`width ${r}ms linear`,a.style.width="0%"),s=setTimeout(()=>xe(n),r)},g=()=>{clearTimeout(s),s=void 0,a&&(a.style.transition="none",a.style.width="100%")};$.clean(()=>clearTimeout(s)),$(`div.s-toast.s-s.${i}.extra-shadow aria-live=polite role=${o}`,"create=",St,"destroy=",Pt,t.attrs,()=>{r>0&&($("mouseenter=",g),$("mouseleave=",l)),$("div.s-toast-body",()=>{$(()=>{t.title!=null&&$("div.s-toast-title",()=>f(t.title))}),$("div.s-toast-msg",()=>f(t.message))}),$(()=>{t.dismissible!==!1&&$("button.s-toast-close type=button aria-label=Dismiss",()=>{$("#\xD7"),$("click=",()=>xe(n))})}),r>0&&(a=$("div.s-toast-progress"))}),r>0&&requestAnimationFrame(l)})})});function xe(e){delete re[e]}function Ct(e){let t=++Lt;return re[t]={id:t,opts:e},()=>xe(t)}import H from"aberdeen";H.insertGlobalCss({".s-tt-tip":{"&":"position:fixed z-index:500 max-width:20rem w:max-content padding: 0.3em 0.65em; font-size:0.85em line-height:1.4 pointer-events:none"}});var J=H.proxy(void 0),R=null;typeof window<"u"&&window.addEventListener("scroll",()=>{J.value=void 0},{capture:!0,passive:!0});function Ht(e,t,n,o){let r=window.innerWidth,s=window.innerHeight,a=0,l=0;return o==="bottom"?(a=e.left+(e.width-t)/2,l=e.bottom+7,l+n>s-8&&(l=e.top-n-7)):o==="left"?(a=e.left-t-7,l=e.top+(e.height-n)/2,a<8&&(a=e.right+7)):o==="right"?(a=e.right+7,l=e.top+(e.height-n)/2,a+t>r-8&&(a=e.left-t-7)):(a=e.left+(e.width-t)/2,l=e.top-n-7,l<8&&(l=e.bottom+7)),{x:Math.max(8,Math.min(a,r-t-8)),y:Math.max(8,Math.min(l,s-n-8))}}function we(){R&&clearTimeout(R),R=setTimeout(()=>{J.value=void 0,R=null},100)}I(()=>{let e=J.value;if(!e)return;let{opts:t,anchor:n}=e,o=t.placement??"top",i=H("div.s-tt-tip.s-s.neutral.shadow role=tooltip visibility:hidden",t.attrs,()=>{H("mouseenter=",()=>{R&&(clearTimeout(R),R=null)}),H("mouseleave=",we),f(t.tip)});requestAnimationFrame(()=>{if(!document.body.contains(i))return;let{x:r,y:s}=Ht(n.getBoundingClientRect(),i.offsetWidth,i.offsetHeight,o);i.style.left=r+"px",i.style.top=s+"px",i.style.visibility=""})});function Rt(e){let t=n=>{R&&(clearTimeout(R),R=null),J.value={opts:e,anchor:n.currentTarget}};H("mouseenter=",t),H("mouseleave=",we),H("focusin=",t),H("focusout=",we),H.clean(()=>{J.value?.opts===e&&(J.value=void 0)})}export{dt as addContextMenu,Rt as addTooltip,ut as alert,Ne as autocomplete,tt as box,O as button,nt as buttonChooser,W as buttonGroup,ot as checkbox,ne as closeFloatingMenu,ht as closeNav,pt as confirm,ce as dialog,it as form,ke as getDarkMode,ye as isDialogOpen,te as isFloatingMenuOpen,mt as main,ct as menuButton,et as panels,ft as prompt,wt as select,Be as setDarkMode,oe as showFloatingMenu,Et as tabs,Mt as textarea,be as textline,Ct as toast};
1
+ import E from"aberdeen";var Y="background: linear-gradient(170deg, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%));",v1="staffa:darkMode",P1=E.proxy({value:a2()});function a2(){try{let t=localStorage.getItem(v1);if(t==="dark")return!0;if(t==="light")return!1}catch{}}function h2(t){P1.value=t;try{t===void 0?localStorage.removeItem(v1):localStorage.setItem(v1,t?"dark":"light")}catch{}}function O1(t=!1){let a=P1.value;return a===void 0&&!t?E.darkMode():a}E(()=>{O1()?E.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#0e0f12 --s-text:#e9eaec",".s-s.neutral":"--s-bg:#191b1f --s-text:#e9eaec",".s-s.neutral .s-s.neutral":"--s-bg:#23262b"}):E.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#eef0f3 --s-text:#1d1f24",".s-s.neutral, .s-s.neutral":"--s-bg:#ffffff --s-text:#1d1f24",".s-s.neutral .s-s.neutral":"--s-bg:#f6f7f9"})});E.setSpacingCssVars(1.1);E.insertGlobalCss({"*, *::before, *::after":"box-sizing:border-box",html:"text-size-adjust:100%",body:"m:0 p:$3 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased background-color:$s-bg text:$s-text",a:"color: $s-link-fg; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;","a:hover":"filter: brightness(1.15)","input, button, textarea, select, optgroup":"font:inherit color:inherit","input:where(:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=image],[type=submit],[type=button],[type=reset],[type=hidden])), textarea, select":"background:$s-bg border: 1px solid $s-faint; r:$s-radius-sm padding: 0.45em 0.65em; max-width:100%","input:where([type=checkbox],[type=radio])":"width:1.15em height:1.15em cursor:pointer","input[type=range]":"appearance:none background:transparent cursor:pointer vertical-align:middle","input[type=range]::-webkit-slider-runnable-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-progress":"height:4px r:99px background:$s-accent","input[type=range]::-webkit-slider-thumb":"appearance:none width:16px height:16px margin-top:-6px r:50% background:$s-accent","input[type=range]::-moz-range-thumb":"width:16px height:16px border:0 r:50% background:$s-accent","input[type=file]":"cursor:pointer",progress:"appearance:none border:0 height:6px r:99px background:$s-faint overflow:hidden vertical-align:middle","progress::-webkit-progress-bar":"background:$s-faint r:99px","progress::-webkit-progress-value":"background:$s-accent r:99px","progress::-moz-progress-bar":"background:$s-accent r:99px",meter:"vertical-align:middle",fieldset:"border: 1px solid $s-faint; r:$s-radius-sm padding:$2 min-width:0",legend:"padding: 0 $1; font-weight:600","code, kbd, samp, pre":"font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;",code:"background: color-mix(in oklab, $s-text, $s-bg 86%); padding: 0.12em 0.34em; r:4px font-size:0.9em",pre:"background: color-mix(in oklab, $s-text, $s-bg 92%); p:$3 r: $s-radius; overflow:auto","pre code":"background:transparent p:0","img, svg, video, canvas":"max-width:100% h:auto",hr:"border:0 border-top: 1px solid $s-faint;","::placeholder":"color: $s-muted; opacity:1",":focus-visible":"outline: 2px solid $s-focus; outline-offset:2px",small:"color:$s-muted font-size:0.9em","@media (prefers-reduced-motion: reduce)":{"*, *::before, *::after":"transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important;"},":root":"--s-primary:#00a884 --s-danger:#dc5b41 --s-success:#00a884 --s-warning:#ef6b00 --s-link:#3f8cd8 --s-radius-sm:6px --s-radius:12px --s-radius-lg:18px --s-focus: color-mix(in srgb, $s-primary 38%, transparent); --s-gradient: linear-gradient(135deg, color-mix(in oklab, $s-primary, white 16%), color-mix(in oklab, $s-primary, black 14%));",":root, .s-s.neutral":"--s-accent:$s-primary --s-link-fg:$s-link",".s-s:not(.neutral)":"--s-bg:$s-primary border:0 --s-text:#eee --s-accent:#fff --s-link-fg:#eef --s-muted: color-mix(in srgb, #fff 70%, transparent); --s-faint: color-mix(in srgb, #fff 30%, transparent);",".s-s.danger":"--s-bg:$s-danger",".s-s.success":"--s-bg:$s-success",".s-s.warning":"--s-bg:$s-warning",".s-s.link":"--s-bg:$s-link",".s-s.primary":"--s-bg:$s-primary",":root, .s-s":"--s-muted: color-mix(in oklab, $s-text, $s-bg 42%); --s-faint: color-mix(in oklab, $s-text, $s-bg 80%); color:$s-text accent-color:$s-accent scrollbar-width:thin scrollbar-color: $s-faint transparent;",".s-s, body":Y,".s-s":"r:$s-radius",":where(.s-s.neutral)":"border: 1px solid $s-faint;",".s-s::-webkit-scrollbar, .s-s ::-webkit-scrollbar":"width:10px height:10px",".s-s::-webkit-scrollbar-track, .s-s ::-webkit-scrollbar-track":"background:transparent",".s-s::-webkit-scrollbar-thumb, .s-s ::-webkit-scrollbar-thumb":"background:$s-faint border-radius:99px border: 2px solid transparent; background-clip:padding-box",".s-s.shadow.neutral:not(.s-btn)":"box-shadow: 0 4px 14px rgba(0,0,0,0.13);",".s-s.extra-shadow.neutral:not(.s-btn)":"box-shadow: 0 18px 50px rgba(0,0,0,0.28);",".s-s.shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 4px 14px color-mix(in srgb, $s-bg 30%, transparent);",".s-s.extra-shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 14px 40px color-mix(in srgb, $s-bg 40%, transparent);",".s-s.no-shadow":"box-shadow: none !important;",".s-s:not(.neutral).tonal, .s-s:not(.neutral).outlined":"--s-text:$s-bg --s-accent:$s-bg --s-link-fg:$s-bg --s-faint: color-mix(in srgb, $s-bg 30%, transparent); --s-muted: color-mix(in srgb, $s-bg 70%, transparent);",".s-s:not(.neutral).tonal":"background: color-mix(in srgb, $s-bg 15%, transparent); border: 1px solid $s-faint;",".s-s:not(.neutral).outlined":"background: transparent; border: 1px solid color-mix(in srgb, $s-bg 45%, transparent);",".s-s:not(.neutral) .s-s.tonal, .s-s:not(.neutral) .s-s.outlined":"--s-text:#fff --s-accent:#fff --s-link-fg:#fff "+Y+" border-color: transparent;"});E.insertGlobalCss({".s-preload, .s-preload *, .s-preload *::before, .s-preload *::after":"transition: none !important; animation: none !important;"});if(typeof document<"u"&&typeof requestAnimationFrame=="function"){let t=document.documentElement;t.classList.add("s-preload"),requestAnimationFrame(()=>requestAnimationFrame(()=>t.classList.remove("s-preload")))}E.insertGlobalCss({":disabled, [aria-disabled=true]":"opacity:0.45 filter:saturate(0.6) user-select:none",":disabled, [aria-disabled=true], :disabled *, [aria-disabled=true] *":"pointer-events:none cursor:not-allowed"});var e2="p, ul, ol, dl, blockquote, pre, table, figure, hr, h1, h2, h3, h4, h5, h6";E.insertGlobalCss({[`${e2}`]:{"&":"margin:0","&:not(:first-child)":"margin-top:$3"},"h1, h2, h3, h4, h5, h6":{"&":"line-height:1.15 font-weight:700 text-wrap:balance","&:not(:first-child)":"margin-top:1.4em"},h1:"font-size:2em font-weight:800 letter-spacing:-0.022em",h2:"font-size:1.55em letter-spacing:-0.018em",h3:"font-size:1.3em letter-spacing:-0.011em",h4:"font-size:1.1em",h5:"font-size:0.95em letter-spacing:0.005em",h6:"font-size:0.8em fg:$s-muted text-transform:uppercase letter-spacing:0.07em","ul, ol":{"&":"padding-left:1.5em","> li:not(:first-child), li > &:not(:first-child)":"margin-top:$1"},blockquote:"border-left: 3px solid $s-faint; padding-left: $3; fg: $s-muted",table:"border-collapse:collapse","th, td":"text-align:left padding: $1 $2; border-bottom: 1px solid $s-faint; vertical-align:top",th:"font-weight:600","thead th":"border-bottom: 2px solid $s-faint;",dt:"font-weight:600",dd:"margin-left: 1.5em",figcaption:"fg:$s-muted font-size:0.9em margin-top:$1 text-align:center"});import s from"aberdeen";import E1 from"aberdeen";var r1=640,p2=0;function B(t="s"){return`${t}-${++p2}`}function x(t,...a){t!=null&&(typeof t=="function"?t(...a):E1("rich=",t))}var r2="a[href], button, input, select, textarea, [tabindex]";function j(t,a){let h=p=>p instanceof HTMLElement&&!p.hasAttribute("disabled")&&p.getAttribute("aria-disabled")!=="true"&&p.tabIndex>=0&&p.getClientRects().length>0,e=(a?[...t.querySelectorAll(a)].find(h):void 0)??[...t.querySelectorAll(r2)].find(h);return e?.focus(),e!=null}function F(t){queueMicrotask(()=>E1(t))}import L from"aberdeen";L.insertGlobalCss({".s-field":{"&":"display:flex flex-direction:column gap:$1","> label":"font-weight:600 font-size:0.9em fg:$s-text user-select:none"},".s-req":"fg:$s-danger margin-left:2px",".s-help":"font-size:0.82em fg:$s-muted",".s-error":"font-size:0.82em fg:$s-danger",".s-input":{"&":"w:100% background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;","&:hover:not(:disabled)":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","&:focus-visible":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none","&[aria-invalid=true]":"border-color:$s-danger"}});function I(t,a){let h=t.id??B("field"),e=()=>!!t.error;L("div.s-field",t.attrs,()=>{L(()=>{t.label!=null&&L("label for=",h,()=>{x(t.label),t.required&&L("span.s-req aria-hidden=true #*")})}),a(h,e),L(()=>{t.help!=null&&!t.error&&L("div.s-help",()=>x(t.help))}),L(()=>{t.error&&L("div.s-error role=alert #",t.error)})})}function _(t,a,h,e){L("id=",a),t.name&&L("name=",t.name),L(()=>{t.disabled&&L("disabled=true")}),L(()=>{t.required&&L("aria-required=true")}),L(()=>L("aria-invalid=",h()?"true":"false")),e&&L("bind=",e)}s.insertGlobalCss({".s-ac":{"&":"position:relative","> .s-control":"display:flex flex-wrap:wrap align-items:center gap:$1 background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.3em 0.4em; cursor:text; transition: border-color 0.15s, box-shadow 0.15s;","> .s-control:hover":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","> .s-control:focus-within":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus;","&[aria-invalid=true] > .s-control":"border-color:$s-danger",".s-chip":"display:inline-flex align-items:center gap:$1 font-size:0.85em background: color-mix(in oklab, $s-bg, $s-text 10%); border: 1px solid $s-faint; r:$s-radius padding: 0.1em 0.2em 0.1em 0.5em;",".s-chip > button":"cursor:pointer border:0 background:transparent fg:$s-muted font-size:1.1em line-height:1 padding: 0 0.2em; r:4px",".s-chip > button:hover":"fg:$s-text background:$s-faint",input:"flex:1 min-width:6ch border:0 background:transparent color:inherit outline:none padding:0.25em","> .s-menu":"position:absolute top:100% left:0 right:0 z-index:20 margin-top:4px max-height:15rem overflow-y:auto list-style:none p:$1 margin-bottom:0","> .s-menu li":"margin:0",".s-option":"padding: 0.45em 0.6em; r:6px cursor:pointer transition: background 0.1s;",".s-option[aria-selected=true]":"background: color-mix(in srgb, $s-text 10%, transparent);",".s-add":"fg:$s-accent font-style:italic",".s-empty":"padding: 0.45em 0.6em; fg:$s-muted"}});function d2(t){return typeof t=="string"?{value:t,label:t}:{value:t.value,label:t.label??t.value}}function o2(t){let a=B("ac-menu"),h=s.proxy({query:"",open:!1,active:0}),e=()=>(typeof t.options=="function"?t.options():t.options).map(d2),p=()=>{let l=t.bind?.value;return l==null||l===""?[]:Array.isArray(l)?l:[l]},r=l=>e().find(u=>u.value===l)?.label??l;if(!t.multi){let l=t.bind?s.peek(t.bind,"value"):void 0;typeof l=="string"&&l&&(h.query=s.peek(()=>r(l)))}let d=()=>{let l=new Set(p()),u=e();t.multi&&(u=u.filter(H=>!l.has(H.value)));let f=h.query.trim().toLowerCase();return f&&(u=u.filter(H=>H.label.toLowerCase().includes(f))),u},o=(l,u)=>{if(t.multi){let f=Array.isArray(t.bind?.value)?[...t.bind.value]:[];f.includes(l)||f.push(l),t.bind&&(t.bind.value=f),h.query=""}else t.bind&&(t.bind.value=l),h.query=r(l),h.open=!1;h.active=0,u?.focus()},c=l=>{if(!t.bind)return;let u=t.bind.value??[];t.bind.value=u.filter(f=>f!==l)};I(t,(l,u)=>{s("div.s-ac",t.inputAttrs,()=>{s(()=>s("aria-invalid=",u()?"true":"false"));let f;s("div.s-control",()=>{s("click=",()=>f?.focus()),s(()=>{if(t.multi)for(let H of p())s("span.s-chip",()=>{s("span #",s.peek(()=>r(H))),s("button type=button aria-label=",`Remove ${H}`,()=>{s("#\xD7"),s("click=",n=>{n.stopPropagation(),c(H),f?.focus()})})})}),f=s("input type=text role=combobox autocomplete=off",()=>{s("id=",l,`aria-controls=${a} aria-autocomplete=list`),t.placeholder!=null&&s("placeholder=",t.placeholder),t.disabled&&s("disabled=true"),t.required&&s("aria-required=true"),s("bind=",s.ref(h,"query")),s(()=>s("aria-expanded=",h.open?"true":"false")),s(()=>{let n=d()[h.active];s("aria-activedescendant=",h.open&&n?`${a}-opt-${h.active}`:"")}),s("input=",()=>{h.open=!0,h.active=0}),s("focus=",()=>{h.open=!0}),s("blur=",()=>{setTimeout(()=>m(),150)}),s("keydown=",H=>M(H,f))})}),s(()=>{if(!h.open)return;let H=d(),n=h.query.trim(),g=t.allowCustom!==!1&&n!==""&&!H.some(C=>C.label.toLowerCase()===n.toLowerCase());s("ul.s-menu.s-s.neutral.shadow role=listbox",`id=${a}`,()=>{H.forEach((C,S)=>{s("li.s-option role=option",`id=${a}-opt-${S}`,()=>{s(()=>s("aria-selected=",h.active===S?"true":"false")),s("#",C.label),s("mousedown=",t2=>t2.preventDefault()),s("click=",()=>o(C.value,f)),s("mousemove=",()=>{h.active=S})})}),g&&s("li.s-option.s-add role=option",()=>{s("#",`Add "${n}"`),s("mousedown=",C=>C.preventDefault()),s("click=",()=>o(n,f))}),H.length===0&&!g&&s("li.s-empty #No matches")})}),s(()=>{if(t.name)if(t.multi)for(let H of p())s("input type=hidden",()=>{s("name=",t.name),s("value=",H)});else s("input type=hidden",()=>{s("name=",t.name),s("value=",p()[0]??"")})})})});function M(l,u){let f=d(),H=f.length-1;if(l.key==="ArrowDown")l.preventDefault(),h.open=!0,h.active=Math.min(H,h.active+1);else if(l.key==="ArrowUp")l.preventDefault(),h.active=Math.max(0,h.active-1);else if(l.key==="Enter"){l.preventDefault();let n=f[h.active];n?o(n.value,u):t.allowCustom!==!1&&h.query.trim()?o(h.query.trim(),u):h.open&&(h.open=!1)}else if(l.key==="Escape")h.open&&(l.preventDefault(),h.open=!1,t.multi||(h.query=r(p()[0]??"")));else if(l.key==="Backspace"&&t.multi&&h.query===""){let n=p();n.length&&c(n[n.length-1])}}function m(){h.open=!1,t.multi?h.query="":t.allowCustom!==!1&&h.query.trim()?o(h.query.trim()):h.query=r(p()[0]??"")}}import W from"aberdeen";import c2 from"aberdeen";var t1={size:24,color:"currentColor",strokeWidth:2,cap:"round",join:"round"};function n2(t,a){let h=a.size??t1.size,e=c2('svg.s-icon aria-hidden=true viewBox="0 0 24 24" fill=none',"width=",h,"height=",h,"stroke=",a.color??t1.color,"stroke-width=",a.strokeWidth??t1.strokeWidth,"stroke-linecap=",a.cap??t1.cap,"stroke-linejoin=",a.join??t1.join,a.attrs);e.innerHTML=t}function z(t){return(a={})=>n2(t,a)}var q1=z('<path d="m9 18 6-6-6-6" />');var T1=z('<circle cx="12" cy="12" r="10" />');var D1=z('<path d="M15 3h6v6" /><path d="M10 14 21 3" /><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />');var R1=z('<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" /><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />');var d1=z('<path d="M4 5h16" /><path d="M4 12h16" /><path d="M4 19h16" />');var Z1=z('<path d="M12 17v5" /><path d="M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" /><path d="m2 2 20 20" /><path d="M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" />'),m1=z('<path d="M12 17v5" /><path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" />');var B1=z('<path d="M22 2 2 22" />');var Q=z('<path d="M18 6 6 18" /><path d="m6 6 12 12" />');import P from"aberdeen";P.insertGlobalCss({".s-btn":{"&":"display:inline-flex align-items:center justify-content:center gap:$2 font-weight:450 line-height:1.1 white-space:nowrap cursor:pointer text-decoration:none padding: $m2 $m3; transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;","&:focus-visible":"outline: 3px solid $s-focus; outline-offset: 1px;","&:hover":"filter: brightness(1.06)","&.tonal:hover, &.outlined:hover":"background: color-mix(in srgb, $s-bg 24%, transparent);","&.neutral:hover":"filter:none background: color-mix(in srgb, $s-text 8%, $s-bg);","> svg":"width:1.25em height:1.25em","&:active:not(:disabled)":"transform: translateY(1px)","&.small, .small > &":"padding: $m1 $m2; font-size:0.85em border-radius:$s-radius-sm","&.large, .large > &":"font-size:1.4em border-radius:$s-radius-lg"},".s-icon-btn":{"&":"display:inline-flex align-items:center justify-content:center flex-shrink:0 width:2rem height:2rem p:0 border:0 background:transparent cursor:pointer fg:$s-muted r:$s-radius-sm line-height:1 font-size:1rem text-decoration:none transition: color 0.12s, background 0.12s;","> svg":"width:1.25em height:1.25em","&:hover:not(:disabled):not([aria-disabled=true])":"fg:$s-text background: color-mix(in srgb, $s-text 10%, transparent);","&:focus-visible":"outline: 3px solid $s-focus; outline-offset:1px","&.small, .small > &":"width:1.6rem height:1.6rem font-size:0.8rem","&.large, .large > &":"width:2.4rem height:2.4rem font-size:1.2rem"}});function a1(t){let a=t.href!=null?"a":"button";P(`${a}.s-icon-btn`,t.attrs,()=>{F1(t),P("aria-label=",t.ariaLabel),x(t.icon)})}function F1(t){t.href!=null?(P("role=button"),t.disabled?P("aria-disabled=true"):P("href=",t.href)):(P("type=",t.type??"button"),t.disabled&&P("disabled=true")),t.click&&!t.disabled&&P("click=",t.click)}function O(t={}){let a=typeof t=="string"||typeof t=="function"?{content:t}:t,h=a.href!=null?"a":"button";P(`${h}.s-btn.s-s.shadow`,a.attrs,()=>{F1(a),a.ariaLabel&&P("aria-label=",a.ariaLabel),x(a.icon),x(a.content)})}W.insertGlobalCss({".s-box":{"&":"display:flex flex-direction:column overflow:hidden r: $s-radius-lg; position:relative","&:not(:first-child)":"margin-top: $3","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0","> div":"p:$3 gap:$3","> header > .s-box-close":"margin-left:auto","> .s-box-close":"position:absolute top:$2 right:$2 z-index:1"}});function i2(t={}){let a=typeof t=="string"||typeof t=="function"?{content:t}:t;W("section.s-box.s-s.neutral.shadow",a.attrs,()=>{W(()=>{a.header!=null?W("header.s-s.neutral",a.headerAttrs,()=>{x(a.header),typeof a.close=="function"&&I1(a.close)}):typeof a.close=="function"&&I1(a.close)}),W("div",a.contentAttrs,()=>{x(a.content)}),W(()=>{a.footer!=null&&W("footer.s-s.neutral",a.footerAttrs,()=>x(a.footer))})})}function I1(t){a1({icon:Q,ariaLabel:"Close",click:t,attrs:".s-box-close"})}import u1 from"aberdeen";import U1 from"aberdeen";U1.insertGlobalCss({".s-bgroup":{"&":"display:inline-flex align-items:stretch","&.s-spaced":"gap:$2 flex-wrap:wrap","&.s-vertical":"flex-direction:column","&.s-attached":"gap:0","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child)":"margin-left:-1px","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached:not(.s-vertical) > .s-btn:first-child:not(:last-child)":"border-top-right-radius:0 border-bottom-right-radius:0","&.s-attached:not(.s-vertical) > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-bottom-left-radius:0","&.s-attached.s-vertical > .s-btn:not(:first-child)":"margin-top:-1px","&.s-attached.s-vertical > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached.s-vertical > .s-btn:first-child:not(:last-child)":"border-bottom-left-radius:0 border-bottom-right-radius:0","&.s-attached.s-vertical > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-top-right-radius:0","&.s-attached > .s-btn:hover, &.s-attached > .s-btn:focus-visible":"z-index:1"}});function X(t={}){let h=`.s-${t.layout??"attached"}${t.vertical?".s-vertical":""}`;U1(`div.s-bgroup${h} role=group`,t.attrs,()=>{if(t.buttons)for(let e of t.buttons)O(e);x(t.content)})}function s2(t){u1(()=>{let a=t.bind.value;X({attrs:t.attrs,buttons:Object.entries(t.options).map(([h,e])=>({content:e,ariaLabel:typeof e=="function"?h:void 0,attrs:a===h?".primary":".neutral",click:()=>{t.bind.value=t.allowDeselect&&a===h?void 0:h}}))})}),t.name&&u1(()=>u1("input type=hidden name=",t.name,"value=",t.bind.value??""))}import k from"aberdeen";k.insertGlobalCss({".s-check":{"&":"display:flex flex-direction:column gap:$1","> label":"display:flex align-items:center gap:$2 cursor:pointer user-select:none","> label:has(input:disabled)":"cursor:not-allowed opacity:0.45 filter:saturate(0.6)",input:"cursor:inherit m:0"}});function l2(t={}){let a=t.id??B("check");k("div.s-check",t.attrs,()=>{k("label for=",a,()=>{k("input type=checkbox",t.inputAttrs,()=>{k("id=",a),t.name&&k("name=",t.name),t.checked&&!t.bind&&k("checked=true"),t.change&&k("change=",t.change),k(()=>{t.disabled&&k("disabled=true")}),k(()=>{t.required&&k("aria-required=true")}),t.bind&&k("bind=",t.bind)}),k(()=>{t.label!=null&&x(t.label),t.required&&k("span.s-req aria-hidden=true #*")})}),k(()=>{t.help!=null&&!t.error&&k("div.s-help",()=>x(t.help))}),k(()=>{t.error&&k("div.s-error role=alert #",t.error)})})}import G from"aberdeen";G.insertGlobalCss({".s-form":{"&":"display:flex flex-direction:column gap:$3","&.grid":"display:grid grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap:$3","&.grid > .s-wide, &.grid > footer":"grid-column: 1 / -1;","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 flex-wrap:wrap margin-top:$1"}});function M2(t={}){let a=typeof t=="string"||typeof t=="function"?{content:t}:t;G("form.s-form",a.attrs,()=>{G(()=>{G(".grid=",a.layout==="grid")}),G("submit=",h=>{if(h.preventDefault(),a.submit){let e=new FormData(h.target),p={};for(let r of new Set(e.keys())){let d=e.getAll(r);p[r]=d.length===1?d[0]:d}a.submit(p,h)}}),x(a.content),G(()=>{a.actions&&G("footer",a.actionsAttrs,()=>x(a.actions))})})}import v from"aberdeen";import{current as $1,matchCurrent as U2}from"aberdeen/route";import y from"aberdeen";import{matchCurrent as f1,current as y1,go as x2}from"aberdeen/route";y.insertGlobalCss({".s-menu-list":"position:fixed z-index:350 min-width:10rem display:flex flex-direction:column p:$1 r:$s-radius-lg overflow-y:auto max-height:min(80vh,28rem) transition: opacity 0.15s, transform 0.15s;",".s-menu-list.hidden":"opacity:0 pointer-events:none transform:translateY(-6px)",".s-menu-item":"display:flex align-items:center gap:$2 w:100% outline:0 scroll-margin:$2 padding: $m2 0; line-height:1.1 r:$s-radius cursor:pointer text-align:left font-weight:450 font-size:0.9em border:0 background:transparent fg:$s-text text-decoration:none transition: color 0.12s, transform 0.12s, text-shadow 0.12s;",".s-menu-item:focus-visible:not([aria-current=page]), .s-menu-item:hover:not([aria-disabled=true]):not([aria-current=page])":"filter:none color: color-mix(in lab, $s-primary 33%, $s-text);",".s-menu-item[aria-current=page]":"color:$s-accent filter:none",".s-menu-list .s-menu-item":"padding-inline:$2",".s-menu-item[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none",".s-menu-icon":"flex-shrink:0",".s-menu-list .s-menu-icon":"display:flex",".s-menu-list .s-menu-icon > svg":"width:1.25em height:1.25em","hr.s-menu-sep":"border:0 height:1px margin: $1 0.6rem; background: linear-gradient(to right, transparent, $s-faint 18%, $s-faint 82%, transparent);",".s-menu-chevron":"margin-left:auto flex-shrink:0 display:flex transition: transform 0.15s ease;",".s-menu-chevron > svg":"width:1em height:1em",".s-menu-details":{"> summary":"list-style:none","> summary::-webkit-details-marker":"display:none","&::details-content":"interpolate-size:allow-keywords block-size:0 overflow-y:clip transition: block-size 0.15s ease, content-visibility 0.15s allow-discrete;","&[open]::details-content":"block-size:auto","&[open] > summary .s-menu-chevron":"transform:rotate(90deg)"},".s-menu-sub":"display:flex flex-direction:column gap:$1 padding-left:$3",".s-menu-inline":"display:flex flex-direction:column gap:$1"});function h1(t,a){y("keydown=",h=>{if(h.key==="Enter"&&h.target.tagName==="A"){queueMicrotask(()=>a?.());return}if(h.key!=="ArrowDown"&&h.key!=="ArrowUp"&&h.key!=="Home"&&h.key!=="End")return;h.preventDefault();let p=[...h.currentTarget.querySelectorAll(".s-menu-item")].filter(c=>c.getAttribute("aria-disabled")!=="true"&&!u2(c));if(!p.length)return;let r=p.indexOf(document.activeElement),d=h.key==="ArrowUp"?-1:1,o=h.key==="Home"?0:h.key==="End"?p.length-1:r<0?d>0?0:p.length-1:(r+d+p.length)%p.length;p[o].focus()}),W1(t,a)}function W1(t,a){for(let h of t){if(typeof h=="string"||typeof h=="function"){x(h);continue}if("separator"in h){y("hr.s-menu-sep");continue}h.items?m2(h,a):v2(h,a)}}function v2(t,a){let h=!1,e=y(t.href?"a.s-menu-item":"button.s-menu-item type=button",t.attrs,()=>{t.href&&(y("href=",t.href),t.target&&y("target=",t.target),y(()=>{let p=!h;h=!0,f1(t.href)&&(y("aria-current=page"),requestAnimationFrame(()=>e.scrollIntoView({block:"nearest",behavior:p?"instant":"smooth"})))})),t.disabled&&y("aria-disabled=true"),y("click=",p=>{if(t.disabled){p.preventDefault();return}a?.(),t.click?.(p)}),t.icon&&y("span.s-menu-icon",()=>x(t.icon)),x(t.label)})}function m2(t,a){let h=t.href??G1(t.items),e=h!=null?y.derive(()=>X1(t)):null;y("details.s-menu-details",()=>{e&&y(()=>{e.value&&y("open=true")}),y("summary.s-menu-item.s-menu-branch",t.attrs,()=>{t.disabled&&y("aria-disabled=true"),y(()=>{t.href!=null&&f1(t.href)&&y("aria-current=page")}),y("click=",p=>{if(t.disabled){p.preventDefault();return}h!=null&&(p.preventDefault(),y2(h),x2(h)),t.click?.(p)}),t.icon&&y("span.s-menu-icon",()=>x(t.icon)),x(t.label),y("span.s-menu-chevron aria-hidden=true",()=>q1())}),y("div.s-menu-sub",()=>W1(t.items,a))})}function u2(t){for(let a=t.closest("details");a;a=a.parentElement&&a.parentElement.closest("details"))if(!a.open&&t.closest("summary")?.parentElement!==a)return!0;return!1}function X1(t){if(t.href!=null&&f1(t.href))return!0;for(let a of t.items??[])if(!(typeof a=="string"||typeof a=="function"||"separator"in a)&&X1(a))return!0;return!1}function G1(t){for(let a of t){if(typeof a=="string"||typeof a=="function"||"separator"in a)continue;let h=a.href??(a.items?G1(a.items):void 0);if(h!=null)return h}}var o1=null;function y2(t){try{o1=new URL(t,location.href).pathname.replace(/\/+$/,"")||"/"}catch{o1=null}}function g1(t){return o1!==t?!1:(o1=null,!0)}var U=y.proxy({opts:null});function Z(){let t=U.opts?.anchor;U.opts=null,t?.focus()}function c1(t){let a=U.opts;return a!=null&&(t==null||a.anchor===t)}function f2(t){c1(t)&&Z()}function g2(t,a){let h=t.offsetWidth,e=t.offsetHeight,p=window.innerWidth,r=window.innerHeight,d=4,o=a.left;o+h>p-8&&(o=Math.max(8,a.right-h));let c=a.bottom+d;c+e>r-8&&a.top-e-d>=8&&(c=a.top-e-d),t.style.left=Math.max(8,o)+"px",t.style.top=Math.max(8,c)+"px"}F(()=>{let t=U.opts;if(!t)return;let a=y("div.s-menu-list.s-s.neutral.shadow create=hidden destroy=hidden",t.dropdownAttrs,()=>{h1(t.items,Z)}),h=r=>{let d=r.target;!a.contains(d)&&(t.closeOnAnchorClick||!t.anchor.contains(d))&&Z()},e=r=>{(r.key==="Escape"||r.key==="Tab")&&(r.preventDefault(),Z())},p=y.peek(y1,"path");y(()=>{y1.path!==p&&!g1(y1.path)&&Z()}),document.addEventListener("click",h,!0),document.addEventListener("keydown",e,!0),y.clean(()=>{document.removeEventListener("click",h,!0),document.removeEventListener("keydown",e,!0)}),requestAnimationFrame(()=>{if(!document.body.contains(a))return;let r=t.at?{left:t.at.x,right:t.at.x,top:t.at.y,bottom:t.at.y}:t.anchor.getBoundingClientRect();g2(a,r),j(a,".s-menu-item[aria-current=page]")})});function b2(t){y("nav.s-menu-inline",t.attrs,()=>h1(t.items,t.onLeafSelect))}function b1(t){return U.opts=t,Z}function w1(t){let a=null;y.clean(()=>{U.opts?.anchor===a&&Z()}),y("contextmenu=",h=>{h.preventDefault(),a=h.currentTarget,b1({items:t.items,anchor:a,at:{x:h.clientX,y:h.clientY},closeOnAnchorClick:!0,dropdownAttrs:t.dropdownAttrs})})}function w2(t){let a=null;y.clean(()=>{U.opts?.anchor===a&&Z()}),O({icon:d1,...t.button?.content==null?{ariaLabel:"Open menu"}:null,attrs:".neutral",...t.button,click:h=>{if(a=h.currentTarget,U.opts?.anchor===a){Z();return}b1({items:t.items,anchor:a,dropdownAttrs:t.dropdownAttrs})}})}import w from"aberdeen";import N from"aberdeen";function H1(t={}){I(t,(a,h)=>{N("input.s-input",t.inputAttrs,()=>{N("type=",t.type??"text"),t.placeholder!=null&&N("placeholder=",t.placeholder),t.autocomplete!=null&&N("autocomplete=",t.autocomplete),t.value!=null&&!t.bind&&N("value=",t.value),t.input&&N("input=",t.input),t.change&&N("change=",t.change),_(t,a,h,t.bind)})})}w.insertGlobalCss({".s-backdrop":{"&":"position:fixed inset:0 z-index:200 display:block background: rgba(0,0,0,0.55); transition: opacity 0.4s ease-in-out;","&.hidden":"opacity:0 pointer-events:none"},".s-dialog":{"&":"position:fixed z-index:200 top:50% left:50% display:flex flex-direction:column transform:translate(-50%,-50%) min-width:20rem max-width:min(90vw,44rem) max-height:min(88vh,800px) r: $s-radius-lg; overflow:hidden transition: opacity 0.2s ease-out, transform 0.2s ease-out;","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600 flex-shrink:0","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0 flex-shrink:0","> div":"p:$3 gap:$3 display:flex flex-direction:column overflow-y:auto flex:1 min-height:0","&.hidden":"opacity:0 pointer-events:none transform: translate(-50%, calc(-50% + 20px)); pointer-events:none"}});var K=w.proxy({}),A1=0,N1=w.derive(()=>{let t=Object.keys(K);if(t.length)return t[t.length-1]});function V1(){return N1.value!=null}F(()=>{w.onEach(K,({resolve:t,opts:a},h)=>{let e=()=>{delete K[h]};w.clean(()=>{a.onClose?.(),t()});let p=w.derive(()=>N1.value!=h);w("div.s-backdrop create=hidden destroy=hidden .hidden=",p,"click=",()=>{a.allowCancel!==!1&&e()});let r=w("div.s-dialog.neutral.s-s.extra-shadow create=hidden destroy=hidden",a.attrs,()=>{w(()=>{a.header!=null&&w("header.s-s.neutral",a.headerAttrs,()=>x(a.header))}),w("div",a.contentAttrs,()=>{x(a.content,e)}),w(()=>{a.footer!=null&&w("footer.s-s.neutral",a.footerAttrs,()=>x(a.footer))})});requestAnimationFrame(()=>{document.body.contains(r)&&j(r)})})});function n1(t){A1||document.addEventListener("keydown",h=>{if(h.key!=="Escape"||h.defaultPrevented)return;let e=w.unproxy(K);for(let p=A1;p>0;p--)if(e[p]){h.preventDefault(),e[p].opts.allowCancel!==!1&&delete K[p];break}});let a=++A1;return t.cancelWithScope!==!1&&w.clean(()=>{delete K[a]}),new Promise(h=>{K[a]={resolve:h,opts:t}})}function H2(t,a={}){return n1({header:"Alert",allowCancel:!0,content:h=>{w("p",()=>{w("#",t)}),X({layout:"spaced",attrs:"align-self:flex-end",content:()=>{O({content:"OK",click:h})}})},...a})}function A2(t,a={}){return new Promise(h=>{let e=!1;n1({header:"Confirm",allowCancel:!0,content:p=>{w("p",()=>{w("#",t)}),X({layout:"spaced",attrs:"align-self:flex-end",content:()=>{O({content:"Cancel",attrs:".neutral",click:p}),O({content:"OK",click:()=>{e=!0,p()}})}})},...a,onClose:()=>{h(e),a.onClose?.()}})})}function V2(t,a="",h={}){return new Promise(e=>{let p=null;n1({header:"Input",allowCancel:!0,content:r=>{w("p",()=>{w("#",t)});let d=w.proxy({value:a});w("form display:contents",()=>{w("submit=",o=>{o.preventDefault(),p=d.value,r()}),H1({bind:w.ref(d,"value")}),X({layout:"spaced",attrs:"align-self:flex-end",content:()=>{O({content:"Cancel",attrs:".neutral",type:"button",click:r}),O({content:"OK",type:"submit"})}})})},...h,onClose:()=>{e(p),h.onClose?.()}})})}import i,{OPAQUE as j1}from"aberdeen";import*as b from"aberdeen/route";import A from"aberdeen";var k2=z('<path d="m15 18-6-6 6-6"/>'),L2=z('<path d="m9 18 6-6-6-6"/>');A.insertGlobalCss({".s-strip":{"&":"position:relative display:flex min-width:0","> .s-strip-row":"display:flex align-items:center flex:1 min-width:0 overflow-x:auto overflow-y:hidden scrollbar-width:none scroll-behavior:smooth","> .s-strip-row::-webkit-scrollbar":"display:none","> .s-strip-btn":"position:absolute top:0 bottom:0 z-index:1 display:none align-items:center justify-content:center width:2.4em border:0 padding:0 cursor:pointer fg:$s-muted transition: color 0.15s;","> .s-strip-btn:hover":"fg:$s-text","> .s-strip-btn-left":"left:0 justify-content:flex-start background: linear-gradient(to right, $s-bg 45%, transparent)","> .s-strip-btn-right":"right:0 justify-content:flex-end background: linear-gradient(to left, $s-bg 45%, transparent)","&.s-can-left > .s-strip-btn-left, &.s-can-right > .s-strip-btn-right":"display:flex"},".s-tabs":{"&":"display:flex flex-direction:column gap:$3",".s-tabbar":"border-bottom: 1px solid $s-faint;",".s-tablist":"gap:$1 align-items:stretch margin-bottom:-1px",".s-tab":"display:inline-flex align-items:center gap:$2 cursor:pointer background:transparent border:0 color: $s-muted; font-weight:600 padding: 0.6em 0.9em; white-space:nowrap border-bottom: 3px solid transparent; transition: color 0.15s, background 0.15s, border-color 0.15s;",".s-tab:hover:not(:disabled), .s-tab[aria-selected=true]":"color: $s-text;",".s-tab:focus-visible":"outline:none box-shadow: inset 0 0 0 2px $s-focus; r: $s-radius;",".s-tab[aria-selected=true]":"border-image: $s-gradient 1;",".s-tabpanel":"display:block"}});function i1(t){A("div.s-strip",t.attrs,()=>{let a=A("div.s-strip-row",t.stripAttrs,()=>x(t.content));K1(a,-1),K1(a,1),z2(a)})}function s1(t){let a=t.parentElement;if(!a||!t.isConnected)return;let h=parseFloat(getComputedStyle(a).fontSize)*2.6,e=t.getBoundingClientRect(),p=a.getBoundingClientRect();e.left<p.left+h?a.scrollBy({left:e.left-p.left-h,behavior:"smooth"}):e.right>p.right-h&&a.scrollBy({left:e.right-p.right+h,behavior:"smooth"})}function C2(t){let a=B("tabs"),h=(r,d)=>r.id??String(d),e=t.bind??A.proxy(h(t.tabs[0]??{label:""},0));t.tabs.length>0&&!t.tabs.some((r,d)=>h(r,d)===A.peek(()=>e.value))&&(e.value=h(t.tabs[0],0));let p=(r,d)=>{r.disabled||(e.value=h(r,d))};A("div.s-tabs",t.attrs,()=>{i1({attrs:".s-tabbar",stripAttrs:".s-tablist role=tablist",content:()=>{t.tabs.forEach((r,d)=>{let o=h(r,d),c=A("button.s-tab type=button role=tab",()=>{A("id=",`${a}-tab-${o}`,"aria-controls=",`${a}-panel-${o}`),A(()=>{let M=e.value===o;A("aria-selected=",M?"true":"false"),A("tabindex=",M?"0":"-1"),M&&requestAnimationFrame(()=>s1(c))}),r.disabled&&A("disabled=true"),A("click=",()=>p(r,d)),A("keydown=",M=>$2(M,t.tabs,d,p)),x(r.icon),x(r.label)})})}}),A("div.s-tabpanel role=tabpanel",t.contentAttrs,()=>{A(()=>{let r=e.value,d=t.tabs.findIndex((c,M)=>h(c,M)===r),o=t.tabs[d]??t.tabs[0];o&&(A("id=",`${a}-panel-${h(o,d)}`,"aria-labelledby=",`${a}-tab-${h(o,d)}`),x(o.content))})})})}function K1(t,a){A(`button.s-strip-btn.s-strip-btn-${a<0?"left":"right"} type=button`,()=>{A("tabindex=-1 aria-hidden=true"),A("click=",()=>t.scrollBy({left:a*t.clientWidth*.8,behavior:"smooth"})),(a<0?k2:L2)({size:"1.1em"})})}function z2(t){let a=t.parentElement;if(!a||typeof ResizeObserver>"u")return;let h=()=>{let r=t.scrollWidth-t.clientWidth;a.classList.toggle("s-can-left",t.scrollLeft>1),a.classList.toggle("s-can-right",t.scrollLeft<r-1)};t.addEventListener("scroll",h,{passive:!0});let e=new ResizeObserver(h);e.observe(t);let p=typeof MutationObserver>"u"?void 0:new MutationObserver(r=>{for(let d of r){for(let o of d.addedNodes)o instanceof Element&&e.observe(o);for(let o of d.removedNodes)o instanceof Element&&e.unobserve(o)}h()});p?.observe(t,{childList:!0});for(let r of Array.from(t.children))e.observe(r);h(),A.clean(()=>{t.removeEventListener("scroll",h),e.disconnect(),p?.disconnect()})}function $2(t,a,h,e){let p=h;if(t.key==="ArrowRight"||t.key==="ArrowDown")p=(h+1)%a.length;else if(t.key==="ArrowLeft"||t.key==="ArrowUp")p=(h-1+a.length)%a.length;else if(t.key==="Home")p=0;else if(t.key==="End")p=a.length-1;else return;t.preventDefault();let r=p>=h?1:-1;for(let d=0;d<a.length;d++){let o=a[p];if(o&&!o.disabled){e(o,p),t.currentTarget?.parentElement?.children[p]?.focus();return}p=(p+r+a.length)%a.length}}import V from"aberdeen";import{grow as S2,shrink as P2}from"aberdeen/transitions";V.insertGlobalCss({".s-toasts":"position:fixed bottom:$3 right:$3 z-index:400 display:flex flex-direction:column gap:$2 pointer-events:none max-width:min(90vw,24rem) w:24rem",".s-toast":{"&":"display:flex align-items:flex-start gap:$2 padding: $3; pointer-events:auto position:relative overflow:hidden",".s-toast-body":"display:flex flex-direction:column gap:$1 flex:1 min-width:0",".s-toast-title":"font-weight:700 line-height:1.3",".s-toast-close":"cursor:pointer border:0 background:transparent fg:$s-muted font-size:1.1em line-height:1 padding: 0 0.15em; r:4px flex-shrink:0 align-self:flex-start",".s-toast-close:hover":"fg:$s-text",".s-toast-close:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-text",".s-toast-progress":"position:absolute bottom:0 left:0 right:0 height:2px background:$s-accent width:100%"}});var O2=0,e1=V.proxy({});F(()=>{V.peek(()=>V.isEmpty(e1))&&V.isEmpty(e1)||V("div.s-toasts",()=>{V.onEach(e1,t=>{let{opts:a,id:h}=t,e=a.type==="danger"||a.type==="warning"?"alert":"status",p=a.type==null||a.type==="neutral"?"neutral":a.type,r=a.duration??6e3,d,o=null,c=()=>{clearTimeout(d),o&&(o.style.transition="none",o.style.width="100%",o.offsetWidth,o.style.transition=`width ${r}ms linear`,o.style.width="0%"),d=setTimeout(()=>k1(h),r)},M=()=>{clearTimeout(d),d=void 0,o&&(o.style.transition="none",o.style.width="100%")};V.clean(()=>clearTimeout(d)),V(`div.s-toast.s-s.${p}.extra-shadow aria-live=polite role=${e}`,"create=",S2,"destroy=",P2,a.attrs,()=>{r>0&&(V("mouseenter=",M),V("mouseleave=",c)),V("div.s-toast-body",()=>{V(()=>{a.title!=null&&V("div.s-toast-title",()=>x(a.title))}),V("div.s-toast-msg",()=>x(a.message))}),V(()=>{a.dismissible!==!1&&V("button.s-toast-close type=button aria-label=Dismiss",()=>{V("#\xD7"),V("click=",()=>k1(h))})}),r>0&&(o=V("div.s-toast-progress"))}),r>0&&requestAnimationFrame(c)})})});function k1(t){delete e1[t]}function l1(t){let a=++O2;return e1[a]={id:a,opts:t},()=>k1(a)}var z1={integer(t){if(!/^(0|-?[1-9]\d*)$/.test(t))return;let a=Number(t);return Number.isSafeInteger(a)?a:void 0}};function q(t){let a=String(t).replace(/\/+$/,"");return a.startsWith("/")||(a=`/${a}`),a}function p1(t){let a=q(t);return a==="/"?[]:a.slice(1).split("/")}function _1(t){let a=p1(t),h=a.map((e,p)=>{if(!e.startsWith("[")||!e.endsWith("]"))return{kind:"lit",value:e};let r=/^\[\.\.\.([A-Za-z_$][\w$]*)\]$/.exec(e);if(r){if(p!==a.length-1)throw new Error(`Staffa: "${e}" must be the last segment of route "${t}"`);return{kind:"rest",name:r[1]}}let d=/^\[([A-Za-z_$][\w$]*)(?:=([A-Za-z_$][\w$]*))?\]$/.exec(e);if(!d)throw new Error(`Staffa: malformed param "${e}" in route "${t}"`);let[,o,c]=d;if(c&&!(c in z1))throw new Error(`Staffa: unknown matcher "${c}" in route "${t}" (known: ${Object.keys(z1).join(", ")})`);return{kind:"param",name:o,matcher:c}});return{key:t,segs:h}}function E2(t){try{return decodeURIComponent(t)}catch{return t}}function L1(t,a){let h={};for(let e=0;e<t.segs.length;e++){let p=t.segs[e];if(p.kind==="rest")return e>=a.length?null:(h[p.name]=a.slice(e).join("/"),h);if(e>=a.length)return null;let r=a[e];if(p.kind==="lit"){if(r!==p.value)return null}else if(p.matcher){let d=z1[p.matcher](r);if(d===void 0)return null;h[p.name]=d}else h[p.name]=E2(r)}return t.segs.length===a.length?h:null}var J1=250,q2=300,T2=1280,D2=360,Q1=2;i.insertGlobalCss({":root":`--s-panel-ms:${J1}ms`,".s-panels":"flex:1 min-width:0 min-height:0 position:relative overflow:hidden isolation:isolate "+Y,".s-panel":{"&":"position:absolute top:0 bottom:0 left:0 display:flex flex-direction:column "+Y+" visibility:visible transition: left var(--s-panel-ms) ease, transform var(--s-panel-ms) ease-out, opacity var(--s-panel-ms) linear, visibility 0s;","&.s-panel-sep::before":"content:'' position:absolute left:0 top:0.6rem bottom:0.6rem width:1px z-index:1 background: linear-gradient(to bottom, transparent, $s-faint 18%, $s-faint 82%, transparent);","&.s-panel-enter":"opacity:0 transition:none transform: translateX(8cqw);","&.s-panel-closing":"opacity:0 pointer-events:none transform: translateX(8cqw);","&.s-panel-hidden, &.s-panel-parked":"opacity:0 visibility:hidden transition: left var(--s-panel-ms) ease, transform var(--s-panel-ms) ease-out, opacity var(--s-panel-ms) linear, visibility var(--s-panel-ms);","&.s-panel-hidden":"transform: translateX(-8cqw);","&.s-panel-parked":"transform: translateX(8cqw);"},".s-panel > .s-content":"flex:1 min-height:0 overflow-y:auto overflow-x:hidden p:$3",".s-panel-actions":"display:flex align-items:center justify-content:flex-end gap:$1 flex-shrink:0 padding: $3 $3 0;",".s-crumbs > .s-strip-row":"gap:$m1",".s-crumb":{"&":"flex-shrink:0 font-size:0.85em line-height:1.5 fg:$s-muted text-decoration:none white-space:nowrap max-width:14rem overflow:hidden text-overflow:ellipsis transition: color 0.12s;","&.s-crumb-on":"font-weight:600 fg:$s-text","a&:hover":"filter:none color: color-mix(in lab, $s-primary 33%, $s-text);","svg.s-crumb-pin":"vertical-align:-0.12em margin-right:0.3em opacity:0.8 fill:currentColor","svg.s-crumb-unsaved":"vertical-align:0.08em margin-right:0.3em fill:currentColor"},"svg.s-crumb-sep":"flex-shrink:0 opacity:0.4",".s-main.s-shell-snap .s-panel":"transition:none",".s-panel-loading":{"&":"position:absolute inset:0 display:flex align-items:center justify-content:center gap:$1 pointer-events:none",i:"width:0.5rem height:0.5rem r:50% background:$s-muted opacity:0.45 animation: s-panel-pulse 1s ease-in-out infinite;","i:nth-child(2)":"animation-delay:0.15s","i:nth-child(3)":"animation-delay:0.3s"},"@keyframes s-panel-pulse":{"0%, 100%":"opacity:0.25 transform:scale(0.8)","50%":"opacity:0.7 transform:scale(1)"}});var C1=!1,M1=class{[j1]=!0;compiled;ancestors;opts;$state=i.proxy({live:[],focus:0});$open=i.proxy({});nextOrder=0;containerEl;geom;lastBodyW=-1;layoutQueued=!1;timers=new Set;intent=null;settling=null;lastSeen=null;queued=null;constructor(a){if(C1)throw new Error("Staffa: only one routed S.main() (one with `routes`) can be active at a time");C1=!0,this.opts=a,this.compiled=Object.entries(a.routes).map(([h,e])=>({..._1(h),draw:e})),this.ancestors=Object.entries(a.ancestors??{}).filter(h=>h[1]!=null).map(([h,e])=>({..._1(h),fn:e})),i(()=>{let h=this.computeTarget(),e={...b.current.search},p=b.current.hash;i.peek(()=>{let r=this.lastSeen;if(r&&r.path!==b.current.path){let d=this.$state.live.find(o=>o.path===r.path);d&&(d.search=r.search,d.hash=r.hash)}this.lastSeen={path:b.current.path,search:e,hash:p},this.propose(h),Array.isArray(b.current.state.panels)||Object.assign(b.current.state,this.stateFor({stack:this.paths(),focus:this.$state.focus}))})}),this.interceptLinks(),this.watchTitle(),this.guardTabClose(),i.clean(()=>{for(let h of this.timers)clearTimeout(h);this.timers.clear(),this.queued?.settle(!1),this.queued=null,C1=!1})}resolve(a){let h=p1(a);for(let e of this.compiled){let p=L1(e,h);if(p)return{draw:e.draw,params:p}}return{draw:this.opts.notFound??I2,params:{}}}matches(a){let h=p1(a);return this.compiled.some(e=>L1(e,h)!=null)}deriveStack(a){let h=q(a),e=this.askAncestors(h),p=e?e.map(q):this.prefixesOf(h),r=[];for(let d of p)d!==h&&!r.includes(d)&&this.matches(d)&&r.push(d);return r.push(h),r}askAncestors(a){let h=p1(a);for(let e of this.ancestors){let p=L1(e,h);if(p)return e.fn(p,a)??void 0}}prefixesOf(a){let h=p1(a),e=[];for(let p=1;p<h.length;p++)e.push("/"+h.slice(0,p).join("/"));return e}pinnedIn(a,h){return a.filter(e=>h.includes(e)?!1:this.$state.live.find(p=>p.path===e)?.$panel.pinned===!0)}unsavedAt(a){return this.$state.live.find(h=>h.path===a)?.$panel.unsaved===!0}targetFor(a,h){let e=Array.isArray(h?.panels)?h.panels.map(String):null;if(e){let p=Array.isArray(h.parked)?h.parked.map(String):[],r=q(a),d=new Set([r]),o=M=>M.map(q).filter(m=>!d.has(m)&&!!d.add(m)),c=o(e);return{stack:[...c,r,...o(p)],focus:c.length}}return i.peek(()=>{let p=this.deriveStack(a).slice(0,-1),r=[...p,...this.pinnedIn(this.paths(),[...p,q(a)]),q(a)];return{stack:r,focus:r.length-1}})}computeTarget(){return this.targetFor(b.current.path,b.current.state)}paths(){return this.$state.live.map(a=>a.path)}propose(a){let h=this.$state.live.filter(e=>!a.stack.includes(e.path)&&e.$panel.unsaved).map(e=>e.path);h.length&&(a={stack:[...a.stack,...h],focus:a.focus}),!(Z2(this.paths(),a.stack)&&a.focus===this.$state.focus)&&this.commit(a,b.current.nav)}commit(a,h){this.geom=void 0;let e=b.current.state.pinned,p=new Set(Array.isArray(e)?e.map(String):[]),r=new Map(this.$state.live.map(o=>[o.path,o])),d=[];for(let o of a.stack){let c=r.get(o);if(c){r.delete(o),d.push(c);continue}let M=this.createEntry(o,d.length<=a.focus,p.has(o));h!=="load"&&h!=="back"&&(M.enter=!0),d.push(M),this.$open[o]=M}for(let o of r.values())this.beginClose(o);this.$state.live=d,this.$state.focus=Math.min(a.focus,d.length-1),this.scheduleLayout()}createEntry(a,h,e){let{draw:p,params:r}=this.resolve(a),d={[j1]:!0,order:this.nextOrder++,path:a,draw:p,$ui:i.proxy({holding:!1}),maxWidth:"full",width:0};return d.$panel=i.proxy({stack:this,params:r,path:a,width:0,visible:h,pinned:e||void 0,close:()=>this.closePath(d.path)}),d}beginClose(a){a.closing=!0,a.$panel.visible=!1,a.el&&(a.el.style.zIndex=String(Q1*this.$state.live.indexOf(a))),delete this.$open[a.path]}playExit(a,h){if(!a.closing){h.remove();return}h.classList.add("s-panel-closing"),h.setAttribute("inert","");let e=()=>{clearTimeout(p),this.timers.delete(p),h.remove()};h.addEventListener("transitionend",r=>{r.target===h&&r.propertyName==="opacity"&&e()});let p=setTimeout(e,J1+80);this.timers.add(p)}intended(){return this.intent??{stack:this.paths(),focus:this.$state.focus}}stateFor(a){return{panels:a.stack.slice(0,a.focus),parked:a.stack.slice(a.focus+1),pinned:this.pinnedPaths()}}pinnedPaths(){return this.$state.live.filter(a=>a.$panel.pinned).map(a=>a.path)}issue(a,h){return this.intent=a,this.settling?(this.queued?.settle(!1),new Promise(e=>{this.queued={run:h,settle:e}})):this.start(h)}start(a){let h=p=>{this.settling=null;let r=this.queued;return this.queued=null,p&&r?this.start(r.run).then(r.settle,()=>r.settle(!1)):(this.intent=null,r?.settle(!1)),p},e=Promise.resolve(a()).then(h,p=>(console.error(p),h(!1)));return this.settling=e,e}focusAt(a,h,e){let p=this.intended();if(a<0||a>=p.stack.length||a===p.focus)return Promise.resolve(!1);let r={stack:p.stack,focus:a},d=p.stack[a];return this.issue(r,()=>{let o=this.$state.live.find(c=>c.path===d);return b.go({path:d,search:h??o?.search,hash:e??o?.hash,state:this.stateFor(r)})})}back(){return i.peek(()=>{let a=this.intended();return a.focus===a.stack.length-1&&!this.unsavedAt(a.stack[a.focus])?this.closePath(a.stack[a.focus]??""):a.focus===0?Promise.resolve(!1):this.focusAt(a.focus-1)})}closePath(a){return i.peek(()=>{let h=this.intended(),e=h.stack.indexOf(q(a));if(e<0||h.stack.length<2||this.unsavedAt(h.stack[e]))return Promise.resolve(!1);let p=h.stack.filter((M,m)=>m!==e),r=e===h.focus?Math.max(0,e-1):h.focus-(e<h.focus?1:0),d={stack:p,focus:r};if(e===h.focus&&e===h.stack.length-1){let M=this.$state.live.find(u=>u.path===p[r]),m={};M?.search&&(m.search=M.search),M?.hash&&(m.hash=M.hash);let l=p.filter(u=>this.$state.live.find(f=>f.path===u)?.$panel.pinned===!0);return this.issue(d,()=>Promise.resolve(b.back({path:p[r],state:{panels:p.slice(0,r),parked:[]}},m)).then(u=>(u&&(b.current.state.pinned=l),u)))}let o=p[r],c=o!==h.stack[h.focus];return this.issue(d,()=>{let M=c?this.$state.live.find(m=>m.path===o):void 0;return b.go({path:o,search:c?M?.search:{...b.current.search},hash:c?M?.hash:b.current.hash,state:this.stateFor(d)})})})}navigate(a,h,e=!1,p){return i.peek(()=>{let r;try{r=new URL(a,location.href)}catch{return Promise.resolve(!1)}let d=q(r.pathname),o=Object.fromEntries(new URLSearchParams(r.search)),c=r.hash,M=this.intended(),m=p?-1:M.stack.indexOf(d);if(m>=0&&m!==M.focus)return this.focusAt(m,r.search?o:void 0,c||void 0);if(m>=0)return r.search===location.search&&(r.hash||"")===(location.hash||"")?Promise.resolve(!0):this.issue(M,()=>b.go({path:d,search:o,hash:c,state:this.stateFor(M)}));let l=h==null?-1:M.stack.indexOf(h),u=p?p.map(q).filter((n,g,C)=>n!==d&&C.indexOf(n)===g):l<0?this.deriveStack(d).slice(0,-1):M.stack.slice(0,e?l:l+1),f=[...u,...this.pinnedIn(M.stack,[...u,d,e?h:null])],H={stack:[...f,d],focus:f.length};return this.issue(H,()=>b.go({path:d,search:o,hash:c,state:this.stateFor(H)}))})}pushPath(a,h){return i.peek(()=>{let e=this.intended();return this.navigate(a,e.stack[e.focus]??null,h)})}interceptLinks(){b.interceptLinks((a,h)=>{let e=h.getAttribute("data-panel"),p=e==="open"?null:h.closest(".s-panel"),r=p?this.$state.live.find(d=>d.el===p):void 0;return this.navigate(a.href,r?.path??null,e==="replace"),!0})}get currentPanel(){return this.$state.live[this.$state.focus]?.$panel}get panels(){return this.$state.live.map(a=>a.$panel)}get currentPanelIndex(){return this.$state.focus}pushPanel(a){return this.pushPath(a,!1)}replacePanel(a){return this.pushPath(a,!0)}openPanelStack(a,h){return this.navigate(a,null,!1,h)}closePanel(a){return i.peek(()=>{let h=this.intended();return this.closePath(a??h.stack[h.focus]??"")})}drawCrumbs(){i1({attrs:".s-crumbs role=navigation aria-label=Breadcrumbs",content:()=>{i(()=>{let a=this.panels.map(p=>p.path),h=this.currentPanelIndex,e;for(let p=0;p<a.length;p++){p&&B1({size:"0.85em",attrs:".s-crumb-sep"});let r=this.drawCrumb(a[p],p,p===h);p===h&&(e=r)}requestAnimationFrame(()=>{e&&s1(e)})})}})}drawCrumb(a,h,e){let p=this.$state.live[h];return i(e?"span.s-crumb aria-current=page":"a.s-crumb",()=>{e||i("href=",a),i(()=>{p?.$panel.visible&&i(".s-crumb-on")}),i(()=>{p?.$panel.unsaved&&T1({size:"0.45em",attrs:".s-crumb-unsaved"})}),i(()=>{p?.$panel.pinned&&m1({size:"0.85em",attrs:".s-crumb-pin"})}),i(()=>{i("#",p?.$panel.title??p?.$ui.fallback??(a.split("/").pop()||a))}),w1({items:[{label:"Open in new tab",icon:D1,click:()=>{window.open(a,"_blank","noopener")}},{label:"Copy link",icon:R1,click:()=>{F2(a)}},{separator:!0},{label:()=>{i(()=>{i("#",p?.$panel.pinned?"Unpin":"Pin")})},icon:()=>{i(()=>{(p?.$panel.pinned?Z1:m1)()})},click:()=>{p&&this.togglePin(p)}},{label:"Close",icon:Q,disabled:p?.$panel.unsaved===!0,click:()=>{this.closePath(a)}}]})})}togglePin(a){a.$panel.pinned=!a.$panel.pinned||void 0,b.current.state.pinned=this.pinnedPaths()}watchTitle(){let a=document.title;i(()=>{let h=this.$state.live[this.$state.focus],e=h?.$panel.title??h?.$ui.fallback,p=typeof this.opts.title=="string"?this.opts.title:void 0,r=this.$state.live.some(o=>o.$panel.unsaved),d=e&&p?`${e} \xB7 ${p}`:e||p;d&&(document.title=(r?"\u2022 ":"")+d)}),i.clean(()=>{document.title=a})}guardTabClose(){if(typeof window>"u")return;let a=!1,h=()=>{a=!0},e=p=>{a=!1;let r=this.$state.live.find(o=>o.$panel.unsaved);if(!r)return;p.preventDefault(),p.returnValue=!0;let d=r.path;setTimeout(()=>{if(a)return;let o=this.$state.live.find(c=>c.path===d);o&&!o.$panel.visible&&this.focusAt(this.intended().stack.indexOf(d))},0)};i(()=>{this.$state.live.some(p=>p.$panel.unsaved)&&(window.addEventListener("beforeunload",e),window.addEventListener("pagehide",h),i.clean(()=>{window.removeEventListener("beforeunload",e),window.removeEventListener("pagehide",h)}))})}drawColumns(){let a=i("div.s-panels role=main",()=>{this.containerEl=i(),i.onEach(this.$open,h=>this.drawPanel(h),h=>h.order)});if(typeof ResizeObserver<"u"){let h=new ResizeObserver(()=>this.layout());h.observe(a);let e=a.parentElement?.parentElement;e&&h.observe(e),i.clean(()=>h.disconnect())}i.clean(()=>{this.containerEl===a&&(this.containerEl=void 0)}),this.scheduleLayout()}drawPanel(a){let h;i(()=>{let e=a.$panel.maxWidth;a.maxWidth=e==="half"||e==="screen"?e:"full";let p=this.roomFor(a.maxWidth);p&&(a.width=p,i.peek(a.$panel,"width")!==p&&(a.$panel.width=p),h&&(h.style.width=`${p}px`,this.scheduleLayout()))}),h=i(`section.s-panel${a.width?` w:${a.width}px`:""}`,"destroy=",e=>this.playExit(a,e),()=>{i(()=>this.drawActions(a)),i("div.s-content",()=>{if(a.draw(a.$panel),b.persistScroll(a.path),i.peek(a.$panel,"title")==null){let e=B2(i());e&&i.peek(a.$ui,"fallback")!==e&&(a.$ui.fallback=e)}}),i(()=>{!a.$panel.loading||a.$ui.holding||i("div.s-panel-loading aria-hidden=true",()=>{i("i"),i("i"),i("i")})})}),a.el=h,a.placed=!1,h.style.transition="none",i.clean(()=>{a.el===h&&(a.el=void 0)}),i(()=>{a.$panel.loading,this.scheduleLayout()}),this.scheduleLayout()}drawActions(a){this.opts.$shell.narrow||a.$panel.actions==null||i("div.s-panel-actions",()=>x(a.$panel.actions))}scheduleLayout(){this.layoutQueued||(this.layoutQueued=!0,requestAnimationFrame(()=>{this.layoutQueued=!1,this.layout()}))}measure(){let a=this.containerEl,h=a?.parentElement,e=h?.parentElement;if(!a||!h||!e)return;let p=e.getBoundingClientRect().width;if(!p)return;let r=0;for(let c of h.children)c!==a&&(r+=c.getBoundingClientRect().width);let d=Math.max(0,Math.min(T2,p)-r),o=d/2;return{total:p,chrome:r,half:o>=D2?o:d,full:d,screen:Math.max(0,p-r)}}geometry(){return this.geom??=this.measure()}roomFor(a){return this.geometry()?.[a]??0}layout(){let a=this.containerEl,h=a?.closest(".s-main");if(!a||!h)return;let e=this.$state.live,p=e.length;if(!p||e.some(n=>!n.el))return;this.geom=void 0;let r=this.geometry();if(!r)return;let d=this.opts.stacking!==!1,o=this.lastBodyW!==r.total;o&&(this.lastBodyW=r.total,h.classList.add("s-shell-snap"));let c=n=>r[n.maxWidth],M=Math.min(this.$state.focus,p-1),m=M,l=c(e[M]);if(d)for(let n=M-1;n>=0;n--){let g=l+c(e[n]);if(g>r.screen)break;l=g,m=n}let u=Math.min(r.screen,Math.max(r.full,l));for(let n=m;n<=M;n++)e[n].width=c(e[n]);for(let n of e)n.width||(n.width=c(n));h.style.setProperty("--s-shell-w",`${r.chrome+u}px`);let f=[],H=0;for(let n=0;n<p;n++){let g=e[n],C=g.el,S=n>=m&&n<=M;R2(C,S?H:n>M?u:0,g.width,Q1*n+1),g.$panel.visible!==S&&(g.$panel.visible=S),g.$panel.width!==g.width&&(g.$panel.width=g.width),S&&(H+=g.width),C.classList.toggle("s-panel-sep",S&&n>m),C.classList.toggle("s-panel-hidden",n<m),C.classList.toggle("s-panel-parked",n>M),C.toggleAttribute("inert",!S),!g.placed&&(f.push(g),!g.$panel.loading||g.holdDone?g.$ui.holding=!1:g.$ui.holding||(g.$ui.holding=!0,this.holdEnter(g)),g.enter&&S&&C.classList.add("s-panel-enter"))}(f.length||o)&&a.offsetWidth,o&&h.classList.remove("s-shell-snap");for(let n of f)n.$ui.holding||(n.el.style.transition="",n.el.classList.remove("s-panel-enter"),n.enter=!1,n.placed=!0)}holdEnter(a){let h=setTimeout(()=>{this.timers.delete(h),a.holdDone=!0,a.$ui.holding&&(a.$ui.holding=!1,this.scheduleLayout())},q2);this.timers.add(h)}};function R2(t,a,h,e){t.style.left=`${a}px`,t.style.width=`${h}px`,t.style.zIndex=String(e)}function Z2(t,a){return t.length===a.length&&t.every((h,e)=>h===a[e])}function B2(t){let a=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let h=a.nextNode();h;h=a.nextNode()){let e=h.textContent.trim();if(e)return e.length>48?`${e.slice(0,47).trimEnd()}\u2026`:e}}async function F2(t){let a=new URL(t,location.href).href;try{await navigator.clipboard.writeText(a),l1({message:"Link copied."})}catch{l1({message:"Couldn't copy the link.",type:"danger"})}}function I2(t){i("p fg:$s-muted",()=>i("#",`No panel at ${t.path}`))}v.insertGlobalCss({".s-main":{"&":"display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size","body > &":"margin: calc(-1 * $3)","> header":"border:0 border-bottom: 1px solid $s-faint; r:0 position:sticky top:0 z-index:10","> footer":"border-top: 1px solid $s-faint; fg:$s-muted","> header > .s-bar, > footer > .s-bar":"display:flex align-items:center width:100% margin-inline:auto gap:$3 padding: $2 $3;","> header .s-logo, > header .s-nav-trigger":"display:flex align-items:center flex-shrink:0","> header .s-nav-trigger":"margin-left:-0.375rem","> header .s-logo":"font-size:1.4em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent;","> header .s-titles":"display:flex flex-direction:column min-width:0 flex: 0 1 auto;","> header .s-subtitle":"fg:$s-muted font-size:0.85em line-height:1.5 overflow:hidden text-overflow:ellipsis white-space:nowrap","> header .s-title":"font-weight:800 font-size:1.1em line-height:1.2 overflow:hidden text-overflow:ellipsis white-space:nowrap letter-spacing:-0.01em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent; width:fit-content max-width:100%","> header a.s-logo, > header a.s-title":"text-decoration:none filter:none cursor:pointer","> header .s-menu":"display:flex align-items:center justify-content:flex-end gap:$2 flex: 1 0 auto;",".s-body":"flex:1 overflow:hidden display:flex flex-direction:row min-height:0 justify-content:center position:relative",".s-body-inner":"flex:1 min-width:0 display:flex flex-direction:row min-height:0","&.s-nav-right .s-body-inner":"flex-direction:row-reverse",".s-nav-sep":"width:1px flex-shrink:0 align-self:stretch margin: 0.6rem 0; border:0 background: linear-gradient(to bottom, transparent, $s-faint 18%, $s-faint 82%, transparent);",".s-body main":"flex:1 min-width:0 min-height:0 overflow-x:hidden overflow-y:auto display:flex flex-direction:column transition: transform var(--s-panel-ms) ease;",".s-body main.s-slide-in":"transform: translateX(100%); transition:none",".s-body main > .s-content":"width:100% flex:1 p:$3",".s-body main.s-scroll-y":"margin-right:$3","&.s-routed > .s-body > .s-body-inner":"max-width: var(--s-shell-w, 100%);","&.s-routed > header > .s-bar":"max-width: var(--s-shell-w, 100%);","&.s-routed > footer > .s-bar":"max-width: var(--s-shell-w, 100%);","&.s-routed > .s-body > .s-body-inner, &.s-routed > header > .s-bar, &.s-routed > footer > .s-bar":"transition: max-width var(--s-panel-ms) ease;","&.s-routed.s-shell-snap > .s-body > .s-body-inner, &.s-routed.s-shell-snap > header > .s-bar, &.s-routed.s-shell-snap > footer > .s-bar":"transition:none"},".s-nav-panel":{"&":"display:flex flex-direction:column overflow-y:auto flex-shrink:0 max-width:228px padding:$3 gap:$1"},".s-nav-page":{"&":"position:absolute inset:0 z-index:5 display:flex flex-direction:column overflow-y:auto overscroll-behavior:contain border:0 r:0 padding:$2 gap:$1 transition: transform var(--s-panel-ms) ease;","&.s-nav-page-off":"transform:translateX(-100%) pointer-events:none",".s-menu-item":"padding: $2 $3; min-height:3rem font-size:1.05em gap:$3"},[`@container (max-width: ${r1}px)`]:{".s-main .s-nav-panel, .s-main .s-nav-sep":"display:none",".s-main > header > .s-bar":"gap:$1 padding: $1 $2;",".s-content > .s-box":"margin-inline: calc(-1 * $3); r:0 border-inline:0",".s-main .s-body main.s-scroll-y":"margin-right:0"}});function W2(t={}){let a=t.nav,h=t.navPosition??"left",e=v.proxy({open:!1}),p=v.proxy({narrow:typeof document<"u"&&document.documentElement.clientWidth<=r1}),r=t.routes;if(r!=null&&t.content!=null)throw new Error("Staffa: S.main() takes either `content` or `routes`, not both");let d=r?new M1({routes:r,notFound:t.notFound,ancestors:t.ancestors,stacking:t.stacking,title:t.title,$shell:p}):null,o=d?null:t.maxWidth,c=v(`div.s-main${d?".s-routed":""}`,t.attrs,()=>{v(()=>{a==null||!a.items.length||v(`.s-nav-${h}`)}),v(()=>{(d!=null||t.title!=null||t.subtitle!=null||t.logo!=null||t.menu!=null||a!=null&&a.items.length>0)&&v("header.s-s.neutral",t.topbarAttrs,()=>{v("div.s-bar",()=>{v(()=>{o!=null&&v("max-width:",o)}),v(()=>{if(p.narrow&&a!=null&&a.items.length){v("div.s-nav-trigger",()=>j2(a,e));return}t.logo!=null&&v(d?"a.s-logo aria-label=Home":"div.s-logo",()=>{d&&v("href=",t.home??"/"),x(t.logo)})}),v("div.s-titles",()=>{v(()=>{t.title!=null&&v(d?"a.s-title":"div.s-title",()=>{d&&v("href=",t.home??"/"),x(t.title)})}),G2(t,d,a,p)}),v(()=>{let l=(p.narrow?d?.currentPanel?.actions:void 0)??t.menu;l!=null&&v("div.s-menu",()=>x(l))})})})}),v("div.s-body",()=>{v("div.s-body-inner",()=>{v(()=>{o!=null&&v("max-width:",o)}),v(()=>{a==null||!a.items.length||(v(`nav.s-nav-panel.s-nav-${h}`,t.navAttrs,()=>{h1(a.items)}),v("div.s-nav-sep aria-hidden=true"))}),J2(t,d)}),v(()=>{a!=null&&a.items.length&&e.open&&_2(a,t.navPageAttrs,e,p)})}),v(()=>{t.footer!=null&&v("footer",()=>{v("div.s-bar",()=>{v(()=>{o!=null&&v("max-width:",o)}),x(t.footer)})})})});if(K2(c,p),a!=null||d){let M=m=>{if(m.key!=="Escape"||m.defaultPrevented||V1()||c1())return;let l=c.querySelector(".s-nav-trigger button");if(e.open){m.preventDefault(),e.open=!1,l?.focus();return}if(d&&d.currentPanelIndex>0){m.preventDefault(),d.back();return}let u=c.querySelector(".s-nav-panel");if(u?.offsetParent!=null){let f=u.querySelector("[aria-current=page]")??u.querySelector(".s-menu-item:not([aria-disabled=true])");f&&(m.preventDefault(),f.focus());return}l&&(m.preventDefault(),l.click())};document.addEventListener("keydown",M),v.clean(()=>document.removeEventListener("keydown",M))}return d??void 0}var x1=null;function X2(){x1?.()}function G2(t,a,h,e){v(()=>{if(t.subtitle!=null&&(a==null||N2(a,h,e))){v("div.s-subtitle",()=>x(t.subtitle));return}a?.drawCrumbs()})}function N2(t,a,h){return h.narrow||a==null||t.panels.length>1?!1:a.items.some(e=>typeof e!="string"&&typeof e!="function"&&!("separator"in e)&&e.href!=null&&U2(e.href))}function K2(t,a){if(typeof ResizeObserver>"u")return;let h=new ResizeObserver(e=>{let p=e[0]?.contentBoxSize?.[0],r=p?p.inlineSize:e[0]?.contentRect.width;r!=null&&(a.narrow=r<=r1)});h.observe(t),v.clean(()=>h.disconnect())}function j2(t,a){a1({icon:t.button?.icon??(()=>v(()=>(a.open?Q:d1)())),ariaLabel:t.button?.ariaLabel??"Open navigation",attrs:t.button?.attrs,click:()=>{a.open=!a.open}})}function _2(t,a,h,e){let p=!1,r=()=>{p=!0,h.open=!1},d=v("nav.s-nav-page.s-s.neutral aria-label=Navigation create=s-nav-page-off destroy=s-nav-page-off",a,()=>h1(t.items,r));x1=r,v.clean(()=>{x1===r&&(x1=null)});let o=v.peek($1,"path");v(()=>{$1.path!==o&&!g1($1.path)&&r()});let c=d.closest(".s-main"),M=d.parentElement?.querySelector(":scope > .s-body-inner"),m=M?.querySelector(":scope > main");M?.setAttribute("inert",""),v(()=>{e.narrow||(h.open=!1)}),v.clean(()=>{M?.removeAttribute("inert"),p&&(m&&Q2(m),c?.querySelector(".s-nav-trigger button")?.focus())}),requestAnimationFrame(()=>{document.body.contains(d)&&j(d,".s-menu-item[aria-current=page]")})}function Q2(t){t.classList.add("s-slide-in"),t.offsetWidth,t.classList.remove("s-slide-in")}function J2(t,a){if(a){a.drawColumns();return}let h=v("main",()=>{v("div.s-content",t.contentAttrs,()=>{x(t.content)})});Y2(h)}function Y2(t){if(typeof ResizeObserver>"u")return;let a=()=>t.classList.toggle("s-scroll-y",t.offsetWidth>t.clientWidth),h=new ResizeObserver(a);h.observe(t),t.firstElementChild&&h.observe(t.firstElementChild),a(),v.clean(()=>h.disconnect())}import $ from"aberdeen";$.insertGlobalCss({".s-select_wrap":{"&":"position:relative display:block",select:"w:100% cursor:pointer padding-right:2.2em; appearance:none","&::after":"content: '\u25BE'; position:absolute right:0.7em top:50%; transform: translateY(-50%); pointer-events:none fg:$s-muted font-size:0.85em"}});function t0(t){I(t,(a,h)=>{$("div.s-select_wrap",t.inputAttrs,()=>{$("select.s-input",()=>{_(t,a,h),$("change=",e=>{t.bind&&(t.bind.value=e.target.value)}),$(()=>{let e=typeof t.options=="function"?t.options():t.options,p=t.bind?.value??"";t.placeholder!=null&&$("option",()=>{$("value= disabled=true hidden=true"),p||$("selected=true"),$("#",t.placeholder)});for(let r of e){let d=typeof r=="string"?{value:r,label:r}:{value:r.value,label:r.label??r.value};$("option",()=>{$("value=",d.value),d.value===p&&$("selected=true"),$("#",d.label)})}})})})})}import T from"aberdeen";T.insertGlobalCss({"textarea.s-input":"resize:vertical min-height:3em line-height:1.45","textarea.s-input.s-autoGrow":"resize:none min-height:2.5em overflow-y:hidden"});function a0(t={}){let a=t.autoGrow!==!1;I(t,(h,e)=>{let p=T("textarea.s-input",t.inputAttrs,()=>{a?(T(".s-autoGrow"),T("input=",r=>{Y1(r.currentTarget),t.input&&t.input(r)})):(T("rows=",t.rows??4),T("resize:",t.resize??"vertical"),t.input&&T("input=",t.input)),t.placeholder!=null&&T("placeholder=",t.placeholder),t.value!=null&&!t.bind&&T("value=",t.value),t.change&&T("change=",t.change),_(t,h,e,t.bind)});a&&requestAnimationFrame(()=>Y1(p))})}function Y1(t){t.style.height="auto",t.style.height=`${t.scrollHeight}px`}import D from"aberdeen";D.insertGlobalCss({".s-tt-tip":{"&":"position:fixed z-index:500 max-width:20rem w:max-content padding: 0.3em 0.65em; font-size:0.85em line-height:1.4 pointer-events:none"}});var J=D.proxy(void 0),R=null;typeof window<"u"&&window.addEventListener("scroll",()=>{J.value=void 0},{capture:!0,passive:!0});function h0(t,a,h,e){let r=window.innerWidth,d=window.innerHeight,o=0,c=0;return e==="bottom"?(o=t.left+(t.width-a)/2,c=t.bottom+7,c+h>d-8&&(c=t.top-h-7)):e==="left"?(o=t.left-a-7,c=t.top+(t.height-h)/2,o<8&&(o=t.right+7)):e==="right"?(o=t.right+7,c=t.top+(t.height-h)/2,o+a>r-8&&(o=t.left-a-7)):(o=t.left+(t.width-a)/2,c=t.top-h-7,c<8&&(c=t.bottom+7)),{x:Math.max(8,Math.min(o,r-a-8)),y:Math.max(8,Math.min(c,d-h-8))}}function S1(){R&&clearTimeout(R),R=setTimeout(()=>{J.value=void 0,R=null},100)}F(()=>{let t=J.value;if(!t)return;let{opts:a,anchor:h}=t,e=a.placement??"top",p=D("div.s-tt-tip.s-s.neutral.shadow role=tooltip visibility:hidden",a.attrs,()=>{D("mouseenter=",()=>{R&&(clearTimeout(R),R=null)}),D("mouseleave=",S1),x(a.tip)});requestAnimationFrame(()=>{if(!document.body.contains(p))return;let{x:r,y:d}=h0(h.getBoundingClientRect(),p.offsetWidth,p.offsetHeight,e);p.style.left=r+"px",p.style.top=d+"px",p.style.visibility=""})});function e0(t){let a=h=>{R&&(clearTimeout(R),R=null),J.value={opts:t,anchor:h.currentTarget}};D("mouseenter=",a),D("mouseleave=",S1),D("focusin=",a),D("focusout=",S1),D.clean(()=>{J.value?.opts===t&&(J.value=void 0)})}export{w1 as addContextMenu,e0 as addTooltip,H2 as alert,o2 as autocomplete,i2 as box,O as button,s2 as buttonChooser,X as buttonGroup,l2 as checkbox,f2 as closeFloatingMenu,X2 as closeNav,A2 as confirm,n1 as dialog,M2 as form,O1 as getDarkMode,a1 as iconButton,V1 as isDialogOpen,c1 as isFloatingMenuOpen,W2 as main,b2 as menu,w2 as menuButton,V2 as prompt,s1 as revealInStrip,i1 as scrollStrip,t0 as select,h2 as setDarkMode,b1 as showFloatingMenu,C2 as tabs,a0 as textarea,H1 as textline,l1 as toast};
package/dist/theme.d.ts CHANGED
@@ -1,3 +1,70 @@
1
+ /**
2
+ * Theming and global base styles for Staffa.
3
+ *
4
+ * # The surface model
5
+ *
6
+ * A Staffa app is a tree of **surfaces**. A surface is anything with its own
7
+ * background and matching ink — the page, a card, a coloured button. Mark an
8
+ * element with `.s-s` and (usually) one modifier class. There are two families:
9
+ *
10
+ * - **Neutral surfaces** — `.s-s.neutral` (and the implicit page at `:root`). A calm
11
+ * neutral whose shade steps automatically with nesting depth (page → panel →
12
+ * raised, capped). No `tonal`/`outlined` variants. Use them for cards, bars,
13
+ * popovers — anything that just holds content.
14
+ * - **Accent surfaces** — `.s-s.primary`, `.s-s.danger`, `.s-s.success`,
15
+ * `.s-s.warning`, `.s-s.link` (a bare `.s-s` defaults to primary). A bright
16
+ * fill with white ink, painted as a subtle single-colour gradient. They support
17
+ * `.tonal` and `.outlined` variants. A surface nested *inside* an accent surface
18
+ * is always rendered filled, so it can't bleed into the vivid parent.
19
+ *
20
+ * # Contextual tokens
21
+ *
22
+ * Inside any surface (including `:root`) these inherited custom properties are
23
+ * defined, so widgets adapt to wherever they're nested:
24
+ *
25
+ * | token | meaning |
26
+ * | ------------ | --------------------------------------------------------- |
27
+ * | `--s-bg` | the surface background |
28
+ * | `--s-text` | default ink (also applied as `color`) |
29
+ * | `--s-muted` | secondary text (subtitles, help) |
30
+ * | `--s-accent` | the surface's "pop" — the brand primary on neutral surfaces, the ink on accent surfaces |
31
+ * | `--s-faint` | hairline, derived from text/bg |
32
+ *
33
+ * The brand/semantic colours are mode-independent and settable: `--s-primary`
34
+ * (the one brand colour — it tints the neutrals and defines `.s-s.primary`),
35
+ * `--s-danger`, `--s-success`, `--s-warning`, and `--s-link` (the link colour,
36
+ * also the fill of the `.s-s.link` surface). Links render in `--s-link` on
37
+ * neutral surfaces and in the ink on accent surfaces.
38
+ *
39
+ * # Borders & shadows
40
+ *
41
+ * Neutral surfaces carry a subtle hairline border by default (so a card reads as a
42
+ * card with no component help); it's applied through `:where()`, so a bar that
43
+ * wants only a divider overrides it trivially. Any surface can opt into elevation
44
+ * with `.shadow` or `.extra-shadow`, or drop a component's built-in shadow with
45
+ * `.no-shadow` (e.g. `S.button({ attrs: ".no-shadow" })`).
46
+ *
47
+ * # Customising
48
+ *
49
+ * Re-skin by overriding the colour tokens (e.g. `--s-primary`). To add your own
50
+ * accent surface, just set `--s-bg` (and, if needed, `--s-text`) — the gradient
51
+ * and the rest of the tokens follow automatically:
52
+ *
53
+ * ```ts
54
+ * A.insertGlobalCss({ ".s-s.brand": "--s-bg:#ef6b00 --s-text:#fff" });
55
+ * S.button({ content: "Buy", attrs: ".brand" });
56
+ * ```
57
+ */
58
+ /**
59
+ * The surface sheen: the subtle single-colour wash every surface (and the page)
60
+ * is painted with, as a `background:` declaration. A shared constant rather
61
+ * than a CSS custom property, deliberately: `var()`s inside a custom property
62
+ * resolve where the property is *defined*, so a `--s-sheen` at `:root` would
63
+ * paint every surface with the page's wash instead of its own `$s-bg`'s. Also
64
+ * used by panels.ts, where the routed columns have to visually *be* the
65
+ * surface around them.
66
+ */
67
+ export declare const SURFACE_SHEEN = "background: linear-gradient(170deg, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%));";
1
68
  /**
2
69
  * Force dark mode (`true`), light mode (`false`), or follow the OS preference
3
70
  * (`undefined`). Takes effect immediately and is persisted to localStorage.
package/dist/theme.js CHANGED
@@ -56,6 +56,16 @@ import A from "aberdeen";
56
56
  * S.button({ content: "Buy", attrs: ".brand" });
57
57
  * ```
58
58
  */
59
+ /**
60
+ * The surface sheen: the subtle single-colour wash every surface (and the page)
61
+ * is painted with, as a `background:` declaration. A shared constant rather
62
+ * than a CSS custom property, deliberately: `var()`s inside a custom property
63
+ * resolve where the property is *defined*, so a `--s-sheen` at `:root` would
64
+ * paint every surface with the page's wash instead of its own `$s-bg`'s. Also
65
+ * used by panels.ts, where the routed columns have to visually *be* the
66
+ * surface around them.
67
+ */
68
+ export const SURFACE_SHEEN = "background: linear-gradient(170deg, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%));";
59
69
  const STORAGE_KEY = "staffa:darkMode";
60
70
  /** The explicit dark-mode choice; `undefined` follows the OS via {@link A.darkMode}. */
61
71
  const $override = A.proxy({ value: readStoredOverride() });
@@ -211,7 +221,7 @@ A.insertGlobalCss({
211
221
  "--s-faint: color-mix(in oklab, $s-text, $s-bg 80%); " +
212
222
  "color:$s-text accent-color:$s-accent scrollbar-width:thin scrollbar-color: $s-faint transparent;",
213
223
  // Subtle single-colour gradient sheen, painted on every surface (and the page).
214
- ".s-s, body": "background: linear-gradient(170deg, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%));",
224
+ ".s-s, body": SURFACE_SHEEN,
215
225
  ".s-s": "r:$s-radius",
216
226
  // Neutral surfaces own a subtle hairline border (a card reads as a card without
217
227
  // any component help). `:where()` keeps it zero-specificity, so a bar/panel that
@@ -245,7 +255,7 @@ A.insertGlobalCss({
245
255
  // a translucent tonal/outlined body would bleed into the vivid parent fill.
246
256
  // Specificity (4 classes) beats the 2-class variant rules — no !important.
247
257
  ".s-s:not(.neutral) .s-s.tonal, .s-s:not(.neutral) .s-s.outlined": "--s-text:#fff --s-accent:#fff --s-link-fg:#fff " +
248
- "background: linear-gradient(170deg, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%)); border-color: transparent;",
258
+ SURFACE_SHEEN + " border-color: transparent;",
249
259
  });
250
260
  // ── Suppress transitions during the initial load ─────────────────────────────
251
261
  // Buttons (and links) transition their colours, so a light↔dark switch animates
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "staffa",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "An opinionated component library for the Aberdeen reactive UI library.",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -41,7 +41,7 @@
41
41
  "jsdom": "^29.1.1",
42
42
  "lucide-static": "^1.17.0",
43
43
  "readme-tsdoc": "^1.2.1",
44
- "shotest": "^1.8.3",
44
+ "shotest": "^1.8.4",
45
45
  "typescript": "^5.9.3"
46
46
  },
47
47
  "allowScripts": {
@@ -16,21 +16,16 @@ Footer content, drawn in a styled bar below the body.
16
16
 
17
17
  ### boxOptions.close · member
18
18
 
19
- Draws a small ✕ button in the box's top-right corner: in the header row when
19
+ Draws a small ✕ button in the box's top-right corner — in the header row when
20
20
  there is a | header, floating over the body when
21
- there isn't.
21
+ there isn't — and runs this when it's clicked.
22
22
 
23
- `true` closes the panel the box is drawn in, which is how a screen of a
24
- routed `S.main()` gives the user a way back (the shell draws no back
25
- arrows or ✕ of its own). Which panel that is gets worked out from the DOM
26
- when it's clicked, so the box needs no `$page` handed to it and works from
27
- any column, top of the stack or not. A box in a column further left closes
28
- just that column and leaves the others alone. Outside a routed shell it
29
- does nothing but warn.
23
+ It is plain furniture: a box that happens to sit in a page of a routed
24
+ `S.main()` does **not** close that page — the shell's breadcrumbs are the
25
+ way out of those. Wire it to `$panel.close()` yourself if a box really is
26
+ the whole page and wants its own ✕.
30
27
 
31
- Pass a function to run that instead, for a dismissal of your own.
32
-
33
- **Type:** `boolean | (() => void)`
28
+ **Type:** `() => void`
34
29
 
35
30
  ### boxOptions.contentAttrs · member
36
31
 
@@ -0,0 +1,41 @@
1
+ ## IconButtonOptions · interface
2
+
3
+ Options for `iconButton`.
4
+
5
+ ### iconButtonOptions.icon · member
6
+
7
+ The glyph, usually one of the `staffa/icons` draw functions.
8
+
9
+ **Type:** `Slot`
10
+
11
+ ### iconButtonOptions.ariaLabel · member
12
+
13
+ What it does, for screen readers. Required: there is no visible text to read.
14
+
15
+ **Type:** `string`
16
+
17
+ ### iconButtonOptions.click · member
18
+
19
+ Click handler.
20
+
21
+ **Type:** `(event: Event) => void`
22
+
23
+ ### iconButtonOptions.href · member
24
+
25
+ Render as a link (`<a role=button>`) pointing here instead of a `<button>`.
26
+
27
+ **Type:** `string`
28
+
29
+ ### iconButtonOptions.disabled · member
30
+
31
+ Disables it.
32
+
33
+ **Type:** `boolean`
34
+
35
+ ### iconButtonOptions.attrs · member
36
+
37
+ Aberdeen attr/style string applied to the button. `.small` and `.large`
38
+ size the hit area (medium is the default and needs no class); a `.small`
39
+ or `.large` parent sizes the ones inside it, as with `button`.
40
+
41
+ **Type:** `string`