efficient-shell 4.163.0 → 4.164.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 +44 -4
  2. package/dist/{Browser-2I27OQFE.js → Browser-AZSXQEJ2.js} +14 -14
  3. package/dist/Calculator-GRNWTZIZ.js +29 -0
  4. package/dist/ConfirmDialog-LSFNIGKM.js +1 -0
  5. package/dist/{CurrencyConverter-4EEIPAVX.js → CurrencyConverter-VT2SZDA3.js} +7 -7
  6. package/dist/{Documents-24YAA5UU.js → Documents-WIYSUFCQ.js} +12 -12
  7. package/dist/{Files-BU7FY2VD.js → Files-FAO4MFCO.js} +30 -30
  8. package/dist/{Notepad-3D4L3K5W.js → Notepad-APW5DX37.js} +11 -11
  9. package/dist/PdfViewer-3NWOBXPP.js +1 -0
  10. package/dist/{PomodoroTimer-B4OPUTJL.js → PomodoroTimer-4JBDIQZK.js} +27 -27
  11. package/dist/{Preview-VZSNH76G.js → Preview-FBVFDTPN.js} +24 -24
  12. package/dist/Sidebar-KRN5ZV3F.js +44 -0
  13. package/dist/{Spreadsheet-TAJ24BQS.js → Spreadsheet-IQF6QAWU.js} +12 -12
  14. package/dist/{Stock-VEPDDIMJ.js → Stock-NIM7MAYG.js} +3 -3
  15. package/dist/{Weather-KGZF4DDW.js → Weather-RLISJWFA.js} +14 -14
  16. package/dist/{WorldClock-UGADOCFW.js → WorldClock-G4L5OLOT.js} +6 -6
  17. package/dist/apps/index.js +1 -1
  18. package/dist/brand.css +1 -1
  19. package/dist/{chunk-ZAJPQAGP.js → chunk-37QZZRDT.js} +1 -1
  20. package/dist/{chunk-PH3PRIFP.js → chunk-4UCRT4ST.js} +5 -5
  21. package/dist/{chunk-GSBX7KIS.js → chunk-6NG4TM3E.js} +16 -16
  22. package/dist/{chunk-J5HNLMGZ.js → chunk-6ZUAHFK3.js} +11 -11
  23. package/dist/{chunk-2FZGALCU.js → chunk-DGWWPVEQ.js} +6 -6
  24. package/dist/chunk-ELSUXC3N.js +1 -0
  25. package/dist/chunk-HQREOTKI.js +9 -0
  26. package/dist/{chunk-FWY5IRGL.js → chunk-I3CQI462.js} +2 -2
  27. package/dist/{chunk-NLASNJNY.js → chunk-IY4CP2HO.js} +1 -1
  28. package/dist/{chunk-UMOVLVTC.js → chunk-J5E4VMLJ.js} +1 -1
  29. package/dist/chunk-L2W5XPZ3.js +1 -0
  30. package/dist/chunk-LZIS72CF.js +9 -0
  31. package/dist/{chunk-VWTYRICQ.js → chunk-MHGFTCEA.js} +498 -490
  32. package/dist/{chunk-E4JWTNG5.js → chunk-NNUE7M5G.js} +12 -12
  33. package/dist/{chunk-4GOHPACN.js → chunk-RKOTKWWU.js} +1 -1
  34. package/dist/{chunk-TZ2EFTST.js → chunk-SVJN7WWF.js} +8 -8
  35. package/dist/{chunk-6A7BN7EN.js → chunk-T7DDT2Z6.js} +3 -3
  36. package/dist/{chunk-TBM3ZIAN.js → chunk-TJ4YXVQQ.js} +97 -97
  37. package/dist/{chunk-PX435JG4.js → chunk-U7ZDZXOJ.js} +1 -1
  38. package/dist/{chunk-MAMJHPFN.js → chunk-XY25UBVS.js} +1 -1
  39. package/dist/{chunk-IJ3V2YOS.js → chunk-YLJ7AZON.js} +9 -9
  40. package/dist/chunk-YS57MJFM.js +1 -0
  41. package/dist/{chunk-WURTAA2S.js → chunk-Z43BI2JI.js} +1 -1
  42. package/dist/file-intake/index.js +1 -1
  43. package/dist/{index-JQXMH_km.d.ts → index-CFLEu3eh.d.ts} +135 -12
  44. package/dist/index.d.ts +11 -4
  45. package/dist/index.js +99 -99
  46. package/dist/map/index.js +6 -6
  47. package/dist/page-tabs/index.js +5 -5
  48. package/dist/pdf/index.js +1 -1
  49. package/dist/ui/index.d.ts +1 -1
  50. package/dist/ui/index.js +1 -1
  51. package/package.json +1 -1
  52. package/dist/Calculator-2EB2RAT7.js +0 -29
  53. package/dist/ConfirmDialog-4LZXI6FM.js +0 -1
  54. package/dist/PdfViewer-5VBKCPCM.js +0 -1
  55. package/dist/Sidebar-7AY5WJZC.js +0 -44
  56. package/dist/chunk-A6O4Y63A.js +0 -1
  57. package/dist/chunk-L7ZMDZAB.js +0 -9
  58. package/dist/chunk-OSJ3ADF2.js +0 -1
  59. package/dist/chunk-QRJ2ERKR.js +0 -9
  60. package/dist/chunk-YJX2IWHB.js +0 -1
@@ -1,52 +1,59 @@
1
- import{Breadcrumbs as e}from"./chunk-UMOVLVTC.js";import{useDropdownPosition as t,MENU_MAX_HEIGHT as r,popupBounds as n,VIEWPORT_MARGIN as a,placeMenu as l,followAnchor as i,Tooltip as s,POPUP_MAX_WIDTH as o,placeAtPoint as c,SidebarLayout as d}from"./chunk-QRJ2ERKR.js";import{BrandMark as u}from"./chunk-TZ2EFTST.js";import{toast_default as h}from"./chunk-NLASNJNY.js";import{useIsMobile as m,useShortcutLabel as p,useShellPrefs as g}from"./chunk-6A7BN7EN.js";import{useFileIntake as f,humanSize as b,FileIntakeAlert as x}from"./chunk-WURTAA2S.js";import{calendarNames as y,firstDayOfWeek as v,formatDate as w,EMPTY_VALUE as k,toInstant as N,timeAgo as M,formatDateTime as $}from"./chunk-S2AZZGFF.js";import{iconButtonClasses as C,Button_default as L,buttonClasses as D}from"./chunk-PH3PRIFP.js";import{useTabLayer as P,focusableIn as j,useFocusTrap as z,useScrollLock as A,stopAfter as S}from"./chunk-E4JWTNG5.js";import{glassStyle as B,PopupMenu as F,MenuSemanticsContext as T,leavesContextMenuAlone as E,PopupMenuDivider as I,PopupMenuLabel as O,itemLook as R}from"./chunk-L7ZMDZAB.js";import{registerModalEscapeInterceptor as W,onOverlayOpen as H,Z_LAYERS as _,useDismissPopupsOnOpen as q}from"./chunk-OSJ3ADF2.js";import{useShellLocale as U,useShellStrings as K,DEFAULT_SHELL_STRINGS as V,currentShellStrings as Y,formatPlain as Z,formatFixed as G,formatPercent as J,splitAround as X}from"./chunk-YJX2IWHB.js";import{useBrowserLayoutEffect as Q,useBrowserValue as ee,useHydrated as te,useBrowserValueOnce as re,useBrowserState as ne}from"./chunk-D65T4H6J.js";import{forwardRef as ae,useCallback as le,useState as ie,useRef as se,useId as oe,useEffect as ce,createContext as de,useMemo as ue,Children as he,isValidElement as me,cloneElement as pe,useContext as ge,Fragment as fe,Component as be,useSyncExternalStore as xe,useLayoutEffect as ye}from"react";import{jsx as ve,jsxs as we,Fragment as ke}from"react/jsx-runtime";import{createPortal as Ne}from"react-dom";var Me=ae(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",...l},i){/* @__PURE__ */
2
- return ve("button",{ref:i,type:n,className:C({variant:t,size:r,className:a}),...l,children:e})}),$e="block w-full rounded-md border border-gray-300 bg-white",Ce="text-gray-800 placeholder:text-gray-400 shadow-sm focus:border-blue-400 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]",Le={sm:"px-2.5 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-3.5 py-2 text-base",touch:"h-14 px-4 text-base"},De=`${$e} ${Le.md} ${Ce}`,Pe="disabled:cursor-not-allowed disabled:opacity-60";function je(e){return[e?.size&&"md"!==e.size?`${$e} ${Le[e.size]} ${Ce}`:De,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",Pe,e?.className??""].filter(Boolean).join(" ")}var ze=ae(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",...l},i){const s=`${t?"pl-9":""} ${r?"pr-9":""}`.trim(),o=
3
- /* @__PURE__ */ve("input",{ref:i,"aria-invalid":e||void 0,className:je({invalid:e,size:n,className:[s,a].filter(Boolean).join(" ")}),...l});return t||r?/* @__PURE__ */we("div",{className:"relative",children:[t&&/* @__PURE__ */ve("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:t}),o,r&&/* @__PURE__ */ve("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):o}),Ae=ae(function({invalid:e,autoGrow:t,className:r="",onInput:n,rows:a=3,size:l,...i},s){const o=le(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}n?.(e)},[t,n]);/* @__PURE__ */
4
- return ve("textarea",{ref:s,"aria-invalid":e||void 0,rows:a,onInput:o,className:je({invalid:e,size:l,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...i})});function Se(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Be(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Fe(e,t,r){let n=t+r;for(;n>=0&&n<e.length;){if(!e[n].disabled)return n;n+=r}return t>=0&&t<e.length&&!e[t].disabled?t:r>0?Se(e):Be(e)}function Te(e,t,r){const n=t.toLowerCase(),a=e.length;if(!n||0===a)return-1;for(let t=1;t<=a;t++){const l=((r+t)%a+a)%a,i=e[l];if(!i.disabled&&i.label.toLowerCase().startsWith(n))return l}return-1}var Ee=ae(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:i,touchSize:s,...o},c){/* @__PURE__ */
5
- return we("select",{ref:c,value:e,onChange:e=>t(e.target.value),"aria-invalid":a||void 0,className:je({invalid:a,size:i,className:`pr-8 ${l}`.trim()}),...o,children:[void 0!==n&&/* @__PURE__ */ve("option",{value:"",disabled:!0,children:n}),r.map(e=>/* @__PURE__ */ve("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value))]})}),Ie=ae(function({value:e,onChange:n,options:a,placeholder:l,invalid:i,className:s="",id:o,disabled:c,size:d,touchSize:u,title:h,"aria-describedby":m,"aria-label":p,"aria-labelledby":g,...f},b){const[x,y]=ie(!1),[v,w]=ie(-1),k=se(null),N=se(null),M=se(null),$=se(x);$.current=x;const C=se({buffer:"",timer:null}),L=oe(),D=`${L}-listbox`,P=e=>`${L}-opt-${e}`,j=t(N,x,{matchTriggerWidth:!0}),z=a.findIndex(t=>t.value===e),A=z>=0?a[z].label:void 0,S=z>=0?a[z].lang:void 0,F=le((e=!0)=>{y(!1),w(-1),e&&N.current?.focus()},[]),T=le(()=>{c||(w(z>=0?z:Se(a)),y(!0))},[c,a,z]),E=le(e=>{const t=a[e];t&&!t.disabled&&(n(t.value),F())},[a,n,F]);ce(()=>{if(!x)return;return W(e=>!("Escape"!==e.key||!$.current)&&(F(),!0))},[x,F]),ce(()=>{if(!x)return;const e=e=>{const t=e.target;k.current?.contains(t)||M.current?.contains(t)||F(!1)};document.addEventListener("pointerdown",e);const t=H(()=>F(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[x,F]),ce(()=>{!x||v<0||M.current?.querySelector(`#${CSS.escape(P(v))}`)?.scrollIntoView({block:"nearest"})});const I=le(e=>{const t=C.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=x?v:z,n=Te(a,t.buffer,r);n<0||(x?w(n):E(n))},[x,v,z,a,E]);/* @__PURE__ */
6
- return we("div",{ref:k,className:"relative",children:[
7
- /* @__PURE__ */ve("button",{ref:N,id:o,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":x,"aria-controls":x?D:void 0,"aria-activedescendant":x&&v>=0?P(v):void 0,"aria-invalid":i||void 0,"aria-describedby":m,"aria-label":p,"aria-labelledby":g,title:h,disabled:c,onClick:()=>x?F():T(),onKeyDown:e=>{if(!c)switch(e.key){case"ArrowDown":return e.preventDefault(),void(x?w(e=>Fe(a,e,1)):T());case"ArrowUp":return e.preventDefault(),void(x?w(e=>Fe(a,e,-1)):T());case"Home":return void(x&&(e.preventDefault(),w(Se(a))));case"End":return void(x&&(e.preventDefault(),w(Be(a))));case"Enter":return void(x&&(e.preventDefault(),E(v)));case" ":return e.preventDefault(),void(x?E(v):T());case"Escape":return void(x&&(e.preventDefault(),e.stopPropagation(),F()));case"Tab":return void(x&&F(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),I(e.key))}},className:je({invalid:i,size:d,className:`pr-8 text-left ${s}`.trim()}),children:/* @__PURE__ */ve("span",{lang:S,className:"block truncate "+(void 0===A?"text-gray-400":""),children:A??l??" "})}),
8
- /* @__PURE__ */ve("svg",{"aria-hidden":"true",className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9l3.75-3.75L15.75 9M8.25 15l3.75 3.75L15.75 15"})}),
9
- /* @__PURE__ */we("select",{ref:b,value:e,onChange:e=>n(e.target.value),disabled:c,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...f,children:[void 0!==l&&/* @__PURE__ */ve("option",{value:"",disabled:!0,children:l}),a.map(e=>/* @__PURE__ */ve("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value))]}),x&&Ne(
10
- /* @__PURE__ */ve("div",{ref:M,id:D,role:"listbox",className:"fixed overflow-y-auto rounded-2xl py-1",style:{zIndex:_.popup,left:j?.left,top:j?.top,bottom:j?.bottom,width:j?.width,maxHeight:j?.maxHeight??r,visibility:j?void 0:"hidden",...B()},children:a.map((t,r)=>/* @__PURE__ */ve("div",{id:P(r),role:"option",lang:t.description?void 0:t.lang,"aria-selected":e===t.value,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||w(r)},onClick:()=>E(r),className:"mx-1 cursor-pointer truncate rounded-lg px-3 py-1.5 text-sm\n "+(t.disabled?"cursor-not-allowed text-gray-400":r===v?"bg-blue-50 text-blue-700":e===t.value?"font-medium text-blue-600":"text-gray-700"),children:t.description?/* @__PURE__ */we(ke,{children:[
1
+ import{Breadcrumbs as e}from"./chunk-J5E4VMLJ.js";import{useDropdownPosition as t,MENU_MAX_HEIGHT as r,Tooltip as n,popupBounds as a,VIEWPORT_MARGIN as l,placeMenu as i,followAnchor as s,POPUP_MAX_WIDTH as o,placeAtPoint as c,SidebarLayout as d}from"./chunk-LZIS72CF.js";import{BrandMark as u}from"./chunk-SVJN7WWF.js";import{toast_default as h}from"./chunk-IY4CP2HO.js";import{useIsMobile as m,useShortcutLabel as p,useShellPrefs as g}from"./chunk-T7DDT2Z6.js";import{useFileIntake as f,humanSize as b,FileIntakeAlert as x}from"./chunk-Z43BI2JI.js";import{calendarNames as y,firstDayOfWeek as v,formatDate as w,EMPTY_VALUE as k,toInstant as N,timeAgo as M,formatDateTime as $}from"./chunk-S2AZZGFF.js";import{iconButtonClasses as C,Button_default as L,buttonClasses as D}from"./chunk-4UCRT4ST.js";import{useTabLayer as j,focusableIn as P,useFocusTrap as S,useScrollLock as z,stopAfter as A}from"./chunk-NNUE7M5G.js";import{glassStyle as B,PopupMenu as F,MenuSemanticsContext as E,leavesContextMenuAlone as T,PopupMenuDivider as I,PopupMenuLabel as O,itemLook as R}from"./chunk-HQREOTKI.js";import{registerModalEscapeInterceptor as W,onOverlayOpen as H,Z_LAYERS as _,useDismissPopupsOnOpen as q}from"./chunk-ELSUXC3N.js";import{useShellLocale as U,useShellStrings as K,DEFAULT_SHELL_STRINGS as V,currentShellStrings as Y,formatPlain as Z,formatFixed as G,formatPercent as J,splitAround as X}from"./chunk-YS57MJFM.js";import{useBrowserLayoutEffect as Q,useBrowserValue as ee,useHydrated as te,useBrowserValueOnce as re,useBrowserState as ne}from"./chunk-D65T4H6J.js";import{forwardRef as ae,useCallback as le,useState as ie,useRef as se,useId as oe,useMemo as ce,useEffect as de,createContext as ue,Children as he,isValidElement as me,cloneElement as pe,useContext as ge,Fragment as fe,Component as be,useSyncExternalStore as xe,useLayoutEffect as ye}from"react";import{jsx as ve,jsxs as we,Fragment as ke}from"react/jsx-runtime";import{createPortal as Ne}from"react-dom";var Me=ae(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",...l},i){/* @__PURE__ */
2
+ return ve("button",{ref:i,type:n,className:C({variant:t,size:r,pressed:!0===l["aria-pressed"]||"true"===l["aria-pressed"],className:a}),...l,children:e})}),$e="block w-full rounded-md border border-gray-300 bg-white",Ce="text-gray-800 placeholder:text-gray-400 shadow-sm focus:border-blue-400 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]",Le={sm:"px-2.5 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-3.5 py-2 text-base",touch:"h-14 px-4 text-base"},De=`${$e} ${Le.md} ${Ce}`,je="disabled:cursor-not-allowed disabled:opacity-60";function Pe(e){return[e?.readOnly?`block w-full rounded-md border border-gray-300 bg-gray-50 ${Le[e.size??"md"]} ${Ce}`:e?.size&&"md"!==e.size?`${$e} ${Le[e.size]} ${Ce}`:De,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",je,e?.className??""].filter(Boolean).join(" ")}var Se=ae(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",readOnly:l,...i},s){const o=`${t?"pl-9":""} ${r?"pr-9":""}`.trim(),c=
3
+ /* @__PURE__ */ve("input",{ref:s,"aria-invalid":e||void 0,readOnly:l,className:Pe({invalid:e,size:n,readOnly:l,className:[o,a].filter(Boolean).join(" ")}),...i});return t||r?/* @__PURE__ */we("div",{className:"relative",children:[t&&/* @__PURE__ */ve("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:t}),c,r&&/* @__PURE__ */ve("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):c}),ze=ae(function({invalid:e,autoGrow:t,className:r="",onInput:n,rows:a=3,size:l,readOnly:i,...s},o){const c=le(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}n?.(e)},[t,n]);/* @__PURE__ */
4
+ return ve("textarea",{ref:o,"aria-invalid":e||void 0,rows:a,onInput:c,readOnly:i,className:Pe({invalid:e,size:l,readOnly:i,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...s})});function Ae(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Be(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Fe(e,t,r){let n=t+r;for(;n>=0&&n<e.length;){if(!e[n].disabled)return n;n+=r}return t>=0&&t<e.length&&!e[t].disabled?t:r>0?Ae(e):Be(e)}function Ee(e,t,r){const n=t.toLowerCase(),a=e.length;if(!n||0===a)return-1;for(let t=1;t<=a;t++){const l=((r+t)%a+a)%a,i=e[l];if(!i.disabled&&i.label.toLowerCase().startsWith(n))return l}return-1}var Te=e=>Array.isArray(e.options);var Ie=ae(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:i,touchSize:s,renderOption:o,multiple:c,...d},u){const h=t;/* @__PURE__ */
5
+ return we("select",{ref:u,value:e,multiple:c||void 0,onChange:e=>h(c?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":a||void 0,className:Pe({invalid:a,size:i,className:`pr-8 ${l}`.trim()}),...d,children:[void 0!==n&&!c&&/* @__PURE__ */ve("option",{value:"",disabled:!0,children:n}),
6
+ /* @__PURE__ */ve(Oe,{items:r})]})});function Oe({items:e}){const t=e=>/* @__PURE__ */ve("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
7
+ return ve(ke,{children:e.map((e,r)=>Te(e)?/* @__PURE__ */ve("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var Re=ae(function({value:e,onChange:n,options:a,placeholder:l,invalid:i,className:s="",id:o,disabled:c,size:d,touchSize:u,title:h,multiple:m,renderOption:p,"aria-describedby":g,"aria-label":f,"aria-labelledby":b,...x},y){const[v,w]=ie(!1),[k,N]=ie(-1),M=se(null),$=se(null),C=se(null),L=se(v);L.current=v;const D=se({buffer:"",timer:null}),j=oe(),P=`${j}-listbox`,S=o??`${j}-trigger`,z=e=>`${j}-opt-${e}`,A=ce(()=>function(e){const t=[];for(const r of e)Te(r)?t.push(...r.options):t.push(r);return t}(a),[a]),F=m?e:[],E=n,T=t($,v,{matchTriggerWidth:!0}),I=m?A.findIndex(e=>F.includes(e.value)):A.findIndex(t=>t.value===e),O=m?A.filter(e=>F.includes(e.value)).map(e=>e.label).join(", ")||void 0:I>=0?A[I].label:void 0,R=!m&&I>=0?A[I].lang:void 0,q=le((e=!0)=>{w(!1),N(-1),e&&$.current?.focus()},[]),U=le(()=>{c||(N(I>=0?I:Ae(A)),w(!0))},[c,A,I]),K=le(t=>{const r=A[t];if(r&&!r.disabled){if(m){const n=e;return E(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void N(t)}E(r.value),q()}},[A,m,e,E,q]);de(()=>{if(!v)return;return W(e=>!("Escape"!==e.key||!L.current)&&(q(),!0),()=>C.current)},[v,q]),de(()=>{if(!v)return;const e=e=>{const t=e.target;M.current?.contains(t)||C.current?.contains(t)||q(!1)};document.addEventListener("pointerdown",e);const t=H(()=>q(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[v,q]),de(()=>{!v||k<0||C.current?.querySelector(`#${CSS.escape(z(k))}`)?.scrollIntoView({block:"nearest"})});const V=le(e=>{const t=D.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=v?k:I,n=Ee(A,t.buffer,r);n<0||(v?N(n):m?(N(n),w(!0)):K(n))},[v,k,I,A,K,m]),Y=(t,r)=>{const n=(a=t.value,m?F.includes(a):e===a);var a;const l=r===k;/* @__PURE__ */
8
+ return we("div",{id:z(r),role:"option",lang:t.description||p?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||N(r)},onClick:()=>K(r),className:`mx-1 cursor-pointer truncate rounded-lg px-3 py-1.5 text-sm${m?" flex items-center gap-2":""}\n ${t.disabled?"cursor-not-allowed text-gray-400":l?"bg-blue-50 text-blue-700":n?"font-medium text-blue-600":"text-gray-700"}`,children:[m&&/* @__PURE__ */ve("svg",{"aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(n?"":"invisible"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),p?/* @__PURE__ */ve("span",{className:"block min-w-0 flex-1 truncate",children:p(t,{selected:n,active:l})}):m?/* @__PURE__ */we("span",{className:"block min-w-0 flex-1",children:[
9
+ /* @__PURE__ */ve("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */ve("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.description?
10
+ /* @__PURE__ */we(ke,{children:[
11
11
  /* @__PURE__ */ve("span",{lang:t.lang,className:"block truncate",children:t.label}),
12
- /* @__PURE__ */ve("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.label},t.value))}),document.body)]})}),Oe=ae(function({touchSize:e="touch",...t},r){return m()?/* @__PURE__ */ve(Ee,{ref:r,...t,size:e}):/* @__PURE__ */ve(Ie,{ref:r,...t})});function Re(e,t,r,n){const a=oe(),l=!!e&&!!t,i=l?`${a}-label`:void 0,s=l?`${a}-description`:void 0;return{labelId:i,descriptionId:s,labelledBy:r??i,describedBy:[n,s].filter(Boolean).join(" ")||void 0}}var We=ae(function({checked:e,onChange:t,indeterminate:r=!1,label:n,description:a,disabled:l,className:i="","aria-labelledby":s,"aria-describedby":o,...c},d){const u=se(null),h=Re(n,a,s,o);ce(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=le(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */ve("input",{ref:m,type:"checkbox",checked:e,disabled:l,onChange:e=>t(e.target.checked),className:`h-4 w-4 shrink-0 rounded border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 ${r}`.trim(),"aria-labelledby":h.labelledBy,"aria-describedby":h.describedBy,...c});return n||a?/* @__PURE__ */we("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
13
- /* @__PURE__ */we("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */ve("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */ve("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),He="h-4 w-4 shrink-0 border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60",_e=ae(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":s,...o},c){const d=Re(r,n,i,s);return r||n?/* @__PURE__ */we("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
14
- /* @__PURE__ */ve("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${He} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...o}),
15
- /* @__PURE__ */we("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */ve("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */ve("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */ve("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${He} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...o})});function qe({label:e,htmlFor:t,labelId:r,hint:n,error:a,required:l,className:i="",children:s}){const o=t?a?`${t}-error`:n?`${t}-hint`:void 0:void 0,c=1===he.count(s)?he.only(s):null,d=me(c)?c:null,u={};d&&(o&&(u["aria-describedby"]=[d.props["aria-describedby"],o].filter(Boolean).join(" ")),a&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0));const h=d&&Object.keys(u).length>0?pe(d,u):s;/* @__PURE__ */
12
+ /* @__PURE__ */ve("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},Z=[];let G=0;return a.forEach((e,t)=>{if(!Te(e))return Z.push(Y(e,G)),void(G+=1);const r=`${j}-group-${t}`,n=G;G+=e.options.length,Z.push(
13
+ /* @__PURE__ */we("div",{role:"group","aria-labelledby":r,children:[
14
+ /* @__PURE__ */ve("div",{id:r,role:"presentation",className:"mx-1 truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500",children:e.label}),e.options.map((e,t)=>Y(e,n+t))]},r))}),/* @__PURE__ */we("div",{ref:M,className:"relative",children:[
15
+ /* @__PURE__ */ve("button",{ref:$,id:S,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":v,"aria-controls":v?P:void 0,"aria-activedescendant":v&&k>=0?z(k):void 0,"aria-invalid":i||void 0,"aria-describedby":g,"aria-label":f,"aria-labelledby":b,title:h,disabled:c,onClick:()=>v?q():U(),onKeyDown:e=>{if(!c)switch(e.key){case"ArrowDown":return e.preventDefault(),void(v?N(e=>Fe(A,e,1)):U());case"ArrowUp":return e.preventDefault(),void(v?N(e=>Fe(A,e,-1)):U());case"Home":return void(v&&(e.preventDefault(),N(Ae(A))));case"End":return void(v&&(e.preventDefault(),N(Be(A))));case"Enter":return void(v&&(e.preventDefault(),K(k)));case" ":return e.preventDefault(),void(v?K(k):U());case"Escape":return void(v&&(e.preventDefault(),e.stopPropagation(),q()));case"Tab":return void(v&&q(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),V(e.key))}},className:Pe({invalid:i,size:d,className:`pr-8 text-left ${s}`.trim()}),children:/* @__PURE__ */ve("span",{lang:R,className:"block truncate "+(void 0===O?"text-gray-400":""),children:O??l??" "})}),
16
+ /* @__PURE__ */ve("svg",{"aria-hidden":"true",className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9l3.75-3.75L15.75 9M8.25 15l3.75 3.75L15.75 15"})}),
17
+ /* @__PURE__ */we("select",{ref:y,value:e,multiple:m||void 0,onChange:e=>E(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:c,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...x,children:[void 0!==l&&!m&&/* @__PURE__ */ve("option",{value:"",disabled:!0,children:l}),
18
+ /* @__PURE__ */ve(Oe,{items:a})]}),v&&Ne(
19
+ /* @__PURE__ */ve("div",{ref:C,id:P,role:"listbox","aria-labelledby":b??(f?void 0:S),"aria-label":b?void 0:f,"aria-multiselectable":m||void 0,className:"fixed overflow-y-auto rounded-2xl py-1",style:{zIndex:_.popup,left:T?.left,top:T?.top,bottom:T?.bottom,width:T?.width,maxHeight:T?.maxHeight??r,visibility:T?void 0:"hidden",...B()},children:Z}),document.body)]})}),We=ae(function({touchSize:e="touch",...t},r){return m()?/* @__PURE__ */ve(Ie,{ref:r,...t,size:e}):/* @__PURE__ */ve(Re,{ref:r,...t})});function He(e,t,r,n){const a=oe(),l=!!e&&!!t,i=l?`${a}-label`:void 0,s=l?`${a}-description`:void 0;return{labelId:i,descriptionId:s,labelledBy:r??i,describedBy:[n,s].filter(Boolean).join(" ")||void 0}}var _e=ae(function({checked:e,onChange:t,indeterminate:r=!1,label:n,description:a,disabled:l,className:i="","aria-labelledby":s,"aria-describedby":o,...c},d){const u=se(null),h=He(n,a,s,o);de(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=le(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */ve("input",{ref:m,type:"checkbox",checked:e,disabled:l,onChange:e=>t(e.target.checked),className:`h-4 w-4 shrink-0 rounded border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 ${r}`.trim(),"aria-labelledby":h.labelledBy,"aria-describedby":h.describedBy,...c});return n||a?/* @__PURE__ */we("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
20
+ /* @__PURE__ */we("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */ve("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */ve("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),qe="h-4 w-4 shrink-0 border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60",Ue=ae(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":s,...o},c){const d=He(r,n,i,s);return r||n?/* @__PURE__ */we("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
21
+ /* @__PURE__ */ve("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${qe} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...o}),
22
+ /* @__PURE__ */we("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */ve("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */ve("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */ve("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${qe} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...o})});function Ke({label:e,htmlFor:t,labelId:r,hint:n,error:a,required:l,className:i="",children:s}){const o=t?a?`${t}-error`:n?`${t}-hint`:void 0:void 0,c=1===he.count(s)?he.only(s):null,d=me(c)?c:null,u={};d&&(o&&(u["aria-describedby"]=[d.props["aria-describedby"],o].filter(Boolean).join(" ")),a&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0));const h=d&&Object.keys(u).length>0?pe(d,u):s;/* @__PURE__ */
16
23
  return we("div",{className:i,children:[e&&/* @__PURE__ */we("label",{id:r,htmlFor:t,className:"mb-1 block text-xs font-medium text-gray-600",children:[e,l&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"ml-0.5 text-red-500",children:"*"})]}),h,a?
17
- /* @__PURE__ */ve("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-[11px] text-red-600",children:a}):n?/* @__PURE__ */ve("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-[11px] text-gray-400",children:n}):null]})}var Ue={vertical:"flex flex-col gap-2",horizontal:"flex flex-wrap items-start gap-x-6 gap-y-2"};function Ke({label:e,hint:t,error:r,required:n,name:a,value:l,onChange:i,options:s,orientation:o="vertical",disabled:c=!1,className:d=""}){const u=oe(),h=e?`${u}-label`:void 0;/* @__PURE__ */
18
- return ve(qe,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */ve("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:Ue[o],children:s.map(e=>/* @__PURE__ */ve(_e,{name:a,value:e.value,checked:l===e.value,onChange:t=>{t&&i(e.value)},label:e.label,description:e.description,disabled:c||e.disabled},e.value))})})}function Ve({errors:e,title:t,autoFocus:r=!0,className:n=""}){const a=K(),l=se(null),i=se(!1);if(ce(()=>{const t=e.length>0;t&&!i.current&&r&&l.current?.focus(),i.current=t},[e.length>0,r]),0===e.length)return null;/* @__PURE__ */
24
+ /* @__PURE__ */ve("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-[11px] text-red-600",children:a}):n?/* @__PURE__ */ve("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-[11px] text-gray-400",children:n}):null]})}var Ve={vertical:"flex flex-col gap-2",horizontal:"flex flex-wrap items-start gap-x-6 gap-y-2"};function Ye({label:e,hint:t,error:r,required:n,name:a,value:l,onChange:i,options:s,orientation:o="vertical",disabled:c=!1,className:d=""}){const u=oe(),h=e?`${u}-label`:void 0;/* @__PURE__ */
25
+ return ve(Ke,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */ve("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:Ve[o],children:s.map(e=>/* @__PURE__ */ve(Ue,{name:a,value:e.value,checked:l===e.value,onChange:t=>{t&&i(e.value)},label:e.label,description:e.description,disabled:c||e.disabled},e.value))})})}function Ze({errors:e,title:t,autoFocus:r=!0,className:n=""}){const a=K(),l=se(null),i=se(!1);if(de(()=>{const t=e.length>0;t&&!i.current&&r&&l.current?.focus(),i.current=t},[e.length>0,r]),0===e.length)return null;/* @__PURE__ */
19
26
  return we("div",{ref:l,role:"alert",tabIndex:-1,className:`rounded-md border border-red-300 bg-red-50 px-4 py-3 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-invalid-solid)] ${n}`.trim(),children:[
20
27
  /* @__PURE__ */ve("h2",{className:"text-sm font-semibold text-red-800",children:t??a.form.errorSummaryTitle}),
21
- /* @__PURE__ */ve("ul",{className:"mt-1.5 space-y-1",children:e.map((e,t)=>/* @__PURE__ */ve("li",{children:/* @__PURE__ */ve("a",{href:`#${e.fieldId}`,onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&(t.scrollIntoView({block:"center"}),t.focus())})(e.fieldId)},className:"text-sm text-red-700 underline hover:text-red-900",children:e.message})},`${e.fieldId}-${t}`))})]})}var Ye="text-xs font-medium text-gray-600";function Ze({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",Ye,t].filter(Boolean).join(" ")}function Ge({required:e,children:t,className:r="",...n}){/* @__PURE__ */
22
- return we("label",{className:Ze({className:r}),...n,children:[t,e&&/* @__PURE__ */ve("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var Je=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function Xe(e){if(/^data:/i.test(e||""))return function(e){const t=Je.exec(e);if(!t)return"media";const[,r,n]=t,a=n.split("+")[0].split(".").pop().replace(/^x-/i,"");return a?`${r.toLowerCase()}.${a.toLowerCase()}`:"media"}(e);const t=(e||"").split("?")[0].split("#")[0],r=t.substring(t.lastIndexOf("/")+1);try{return decodeURIComponent(r.replace(/^[0-9a-f]{32}_/i,""))||r||"media"}catch{return r||"media"}}var Qe=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function et(e,t=V.media){const r=function(e){const t=e.includes("video"),r=e.includes("image")||"*"===e||""===e;return t&&!r?"video":r&&!t?"image":"file"}(e);return"image"===r?t.uploadImage:"video"===r?t.uploadVideo:t.uploadFile}function tt(e,t,r=""){return["flex w-full flex-col items-center justify-center gap-1.5 rounded-lg border-2 border-dashed text-center transition-colors",t?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",r].filter(Boolean).join(" ")}function rt(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function nt({label:e,rounded:t="rounded-lg"}){/* @__PURE__ */
28
+ /* @__PURE__ */ve("ul",{className:"mt-1.5 space-y-1",children:e.map((e,t)=>/* @__PURE__ */ve("li",{children:/* @__PURE__ */ve("a",{href:`#${e.fieldId}`,onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&(t.scrollIntoView({block:"center"}),t.focus())})(e.fieldId)},className:"text-sm text-red-700 underline hover:text-red-900",children:e.message})},`${e.fieldId}-${t}`))})]})}var Ge="text-xs font-medium text-gray-600";function Je({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",Ge,t].filter(Boolean).join(" ")}function Xe({required:e,children:t,className:r="",...n}){/* @__PURE__ */
29
+ return we("label",{className:Je({className:r}),...n,children:[t,e&&/* @__PURE__ */ve("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var Qe=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function et(e){if(/^data:/i.test(e||""))return function(e){const t=Qe.exec(e);if(!t)return"media";const[,r,n]=t,a=n.split("+")[0].split(".").pop().replace(/^x-/i,"");return a?`${r.toLowerCase()}.${a.toLowerCase()}`:"media"}(e);const t=(e||"").split("?")[0].split("#")[0],r=t.substring(t.lastIndexOf("/")+1);try{return decodeURIComponent(r.replace(/^[0-9a-f]{32}_/i,""))||r||"media"}catch{return r||"media"}}var tt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function rt(e,t=V.media){const r=function(e){const t=e.includes("video"),r=e.includes("image")||"*"===e||""===e;return t&&!r?"video":r&&!t?"image":"file"}(e);return"image"===r?t.uploadImage:"video"===r?t.uploadVideo:t.uploadFile}function nt(e,t,r=""){return["flex w-full flex-col items-center justify-center gap-1.5 rounded-lg border-2 border-dashed text-center transition-colors",t?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",r].filter(Boolean).join(" ")}function at(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function lt({label:e,rounded:t="rounded-lg"}){/* @__PURE__ */
23
30
  return we("div",{role:"status",className:`absolute inset-0 flex items-center justify-center gap-2 bg-white/60 ${t}`,children:[
24
- /* @__PURE__ */ve(it,{}),
25
- /* @__PURE__ */ve("span",{className:"text-xs font-medium text-gray-600",children:e})]})}function at({children:e}){/* @__PURE__ */
26
- return ve("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-1.5 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function lt(e,t=""){if(!e)return!1;const r=Je.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return Qe.test(e)||n&&!a}function it({className:e="h-5 w-5"}){/* @__PURE__ */
31
+ /* @__PURE__ */ve(ot,{}),
32
+ /* @__PURE__ */ve("span",{className:"text-xs font-medium text-gray-600",children:e})]})}function it({children:e}){/* @__PURE__ */
33
+ return ve("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-1.5 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function st(e,t=""){if(!e)return!1;const r=Qe.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return tt.test(e)||n&&!a}function ot({className:e="h-5 w-5"}){/* @__PURE__ */
27
34
  return we("svg",{className:`${e} animate-spin text-gray-400`,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
28
35
  /* @__PURE__ */ve("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
29
- /* @__PURE__ */ve("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function st({className:e="h-4 w-4"}){/* @__PURE__ */
30
- return ve("svg",{className:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M6 6l8 8M14 6l-8 8"})})}function ot({className:e="h-6 w-6"}){/* @__PURE__ */
36
+ /* @__PURE__ */ve("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function ct({className:e="h-4 w-4"}){/* @__PURE__ */
37
+ return ve("svg",{className:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M6 6l8 8M14 6l-8 8"})})}function dt({className:e="h-6 w-6"}){/* @__PURE__ */
31
38
  return we("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
32
39
  /* @__PURE__ */ve("path",{d:"M12 15V4"}),
33
40
  /* @__PURE__ */ve("path",{d:"M8 8l4-4 4 4"}),
34
- /* @__PURE__ */ve("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function ct({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:s,className:o,accept:c="image/*",maxSizeBytes:d,fit:u="cover",height:h=112,placeholder:m,cta:p,acceptHint:g,showFilename:b=!0,allowReplace:y=!0,allowRemove:v=!0,replaceLabel:w,removeLabel:k,busy:N=!1,busyLabel:M,disabled:$=!1}){const C=K().media,D=p??C.cta,P=w??C.replace,j=k??C.remove,z=M??C.uploading,A=oe(),S=se(null),[B,F]=ie(null);ce(()=>()=>{S.current&&URL.revokeObjectURL(S.current)},[]);const T=$||N,E=!!e&&(lt(e,c)||e===B),I=m??et(c,C),O=e=>{r?r(e):n?n(e):(e=>{S.current&&URL.revokeObjectURL(S.current);const r=URL.createObjectURL(e);S.current=r,F(e.type.startsWith("video/")?r:null),t(r)})(e)},R=f({accept:c,maxSizeBytes:d,acceptHint:g,multiple:!1,disabled:T,onAccept:([e])=>O(e)}),{dragOver:W}=R,H=()=>{T||(r?r():R.open())},_=e?Xe(e):"",q=/* @__PURE__ */we("div",{children:[
35
- /* @__PURE__ */we("div",{...R.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",W?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[E?/* @__PURE__ */ve("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":_||void 0,className:"h-full w-full",style:{objectFit:u}}):/* @__PURE__ */ve("img",{src:e??void 0,alt:_,className:"h-full w-full",style:{objectFit:u}}),b&&e&&/* @__PURE__ */ve(at,{children:_}),N&&/* @__PURE__ */ve(nt,{label:z,rounded:"rounded-md"})]}),!$&&(y||v)&&/* @__PURE__ */we("div",{className:"mt-2 flex gap-2",children:[y&&/* @__PURE__ */ve(L,{id:A,variant:"secondary",size:"sm",onClick:()=>H(),disabled:N,children:P}),v&&/* @__PURE__ */ve(L,{variant:"ghost",size:"sm",onClick:()=>{S.current&&(URL.revokeObjectURL(S.current),S.current=null),F(null),t("")},disabled:N,children:j})]})]}),U=/* @__PURE__ */ve("button",{type:"button",id:A,onClick:()=>H(),disabled:T,"aria-label":"string"==typeof I?I:C.upload,"aria-busy":N||void 0,"aria-invalid":!!i||void 0,"aria-required":s||void 0,"aria-describedby":i?`${A}-error`:l?`${A}-hint`:void 0,...R.zoneProps,className:tt(W,T,rt(T)),style:{minHeight:h},children:N?/* @__PURE__ */we("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
36
- /* @__PURE__ */ve(it,{}),
37
- /* @__PURE__ */ve("span",{className:"text-xs font-medium text-gray-500",children:z})]}):/* @__PURE__ */we(ke,{children:[
38
- /* @__PURE__ */ve("span",{className:"text-gray-400",children:/* @__PURE__ */ve(ot,{})}),
41
+ /* @__PURE__ */ve("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function ut({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:s,className:o,accept:c="image/*",maxSizeBytes:d,fit:u="cover",height:h=112,placeholder:m,cta:p,acceptHint:g,showFilename:b=!0,allowReplace:y=!0,allowRemove:v=!0,replaceLabel:w,removeLabel:k,busy:N=!1,busyLabel:M,disabled:$=!1}){const C=K().media,D=p??C.cta,j=w??C.replace,P=k??C.remove,S=M??C.uploading,z=oe(),A=se(null),[B,F]=ie(null);de(()=>()=>{A.current&&URL.revokeObjectURL(A.current)},[]);const E=$||N,T=!!e&&(st(e,c)||e===B),I=m??rt(c,C),O=e=>{r?r(e):n?n(e):(e=>{A.current&&URL.revokeObjectURL(A.current);const r=URL.createObjectURL(e);A.current=r,F(e.type.startsWith("video/")?r:null),t(r)})(e)},R=f({accept:c,maxSizeBytes:d,acceptHint:g,multiple:!1,disabled:E,onAccept:([e])=>O(e)}),{dragOver:W}=R,H=()=>{E||(r?r():R.open())},_=e?et(e):"",q=/* @__PURE__ */we("div",{children:[
42
+ /* @__PURE__ */we("div",{...R.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",W?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[T?/* @__PURE__ */ve("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":_||void 0,className:"h-full w-full",style:{objectFit:u}}):/* @__PURE__ */ve("img",{src:e??void 0,alt:_,className:"h-full w-full",style:{objectFit:u}}),b&&e&&/* @__PURE__ */ve(it,{children:_}),N&&/* @__PURE__ */ve(lt,{label:S,rounded:"rounded-md"})]}),!$&&(y||v)&&/* @__PURE__ */we("div",{className:"mt-2 flex gap-2",children:[y&&/* @__PURE__ */ve(L,{id:z,variant:"secondary",size:"sm",onClick:()=>H(),disabled:N,children:j}),v&&/* @__PURE__ */ve(L,{variant:"ghost",size:"sm",onClick:()=>{A.current&&(URL.revokeObjectURL(A.current),A.current=null),F(null),t("")},disabled:N,children:P})]})]}),U=/* @__PURE__ */ve("button",{type:"button",id:z,onClick:()=>H(),disabled:E,"aria-label":"string"==typeof I?I:C.upload,"aria-busy":N||void 0,"aria-invalid":!!i||void 0,"aria-required":s||void 0,"aria-describedby":i?`${z}-error`:l?`${z}-hint`:void 0,...R.zoneProps,className:nt(W,E,at(E)),style:{minHeight:h},children:N?/* @__PURE__ */we("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
43
+ /* @__PURE__ */ve(ot,{}),
44
+ /* @__PURE__ */ve("span",{className:"text-xs font-medium text-gray-500",children:S})]}):/* @__PURE__ */we(ke,{children:[
45
+ /* @__PURE__ */ve("span",{className:"text-gray-400",children:/* @__PURE__ */ve(dt,{})}),
39
46
  /* @__PURE__ */ve("span",{className:"px-3 text-xs text-gray-500",children:I}),
40
47
  /* @__PURE__ */ve("span",{className:"text-sm font-medium text-blue-600",children:D}),g&&/* @__PURE__ */ve("span",{className:"text-xs text-gray-400",children:g})]})});/* @__PURE__ */
41
- return we(qe,{label:a,htmlFor:A,hint:l,error:i,required:s,className:o,children:[e?q:U,!r&&/* @__PURE__ */ve("input",{...R.inputProps}),
42
- /* @__PURE__ */ve(x,{rejections:R.rejections})]})}function dt({committedUrl:e,committedHasAlpha:t=null,committedIsLight:r=null,fallbackUrl:n,fallbackHasAlpha:a=null,fallbackIsLight:l=null,subjectName:i,assetName:s,onSave:o,onRemove:c,accept:d="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:h="PNG · ICO · SVG · JPG · WEBP",maxBytes:m=5242880,previews:p=[],disabled:g=!1}){const f=se(null),[b,x]=ie(null),[y,v]=ie(""),[w,k]=ie(""),[N,M]=ie(!1),[$,C]=ie(!1),D=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(s),P=K().brandAsset,j=y||e||n||"",z=b?null:e?t:a,A=b?null:e?r:l;ce(()=>()=>{f.current&&URL.revokeObjectURL(f.current)},[]);const S=()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null)};/* @__PURE__ */
43
- return we("section",{"aria-label":P.region(s,i),className:"grid gap-4 lg:grid-cols-2",children:[
48
+ return we(Ke,{label:a,htmlFor:z,hint:l,error:i,required:s,className:o,children:[e?q:U,!r&&/* @__PURE__ */ve("input",{...R.inputProps}),
49
+ /* @__PURE__ */ve(x,{rejections:R.rejections})]})}function ht({committedUrl:e,committedHasAlpha:t=null,committedIsLight:r=null,fallbackUrl:n,fallbackHasAlpha:a=null,fallbackIsLight:l=null,subjectName:i,assetName:s,onSave:o,onRemove:c,accept:d="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:h="PNG · ICO · SVG · JPG · WEBP",maxBytes:m=5242880,previews:p=[],disabled:g=!1}){const f=se(null),[b,x]=ie(null),[y,v]=ie(""),[w,k]=ie(""),[N,M]=ie(!1),[$,C]=ie(!1),D=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(s),j=K().brandAsset,P=y||e||n||"",S=b?null:e?t:a,z=b?null:e?r:l;de(()=>()=>{f.current&&URL.revokeObjectURL(f.current)},[]);const A=()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null)};/* @__PURE__ */
50
+ return we("section",{"aria-label":j.region(s,i),className:"grid gap-4 lg:grid-cols-2",children:[
44
51
  /* @__PURE__ */we("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
45
- /* @__PURE__ */ve(ct,{value:j,onChange:()=>{},onFile:e=>{if(g)return;S();const t=URL.createObjectURL(e);f.current=t,x(e),v(t),k("")},label:s,hint:w||P.usedFor(i),error:w||void 0,accept:d,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:N||$,disabled:g}),
52
+ /* @__PURE__ */ve(ut,{value:P,onChange:()=>{},onFile:e=>{if(g)return;A();const t=URL.createObjectURL(e);f.current=t,x(e),v(t),k("")},label:s,hint:w||j.usedFor(i),error:w||void 0,accept:d,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:N||$,disabled:g}),
46
53
  /* @__PURE__ */we("div",{className:"mt-3 flex flex-wrap gap-2",children:[
47
- /* @__PURE__ */ve(L,{onClick:async()=>{if(b&&!g&&!N){M(!0),k("");try{await o(b),S(),x(null),v("")}catch(e){k(e instanceof Error?e.message:P.saveFailed(D,s))}finally{M(!1)}}},disabled:!b||g,loading:N,children:P.save(D,s)}),(b||e)&&/* @__PURE__ */ve(L,{variant:"ghost-danger",onClick:async()=>{if(!g&&!$){if(b)return S(),x(null),v(""),void k("");if(e){C(!0),k("");try{await c()}catch(e){k(e instanceof Error?e.message:P.removeFailed(D,s))}finally{C(!1)}}}},disabled:g,loading:$,children:b?P.discard:P.remove(D,s)})]})]}),p.length>0&&/* @__PURE__ */we("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":P.previews(s),children:[
48
- /* @__PURE__ */ve("h3",{className:"text-sm font-semibold text-gray-900",children:P.preview}),
49
- /* @__PURE__ */ve("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const t=/* @__PURE__ */ve(u,{src:j,alt:P.alt(i,s),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:z,isLight:A,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
54
+ /* @__PURE__ */ve(L,{onClick:async()=>{if(b&&!g&&!N){M(!0),k("");try{await o(b),A(),x(null),v("")}catch(e){k(e instanceof Error?e.message:j.saveFailed(D,s))}finally{M(!1)}}},disabled:!b||g,loading:N,children:j.save(D,s)}),(b||e)&&/* @__PURE__ */ve(L,{variant:"ghost-danger",onClick:async()=>{if(!g&&!$){if(b)return A(),x(null),v(""),void k("");if(e){C(!0),k("");try{await c()}catch(e){k(e instanceof Error?e.message:j.removeFailed(D,s))}finally{C(!1)}}}},disabled:g,loading:$,children:b?j.discard:j.remove(D,s)})]})]}),p.length>0&&/* @__PURE__ */we("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":j.previews(s),children:[
55
+ /* @__PURE__ */ve("h3",{className:"text-sm font-semibold text-gray-900",children:j.preview}),
56
+ /* @__PURE__ */ve("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const t=/* @__PURE__ */ve(u,{src:P,alt:j.alt(i,s),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:S,isLight:z,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
50
57
  return we("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
51
58
  /* @__PURE__ */ve("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */we("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
52
59
  /* @__PURE__ */we("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[t,
@@ -58,209 +65,210 @@ return we("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-whit
58
65
  /* @__PURE__ */we("div",{className:"min-w-0 leading-tight",children:[
59
66
  /* @__PURE__ */ve("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??i}),e.url&&/* @__PURE__ */ve("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
60
67
  /* @__PURE__ */ve("div",{className:"mt-1.5 text-sm font-medium text-blue-700",children:e.title??i}),e.description&&/* @__PURE__ */ve("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */we("div",{className:["flex items-center gap-3 rounded-md border border-gray-200 p-3","dark"===e.surface?"bg-gray-900 text-white":"bg-white text-gray-900"].join(" "),children:[t,
61
- /* @__PURE__ */ve("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function ut(e,t={}){return t.preferSquare&&e.logo_square_url?{src:e.logo_square_url,hasAlpha:e.logo_square_has_alpha,isLight:e.logo_square_is_light,adaptive:!0}:"dark"===t.surface&&e.logo_on_dark_url?{src:e.logo_on_dark_url,hasAlpha:null,isLight:null,adaptive:!1}:{src:e.logo_url,hasAlpha:e.logo_has_alpha,isLight:e.logo_is_light,adaptive:!0}}var ht=de(null);function mt(e){const t=document.head.querySelector('link[data-portal-branding="favicon"]');if(!e)return void t?.remove();const r=t??document.createElement("link");r.rel="icon",r.href=e,r.dataset.portalBranding="favicon",t||document.head.appendChild(r)}function pt({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=ie(t),[i,s]=ie(!0),[o,c]=ie(null),d=se(e),u=se(t);d.current=e,u.current=t,ce(()=>{const e=new AbortController;let t=!0;return l(u.current),s(!0),c(null),d.current(e.signal).then(e=>{t&&(l(e),s(!1))},e=>{t&&(c(e instanceof Error?e:new Error("Could not load portal branding.")),s(!1))}),()=>{t=!1,e.abort()}},[]),ce(()=>(mt(a.favicon_url),()=>mt(null)),[a.favicon_url]),ce(()=>{r&&(document.title=r(a))},[a,r]);const h=ue(()=>({branding:a,loading:i,error:o}),[a,i,o]);/* @__PURE__ */
62
- return ve(ht.Provider,{value:h,children:n})}function gt(){const e=ge(ht);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var ft=/* @__PURE__ */ve("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */ve("path",{d:"M6 6l12 12M18 6L6 18"})});function bt({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,label:l,hint:i,error:s,required:o,className:c,accept:d="image/*",maxSizeBytes:u,maxFiles:h,fit:m="cover",thumbSize:p=96,placeholder:g,cta:b,acceptHint:y,showCover:v=!1,coverLabel:w,busy:k=!1,busyLabel:N,disabled:M=!1,readOnly:$=!1}){const C=K().media,L=b??C.cta,D=w??C.cover,P=N??C.uploading,j=oe(),[z,A]=ie(null),S=M||k,B=!(!t&&!r||S||$),F=!!n&&!S&&!$,T=!!a&&!S&&!$,E=rt(S),I=g??et(d,C),O=f({accept:d,maxSizeBytes:u,maxFiles:h,acceptHint:y,multiple:!0,disabled:!B,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),R=O.dragOver,W=()=>{B&&(t?t():O.open())},H={width:p,height:p},_=B&&/* @__PURE__ */we("button",{type:"button",onClick:()=>W(),"aria-label":C.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${E}`,style:H,children:[
63
- /* @__PURE__ */ve(ot,{className:"h-5 w-5"}),
64
- /* @__PURE__ */ve("span",{className:"text-xs font-medium text-gray-500",children:C.add})]}),q=B?/* @__PURE__ */we("button",{type:"button",onClick:()=>W(),"aria-label":"string"==typeof I?I:C.upload,className:tt(R,!1,E),style:{minHeight:p+32},children:[
65
- /* @__PURE__ */ve("span",{className:"text-gray-400",children:/* @__PURE__ */ve(ot,{})}),
68
+ /* @__PURE__ */ve("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function mt(e,t={}){return t.preferSquare&&e.logo_square_url?{src:e.logo_square_url,hasAlpha:e.logo_square_has_alpha,isLight:e.logo_square_is_light,adaptive:!0}:"dark"===t.surface&&e.logo_on_dark_url?{src:e.logo_on_dark_url,hasAlpha:null,isLight:null,adaptive:!1}:{src:e.logo_url,hasAlpha:e.logo_has_alpha,isLight:e.logo_is_light,adaptive:!0}}var pt=ue(null);function gt(e){const t=document.head.querySelector('link[data-portal-branding="favicon"]');if(!e)return void t?.remove();const r=t??document.createElement("link");r.rel="icon",r.href=e,r.dataset.portalBranding="favicon",t||document.head.appendChild(r)}function ft({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=ie(t),[i,s]=ie(!0),[o,c]=ie(null),d=se(e),u=se(t);d.current=e,u.current=t,de(()=>{const e=new AbortController;let t=!0;return l(u.current),s(!0),c(null),d.current(e.signal).then(e=>{t&&(l(e),s(!1))},e=>{t&&(c(e instanceof Error?e:new Error("Could not load portal branding.")),s(!1))}),()=>{t=!1,e.abort()}},[]),de(()=>(gt(a.favicon_url),()=>gt(null)),[a.favicon_url]),de(()=>{r&&(document.title=r(a))},[a,r]);const h=ce(()=>({branding:a,loading:i,error:o}),[a,i,o]);/* @__PURE__ */
69
+ return ve(pt.Provider,{value:h,children:n})}function bt(){const e=ge(pt);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var xt=/* @__PURE__ */ve("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */ve("path",{d:"M6 6l12 12M18 6L6 18"})});function yt({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,label:l,hint:i,error:s,required:o,className:c,accept:d="image/*",maxSizeBytes:u,maxFiles:h,fit:m="cover",thumbSize:p=96,placeholder:g,cta:b,acceptHint:y,showCover:v=!1,coverLabel:w,busy:k=!1,busyLabel:N,disabled:M=!1,readOnly:$=!1}){const C=K().media,L=b??C.cta,D=w??C.cover,j=N??C.uploading,P=oe(),[S,z]=ie(null),A=M||k,B=!(!t&&!r||A||$),F=!!n&&!A&&!$,E=!!a&&!A&&!$,T=at(A),I=g??rt(d,C),O=f({accept:d,maxSizeBytes:u,maxFiles:h,acceptHint:y,multiple:!0,disabled:!B,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),R=O.dragOver,W=()=>{B&&(t?t():O.open())},H={width:p,height:p},_=B&&/* @__PURE__ */we("button",{type:"button",onClick:()=>W(),"aria-label":C.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${T}`,style:H,children:[
70
+ /* @__PURE__ */ve(dt,{className:"h-5 w-5"}),
71
+ /* @__PURE__ */ve("span",{className:"text-xs font-medium text-gray-500",children:C.add})]}),q=B?/* @__PURE__ */we("button",{type:"button",onClick:()=>W(),"aria-label":"string"==typeof I?I:C.upload,className:nt(R,!1,T),style:{minHeight:p+32},children:[
72
+ /* @__PURE__ */ve("span",{className:"text-gray-400",children:/* @__PURE__ */ve(dt,{})}),
66
73
  /* @__PURE__ */ve("span",{className:"px-3 text-xs text-gray-500",children:I}),
67
74
  /* @__PURE__ */ve("span",{className:"text-sm font-medium text-blue-600",children:L}),y&&/* @__PURE__ */ve("span",{className:"text-xs text-gray-400",children:y})]}):/* @__PURE__ */ve("div",{className:"flex w-full items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-3 text-xs text-gray-400",style:{minHeight:p+32},children:C.empty});/* @__PURE__ */
68
- return we(qe,{label:l,labelId:l?`${j}-label`:void 0,htmlFor:j,hint:i,error:s,required:o,className:c,children:[
69
- /* @__PURE__ */we("div",{id:j,role:"group","aria-labelledby":l?`${j}-label`:void 0,"aria-describedby":s?`${j}-error`:i?`${j}-hint`:void 0,"aria-busy":k||void 0,...O.zoneProps,className:"relative rounded-lg transition-colors",style:{...S?{opacity:.6}:{},...R?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?q:/* @__PURE__ */we("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:lt(t.url,d),i=Xe(t.url),s=v&&(t.cover??0===r);/* @__PURE__ */
70
- return we("div",{draggable:T||void 0,onDragStart:T?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),A(r)}:void 0,onDragEnd:T?()=>A(null):void 0,onDragOver:T?e=>{null!=z&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:T?e=>{null!=z&&(e.preventDefault(),e.stopPropagation(),z!==r&&a(z,r),A(null))}:void 0,tabIndex:T?0:void 0,"aria-label":T?C.reorder(i,r+1,e.length):void 0,onKeyDown:T?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",E,z===r?"opacity-50":""].join(" "),style:{...H,cursor:T?"move":void 0},children:[l?/* @__PURE__ */ve("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */ve("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),s&&/* @__PURE__ */ve("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-1.5 py-0.5 text-xs font-medium text-white",children:D}),null!=t.caption&&/* @__PURE__ */ve(at,{children:t.caption}),F&&/* @__PURE__ */ve("button",{type:"button",onClick:()=>n(t.id),"aria-label":C.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${E}`,style:{background:"var(--rosh-media-scrim-button)"},children:ft})]},t.id)}),_]}),k&&/* @__PURE__ */ve(nt,{label:P})]}),!t&&r&&/* @__PURE__ */ve("input",{...O.inputProps}),
71
- /* @__PURE__ */ve(x,{rejections:O.rejections})]})}var xt=e=>String(e).padStart(2,"0");function yt(e){return`${e.getFullYear()}-${xt(e.getMonth()+1)}-${xt(e.getDate())}`}function vt(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var wt=e=>`${e.getFullYear()}-${xt(e.getMonth()+1)}`;var kt=()=>yt(/* @__PURE__ */new Date);var Nt=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Mt=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),n=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),n))};function $t({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:s,onMonthChange:o,weekStartsOn:c,quickJump:d=!0,"aria-label":u,className:h=""}){const m=vt(e),p=ee(kt,null),g=vt(p),f=K().calendar,b=U(),x=y(b),w=ee(()=>v(b),0),k=c??w,N=()=>{if(!g)return null;const e=wt(g);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[M,$]=ie(()=>s||(m?wt(m):N())),C=i??M??N(),L=null===C?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(C,g),[D,P]=ie(()=>e??p),j=se(null),z=se(!1),[A,S]=ie("days"),B=ue(()=>L?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),n=(r.getDay()-t+7)%7,a=new Date(r.getFullYear(),r.getMonth(),1-n);return Array.from({length:42},(e,t)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+t))}(L,k):[],[C,k]),F=e=>!!a&&e<a||!!l&&e>l,T=D??p,E=B.some(e=>yt(e)===T),I=L?B.find(e=>e.getMonth()===L.getMonth())??B[0]:null,O=E&&T?T:I?yt(I):"";if(ce(()=>{z.current&&(z.current=!1,j.current?.querySelector('[data-active="true"]')?.focus())},[O,C]),!L)/* @__PURE__ */
75
+ return we(Ke,{label:l,labelId:l?`${P}-label`:void 0,htmlFor:P,hint:i,error:s,required:o,className:c,children:[
76
+ /* @__PURE__ */we("div",{id:P,role:"group","aria-labelledby":l?`${P}-label`:void 0,"aria-describedby":s?`${P}-error`:i?`${P}-hint`:void 0,"aria-busy":k||void 0,...O.zoneProps,className:"relative rounded-lg transition-colors",style:{...A?{opacity:.6}:{},...R?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?q:/* @__PURE__ */we("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:st(t.url,d),i=et(t.url),s=v&&(t.cover??0===r);/* @__PURE__ */
77
+ return we("div",{draggable:E||void 0,onDragStart:E?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),z(r)}:void 0,onDragEnd:E?()=>z(null):void 0,onDragOver:E?e=>{null!=S&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:E?e=>{null!=S&&(e.preventDefault(),e.stopPropagation(),S!==r&&a(S,r),z(null))}:void 0,tabIndex:E?0:void 0,"aria-label":E?C.reorder(i,r+1,e.length):void 0,onKeyDown:E?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",T,S===r?"opacity-50":""].join(" "),style:{...H,cursor:E?"move":void 0},children:[l?/* @__PURE__ */ve("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */ve("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),s&&/* @__PURE__ */ve("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-1.5 py-0.5 text-xs font-medium text-white",children:D}),null!=t.caption&&/* @__PURE__ */ve(it,{children:t.caption}),F&&/* @__PURE__ */ve("button",{type:"button",onClick:()=>n(t.id),"aria-label":C.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${T}`,style:{background:"var(--rosh-media-scrim-button)"},children:xt})]},t.id)}),_]}),k&&/* @__PURE__ */ve(lt,{label:j})]}),!t&&r&&/* @__PURE__ */ve("input",{...O.inputProps}),
78
+ /* @__PURE__ */ve(x,{rejections:O.rejections})]})}var vt=e=>String(e).padStart(2,"0");function wt(e){return`${e.getFullYear()}-${vt(e.getMonth()+1)}-${vt(e.getDate())}`}function kt(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var Nt=e=>`${e.getFullYear()}-${vt(e.getMonth()+1)}`;var Mt=()=>wt(/* @__PURE__ */new Date);var $t=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Ct=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),n=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),n))};function Lt({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:s,onMonthChange:o,weekStartsOn:c,quickJump:d=!0,"aria-label":u,className:h=""}){const m=kt(e),p=ee(Mt,null),g=kt(p),f=K().calendar,b=U(),x=y(b),w=ee(()=>v(b),0),k=c??w,N=()=>{if(!g)return null;const e=Nt(g);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[M,$]=ie(()=>s||(m?Nt(m):N())),C=i??M??N(),L=null===C?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(C,g),[D,j]=ie(()=>e??p),P=se(null),S=se(!1),[z,A]=ie("days"),B=ce(()=>L?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),n=(r.getDay()-t+7)%7,a=new Date(r.getFullYear(),r.getMonth(),1-n);return Array.from({length:42},(e,t)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+t))}(L,k):[],[C,k]),F=e=>!!a&&e<a||!!l&&e>l,E=D??p,T=B.some(e=>wt(e)===E),I=L?B.find(e=>e.getMonth()===L.getMonth())??B[0]:null,O=T&&E?E:I?wt(I):"";if(de(()=>{S.current&&(S.current=!1,P.current?.querySelector('[data-active="true"]')?.focus())},[O,C]),!L)/* @__PURE__ */
72
79
  return we("div",{className:h,"aria-hidden":"true","data-calendar-pending":"",children:[
73
- /* @__PURE__ */ve("div",{className:"mb-2 h-6"}),Array.from({length:7},(e,t)=>/* @__PURE__ */ve("div",{className:0===t?"py-1 text-xs":"py-1.5 min-h-11 sm:min-h-0 text-sm",children:" "},t))]});const R=e=>"years"===A?new Date(L.getFullYear()+12*e,L.getMonth(),1):"months"===A?new Date(L.getFullYear()+e,L.getMonth(),1):Mt(L,e),W=e=>{const t=wt(e);void 0===i&&$(t),o?.(t)},H=u??x.monthYear(L.getFullYear(),L.getMonth());/* @__PURE__ */
80
+ /* @__PURE__ */ve("div",{className:"mb-2 h-6"}),Array.from({length:7},(e,t)=>/* @__PURE__ */ve("div",{className:0===t?"py-1 text-xs":"py-1.5 min-h-11 sm:min-h-0 text-sm",children:" "},t))]});const R=e=>"years"===z?new Date(L.getFullYear()+12*e,L.getMonth(),1):"months"===z?new Date(L.getFullYear()+e,L.getMonth(),1):Ct(L,e),W=e=>{const t=Nt(e);void 0===i&&$(t),o?.(t)},H=u??x.monthYear(L.getFullYear(),L.getMonth());/* @__PURE__ */
74
81
  return we("div",{className:h,children:[
75
82
  /* @__PURE__ */we("div",{className:"mb-2 flex items-center justify-between px-1",children:[
76
- /* @__PURE__ */ve("button",{type:"button","aria-label":"years"===A?f.previousYears:"months"===A?f.previousYear:f.previousMonth,onClick:()=>W(R(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */ve("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),
77
- /* @__PURE__ */ve("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */we(ke,{children:["years"!==A&&/* @__PURE__ */ve("button",{type:"button","aria-label":f.chooseMonth(x.months[L.getMonth()]),onClick:()=>S(e=>"months"===e?"days":"months"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:x.months[L.getMonth()]}),
78
- /* @__PURE__ */ve("button",{type:"button","aria-label":f.chooseYear(L.getFullYear()),onClick:()=>S(e=>"years"===e?"days":"years"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:L.getFullYear()})]}):/* @__PURE__ */ve("span",{children:x.monthYear(L.getFullYear(),L.getMonth())})}),
79
- /* @__PURE__ */ve("button",{type:"button","aria-label":"years"===A?f.nextYears:"months"===A?f.nextYear:f.nextMonth,onClick:()=>W(R(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */ve("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})})]}),"months"===A&&/* @__PURE__ */ve("div",{role:"group","aria-label":f.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:x.monthsShort.map((e,t)=>/* @__PURE__ */ve("button",{type:"button","aria-pressed":t===L.getMonth(),onClick:()=>{W(new Date(L.getFullYear(),t,1)),S("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===L.getMonth()?"bg-blue-600 font-semibold text-white":g&&t===g.getMonth()&&L.getFullYear()===g.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===A&&/* @__PURE__ */ve("div",{role:"group","aria-label":f.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=L.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */ve("button",{type:"button","aria-pressed":e===L.getFullYear(),onClick:()=>{W(new Date(e,L.getMonth(),1)),S("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===L.getFullYear()?"bg-blue-600 font-semibold text-white":e===g?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
80
- /* @__PURE__ */we("div",{ref:j,role:"grid","aria-label":H,onKeyDown:e=>{const t=vt(O)??g??L,r={ArrowLeft:()=>Nt(t,-1),ArrowRight:()=>Nt(t,1),ArrowUp:()=>Nt(t,-7),ArrowDown:()=>Nt(t,7),Home:()=>Nt(t,-(t.getDay()-k+7)%7),End:()=>Nt(t,6-(t.getDay()-k+7)%7),PageUp:()=>Mt(t,e.shiftKey?-12:-1),PageDown:()=>Mt(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),z.current=!0,P(yt(a)),void(wt(a)!==C&&W(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),F(O)||n(O))},hidden:"days"!==A,children:[
83
+ /* @__PURE__ */ve("button",{type:"button","aria-label":"years"===z?f.previousYears:"months"===z?f.previousYear:f.previousMonth,onClick:()=>W(R(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */ve("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),
84
+ /* @__PURE__ */ve("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */we(ke,{children:["years"!==z&&/* @__PURE__ */ve("button",{type:"button","aria-label":f.chooseMonth(x.months[L.getMonth()]),onClick:()=>A(e=>"months"===e?"days":"months"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:x.months[L.getMonth()]}),
85
+ /* @__PURE__ */ve("button",{type:"button","aria-label":f.chooseYear(L.getFullYear()),onClick:()=>A(e=>"years"===e?"days":"years"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:L.getFullYear()})]}):/* @__PURE__ */ve("span",{children:x.monthYear(L.getFullYear(),L.getMonth())})}),
86
+ /* @__PURE__ */ve("button",{type:"button","aria-label":"years"===z?f.nextYears:"months"===z?f.nextYear:f.nextMonth,onClick:()=>W(R(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */ve("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})})]}),"months"===z&&/* @__PURE__ */ve("div",{role:"group","aria-label":f.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:x.monthsShort.map((e,t)=>/* @__PURE__ */ve("button",{type:"button","aria-pressed":t===L.getMonth(),onClick:()=>{W(new Date(L.getFullYear(),t,1)),A("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===L.getMonth()?"bg-blue-600 font-semibold text-white":g&&t===g.getMonth()&&L.getFullYear()===g.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===z&&/* @__PURE__ */ve("div",{role:"group","aria-label":f.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=L.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */ve("button",{type:"button","aria-pressed":e===L.getFullYear(),onClick:()=>{W(new Date(e,L.getMonth(),1)),A("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===L.getFullYear()?"bg-blue-600 font-semibold text-white":e===g?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
87
+ /* @__PURE__ */we("div",{ref:P,role:"grid","aria-label":H,onKeyDown:e=>{const t=kt(O)??g??L,r={ArrowLeft:()=>$t(t,-1),ArrowRight:()=>$t(t,1),ArrowUp:()=>$t(t,-7),ArrowDown:()=>$t(t,7),Home:()=>$t(t,-(t.getDay()-k+7)%7),End:()=>$t(t,6-(t.getDay()-k+7)%7),PageUp:()=>Ct(t,e.shiftKey?-12:-1),PageDown:()=>Ct(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),S.current=!0,j(wt(a)),void(Nt(a)!==C&&W(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),F(O)||n(O))},hidden:"days"!==z,children:[
81
88
  /* @__PURE__ */ve("div",{role:"row",className:"grid grid-cols-7 text-center text-xs font-medium text-gray-500",children:Array.from({length:7},(e,t)=>(t+k)%7).map(e=>
82
- /* @__PURE__ */ve("div",{role:"columnheader","aria-label":x.weekdays[e],className:"py-1",children:/* @__PURE__ */ve("abbr",{title:x.weekdays[e],className:"no-underline",children:x.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */ve("div",{role:"row",className:"grid grid-cols-7 text-center text-sm",children:B.slice(7*l,7*l+7).map(a=>{const l=yt(a),i=a.getMonth()!==L.getMonth(),s=l===e||"range"===r&&l===t,o=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=F(l);/* @__PURE__ */
83
- return ve("div",{role:"gridcell","aria-selected":s,children:/* @__PURE__ */ve("button",{type:"button","data-active":l===O,tabIndex:l===O?0:-1,disabled:c,"aria-label":x.longDate(a.getFullYear(),a.getMonth(),a.getDate()),"aria-current":l===p?"date":void 0,onClick:()=>{P(l),n(l)},className:["w-full rounded-md py-1.5 min-h-11 sm:min-h-0 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",c?"cursor-not-allowed text-gray-300":s?"bg-blue-600 font-semibold text-white":o?"bg-blue-100 text-blue-800":i?"text-gray-500 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100",l!==p||s?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),children:a.getDate()})},l)})},l))]})]})}var Ct=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Lt=e=>`${e.getFullYear()}-${Dt(e.getMonth()+1)}`,Dt=e=>String(e).padStart(2,"0");function Pt(e){return`${e.getFullYear()}-${Dt(e.getMonth()+1)}-${Dt(e.getDate())}`}function jt(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),l=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:Pt(new Date(r,n,t.getDate()-14)),to:Pt(a)};case"lastMonth":return{from:Pt(i(1)),to:Pt(l)};case"last3Months":return{from:Pt(i(3)),to:Pt(l)};case"last6Months":return{from:Pt(i(6)),to:Pt(l)};case"last12Months":return{from:Pt(i(12)),to:Pt(l)}}}function zt(e,t,r){const n=Lt(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function At(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function St(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Bt=/* @__PURE__ */new Map;function Ft({from:e,to:r,onChange:n,formatDisplay:a,clearable:l,required:i=!1,name:s,id:o,"aria-labelledby":c,"aria-label":d,weekStartsOn:u,placeholder:h,fullWidth:m=!1,min:p,max:g}){const f=K().dateRange,b=U(),x=a??(b?function(e){let t=Bt.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Bt.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(b):St),v=h??f.placeholder,w=l??!i,[k,N]=ie(!1),[M,$]=ie(e),[C,L]=ie(r),[D,P]=ie(null),j=se(null),z=se(null),A=se(null),S=oe(),F=oe(),T=oe(),[E,I]=ie(!1),O=t(j,k,{preferredMaxWidth:520,preferredMaxHeight:E?720:560,popupRef:A}),R=se(null),W=se(null);Q(()=>{const e=A.current;if(!k||!O||!e)return;const t=getComputedStyle(e),r=O.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(E)null!==W.current&&W.current<=r&&I(!1);else{const e=R.current?.offsetWidth??0;if(0===e)return;W.current=e,e>r+.5&&I(!0)}});const[q,V]=ie(!1);Q(()=>{const e=!!o&&(z.current?.labels?.length??0)>0;e!==q&&V(e)});const Y=!!d||!!c||q,Z=/* @__PURE__ */new Date,[G,J]=ie(()=>e?Lt(At(e)):zt(Z,p,g)),X=Ct.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(jt(e,Z),p,g)),ee=e=>e?x(e):"";ce(()=>{if(!k)return;const e=e=>{const t=e.target;j.current?.contains(t)||A.current?.contains(t)||N(!1)};document.addEventListener("mousedown",e);const t=H(()=>N(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[k]);const te=()=>{n("",""),N(!1)},re=e&&r?`${ee(e)} — ${ee(r)}`:e?f.fromOnly(ee(e)):r?f.toOnly(ee(r)):"",ne=y(b),ae=e=>{const t=vt(e);return t?ne.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},le=e&&r?f.range(ae(e),ae(r)):e?f.fromOnly(ae(e)):r?f.toOnly(ae(r)):v,de=e=>E?"rounded-md border px-2.5 py-1 text-sm transition-colors "+(D===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"text-left px-3 py-1.5 text-sm rounded-md transition-colors "+(D===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),ue=/* @__PURE__ */we(ke,{children:[X.map(e=>/* @__PURE__ */ve("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=jt(e,Z);$(t.from),L(t.to),P(e),J(t.from.slice(0,7))})(e),className:de(e),children:f[e]},e)),
84
- /* @__PURE__ */ve("button",{type:"button",onClick:()=>P("Custom"),className:de("Custom"),children:f.custom})]}),he=
85
- /* @__PURE__ */ve($t,{mode:"range",min:p,max:g,value:M||null,endValue:C||null,month:G,onMonthChange:J,onSelect:e=>{P("Custom"),!M||M&&C?($(e),L("")):e<M?(L(M),$(e)):L(e)},weekStartsOn:u,"aria-label":f.dialog});/* @__PURE__ */
86
- return we("div",{className:"relative"+(m?" w-full":""),ref:j,children:[
89
+ /* @__PURE__ */ve("div",{role:"columnheader","aria-label":x.weekdays[e],className:"py-1",children:/* @__PURE__ */ve("abbr",{title:x.weekdays[e],className:"no-underline",children:x.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */ve("div",{role:"row",className:"grid grid-cols-7 text-center text-sm",children:B.slice(7*l,7*l+7).map(a=>{const l=wt(a),i=a.getMonth()!==L.getMonth(),s=l===e||"range"===r&&l===t,o=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=F(l);/* @__PURE__ */
90
+ return ve("div",{role:"gridcell","aria-selected":s,children:/* @__PURE__ */ve("button",{type:"button","data-active":l===O,tabIndex:l===O?0:-1,disabled:c,"aria-label":x.longDate(a.getFullYear(),a.getMonth(),a.getDate()),"aria-current":l===p?"date":void 0,onClick:()=>{j(l),n(l)},className:["w-full rounded-md py-1.5 min-h-11 sm:min-h-0 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",c?"cursor-not-allowed text-gray-300":s?"bg-blue-600 font-semibold text-white":o?"bg-blue-100 text-blue-800":i?"text-gray-500 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100",l!==p||s?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),children:a.getDate()})},l)})},l))]})]})}var Dt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],jt=e=>`${e.getFullYear()}-${Pt(e.getMonth()+1)}`,Pt=e=>String(e).padStart(2,"0");function St(e){return`${e.getFullYear()}-${Pt(e.getMonth()+1)}-${Pt(e.getDate())}`}function zt(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),l=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:St(new Date(r,n,t.getDate()-14)),to:St(a)};case"lastMonth":return{from:St(i(1)),to:St(l)};case"last3Months":return{from:St(i(3)),to:St(l)};case"last6Months":return{from:St(i(6)),to:St(l)};case"last12Months":return{from:St(i(12)),to:St(l)}}}function At(e,t,r){const n=jt(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Bt(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function Ft(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Et=/* @__PURE__ */new Map;function Tt({from:e,to:r,onChange:n,formatDisplay:a,clearable:l,required:i=!1,name:s,id:o,"aria-labelledby":c,"aria-label":d,weekStartsOn:u,placeholder:h,fullWidth:m=!1,min:p,max:g}){const f=K().dateRange,b=U(),x=a??(b?function(e){let t=Et.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Et.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(b):Ft),v=h??f.placeholder,w=l??!i,[k,N]=ie(!1),[M,$]=ie(e),[C,L]=ie(r),[D,j]=ie(null),P=se(null),S=se(null),z=se(null),A=oe(),F=oe(),E=oe(),[T,I]=ie(!1),O=t(P,k,{preferredMaxWidth:520,preferredMaxHeight:T?720:560,popupRef:z}),R=se(null),W=se(null);Q(()=>{const e=z.current;if(!k||!O||!e)return;const t=getComputedStyle(e),r=O.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(T)null!==W.current&&W.current<=r&&I(!1);else{const e=R.current?.offsetWidth??0;if(0===e)return;W.current=e,e>r+.5&&I(!0)}});const[q,V]=ie(!1);Q(()=>{const e=!!o&&(S.current?.labels?.length??0)>0;e!==q&&V(e)});const Y=!!d||!!c||q,Z=/* @__PURE__ */new Date,[G,J]=ie(()=>e?jt(Bt(e)):At(Z,p,g)),X=Dt.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(zt(e,Z),p,g)),ee=e=>e?x(e):"";de(()=>{if(!k)return;const e=e=>{const t=e.target;P.current?.contains(t)||z.current?.contains(t)||N(!1)};document.addEventListener("mousedown",e);const t=H(()=>N(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[k]);const te=()=>{n("",""),N(!1)},re=e&&r?`${ee(e)} — ${ee(r)}`:e?f.fromOnly(ee(e)):r?f.toOnly(ee(r)):"",ne=y(b),ae=e=>{const t=kt(e);return t?ne.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},le=e&&r?f.range(ae(e),ae(r)):e?f.fromOnly(ae(e)):r?f.toOnly(ae(r)):v,ce=e=>T?"rounded-md border px-2.5 py-1 text-sm transition-colors "+(D===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"text-left px-3 py-1.5 text-sm rounded-md transition-colors "+(D===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),ue=/* @__PURE__ */we(ke,{children:[X.map(e=>/* @__PURE__ */ve("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=zt(e,Z);$(t.from),L(t.to),j(e),J(t.from.slice(0,7))})(e),className:ce(e),children:f[e]},e)),
91
+ /* @__PURE__ */ve("button",{type:"button",onClick:()=>j("Custom"),className:ce("Custom"),children:f.custom})]}),he=
92
+ /* @__PURE__ */ve(Lt,{mode:"range",min:p,max:g,value:M||null,endValue:C||null,month:G,onMonthChange:J,onSelect:e=>{j("Custom"),!M||M&&C?($(e),L("")):e<M?(L(M),$(e)):L(e)},weekStartsOn:u,"aria-label":f.dialog});/* @__PURE__ */
93
+ return we("div",{className:"relative"+(m?" w-full":""),ref:P,children:[
87
94
  /* @__PURE__ */we("div",{className:`${m?"flex w-full":"inline-flex"} items-center gap-2 border rounded-lg px-2.5 py-1.5 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${e||r?"border-blue-400 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500"}`,children:[
88
- /* @__PURE__ */we("button",{ref:z,type:"button",onClick:()=>{$(e),L(r),P(null),J(e?Lt(At(e)):zt(Z,p,g)),N(!0)},"aria-haspopup":"dialog","aria-expanded":k,id:o,"aria-label":d,"aria-labelledby":c,"aria-describedby":[Y?F:void 0,i?T:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":k?S:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(m?" min-w-0 flex-1 justify-start":""),children:[
95
+ /* @__PURE__ */we("button",{ref:S,type:"button",onClick:()=>{$(e),L(r),j(null),J(e?jt(Bt(e)):At(Z,p,g)),N(!0)},"aria-haspopup":"dialog","aria-expanded":k,id:o,"aria-label":d,"aria-labelledby":c,"aria-describedby":[Y?F:void 0,i?E:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":k?A:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(m?" min-w-0 flex-1 justify-start":""),children:[
89
96
  /* @__PURE__ */ve("svg",{className:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),
90
- /* @__PURE__ */ve("span",{className:"truncate",children:re||v})]}),w&&(e||r)&&/* @__PURE__ */ve("button",{type:"button",onClick:te,"aria-label":f.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Y&&/* @__PURE__ */ve("span",{id:F,className:"sr-only",children:le}),i&&/* @__PURE__ */ve("span",{id:T,className:"sr-only",children:f.required}),s&&/* @__PURE__ */we(ke,{children:[
97
+ /* @__PURE__ */ve("span",{className:"truncate",children:re||v})]}),w&&(e||r)&&/* @__PURE__ */ve("button",{type:"button",onClick:te,"aria-label":f.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Y&&/* @__PURE__ */ve("span",{id:F,className:"sr-only",children:le}),i&&/* @__PURE__ */ve("span",{id:E,className:"sr-only",children:f.required}),s&&/* @__PURE__ */we(ke,{children:[
91
98
  /* @__PURE__ */ve("input",{type:"hidden",name:s.from,value:e}),
92
99
  /* @__PURE__ */ve("input",{type:"hidden",name:s.to,value:r})]}),k&&Ne(
93
- /* @__PURE__ */we("div",{ref:A,id:S,role:"dialog","aria-label":f.dialog,"data-layout":E?"stacked":"side",className:"fixed rounded-2xl p-4",style:{zIndex:_.popup,left:O?.left,right:O?.right,top:O?.top,bottom:O?.bottom,width:E&&O?O.maxWidth:"max-content",maxWidth:O?.maxWidth,maxHeight:O?.maxHeight,overflowY:"auto",visibility:O?void 0:"hidden",...B()},children:[
94
- /* @__PURE__ */we("div",{className:E?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
100
+ /* @__PURE__ */we("div",{ref:z,id:A,role:"dialog","aria-label":f.dialog,"data-layout":T?"stacked":"side",className:"fixed rounded-2xl p-4",style:{zIndex:_.popup,left:O?.left,right:O?.right,top:O?.top,bottom:O?.bottom,width:T&&O?O.maxWidth:"max-content",maxWidth:O?.maxWidth,maxHeight:O?.maxHeight,overflowY:"auto",visibility:O?void 0:"hidden",...B()},children:[
101
+ /* @__PURE__ */we("div",{className:T?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
95
102
  /* @__PURE__ */we("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
96
103
  /* @__PURE__ */ve("span",{className:"text-xs font-medium text-gray-500",children:f.from}),
97
- /* @__PURE__ */ve("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(M?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:M?ee(M):f.start})]}),!E&&/* @__PURE__ */ve("span",{className:"text-gray-300",children:"—"}),
104
+ /* @__PURE__ */ve("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(M?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:M?ee(M):f.start})]}),!T&&/* @__PURE__ */ve("span",{className:"text-gray-300",children:"—"}),
98
105
  /* @__PURE__ */we("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
99
106
  /* @__PURE__ */ve("span",{className:"text-xs font-medium text-gray-500",children:f.to}),
100
- /* @__PURE__ */ve("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(C?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:C?ee(C):f.end})]})]}),E?/* @__PURE__ */we(ke,{children:[X.length>0&&/* @__PURE__ */ve("div",{className:"mb-3 flex flex-wrap gap-1.5",children:ue}),
107
+ /* @__PURE__ */ve("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(C?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:C?ee(C):f.end})]})]}),T?/* @__PURE__ */we(ke,{children:[X.length>0&&/* @__PURE__ */ve("div",{className:"mb-3 flex flex-wrap gap-1.5",children:ue}),
101
108
  /* @__PURE__ */ve("div",{className:"w-full",children:he})]}):
102
109
  /* @__PURE__ */we("div",{ref:R,className:"flex w-max gap-4",children:[
103
110
  /* @__PURE__ */ve("div",{className:"w-64",children:he}),X.length>0&&/* @__PURE__ */ve("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:ue})]}),
104
111
  /* @__PURE__ */we("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[w&&/* @__PURE__ */ve("button",{type:"button",onClick:te,className:"px-3 py-1.5 text-sm text-gray-500 hover:text-gray-700",children:f.clear}),
105
112
  /* @__PURE__ */ve("button",{type:"button",onClick:()=>N(!1),className:"px-3 py-1.5 text-sm text-gray-600 border border-gray-300 rounded-md hover:bg-gray-50",children:f.cancel}),
106
- /* @__PURE__ */ve("button",{type:"button",onClick:()=>{n(M,C),N(!1)},disabled:!M||!C,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",children:f.apply})]})]}),document.body)]})}var Tt=/^\d{2}:\d{2}(:\d{2})?$/,Et=e=>String(e).padStart(2,"0");function It(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Et(e.getHours())}:${Et(e.getMinutes())}`;return t?`${r}:${Et(e.getSeconds())}`:r}return Tt.test(e)?e:""}var Ot=ae(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",step:s,...o},c){const d=null!=s&&Number(s)<60,u=U();/* @__PURE__ */
107
- return ve("input",{ref:c,type:"time",lang:u,step:s,"aria-invalid":a||void 0,value:It(e,d),min:It(r,d)||void 0,max:It(n,d)||void 0,onChange:e=>t?.(Tt.test(e.target.value)?e.target.value:null),className:je({invalid:a,size:l,className:i}),...o})}),Rt=/^\d{4}-\d{2}-\d{2}$/,Wt=/^(aria|data)-/,Ht=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function _t(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Pt(e);if(Rt.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Pt(t)}function qt(e){if(!Rt.test(e))return null;const[t,r,n]=e.split("-").map(Number),a=new Date(t,r-1,n);return a.getMonth()===r-1&&a.getDate()===n?a:null}function Ut(e,t){const r=qt(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var Kt=ae(function({value:e,onChange:r,min:n,max:a,invalid:l,size:i,native:s,weekStartsOn:o,className:c="","aria-label":d,"aria-describedby":u,"aria-labelledby":h,id:m,name:p,disabled:g,placeholder:f,required:b,clearable:x,form:v,title:w,tabIndex:k,autoFocus:N,onFocus:M,onBlur:$,...C},L){const D=x??!b,P=_t(e),j=_t(n),z=_t(a),A=K().datePicker,S=U(),B=y(S),[F,T]=ie(!1),E=se(null),I=se(null),O=se(null),R=oe(),q=oe(),V=oe(),Y=t(I,F,{popupRef:O}),[Z,G]=ie(!1);Q(()=>{const e=!!m&&(I.current?.labels?.length??0)>0;e!==Z&&G(e)});const J=!d&&(!!h||Z);if(ce(()=>{if(!F)return;const e=e=>{const t=e.target;E.current?.contains(t)||O.current?.contains(t)||T(!1)};document.addEventListener("pointerdown",e,!0);const t=H(()=>T(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[F]),ce(()=>{if(F)return W(e=>"Escape"===e.key&&(T(!1),I.current?.focus(),!0))},[F]),s)/* @__PURE__ */
108
- return ve("input",{ref:L,type:"date",lang:S,id:m,name:p,disabled:g,"aria-label":d,"aria-describedby":u,"aria-invalid":l||void 0,value:P,min:j||void 0,max:z||void 0,onChange:e=>r?.(qt(e.target.value)),className:je({invalid:l,size:i,className:c}),"aria-labelledby":h,required:b,form:v,title:w,tabIndex:k,autoFocus:N,onFocus:M,onBlur:$,...C});const X=Object.fromEntries(Object.entries(C).filter(([e])=>Wt.test(e)&&!Ht.has(e))),ee=C["aria-required"],te=!!b||!0===ee||"true"===ee,re=[J?q:void 0,te?V:void 0,u].filter(Boolean).join(" ")||void 0,ne=Pt(/* @__PURE__ */new Date),ae=(!j||ne>=j)&&(!z||ne<=z),le=f??A.placeholder;/* @__PURE__ */
109
- return we("div",{ref:E,className:"relative",children:[
110
- /* @__PURE__ */ve("input",{ref:L,type:"hidden",name:p,form:v,value:P}),
111
- /* @__PURE__ */we("button",{ref:I,type:"button",...X,id:m,disabled:g,title:w,tabIndex:k,autoFocus:N,onFocus:M,onBlur:$,"aria-haspopup":"dialog","aria-expanded":F,"aria-controls":F?R:void 0,"aria-labelledby":h,"aria-describedby":re,"aria-label":d?`${d}${P?`, ${Ut(P,B)}`:""}`:void 0,onClick:()=>T(e=>!e),className:`${je({invalid:l,size:i,className:c})} flex items-center justify-between text-left`,children:[
112
- /* @__PURE__ */ve("span",{className:P?"text-gray-900":"text-gray-400",children:P?Ut(P,B):le}),
113
- /* @__PURE__ */ve("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3M4 11h16M5 7h14a1 1 0 011 1v11a1 1 0 01-1 1H5a1 1 0 01-1-1V8a1 1 0 011-1z"})})]}),J&&/* @__PURE__ */ve("span",{id:q,className:"sr-only",children:P?Ut(P,B):le}),te&&/* @__PURE__ */ve("span",{id:V,className:"sr-only",children:A.required}),F&&Ne(
114
- /* @__PURE__ */we("div",{ref:O,id:R,role:"dialog","aria-label":d??A.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:_.popup,left:Y?.left,right:Y?.right,top:Y?.top,bottom:Y?.bottom,maxWidth:Y?.maxWidth,visibility:Y?void 0:"hidden"},children:[
115
- /* @__PURE__ */ve($t,{value:P||null,min:j||null,max:z||null,weekStartsOn:o,onSelect:e=>{T(!1),I.current?.focus(),r?.(qt(e))}}),(D||ae)&&/* @__PURE__ */we("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[D&&/* @__PURE__ */ve("button",{type:"button",onClick:()=>{T(!1),I.current?.focus(),r?.(null)},className:"rounded-md px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:A.clear}),ae&&/* @__PURE__ */ve("button",{type:"button",onClick:()=>{T(!1),I.current?.focus(),r?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-md px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:A.today})]})]}),document.body)]})}),Vt=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Yt=e=>String(e).padStart(2,"0");function Zt(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Yt(t.getMonth()+1)}-${Yt(t.getDate())}T${Yt(t.getHours())}:${Yt(t.getMinutes())}`:Vt.test(e)?e:"";var t}var Gt=ae(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",...s},o){const c=U();/* @__PURE__ */
116
- return ve("input",{ref:o,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:Zt(e),min:Zt(r)||void 0,max:Zt(n)||void 0,onChange:e=>t?.(function(e){if(!Vt.test(e))return null;const[t,r]=e.split("T"),[n,a,l]=t.split("-").map(Number),[i,s,o=0]=r.split(":").map(Number);if(i>23||s>59||o>59)return null;const c=new Date(n,a-1,l,i,s,o);return c.getMonth()===a-1&&c.getDate()===l?c:null}(e.target.value)),className:je({invalid:a,size:l,className:i}),...s})});function Jt(e){let t=null;try{t=window.getSelection()}catch{return null}if(!t||0===t.rangeCount||t.isCollapsed)return null;const r=e;if(r&&"number"==typeof r.nodeType){let e=!1;for(let n=0;n<t.rangeCount&&!e;n++)e=t.getRangeAt(n).intersectsNode(r);if(!e)return null}const n=t.toString();if(!n.trim())return null;const a=document.createElement("div");for(let e=0;e<t.rangeCount;e++)a.appendChild(t.getRangeAt(e).cloneContents());return{text:n,html:a.innerHTML}}async function Xt(e,t){try{if(t&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}const r=r=>{r.clipboardData?.setData("text/plain",e),t&&r.clipboardData?.setData("text/html",t),r.preventDefault()},n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.addEventListener("copy",r);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",r),n.remove()}}async function Qt(e,t,r){const n=await Xt(t,r),a=Y().copy;return n?h.success(a.copiedLabel(e)):h.error(a.failed),n}var er={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},tr={sm:{box:"gap-1.5 px-2.5 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 py-1.5 text-sm",button:"-my-0.5"}};function rr(){/* @__PURE__ */
117
- return ve("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function nr(){/* @__PURE__ */
118
- return ve("svg",{className:"h-4 w-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function ar({value:e,children:t,symbol:r,label:n,size:a="md",variant:l="bordered",hideCopyButton:i=!1,onCopy:s,multiline:o=!1,id:c,"aria-describedby":d,className:u=""}){const[m,p]=ie(!1),g=se(null),f=K().copy;ce(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=le(async()=>{await Xt(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),s?.(e)):h.error(f.failed)},[e,s,f]),{box:x,button:y}=tr[a],v=!i;/* @__PURE__ */
119
- return we("div",{id:v?void 0:c,"aria-describedby":v?void 0:d,className:["inline-flex max-w-full items-center rounded-md",er[l],x,u].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
113
+ /* @__PURE__ */ve("button",{type:"button",onClick:()=>{n(M,C),N(!1)},disabled:!M||!C,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",children:f.apply})]})]}),document.body)]})}var It=/^\d{2}:\d{2}(:\d{2})?$/,Ot=e=>String(e).padStart(2,"0");function Rt(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Ot(e.getHours())}:${Ot(e.getMinutes())}`;return t?`${r}:${Ot(e.getSeconds())}`:r}return It.test(e)?e:""}var Wt=ae(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",step:s,...o},c){const d=null!=s&&Number(s)<60,u=U();/* @__PURE__ */
114
+ return ve("input",{ref:c,type:"time",lang:u,step:s,"aria-invalid":a||void 0,value:Rt(e,d),min:Rt(r,d)||void 0,max:Rt(n,d)||void 0,onChange:e=>t?.(It.test(e.target.value)?e.target.value:null),className:Pe({invalid:a,size:l,className:i}),...o})}),Ht=/^\d{4}-\d{2}-\d{2}$/,_t=/^(aria|data)-/,qt=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function Ut(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":St(e);if(Ht.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":St(t)}function Kt(e){if(!Ht.test(e))return null;const[t,r,n]=e.split("-").map(Number),a=new Date(t,r-1,n);return a.getMonth()===r-1&&a.getDate()===n?a:null}function Vt(e,t){const r=Kt(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var Yt=ae(function({value:e,onChange:r,min:n,max:a,invalid:l,size:i,native:s,weekStartsOn:o,className:c="","aria-label":d,"aria-describedby":u,"aria-labelledby":h,id:m,name:p,disabled:g,placeholder:f,required:b,clearable:x,form:v,title:w,tabIndex:k,autoFocus:N,onFocus:M,onBlur:$,...C},L){const D=x??!b,j=Ut(e),P=Ut(n),S=Ut(a),z=K().datePicker,A=U(),B=y(A),[F,E]=ie(!1),T=se(null),I=se(null),O=se(null),R=oe(),q=oe(),V=oe(),Y=t(I,F,{popupRef:O}),[Z,G]=ie(!1);Q(()=>{const e=!!m&&(I.current?.labels?.length??0)>0;e!==Z&&G(e)});const J=!d&&(!!h||Z);if(de(()=>{if(!F)return;const e=e=>{const t=e.target;T.current?.contains(t)||O.current?.contains(t)||E(!1)};document.addEventListener("pointerdown",e,!0);const t=H(()=>E(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[F]),de(()=>{if(F)return W(e=>"Escape"===e.key&&(E(!1),I.current?.focus(),!0),()=>O.current)},[F]),s)/* @__PURE__ */
115
+ return ve("input",{ref:L,type:"date",lang:A,id:m,name:p,disabled:g,"aria-label":d,"aria-describedby":u,"aria-invalid":l||void 0,value:j,min:P||void 0,max:S||void 0,onChange:e=>r?.(Kt(e.target.value)),className:Pe({invalid:l,size:i,className:c}),"aria-labelledby":h,required:b,form:v,title:w,tabIndex:k,autoFocus:N,onFocus:M,onBlur:$,...C});const X=Object.fromEntries(Object.entries(C).filter(([e])=>_t.test(e)&&!qt.has(e))),ee=C["aria-required"],te=!!b||!0===ee||"true"===ee,re=[J?q:void 0,te?V:void 0,u].filter(Boolean).join(" ")||void 0,ne=St(/* @__PURE__ */new Date),ae=(!P||ne>=P)&&(!S||ne<=S),le=f??z.placeholder;/* @__PURE__ */
116
+ return we("div",{ref:T,className:"relative",children:[
117
+ /* @__PURE__ */ve("input",{ref:L,type:"hidden",name:p,form:v,value:j}),
118
+ /* @__PURE__ */we("button",{ref:I,type:"button",...X,id:m,disabled:g,title:w,tabIndex:k,autoFocus:N,onFocus:M,onBlur:$,"aria-haspopup":"dialog","aria-expanded":F,"aria-controls":F?R:void 0,"aria-labelledby":h,"aria-describedby":re,"aria-label":d?`${d}${j?`, ${Vt(j,B)}`:""}`:void 0,onClick:()=>E(e=>!e),className:`${Pe({invalid:l,size:i,className:c})} flex items-center justify-between text-left`,children:[
119
+ /* @__PURE__ */ve("span",{className:j?"text-gray-900":"text-gray-400",children:j?Vt(j,B):le}),
120
+ /* @__PURE__ */ve("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3M4 11h16M5 7h14a1 1 0 011 1v11a1 1 0 01-1 1H5a1 1 0 01-1-1V8a1 1 0 011-1z"})})]}),J&&/* @__PURE__ */ve("span",{id:q,className:"sr-only",children:j?Vt(j,B):le}),te&&/* @__PURE__ */ve("span",{id:V,className:"sr-only",children:z.required}),F&&Ne(
121
+ /* @__PURE__ */we("div",{ref:O,id:R,role:"dialog","aria-label":d??z.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:_.popup,left:Y?.left,right:Y?.right,top:Y?.top,bottom:Y?.bottom,maxWidth:Y?.maxWidth,visibility:Y?void 0:"hidden"},children:[
122
+ /* @__PURE__ */ve(Lt,{value:j||null,min:P||null,max:S||null,weekStartsOn:o,onSelect:e=>{E(!1),I.current?.focus(),r?.(Kt(e))}}),(D||ae)&&/* @__PURE__ */we("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[D&&/* @__PURE__ */ve("button",{type:"button",onClick:()=>{E(!1),I.current?.focus(),r?.(null)},className:"rounded-md px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:z.clear}),ae&&/* @__PURE__ */ve("button",{type:"button",onClick:()=>{E(!1),I.current?.focus(),r?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-md px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:z.today})]})]}),document.body)]})}),Zt=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Gt=e=>String(e).padStart(2,"0");function Jt(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Gt(t.getMonth()+1)}-${Gt(t.getDate())}T${Gt(t.getHours())}:${Gt(t.getMinutes())}`:Zt.test(e)?e:"";var t}var Xt=ae(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",...s},o){const c=U();/* @__PURE__ */
123
+ return ve("input",{ref:o,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:Jt(e),min:Jt(r)||void 0,max:Jt(n)||void 0,onChange:e=>t?.(function(e){if(!Zt.test(e))return null;const[t,r]=e.split("T"),[n,a,l]=t.split("-").map(Number),[i,s,o=0]=r.split(":").map(Number);if(i>23||s>59||o>59)return null;const c=new Date(n,a-1,l,i,s,o);return c.getMonth()===a-1&&c.getDate()===l?c:null}(e.target.value)),className:Pe({invalid:a,size:l,className:i}),...s})});function Qt(e){let t=null;try{t=window.getSelection()}catch{return null}if(!t||0===t.rangeCount||t.isCollapsed)return null;const r=e;if(r&&"number"==typeof r.nodeType){let e=!1;for(let n=0;n<t.rangeCount&&!e;n++)e=t.getRangeAt(n).intersectsNode(r);if(!e)return null}const n=t.toString();if(!n.trim())return null;const a=document.createElement("div");for(let e=0;e<t.rangeCount;e++)a.appendChild(t.getRangeAt(e).cloneContents());return{text:n,html:a.innerHTML}}async function er(e,t){try{if(t&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}const r=r=>{r.clipboardData?.setData("text/plain",e),t&&r.clipboardData?.setData("text/html",t),r.preventDefault()},n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.addEventListener("copy",r);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",r),n.remove()}}async function tr(e,t,r){const n=await er(t,r),a=Y().copy;return n?h.success(a.copiedLabel(e)):h.error(a.failed),n}var rr={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},nr={sm:{box:"gap-1.5 px-2.5 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 py-1.5 text-sm",button:"-my-0.5"}};function ar(){/* @__PURE__ */
124
+ return ve("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function lr(){/* @__PURE__ */
125
+ return ve("svg",{className:"h-4 w-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function ir({value:e,children:t,symbol:r,label:n,size:a="md",variant:l="bordered",hideCopyButton:i=!1,onCopy:s,multiline:o=!1,id:c,"aria-describedby":d,className:u=""}){const[m,p]=ie(!1),g=se(null),f=K().copy;de(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=le(async()=>{await er(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),s?.(e)):h.error(f.failed)},[e,s,f]),{box:x,button:y}=nr[a],v=!i;/* @__PURE__ */
126
+ return we("div",{id:v?void 0:c,"aria-describedby":v?void 0:d,className:["inline-flex max-w-full items-center rounded-md",rr[l],x,u].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
120
127
  /* @__PURE__ */ve("span",{className:"min-w-0 font-mono text-gray-800 "+(o?"whitespace-pre-wrap break-all":"truncate"),title:o?void 0:e,children:t??e}),!i&&/* @__PURE__ */we(ke,{children:[
121
- /* @__PURE__ */ve(Me,{id:c,"aria-label":n?f.copyLabel(n):f.copy,"aria-describedby":d,onClick:b,className:`${y} text-gray-400`,children:/* @__PURE__ */ve(m?nr:rr,{})}),
122
- /* @__PURE__ */ve("span",{"aria-live":"polite",className:"sr-only",children:m?f.copied:""})]})]})}var lr=2;function ir(e,t){if("."===t)return e.includes(".")?e:""===e?"0.":`${e}.`;if(t<"0"||t>"9")return e;const r=e.indexOf(".");return-1!==r&&e.length-r-1>=2?e:"0"===e?t:e+t}function sr(e){return e.slice(0,-1)}var or=["1","2","3","4","5","6","7","8","9",".","0"];function cr({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=K().keypad,s=r=>{r!==e&&t(r)};/* @__PURE__ */
123
- return we("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[or.map(t=>/* @__PURE__ */ve(L,{size:"touch-xl",variant:"secondary",onClick:()=>s(ir(e,t)),children:t},t)),
124
- /* @__PURE__ */ve(L,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>s(sr(e)),children:"⌫"}),r&&/* @__PURE__ */ve(L,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var dr={md:"h-24 p-3",lg:"h-32 p-4"},ur=ae(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...s},o){/* @__PURE__ */
125
- return we("button",{ref:o,type:l,disabled:a,"aria-pressed":n||void 0,className:["flex w-full flex-col justify-between rounded-xl border text-left transition-colors rosh-focus-ring","disabled:cursor-not-allowed disabled:opacity-50",n?"border-blue-600 bg-blue-50 ring-2 ring-blue-400/40":"border-gray-200 bg-white hover:bg-gray-50 focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",dr[r],i].filter(Boolean).join(" "),...s,children:[
126
- /* @__PURE__ */ve("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */ve("span",{className:"text-sm text-gray-500",children:t})]})}),hr={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},mr="bg-white text-gray-900 shadow-sm rosh-segmented-on",pr="text-gray-600 hover:text-gray-900";function gr({value:e,onChange:t,options:r,name:n,size:a="md",block:l=!1,label:i,className:s="","aria-labelledby":o,"aria-describedby":c}){const d={"aria-label":o?void 0:i,"aria-labelledby":o,"aria-describedby":c},u=oe(),h=`inline-flex max-w-full items-center gap-1 overflow-x-auto rounded-lg bg-gray-100 p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden ${l?"w-full":""} ${s}`.trim(),m="inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors "+(l?"flex-1":"");/* @__PURE__ */
127
- return ve("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const l=`${u}-${r.value}`,i=r.value===e;
128
- /* @__PURE__ */
129
- return we("label",{htmlFor:l,title:r.title,className:[m,"relative",hr[a],i?mr:pr,r.disabled?"cursor-not-allowed opacity-40":"cursor-pointer"].join(" "),children:[
130
- /* @__PURE__ */ve("input",{id:l,type:"radio",name:n,value:r.value,checked:i,disabled:r.disabled,onChange:()=>t(r.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),r.icon,r.label]},r.value)})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e;/* @__PURE__ */
131
- return we("button",{type:"button",title:r.title,"aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:[m,hr[a],n?mr:pr,"disabled:cursor-not-allowed disabled:opacity-40"].join(" "),children:[r.icon,r.label]},r.value)})})}var fr={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},br={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},xr={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},yr=ae(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:s="",disabledReason:o,disabledReasonId:c,...d},u){const h=oe(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=o&&""!==o,b=f?`${m}-reason`:void 0,x=[p,g??b].filter(Boolean).join(" ")||void 0,y=/* @__PURE__ */ve("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":x,disabled:r,onClick:()=>t(!e),...d,className:["relative inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]","disabled:cursor-not-allowed disabled:opacity-40",fr[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */ve("span",{className:["inline-block rounded-full bg-white shadow transition-transform",br[n],e?xr[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */we("span",{className:`flex items-start gap-3 ${s}`.trim(),children:[y,
132
- /* @__PURE__ */we("span",{className:"min-w-0",children:[a&&/* @__PURE__ */ve("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */ve("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */ve("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:o})]})]}):/* @__PURE__ */ve("span",{className:s,children:y})}),vr=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function wr(e){const t=e.trim();if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}var kr=ae(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,disabled:i,invalid:s,placeholder:o,size:c,prefix:d,suffix:u,id:h,name:m,className:p="",onBlur:g,"aria-label":f,"aria-labelledby":b},x){const[y,v]=ie(()=>vr(e,a)),w=se(y);w.current=y,ce(()=>{wr(w.current)!==e&&v(vr(e,a))},[e,a]);const k=/* @__PURE__ */ve("input",{ref:x,id:h,name:m,type:"text",inputMode:0===a?"numeric":"decimal",value:y,disabled:i,placeholder:o,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?void 0:vr(e,a),"aria-invalid":s||void 0,"aria-label":f,"aria-labelledby":b,onChange:e=>{var r;(""===(r=e.target.value)||/^-?\d*\.?\d*$/.test(r))&&(v(r),t(wr(r)))},onKeyDown:e=>{const s=l??1,o="ArrowUp"===e.key?s:"ArrowDown"===e.key?-s:"PageUp"===e.key?10*s:"PageDown"===e.key?10*-s:null;null===o||i||(e.preventDefault(),(e=>{let i=(wr(w.current)??0)+e;null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n);const s=a??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(s)),v(vr(i,a)),t(i)})(o))},onBlur:()=>{const e=wr(y);if(null==e)v(""),t(null);else{let l=e;null!=r&&l<r&&(l=r),null!=n&&l>n&&(l=n),null!=a&&(l=Number(l.toFixed(a))),v(vr(l,a)),l!==e&&t(l)}g?.()},className:je({invalid:s,size:c,className:[d?"pl-7":"",u?"pr-9":"","text-right tabular-nums",p].filter(Boolean).join(" ")})});return d||u?/* @__PURE__ */we("div",{className:"relative",children:[d&&/* @__PURE__ */ve("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:d}),k,u&&/* @__PURE__ */ve("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:u})]}):k}),Nr=(e,t,r)=>Math.min(r,Math.max(t,e));function Mr({value:e,onChange:t,min:r,max:n,step:a=1,precision:l,inputMin:i,inputMax:s,suffix:o,showInput:c=!0,emptyLabel:d,label:u,"aria-labelledby":h,valueText:m,id:p,disabled:g,size:f="md",className:b=""}){const x=K(),y=oe(),v=p??y,w=l??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(a),k=i??r,N=s??n,M=void 0!==d,[$,C]=ie(0),L=se(!1),D=null==e?r:Nr(e,r,n),P=null==e?d:m?m(e):"string"==typeof o?`${e.toFixed(w)} ${o}`:void 0;/* @__PURE__ */
128
+ /* @__PURE__ */ve(Me,{id:c,"aria-label":n?f.copyLabel(n):f.copy,"aria-describedby":d,onClick:b,className:`${y} text-gray-400`,children:/* @__PURE__ */ve(m?lr:ar,{})}),
129
+ /* @__PURE__ */ve("span",{"aria-live":"polite",className:"sr-only",children:m?f.copied:""})]})]})}var sr=2;function or(e,t){if("."===t)return e.includes(".")?e:""===e?"0.":`${e}.`;if(t<"0"||t>"9")return e;const r=e.indexOf(".");return-1!==r&&e.length-r-1>=2?e:"0"===e?t:e+t}function cr(e){return e.slice(0,-1)}var dr=["1","2","3","4","5","6","7","8","9",".","0"];function ur({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=K().keypad,s=r=>{r!==e&&t(r)};/* @__PURE__ */
130
+ return we("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[dr.map(t=>/* @__PURE__ */ve(L,{size:"touch-xl",variant:"secondary",onClick:()=>s(or(e,t)),children:t},t)),
131
+ /* @__PURE__ */ve(L,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>s(cr(e)),children:"⌫"}),r&&/* @__PURE__ */ve(L,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var hr={md:"h-24 p-3",lg:"h-32 p-4"},mr=ae(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...s},o){/* @__PURE__ */
132
+ return we("button",{ref:o,type:l,disabled:a,"aria-pressed":n||void 0,className:["flex w-full flex-col justify-between rounded-xl border text-left transition-colors rosh-focus-ring","disabled:cursor-not-allowed disabled:opacity-50",n?"border-blue-600 bg-blue-50 ring-2 ring-blue-400/40":"border-gray-200 bg-white hover:bg-gray-50 focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",hr[r],i].filter(Boolean).join(" "),...s,children:[
133
+ /* @__PURE__ */ve("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */ve("span",{className:"text-sm text-gray-500",children:t})]})}),pr={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},gr="bg-white text-gray-900 shadow-sm ring-1 ring-inset ring-[color:var(--ink-faint)] rosh-segmented-on",fr="text-gray-600 hover:text-gray-900";function br({value:e,onChange:t,options:r,name:a,size:l="md",block:i=!1,label:s,className:o="","aria-labelledby":c,"aria-describedby":d}){const u={"aria-label":c?void 0:s,"aria-labelledby":c,"aria-describedby":d},h=oe(),m=`inline-flex max-w-full items-center gap-1 overflow-x-auto rounded-lg bg-gray-100 p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden ${i?"w-full":""} ${o}`.trim(),p=("relative inline-flex shrink-0 "+(i?"flex-1":"")).trim(),g="inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors "+(i?"flex-1":"");/* @__PURE__ */
134
+ return ve("div",a?{role:"radiogroup",...u,className:m,children:r.map(r=>{const i=`${h}-${r.value}`,s=r.value===e,o=/* @__PURE__ */we("label",{htmlFor:i,className:[g,"relative",pr[l],s?gr:fr,r.disabled?"cursor-not-allowed opacity-40":"cursor-pointer"].join(" "),children:[
135
+ /* @__PURE__ */ve("input",{id:i,type:"radio",name:a,value:r.value,checked:s,disabled:r.disabled,"aria-describedby":r.title?`${i}-note`:void 0,onChange:()=>t(r.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),r.icon,r.label,r.title&&/* @__PURE__ */ve("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */ve(n,{content:r.title,className:p,children:o},r.value):o})}:{role:"group",...u,className:m,children:r.map(r=>{const a=r.value===e,i=/* @__PURE__ */we("button",{type:"button","aria-pressed":a,disabled:r.disabled,onClick:()=>t(r.value),className:[g,pr[l],a?gr:fr,"disabled:cursor-not-allowed disabled:opacity-40"].join(" "),children:[r.icon,r.label]},r.value);return r.title?/* @__PURE__ */ve(n,{content:r.title,className:p,children:i},r.value):i})})}var xr={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},yr={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},vr={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},wr=ae(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:s="",disabledReason:o,disabledReasonId:c,...d},u){const h=oe(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=o&&""!==o,b=f?`${m}-reason`:void 0,x=[p,g??b].filter(Boolean).join(" ")||void 0,y=/* @__PURE__ */ve("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":x,disabled:r,onClick:()=>t(!e),...d,className:["relative inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]","disabled:cursor-not-allowed disabled:opacity-40",xr[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */ve("span",{className:["inline-block rounded-full bg-white shadow transition-transform",yr[n],e?vr[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */we("span",{className:`flex items-start gap-3 ${s}`.trim(),children:[y,
136
+ /* @__PURE__ */we("span",{className:"min-w-0",children:[a&&/* @__PURE__ */ve("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */ve("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */ve("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:o})]})]}):/* @__PURE__ */ve("span",{className:s,children:y})});function kr(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var Nr=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function Mr(e){const t=e.trim().replace(",",".");if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}function $r({dir:e,label:t,disabled:r,onStep:n}){const a=se(n);a.current=n;const l=se({}),i=le(()=>{const e=l.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),l.current={}},[]);de(()=>i,[i]),de(()=>{r&&i()},[r,i]);/* @__PURE__ */
137
+ return ve(Me,{size:"sm",tabIndex:-1,"aria-label":t,disabled:r,onPointerDown:e=>{if(0!==e.button||r)return;e.preventDefault(),i();const t=e.shiftKey;a.current(t);const n=e.currentTarget.ownerDocument.defaultView??window;n.addEventListener("pointerup",i),l.current={off:()=>n.removeEventListener("pointerup",i),wait:setTimeout(()=>{l.current.every=setInterval(()=>a.current(t),60)},400)}},onPointerLeave:i,onPointerCancel:i,onClick:e=>{0===e.detail&&a.current(e.shiftKey)},children:/* @__PURE__ */ve("svg",{"aria-hidden":"true",focusable:"false",className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e>0?"M4.5 15.75l7.5-7.5 7.5 7.5":"M19.5 8.25l-7.5 7.5-7.5-7.5"})})})}var Cr=ae(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,shiftStep:i,disabled:s,readOnly:o,invalid:c,placeholder:d,size:u,prefix:h,suffix:m,id:p,name:g,className:f="",onBlur:b,steppers:x=!1,snap:y=!1,allowEmpty:v=!0,"aria-label":w,"aria-labelledby":k},N){const M=K(),[$,C]=ie(()=>Nr(e,a)),L=se($);L.current=$;const D=se(null),j=le(e=>{D.current=e,"function"==typeof N?N(e):N&&(N.current=e)},[N]),P=se(e),S=se(e);S.current=e;const z=Boolean(s||o);de(()=>{Mr(L.current)!==e&&C(Nr(e,a))},[e,a]);const A=e=>{if(z)return;let i=(Mr(L.current)??(d?Mr(d):null)??0)+e;null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n);const s=a??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(s));const o=Nr(i,a);L.current=o,C(o),t(i)},B=se(A);B.current=A;const[F,E]=ie(!1);de(()=>{if(F&&!z)return W(e=>{if("Escape"!==e.key||document.activeElement!==D.current)return!1;const r=P.current;if(Mr(L.current)===r)return!1;const n=Nr(r,a);return L.current=n,C(n),S.current!==r&&t(r),!0})},[F,z,a,t]);const T=()=>{const e=Mr(L.current);if(null==e){if(!v){const e=Nr(S.current,a);return L.current=e,C(e),S.current}return L.current="",C(""),null!==S.current&&t(null),null}let i=e;const s=a??(y?Math.max(kr(l??1),kr(r??0)):void 0);if(y){const e=l??1,t=r??0;i=t+Math.round((i-t)/e)*e}null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n),null!=s&&(i=Number(i.toFixed(s)));const o=Nr(i,a);return L.current=o,C(o),i===e&&i===S.current||t(i),i},I=/* @__PURE__ */ve("input",{ref:j,id:p,name:g,type:"text",inputMode:0===a?"numeric":"decimal",value:$,disabled:s,readOnly:o,placeholder:d,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?d||void 0:Nr(e,a),"aria-invalid":c||void 0,"aria-label":w,"aria-labelledby":k,onChange:e=>(e=>{if(o)return;if(""!==e&&!/^-?\d*[.,]?\d*$/.test(e))return;C(e);const r=Mr(e);(null!==r||v)&&t(r)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!z)return void(P.current=T());const t=l??1,r=i??10*t,n="ArrowUp"===e.key?e.shiftKey?r:t:"ArrowDown"===e.key?-(e.shiftKey?r:t):"PageUp"===e.key?10*t:"PageDown"===e.key?10*-t:null;null===n||z||(e.preventDefault(),A(n))},onFocus:()=>{P.current=S.current,E(!0)},onBlur:()=>{E(!1),T(),b?.()},className:Pe({invalid:c,size:u,readOnly:o,className:[h?"pl-7":"",x?m?"pr-24":"pr-16":m?"pr-9":"","text-right tabular-nums",f].filter(Boolean).join(" ")})});if(!h&&!m&&!x)return I;const O=Mr($);/* @__PURE__ */
138
+ return we("div",{className:"relative",children:[h&&/* @__PURE__ */ve("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:h}),I,m&&/* @__PURE__ */ve("span",{className:`pointer-events-none absolute ${x?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-sm text-gray-500`,children:m}),x&&/* @__PURE__ */we("span",{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[
139
+ /* @__PURE__ */ve($r,{dir:-1,label:M.number.decrease,disabled:z||null!=r&&null!=O&&O<=r,onStep:e=>B.current(-(e?i??10*(l??1):l??1))}),
140
+ /* @__PURE__ */ve($r,{dir:1,label:M.number.increase,disabled:z||null!=n&&null!=O&&O>=n,onStep:e=>B.current(e?i??10*(l??1):l??1)})]})]})}),Lr=(e,t,r)=>Math.min(r,Math.max(t,e));function Dr({value:e,onChange:t,min:r,max:n,step:a=1,precision:l,inputMin:i,inputMax:s,suffix:o,showInput:c=!0,emptyLabel:d,label:u,"aria-labelledby":h,valueText:m,id:p,disabled:g,size:f="md",className:b=""}){const x=K(),y=oe(),v=p??y,w=l??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(a),k=i??r,N=s??n,M=void 0!==d,$=null==e?r:Lr(e,r,n),C=null==e?d:m?m(e):"string"==typeof o?`${e.toFixed(w)} ${o}`:void 0;/* @__PURE__ */
133
141
  return we("div",{className:`flex items-center gap-3 ${b}`.trim(),children:[
134
- /* @__PURE__ */ve("input",{id:v,type:"range",min:r,max:n,step:a,value:D,disabled:g,"aria-label":h?void 0:u,"aria-labelledby":h,"aria-valuetext":P,onChange:e=>t(function(e,t,r,n){return Number(Nr(e,t,r).toFixed(n))}(Number(e.target.value),r,n,w)),className:"min-w-0 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===f?"h-1":"h-1.5")}),c&&/* @__PURE__ */ve("div",{className:"sm"===f?"w-16 shrink-0":"w-20 shrink-0",children:/* @__PURE__ */ve(kr,{value:e,onChange:e=>{if(null==e)return L.current=!0,void(M&&t(null));L.current=!1,e<k||e>N||t(e)},min:k,max:N,step:a,precision:w,suffix:o,disabled:g,placeholder:d,size:"sm","aria-label":u?x.slider.value(u):void 0,"aria-labelledby":u?void 0:h,onBlur:()=>{L.current&&!M&&C(e=>e+1),L.current=!1}},$)})]})}var $r=/(^|[\s:])!?z-/;function Cr({trigger:e,children:t,title:r,description:s,"aria-label":o,align:c="start",side:d="bottom",open:u,defaultOpen:h=!1,onOpenChange:m,matchTriggerWidth:p=!1,maxHeight:g,initialFocus:f,id:b,triggerLabel:x,"aria-describedby":y,disabled:v,className:w="",triggerClassName:k,panelClassName:N=""}){const[M,$]=ie(h),C=(u??M)&&!v,L=te(),z=se(null),A=se(null),B=se(null),F=se(null),T=oe(),E=b??T,I=oe(),O=oe(),R=oe(),q=se(null),U=se(!1),K=se({openProp:u,onOpenChange:m});K.current={openProp:u,onOpenChange:m};const V=le(e=>{void 0===K.current.openProp&&$(e),K.current.onOpenChange?.(e)},[]),Y=le((e=!1)=>{U.current=e,V(!1)},[V]),Z=e=>{q.current=e.nativeEvent},G=le(()=>{const e=B.current,t=A.current;if(!e||!t)return;const r=t.getBoundingClientRect(),i=n(t),s=Math.max(0,i.right-i.left-2*a),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${s}px`,o.maxHeight="none",o.width=p?`${Math.min(r.width,s)}px`:"";const u={width:e.offsetWidth,height:e.offsetHeight},h=g??1/0,m=l({trigger:r,menu:{width:u.width,height:Math.min(u.height,h)},bounds:i,align:c,side:d}),f=Math.min(m.maxHeight,h);o.left=`${m.left}px`,o.top=`${m.top}px`,o.maxHeight=`${f}px`,o.overflowY=u.height>f?"auto":"",e.dataset.side=m.side,e.dataset.align=c},[c,d,p,g]);Q(()=>{C&&L&&G()}),ce(()=>{if(!C||!L)return;const e=i(()=>A.current,G),t=F.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>G());return r.observe(t),()=>{e(),r.disconnect()}},[C,L,G]),ce(()=>{if(!C)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(q.current===e)return!1;const t=e.target;return!(t&&(z.current?.contains(t)||B.current?.contains(t)))})(e)&&Y(!0))},a=e=>{t=e,r=window.setTimeout(()=>n(e),0)},l=e=>n(e);return document.addEventListener(e,a,!0),window.addEventListener(e,l),()=>{window.clearTimeout(r),document.removeEventListener(e,a,!0),window.removeEventListener(e,l)}},t=e("pointerdown"),r=e("focusin"),n=H(()=>Y()),a=W(e=>"Escape"===e.key&&(Y(),A.current?.focus(),!0));return()=>{t(),r(),n(),a()}},[C,Y]),P(B,C&&L),Q(()=>{if(!C||!L)return;const e=B.current;return()=>{if(U.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||A.current?.focus({preventScroll:!0})}},[C,L]),ce(()=>{if(!C||!L)return;const e=B.current;e&&(U.current=!1,(f?.current??j(e)[0]??e).focus({preventScroll:!0}))},[C,L]);const J="function"==typeof t?t({close:()=>Y()}):t,X=r?{"aria-labelledby":O}:o?{"aria-label":o}:{"aria-labelledby":E};/* @__PURE__ */
135
- return we("div",{ref:z,className:`relative inline-flex ${w}`.trim(),children:[
136
- /* @__PURE__ */ve("button",{ref:A,id:E,type:"button","aria-haspopup":"dialog","aria-expanded":C,"aria-controls":C&&L?I:void 0,"aria-label":x,"aria-describedby":y,disabled:v,onClick:()=>C?Y():V(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!C)return;const t=(()=>{const e=B.current;return e?j(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:k??D({variant:"secondary"}),children:e}),C&&L&&Ne(
137
- /* @__PURE__ */ve("div",{ref:B,id:I,role:"dialog",...X,"aria-describedby":s?R:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:Z,onFocusCapture:Z,onKeyDown:e=>{const t=B.current,r=A.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=j(t),a=document.activeElement;if(e.shiftKey){if(n.length>0&&a!==n[0]&&a!==t)return;return e.preventDefault(),void r.focus({preventScroll:!0})}if(n.length>0&&a!==n[n.length-1])return;e.preventDefault();const l=S(r,t);Y(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${N}`.trim(),style:$r.test(N)?void 0:{zIndex:_.popup},children:/* @__PURE__ */we("div",{ref:F,children:[r&&/* @__PURE__ */ve("h2",{id:O,className:"text-sm font-semibold text-gray-900",children:r}),s&&/* @__PURE__ */ve("p",{id:R,className:"mt-1 text-sm text-gray-500",children:s}),r||s?/* @__PURE__ */ve("div",{className:"mt-3",children:J}):J]})}),document.body)]})}var Lr=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function Dr(e){const t=e.trim().replace(/^#/,"");if(!Lr.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var Pr=e=>e.toUpperCase(),jr=(e,t,r)=>Math.min(r,Math.max(t,e));function zr(e){const t=Dr(e);if(!t)return{h:0,s:0,v:0};const r=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255,l=Math.max(r,n,a),i=l-Math.min(r,n,a);let s=0;return 0!==i&&(s=l===r?(n-a)/i%6*60:l===n?60*((a-r)/i+2):60*((r-n)/i+4)),{h:(s+360)%360,s:0===l?0:i/l,v:l}}function Ar({h:e,s:t,v:r}){const n=(e%360+360)%360,a=jr(t,0,1),l=jr(r,0,1),i=l*a,s=i*(1-Math.abs(n/60%2-1)),o=l-i,[c,d,u]=n<60?[i,s,0]:n<120?[s,i,0]:n<180?[0,i,s]:n<240?[0,s,i]:n<300?[s,0,i]:[i,0,s],h=e=>Math.round(255*(e+o)).toString(16).padStart(2,"0");return`#${h(c)}${h(d)}${h(u)}`}var Sr=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>Ar({h:e%360,s:1,v:1})).join(", ")})`,Br={sm:"h-5 w-5",md:"h-7 w-7",lg:"h-9 w-9"},Fr={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function Tr(e){return e?{background:e}:Fr}function Er({size:e="md",selected:t=!1,className:r=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",t?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",Br[e],r].filter(Boolean).join(" ")}var Ir=ae(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
138
- return ve("button",{ref:i,type:a,"aria-pressed":r,className:Er({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"absolute inset-0",style:Tr(e)})})}),Or=(e,t,r)=>Math.min(r,Math.max(t,e)),Rr=e=>"string"==typeof e?{value:e}:e;var Wr={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function Hr({value:e,onChange:t,label:r,presets:n,clearable:a=!1,fallback:l,dragWrites:i="live",disabled:o=!1,onClose:c,id:d,className:u=""}){const h=K().color,m=Dr(l??""),[p,g]=ie(()=>zr(e||m||"")),f=se(e);ce(()=>{e!==f.current&&(f.current=e,e?g(zr(e)):m&&g(zr(m)))},[e]);const b=r=>{o||r===e||(f.current=r,t(r))},x=e=>{const t=Dr(e);t&&(g(zr(t)),b(t))},y=e=>{g(e),b(Ar(e))},[v,w]=ie(!1),k=se(p);k.current=p;const N=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,k.current);"end"===i?(w(!0),g(r)):y(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,k.current);"end"===i?g(r):y(r)},onPointerUp:t=>{"end"===i&&v&&(w(!1),y(e(t,k.current)))}}),M=N((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?jr((r-a.left)/a.width,0,1):0,v:a.height>0?1-jr((n-a.top)/a.height,0,1):0})};var r,n,a}),$=N((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*jr((r-n.left)/n.width,0,1)):0)};var r,n}),C=v?Ar(p):e,L=e=>`${Math.round(100*e)}%`,D=(n??[]).map(Rr),P=Dr(e);/* @__PURE__ */
139
- return we("div",{id:d,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${u}`.trim(),onKeyDown:e=>{"Escape"===e.key&&c&&(e.preventDefault(),e.stopPropagation(),c())},children:[(D.length>0||a)&&/* @__PURE__ */we("div",{role:"group","aria-label":h.presets,className:"flex flex-wrap gap-1.5",children:[a&&/* @__PURE__ */ve(s,{content:h.clear,children:/* @__PURE__ */ve(Ir,{color:"",size:"sm","aria-label":h.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(f.current="",t(""))}})}),D.map(e=>{const t=Dr(e.value),r=e.label?`${e.label} · ${Pr(t??e.value)}`:Pr(t??e.value);/* @__PURE__ */
140
- return ve(s,{content:r,children:/* @__PURE__ */ve(Ir,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===P,disabled:o,onClick:()=>x(e.value)})},`${e.label??""}:${e.value}`)})]}),
141
- /* @__PURE__ */ve("div",{role:"slider",tabIndex:o?-1:0,"aria-label":h.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*p.v),"aria-valuetext":h.squareValue(Math.round(100*p.s),Math.round(100*p.v)),"aria-disabled":o||void 0,"data-color-square":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?.1:.01,a={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[t];return a?{...e,s:Or(e.s+a[0],0,1),v:Or(e.v+a[1],0,1)}:null}(p,e.key,e.shiftKey);t&&(e.preventDefault(),y(t))},...M,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:Ar({h:p.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:L(p.s),top:L(1-p.v),...Wr}})}),
142
- /* @__PURE__ */ve("div",{role:"slider",tabIndex:o?-1:0,"aria-label":h.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(p.h),"aria-orientation":"horizontal","aria-disabled":o||void 0,"data-color-hue":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?10:1;switch(t){case"ArrowLeft":case"ArrowDown":return Or(e-n,0,359);case"ArrowRight":case"ArrowUp":return Or(e+n,0,359);case"PageDown":return Or(e-10,0,359);case"PageUp":return Or(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}(p.h,e.key,e.shiftKey);null!==t&&(e.preventDefault(),y({...p,h:t}))},...$,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:Sr},children:/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:p.h/360*100+"%",background:Ar({h:p.h,s:1,v:1}),...Wr}})}),
142
+ /* @__PURE__ */ve("input",{id:v,type:"range",min:r,max:n,step:a,value:$,disabled:g,"aria-label":h?void 0:u,"aria-labelledby":h,"aria-valuetext":C,onChange:e=>t(function(e,t,r,n){return Number(Lr(e,t,r).toFixed(n))}(Number(e.target.value),r,n,w)),className:"min-w-0 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===f?"h-1":"h-1.5")}),c&&/* @__PURE__ */ve("div",{className:"sm"===f?"w-16 shrink-0":"w-20 shrink-0",children:/* @__PURE__ */ve(Cr,{value:e,onChange:e=>{null!=e?e<k||e>N||t(e):M&&t(null)},min:k,max:N,step:a,precision:w,snap:!0,allowEmpty:M,suffix:o,disabled:g,placeholder:d,size:"sm","aria-label":u?x.slider.value(u):void 0,"aria-labelledby":u?void 0:h})})]})}var jr=/(^|[\s:])!?z-/;function Pr({trigger:e,children:t,title:r,description:n,"aria-label":o,align:c="start",side:d="bottom",open:u,defaultOpen:h=!1,onOpenChange:m,matchTriggerWidth:p=!1,maxHeight:g,initialFocus:f,id:b,triggerLabel:x,"aria-describedby":y,disabled:v,className:w="",triggerClassName:k,panelClassName:N=""}){const[M,$]=ie(h),C=(u??M)&&!v,L=te(),S=se(null),z=se(null),B=se(null),F=se(null),E=oe(),T=b??E,I=oe(),O=oe(),R=oe(),q=se(null),U=se(!1),K=se({openProp:u,onOpenChange:m});K.current={openProp:u,onOpenChange:m};const V=le(e=>{void 0===K.current.openProp&&$(e),K.current.onOpenChange?.(e)},[]),Y=le((e=!1)=>{U.current=e,V(!1)},[V]),Z=e=>{q.current=e.nativeEvent},G=le(()=>{const e=B.current,t=z.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=a(t),s=Math.max(0,n.right-n.left-2*l),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${s}px`,o.maxHeight="none",o.width=p?`${Math.min(r.width,s)}px`:"";const u={width:e.offsetWidth,height:e.offsetHeight},h=g??1/0,m=i({trigger:r,menu:{width:u.width,height:Math.min(u.height,h)},bounds:n,align:c,side:d}),f=Math.min(m.maxHeight,h);o.left=`${m.left}px`,o.top=`${m.top}px`,o.maxHeight=`${f}px`,o.overflowY=u.height>f?"auto":"",e.dataset.side=m.side,e.dataset.align=c},[c,d,p,g]);Q(()=>{C&&L&&G()}),de(()=>{if(!C||!L)return;const e=s(()=>z.current,G),t=F.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>G());return r.observe(t),()=>{e(),r.disconnect()}},[C,L,G]),de(()=>{if(!C)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(q.current===e)return!1;const t=e.target;return!(t&&(S.current?.contains(t)||B.current?.contains(t)))})(e)&&Y(!0))},a=e=>{t=e,r=window.setTimeout(()=>n(e),0)},l=e=>n(e);return document.addEventListener(e,a,!0),window.addEventListener(e,l),()=>{window.clearTimeout(r),document.removeEventListener(e,a,!0),window.removeEventListener(e,l)}},t=e("pointerdown"),r=e("focusin"),n=H(()=>Y()),a=W(e=>"Escape"===e.key&&(Y(),z.current?.focus(),!0),()=>B.current);return()=>{t(),r(),n(),a()}},[C,Y]),j(B,C&&L),Q(()=>{if(!C||!L)return;const e=B.current;return()=>{if(U.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||z.current?.focus({preventScroll:!0})}},[C,L]),de(()=>{if(!C||!L)return;const e=B.current;e&&(U.current=!1,(f?.current??P(e)[0]??e).focus({preventScroll:!0}))},[C,L]);const J="function"==typeof t?t({close:()=>Y()}):t,X=r?{"aria-labelledby":O}:o?{"aria-label":o}:{"aria-labelledby":T};/* @__PURE__ */
143
+ return we("div",{ref:S,className:`relative inline-flex ${w}`.trim(),children:[
144
+ /* @__PURE__ */ve("button",{ref:z,id:T,type:"button","aria-haspopup":"dialog","aria-expanded":C,"aria-controls":C&&L?I:void 0,"aria-label":x,"aria-describedby":y,disabled:v,onClick:()=>C?Y():V(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!C)return;const t=(()=>{const e=B.current;return e?P(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:k??D({variant:"secondary"}),children:e}),C&&L&&Ne(
145
+ /* @__PURE__ */ve("div",{ref:B,id:I,role:"dialog",...X,"aria-describedby":n?R:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:Z,onFocusCapture:Z,onKeyDown:e=>{const t=B.current,r=z.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=P(t),a=document.activeElement;if(e.shiftKey){if(n.length>0&&a!==n[0]&&a!==t)return;return e.preventDefault(),void r.focus({preventScroll:!0})}if(n.length>0&&a!==n[n.length-1])return;e.preventDefault();const l=A(r,t);Y(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${N}`.trim(),style:jr.test(N)?void 0:{zIndex:_.popup},children:/* @__PURE__ */we("div",{ref:F,children:[r&&/* @__PURE__ */ve("h2",{id:O,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */ve("p",{id:R,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */ve("div",{className:"mt-3",children:J}):J]})}),document.body)]})}var Sr=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function zr(e){const t=e.trim().replace(/^#/,"");if(!Sr.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var Ar=e=>e.toUpperCase(),Br=(e,t,r)=>Math.min(r,Math.max(t,e));function Fr(e){const t=zr(e);if(!t)return{h:0,s:0,v:0};const r=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255,l=Math.max(r,n,a),i=l-Math.min(r,n,a);let s=0;return 0!==i&&(s=l===r?(n-a)/i%6*60:l===n?60*((a-r)/i+2):60*((r-n)/i+4)),{h:(s+360)%360,s:0===l?0:i/l,v:l}}function Er({h:e,s:t,v:r}){const n=(e%360+360)%360,a=Br(t,0,1),l=Br(r,0,1),i=l*a,s=i*(1-Math.abs(n/60%2-1)),o=l-i,[c,d,u]=n<60?[i,s,0]:n<120?[s,i,0]:n<180?[0,i,s]:n<240?[0,s,i]:n<300?[s,0,i]:[i,0,s],h=e=>Math.round(255*(e+o)).toString(16).padStart(2,"0");return`#${h(c)}${h(d)}${h(u)}`}var Tr=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>Er({h:e%360,s:1,v:1})).join(", ")})`,Ir={sm:"h-5 w-5",md:"h-7 w-7",lg:"h-9 w-9"},Or={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function Rr(e){return e?{background:e}:Or}function Wr({size:e="md",selected:t=!1,className:r=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",t?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",Ir[e],r].filter(Boolean).join(" ")}var Hr=ae(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
146
+ return ve("button",{ref:i,type:a,"aria-pressed":r,className:Wr({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"absolute inset-0",style:Rr(e)})})}),_r=(e,t,r)=>Math.min(r,Math.max(t,e)),qr=e=>"string"==typeof e?{value:e}:e;var Ur={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function Kr({value:e,onChange:t,label:r,presets:a,clearable:l=!1,fallback:i,dragWrites:s="live",disabled:o=!1,onClose:c,id:d,className:u=""}){const h=K().color,m=zr(i??""),[p,g]=ie(()=>Fr(e||m||"")),f=se(e);de(()=>{e!==f.current&&(f.current=e,e?g(Fr(e)):m&&g(Fr(m)))},[e]);const b=r=>{o||r===e||(f.current=r,t(r))},x=e=>{const t=zr(e);t&&(g(Fr(t)),b(t))},y=e=>{g(e),b(Er(e))},[v,w]=ie(!1),k=se(p);k.current=p;const N=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,k.current);"end"===s?(w(!0),g(r)):y(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,k.current);"end"===s?g(r):y(r)},onPointerUp:t=>{"end"===s&&v&&(w(!1),y(e(t,k.current)))}}),M=N((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?Br((r-a.left)/a.width,0,1):0,v:a.height>0?1-Br((n-a.top)/a.height,0,1):0})};var r,n,a}),$=N((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*Br((r-n.left)/n.width,0,1)):0)};var r,n}),C=v?Er(p):e,L=e=>`${Math.round(100*e)}%`,D=(a??[]).map(qr),j=zr(e);/* @__PURE__ */
147
+ return we("div",{id:d,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${u}`.trim(),onKeyDown:e=>{"Escape"===e.key&&c&&(e.preventDefault(),e.stopPropagation(),c())},children:[(D.length>0||l)&&/* @__PURE__ */we("div",{role:"group","aria-label":h.presets,className:"flex flex-wrap gap-1.5",children:[l&&/* @__PURE__ */ve(n,{content:h.clear,children:/* @__PURE__ */ve(Hr,{color:"",size:"sm","aria-label":h.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(f.current="",t(""))}})}),D.map(e=>{const t=zr(e.value),r=e.label?`${e.label} · ${Ar(t??e.value)}`:Ar(t??e.value);/* @__PURE__ */
148
+ return ve(n,{content:r,children:/* @__PURE__ */ve(Hr,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===j,disabled:o,onClick:()=>x(e.value)})},`${e.label??""}:${e.value}`)})]}),
149
+ /* @__PURE__ */ve("div",{role:"slider",tabIndex:o?-1:0,"aria-label":h.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*p.v),"aria-valuetext":h.squareValue(Math.round(100*p.s),Math.round(100*p.v)),"aria-disabled":o||void 0,"data-color-square":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?.1:.01,a={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[t];return a?{...e,s:_r(e.s+a[0],0,1),v:_r(e.v+a[1],0,1)}:null}(p,e.key,e.shiftKey);t&&(e.preventDefault(),y(t))},...M,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:Er({h:p.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:L(p.s),top:L(1-p.v),...Ur}})}),
150
+ /* @__PURE__ */ve("div",{role:"slider",tabIndex:o?-1:0,"aria-label":h.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(p.h),"aria-orientation":"horizontal","aria-disabled":o||void 0,"data-color-hue":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?10:1;switch(t){case"ArrowLeft":case"ArrowDown":return _r(e-n,0,359);case"ArrowRight":case"ArrowUp":return _r(e+n,0,359);case"PageDown":return _r(e-10,0,359);case"PageUp":return _r(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}(p.h,e.key,e.shiftKey);null!==t&&(e.preventDefault(),y({...p,h:t}))},...$,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:Tr},children:/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:p.h/360*100+"%",background:Er({h:p.h,s:1,v:1}),...Ur}})}),
143
151
  /* @__PURE__ */we("div",{className:"flex items-center gap-2",children:[
144
- /* @__PURE__ */ve("span",{"aria-hidden":"true",className:"relative h-7 w-7 shrink-0 overflow-hidden rounded-md border border-gray-300",style:Tr(C||(m??""))}),
145
- /* @__PURE__ */ve(_r,{value:C,placeholder:!e&&m?Pr(m):void 0,onChange:x,label:h.hex(r),disabled:o})]})]})}function _r({value:e,onChange:t,label:r,placeholder:n,disabled:a,id:l,className:i=""}){const[s,o]=ie(null);/* @__PURE__ */
146
- return ve("input",{id:l,type:"text",value:s??(e?Pr(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{o(r.target.value);const n=Dr(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),o(null))},onBlur:()=>o(null),className:je({size:"sm",className:`min-w-0 flex-1 font-mono uppercase ${i}`.trim()})})}function qr({value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:s,id:o,showHexInput:c=!1,size:d="md",align:u="start",open:h,onOpenChange:m,className:p=""}){const g=K().color,f=oe(),b=Dr(l??""),x=e||b||"",y=e?Pr(e):b?Pr(b):g.none;/* @__PURE__ */
152
+ /* @__PURE__ */ve("span",{"aria-hidden":"true",className:"relative h-7 w-7 shrink-0 overflow-hidden rounded-md border border-gray-300",style:Rr(C||(m??""))}),
153
+ /* @__PURE__ */ve(Vr,{value:C,placeholder:!e&&m?Ar(m):void 0,onChange:x,label:h.hex(r),disabled:o})]})]})}function Vr({value:e,onChange:t,label:r,placeholder:n,disabled:a,id:l,className:i=""}){const[s,o]=ie(null);/* @__PURE__ */
154
+ return ve("input",{id:l,type:"text",value:s??(e?Ar(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{o(r.target.value);const n=zr(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),o(null))},onBlur:()=>o(null),className:Pe({size:"sm",className:`min-w-0 flex-1 font-mono uppercase ${i}`.trim()})})}function Yr({value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:s,id:o,showHexInput:c=!1,size:d="md",align:u="start",open:h,onOpenChange:m,className:p=""}){const g=K().color,f=oe(),b=zr(l??""),x=e||b||"",y=e?Ar(e):b?Ar(b):g.none;/* @__PURE__ */
147
155
  return we("div",{className:`inline-flex items-center gap-2 ${p}`.trim(),children:[
148
- /* @__PURE__ */ve(Cr,{id:o,trigger:/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"absolute inset-0",style:Tr(x)}),triggerLabel:g.swatch(r,y),triggerClassName:Er({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:s,children:/* @__PURE__ */ve(Hr,{id:f,value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:s})}),c&&
149
- /* @__PURE__ */ve("div",{className:"w-24 flex-none",children:/* @__PURE__ */ve(_r,{value:e,placeholder:!e&&b?Pr(b):void 0,onChange:r=>{s||r===e||t(r)},label:g.hex(r),disabled:s})})]})}var Ur=ae(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:s=!1,label:o,hint:c,error:d,required:u,className:h=""},m){const p=oe(),g=K().files,y=f({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:s,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),v=d?`${p}-error`:c?`${p}-hint`:void 0;/* @__PURE__ */
150
- return we(qe,{label:o,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
151
- /* @__PURE__ */we("button",{ref:m,type:"button",id:p,disabled:s,onClick:y.open,"aria-invalid":!!d||void 0,"aria-required":u||void 0,"aria-describedby":v,...y.zoneProps,className:tt(y.dragOver,s,`px-4 py-6 ${rt(s)}`),children:[
156
+ /* @__PURE__ */ve(Pr,{id:o,trigger:/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"absolute inset-0",style:Rr(x)}),triggerLabel:g.swatch(r,y),triggerClassName:Wr({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:s,children:/* @__PURE__ */ve(Kr,{id:f,value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:s})}),c&&
157
+ /* @__PURE__ */ve("div",{className:"w-24 flex-none",children:/* @__PURE__ */ve(Vr,{value:e,placeholder:!e&&b?Ar(b):void 0,onChange:r=>{s||r===e||t(r)},label:g.hex(r),disabled:s})})]})}var Zr=ae(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:s=!1,label:o,hint:c,error:d,required:u,className:h=""},m){const p=oe(),g=K().files,y=f({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:s,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),v=d?`${p}-error`:c?`${p}-hint`:void 0;/* @__PURE__ */
158
+ return we(Ke,{label:o,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
159
+ /* @__PURE__ */we("button",{ref:m,type:"button",id:p,disabled:s,onClick:y.open,"aria-invalid":!!d||void 0,"aria-required":u||void 0,"aria-describedby":v,...y.zoneProps,className:nt(y.dragOver,s,`px-4 py-6 ${at(s)}`),children:[
152
160
  /* @__PURE__ */we("span",{children:[
153
161
  /* @__PURE__ */ve("span",{className:"text-sm font-medium text-blue-600",children:a?g.chooseMany:g.chooseOne}),
154
162
  /* @__PURE__ */ve("span",{className:"text-sm text-gray-500",children:` ${a?g.dragMany:g.dragOne}`})]}),n&&/* @__PURE__ */ve("span",{className:"text-xs text-gray-400",children:n})]}),
155
163
  /* @__PURE__ */ve("input",{...y.inputProps}),e.length>0&&/* @__PURE__ */ve("ul",{className:"mt-2 flex flex-col gap-1",children:e.map((r,n)=>/* @__PURE__ */we("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
156
164
  /* @__PURE__ */ve("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:r.name,children:r.name}),
157
165
  /* @__PURE__ */ve("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:b(r.size,g)}),
158
- /* @__PURE__ */ve("button",{type:"button",disabled:s,onClick:()=>{y.clearRejections(),t(e.filter((e,t)=>t!==n))},"aria-label":g.remove(r.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */ve(st,{})})]},`${r.name}-${n}`))}),
159
- /* @__PURE__ */ve(x,{rejections:y.rejections})]})});function Kr({className:e="h-4 w-4"}){/* @__PURE__ */
160
- return ve("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:/* @__PURE__ */ve("path",{d:"M21 11.5l-8.5 8.5a5.5 5.5 0 0 1-7.8-7.8l9-9a3.5 3.5 0 0 1 5 5l-9 9a1.5 1.5 0 0 1-2.1-2.1l8-8"})})}function Vr({className:e="h-4 w-4"}){/* @__PURE__ */
166
+ /* @__PURE__ */ve("button",{type:"button",disabled:s,onClick:()=>{y.clearRejections(),t(e.filter((e,t)=>t!==n))},"aria-label":g.remove(r.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */ve(ct,{})})]},`${r.name}-${n}`))}),
167
+ /* @__PURE__ */ve(x,{rejections:y.rejections})]})});function Gr({className:e="h-4 w-4"}){/* @__PURE__ */
168
+ return ve("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:/* @__PURE__ */ve("path",{d:"M21 11.5l-8.5 8.5a5.5 5.5 0 0 1-7.8-7.8l9-9a3.5 3.5 0 0 1 5 5l-9 9a1.5 1.5 0 0 1-2.1-2.1l8-8"})})}function Jr({className:e="h-4 w-4"}){/* @__PURE__ */
161
169
  return we("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
162
170
  /* @__PURE__ */ve("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),
163
- /* @__PURE__ */ve("path",{d:"M14 3v5h5"})]})}function Yr({intake:e,dropLabel:t,className:r="",children:n}){const a=K().files;/* @__PURE__ */
171
+ /* @__PURE__ */ve("path",{d:"M14 3v5h5"})]})}function Xr({intake:e,dropLabel:t,className:r="",children:n}){const a=K().files;/* @__PURE__ */
164
172
  return we("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,children:[n,
165
- /* @__PURE__ */ve("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */ve("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function Zr({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=K().files,l=se(/* @__PURE__ */new Map);ce(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),ce(()=>()=>{for(const e of l.current.values())URL.revokeObjectURL(e);l.current.clear()},[]);const i=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=l.current.get(e);return t||(t=URL.createObjectURL(e),l.current.set(e,t)),t};return 0===e.length?null:/* @__PURE__ */ve("ul",{className:`flex flex-wrap gap-1.5 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
166
- return we("li",{className:"flex max-w-full items-center gap-1.5 rounded-md border border-gray-200 bg-gray-50 py-1 pl-1.5 pr-1 text-xs text-gray-700",children:[l?/* @__PURE__ */ve("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */ve("span",{className:"text-gray-400",children:/* @__PURE__ */ve(Vr,{})}),
173
+ /* @__PURE__ */ve("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */ve("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function Qr({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=K().files,l=se(/* @__PURE__ */new Map);de(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),de(()=>()=>{for(const e of l.current.values())URL.revokeObjectURL(e);l.current.clear()},[]);const i=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=l.current.get(e);return t||(t=URL.createObjectURL(e),l.current.set(e,t)),t};return 0===e.length?null:/* @__PURE__ */ve("ul",{className:`flex flex-wrap gap-1.5 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
174
+ return we("li",{className:"flex max-w-full items-center gap-1.5 rounded-md border border-gray-200 bg-gray-50 py-1 pl-1.5 pr-1 text-xs text-gray-700",children:[l?/* @__PURE__ */ve("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */ve("span",{className:"text-gray-400",children:/* @__PURE__ */ve(Jr,{})}),
167
175
  /* @__PURE__ */ve("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
168
- /* @__PURE__ */ve("span",{className:"shrink-0 tabular-nums text-gray-400",children:b(e.size,a)}),t&&/* @__PURE__ */ve("button",{type:"button",disabled:r,onClick:()=>t(n),"aria-label":a.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */ve(st,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function Gr({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=K().files,i=n??l.attach,s=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */we("span",{className:"relative inline-flex",children:[
169
- /* @__PURE__ */ve(Me,{"aria-label":s,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */ve(Kr,{})}),t>0&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-[10px] font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */ve(L,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */ve(Kr,{}),children:s})}function Jr({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i=!1,dropLabel:s,attachLabel:o,trigger:c="button",actions:d,onReject:u,className:h="",children:m}){const p=f({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),g=se([]);return ce(()=>{u&&p.rejections.length>0&&p.rejections!==g.current&&(g.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */we(Yr,{intake:p,dropLabel:s,className:h,children:[m,
170
- /* @__PURE__ */ve(Zr,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
176
+ /* @__PURE__ */ve("span",{className:"shrink-0 tabular-nums text-gray-400",children:b(e.size,a)}),t&&/* @__PURE__ */ve("button",{type:"button",disabled:r,onClick:()=>t(n),"aria-label":a.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */ve(ct,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function en({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=K().files,i=n??l.attach,s=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */we("span",{className:"relative inline-flex",children:[
177
+ /* @__PURE__ */ve(Me,{"aria-label":s,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */ve(Gr,{})}),t>0&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-[10px] font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */ve(L,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */ve(Gr,{}),children:s})}function tn({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i=!1,dropLabel:s,attachLabel:o,trigger:c="button",actions:d,onReject:u,className:h="",children:m}){const p=f({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),g=se([]);return de(()=>{u&&p.rejections.length>0&&p.rejections!==g.current&&(g.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */we(Xr,{intake:p,dropLabel:s,className:h,children:[m,
178
+ /* @__PURE__ */ve(Qr,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
171
179
  /* @__PURE__ */we("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
172
- /* @__PURE__ */ve(Gr,{onClick:p.open,count:e.length,variant:c,label:o,disabled:i}),d]}),
173
- /* @__PURE__ */ve(x,{rejections:p.rejections})]})}function Xr({onClear:e,ariaLabel:t}){/* @__PURE__ */
174
- return ve("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function Qr({value:e,onChange:n,options:a,placeholder:l,emptyOptionLabel:i,className:s="",disabled:o,id:c,allowFreeText:d=!1,onSearchChange:u,rightAdornment:h,renderOption:m}){const[p,g]=ie(!1),[f,b]=ie(""),x=K(),y=i??x.select.none,v=e=>{b(e),u?.(e)},w=se(null),k=se(null),N=se(null),M=se(null),$=se(p);$.current=p;const C=se(!1),L=t=>{if(!$.current)return;$.current=!1;const r=f.trim();t&&d&&r&&r!==e&&n(r),g(!1),v("")},[D,P]=ie(null);Q(()=>{if(!h||p)return void P(null);const t=M.current?.offsetWidth??0;P(t?t+(e&&!o?32:8)+6:null)});const j=t(k,p,{matchTriggerWidth:!0}),z=ue(()=>{const t=a.find(t=>t.value===e);return t?t.label:d?e:""},[a,e,d]);ce(()=>{if(!p)return;const e=e=>{const t=e.target;w.current?.contains(t)||N.current?.contains(t)||L(!0)};document.addEventListener("mousedown",e);const t=H(()=>L(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[p,d,f,e,n]),ce(()=>{if(p)return W(e=>!("Escape"!==e.key||!$.current)&&(L(!1),k.current?.blur(),!0))},[p]);const A=ue(()=>{const e=/* @__PURE__ */new Set,t=[];for(const r of a)e.has(r.value)||(e.add(r.value),t.push(r));return t},[a]),S=ue(()=>{if(u)return A;const e=f.trim().toLowerCase();return e?A.filter(t=>t.label.toLowerCase().includes(e)||(t.sublabel?.toLowerCase().includes(e)??!1)):A},[A,f,u]);/* @__PURE__ */
175
- return we("div",{ref:w,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(w.current?.contains(t)||N.current?.contains(t))||C.current||document.activeElement!==k.current&&L(!0)},children:[
176
- /* @__PURE__ */ve("input",{id:c,ref:k,type:"text",autoComplete:"off",role:"combobox","aria-expanded":p,value:p?f:z,onChange:e=>{v(e.target.value),g(!0)},onFocus:()=>{o||(v(""),g(!0))},onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),1===S.length?(n(S[0].value),L(!1)):d&&f.trim()&&(n(f.trim()),L(!1),k.current?.blur())):"Escape"===e.key?(L(!1),k.current?.blur()):"Tab"===e.key&&L(!0)},placeholder:l||y,className:`${De} ${s} ${e?"pr-8":""} ${o?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate`,style:D?{paddingRight:D}:void 0,disabled:o}),e&&!o&&/* @__PURE__ */ve(Xr,{ariaLabel:x.select.clear,onClear:()=>{n(""),L(!1)}}),h&&!p&&/* @__PURE__ */ve("div",{ref:M,className:`absolute top-1/2 -translate-y-1/2 ${e&&!o?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:h}),p&&Ne(
177
- /* @__PURE__ */ve("div",{ref:N,onMouseDownCapture:()=>{C.current=!0,setTimeout(()=>{C.current=!1},0)},className:"fixed rounded-2xl overflow-hidden",style:{zIndex:_.popup,left:j?.left,right:j?.right,top:j?.top,bottom:j?.bottom,minWidth:j?.minWidth,width:j?.width,visibility:j?void 0:"hidden",...B()},children:/* @__PURE__ */ve("div",{className:"overflow-y-auto",style:{maxHeight:j?.maxHeight??r},children:0===S.length?/* @__PURE__ */ve("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:x.select.noMatches}):S.map(t=>/* @__PURE__ */we("button",{type:"button",onMouseDown:()=>{n(t.value),L(!1)},className:"w-full overflow-hidden text-left px-3 py-1.5 text-sm hover:bg-gray-50 flex items-center justify-between gap-2 whitespace-nowrap "+(e===t.value?"text-blue-600 font-medium bg-blue-50/50":"text-gray-700"),children:[
178
- /* @__PURE__ */ve("span",{className:"min-w-0 flex-1 truncate",children:m?m(t,{selected:e===t.value}):t.label}),t.sublabel&&/* @__PURE__ */ve("span",{className:"min-w-0 max-w-[45%] shrink-0 truncate text-xs text-gray-400",children:t.sublabel})]},t.value))})}),document.body)]})}function en({value:e,onChange:n,options:a=[],placeholder:l,allowFreeText:i=!1,invalid:s,disabled:c,id:d,className:u=""}){const[h,m]=ie(!1),[p,g]=ie(""),f=K(),b=se(null),x=se(null),y=se(null),v=t(b,h),w=e=>a.find(t=>t.value===e)?.label??e,k=ue(()=>{const t=new Set(e),r=[],n=p.trim().toLowerCase();for(const e of a)t.has(e.value)||(t.add(e.value),n&&!e.label.toLowerCase().includes(n)||r.push(e));return r},[a,e,p]),N=t=>{t&&!e.includes(t)?(n([...e,t]),g("")):g("")},M=t=>n(e.filter(e=>e!==t)),$=()=>{const e=p.trim();i&&e?N(e):g("")},C=se(()=>{});C.current=()=>{$(),m(!1)},ce(()=>{if(!h)return;const e=e=>{const t=e.target;b.current?.contains(t)||y.current?.contains(t)||($(),m(!1))};document.addEventListener("mousedown",e);const t=H(()=>C.current());return()=>{document.removeEventListener("mousedown",e),t()}});const L=a.length>0;/* @__PURE__ */
180
+ /* @__PURE__ */ve(en,{onClick:p.open,count:e.length,variant:c,label:o,disabled:i}),d]}),
181
+ /* @__PURE__ */ve(x,{rejections:p.rejections})]})}function rn({onClear:e,ariaLabel:t}){/* @__PURE__ */
182
+ return ve("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function nn({value:e,onChange:n,options:a,placeholder:l,emptyOptionLabel:i,className:s="",disabled:o,id:c,allowFreeText:d=!1,onSearchChange:u,rightAdornment:h,renderOption:m,"aria-label":p,"aria-labelledby":g,"aria-describedby":f}){const[b,x]=ie(!1),[y,v]=ie(-1),w=oe(),k=c??`${w}-input`,N=`${w}-listbox`,M=e=>`${w}-opt-${e}`,[$,C]=ie(""),L=K(),D=i??L.select.none,j=e=>{C(e),v(-1),u?.(e)},P=se(null),S=se(null),z=se(null),A=se(null),F=se(b);F.current=b;const E=se(!1),T=t=>{if(!F.current)return;F.current=!1;const r=$.trim();t&&d&&r&&r!==e&&n(r),x(!1),j("")},[I,O]=ie(null);Q(()=>{if(!h||b)return void O(null);const t=A.current?.offsetWidth??0;O(t?t+(e&&!o?32:8)+6:null)});const R=t(S,b,{matchTriggerWidth:!0}),q=ce(()=>{const t=a.find(t=>t.value===e);return t?t.label:d?e:""},[a,e,d]);de(()=>{if(!b)return;const e=e=>{const t=e.target;P.current?.contains(t)||z.current?.contains(t)||T(!0)};document.addEventListener("mousedown",e);const t=H(()=>T(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[b,d,$,e,n]),de(()=>{if(b)return W(e=>!("Escape"!==e.key||!F.current)&&(T(!1),S.current?.blur(),!0),()=>z.current)},[b]);const U=ce(()=>{const e=/* @__PURE__ */new Set,t=[];for(const r of a)e.has(r.value)||(e.add(r.value),t.push(r));return t},[a]),V=ce(()=>{if(u)return U;const e=$.trim().toLowerCase();return e?U.filter(t=>t.label.toLowerCase().includes(e)||(t.sublabel?.toLowerCase().includes(e)??!1)):U},[U,$,u]);/* @__PURE__ */
183
+ return we("div",{ref:P,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(P.current?.contains(t)||z.current?.contains(t))||E.current||document.activeElement!==S.current&&T(!0)},children:[
184
+ /* @__PURE__ */ve("input",{id:k,ref:S,type:"text",autoComplete:"off",role:"combobox","aria-expanded":b,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":b?N:void 0,"aria-activedescendant":b&&y>=0&&y<V.length?M(y):void 0,"aria-label":g?void 0:p,"aria-labelledby":g,"aria-describedby":f,value:b?$:q,onChange:e=>{j(e.target.value),x(!0)},onFocus:()=>{o||(j(""),x(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(o)return;if(e.preventDefault(),!b)return void x(!0);const t=V.length-1;if(t<0)return;return void v(r=>"ArrowDown"===e.key?r<0?0:Math.min(r+1,t):r<0?t:Math.max(r-1,0))}"Enter"===e.key?(e.preventDefault(),b&&y>=0&&y<V.length?(n(V[y].value),T(!1)):1===V.length?(n(V[0].value),T(!1)):d&&$.trim()&&(n($.trim()),T(!1),S.current?.blur())):"Escape"===e.key?(T(!1),S.current?.blur()):"Tab"===e.key&&T(!0)},placeholder:l||D,className:`${De} ${s} ${e?"pr-8":""} ${o?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate`,style:I?{paddingRight:I}:void 0,disabled:o}),e&&!o&&/* @__PURE__ */ve(rn,{ariaLabel:L.select.clear,onClear:()=>{n(""),T(!1)}}),h&&!b&&/* @__PURE__ */ve("div",{ref:A,className:`absolute top-1/2 -translate-y-1/2 ${e&&!o?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:h}),b&&Ne(
185
+ /* @__PURE__ */ve("div",{ref:z,onMouseDownCapture:()=>{E.current=!0,setTimeout(()=>{E.current=!1},0)},className:"fixed rounded-2xl overflow-hidden",style:{zIndex:_.popup,left:R?.left,right:R?.right,top:R?.top,bottom:R?.bottom,minWidth:R?.minWidth,width:R?.width,visibility:R?void 0:"hidden",...B()},children:/* @__PURE__ */ve("div",{id:N,role:V.length?"listbox":void 0,"aria-labelledby":V.length?g??(p?void 0:k):void 0,"aria-label":V.length&&!g?p:void 0,className:"overflow-y-auto",style:{maxHeight:R?.maxHeight??r},children:0===V.length?/* @__PURE__ */ve("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:L.select.noMatches}):V.map((t,r)=>/* @__PURE__ */we("button",{id:M(r),type:"button",role:"option","aria-selected":e===t.value,tabIndex:-1,onMouseDown:()=>{n(t.value),T(!1)},className:`w-full overflow-hidden text-left px-3 py-1.5 text-sm hover:bg-gray-50 flex items-center justify-between gap-2 whitespace-nowrap ${e===t.value?"text-blue-600 font-medium":"text-gray-700"} ${r===y?"bg-gray-100":e===t.value?"bg-blue-50/50":""}`,children:[
186
+ /* @__PURE__ */ve("span",{className:"min-w-0 flex-1 truncate",children:m?m(t,{selected:e===t.value}):t.label}),t.sublabel&&/* @__PURE__ */ve("span",{className:"min-w-0 max-w-[45%] shrink-0 truncate text-xs text-gray-400",children:t.sublabel})]},t.value))})}),document.body)]})}function an({value:e,onChange:n,options:a=[],placeholder:l,allowFreeText:i=!1,invalid:s,disabled:c,id:d,className:u=""}){const[h,m]=ie(!1),[p,g]=ie(""),f=K(),b=se(null),x=se(null),y=se(null),v=t(b,h),w=e=>a.find(t=>t.value===e)?.label??e,k=ce(()=>{const t=new Set(e),r=[],n=p.trim().toLowerCase();for(const e of a)t.has(e.value)||(t.add(e.value),n&&!e.label.toLowerCase().includes(n)||r.push(e));return r},[a,e,p]),N=t=>{t&&!e.includes(t)?(n([...e,t]),g("")):g("")},M=t=>n(e.filter(e=>e!==t)),$=()=>{const e=p.trim();i&&e?N(e):g("")},C=se(()=>{});C.current=()=>{$(),m(!1)},de(()=>{if(!h)return;const e=e=>{const t=e.target;b.current?.contains(t)||y.current?.contains(t)||($(),m(!1))};document.addEventListener("mousedown",e);const t=H(()=>C.current());return()=>{document.removeEventListener("mousedown",e),t()}});const L=a.length>0;/* @__PURE__ */
179
187
  return we("div",{ref:b,className:"relative",children:[
180
- /* @__PURE__ */we("div",{onMouseDown:e=>{c||e.target.closest("button")||(e.preventDefault(),x.current?.focus())},className:je({invalid:s,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${c?"bg-gray-50 cursor-not-allowed":""} ${u}`}),children:[e.map(e=>/* @__PURE__ */we("span",{className:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-1.5 py-0.5 text-xs font-medium text-blue-700",children:[
188
+ /* @__PURE__ */we("div",{onMouseDown:e=>{c||e.target.closest("button")||(e.preventDefault(),x.current?.focus())},className:Pe({invalid:s,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${c?"bg-gray-50 cursor-not-allowed":""} ${u}`}),children:[e.map(e=>/* @__PURE__ */we("span",{className:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-1.5 py-0.5 text-xs font-medium text-blue-700",children:[
181
189
  /* @__PURE__ */ve("span",{className:"truncate",children:w(e)}),!c&&/* @__PURE__ */ve("button",{type:"button","aria-label":f.select.removeItem?.(w(e))??`${f.select.remove} ${w(e)}`,onClick:()=>M(e),className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none",children:"×"})]},e)),
182
190
  /* @__PURE__ */ve("input",{id:d,ref:x,type:"text",autoComplete:"off",role:"combobox","aria-expanded":h&&L,"aria-invalid":s||void 0,disabled:c,value:p,placeholder:0===e.length?l:void 0,onChange:e=>{g(e.target.value),m(!0)},onFocus:()=>{!c&&L&&m(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&i){t.preventDefault();const e=p.trim(),r=e?k.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())):[];1===r.length?N(r[0].value):$()}else"Backspace"===t.key&&""===p&&e.length>0?M(e[e.length-1]):"Escape"===t.key?(m(!1),g(""),x.current?.blur()):"Tab"===t.key&&($(),m(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),h&&L&&Ne(
183
- /* @__PURE__ */ve("div",{ref:y,className:"fixed rounded-2xl overflow-hidden",style:{zIndex:_.popup,left:v?.left,right:v?.right,top:v?.top,bottom:v?.bottom,minWidth:v?.minWidth,maxWidth:v?.maxWidth??o,width:"max-content",visibility:v?void 0:"hidden",...B()},children:/* @__PURE__ */ve("div",{className:"overflow-y-auto",style:{maxHeight:v?.maxHeight??r},children:0===k.length?/* @__PURE__ */ve("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:a.length>0&&e.length>=a.length?f.select.allSelected:f.select.noMatches}):k.map(e=>/* @__PURE__ */ve("button",{type:"button",onMouseDown:t=>{t.preventDefault(),N(e.value)},className:"w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.label},e.value))})}),document.body)]})}var tn={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}};function rn({children:e,header:t,footer:r,padded:n=!0,padding:a,headingLevel:l,headerActions:i,"aria-label":s,className:o="",bodyClassName:c="",style:d}){const u=tn[a??(n?"md":"none")],h=oe(),m=null!=l&&null!=t,p=`h${l}`,g=m||null!=s&&""!==s,f=g?"section":"div",b=`rounded-lg border border-gray-200 bg-white shadow-sm ${o}`.trim(),x=`border-b border-gray-100 ${u.edge} text-sm font-semibold text-gray-900`;/* @__PURE__ */
191
+ /* @__PURE__ */ve("div",{ref:y,className:"fixed rounded-2xl overflow-hidden",style:{zIndex:_.popup,left:v?.left,right:v?.right,top:v?.top,bottom:v?.bottom,minWidth:v?.minWidth,maxWidth:v?.maxWidth??o,width:"max-content",visibility:v?void 0:"hidden",...B()},children:/* @__PURE__ */ve("div",{className:"overflow-y-auto",style:{maxHeight:v?.maxHeight??r},children:0===k.length?/* @__PURE__ */ve("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:a.length>0&&e.length>=a.length?f.select.allSelected:f.select.noMatches}):k.map(e=>/* @__PURE__ */ve("button",{type:"button",onMouseDown:t=>{t.preventDefault(),N(e.value)},className:"w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.label},e.value))})}),document.body)]})}var ln={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}};function sn({children:e,header:t,footer:r,padded:n=!0,padding:a,headingLevel:l,headerActions:i,"aria-label":s,className:o="",bodyClassName:c="",style:d}){const u=ln[a??(n?"md":"none")],h=oe(),m=null!=l&&null!=t,p=`h${l}`,g=m||null!=s&&""!==s,f=g?"section":"div",b=`rounded-lg border border-gray-200 bg-white shadow-sm ${o}`.trim(),x=`border-b border-gray-100 ${u.edge} text-sm font-semibold text-gray-900`;/* @__PURE__ */
184
192
  return we(f,{className:b,style:d,...m?{"aria-labelledby":h}:g?{"aria-label":s}:{},children:[null!=t&&(null!=i?
185
193
  /* @__PURE__ */we("div",{className:`${x} flex items-center justify-between gap-3`,children:[m?/* @__PURE__ */ve(p,{id:h,children:t}):/* @__PURE__ */ve("span",{children:t}),i]}):m?
186
194
  /* @__PURE__ */ve(p,{id:h,className:x,children:t}):/* @__PURE__ */ve("div",{className:x,children:t})),
187
- /* @__PURE__ */ve("div",{className:[u.body,c].filter(Boolean).join(" "),children:e}),r&&/* @__PURE__ */ve("div",{className:`border-t border-gray-100 ${u.edge}`,children:r})]})}function nn({label:e,value:t,icon:r,delta:n,className:a=""}){const l=U(),i="number"==typeof t&&l?Z(t,l):t,s="up"===n?.direction?"text-green-600":"down"===n?.direction?"text-red-600":"text-gray-500",o="up"===n?.direction?"▲":"down"===n?.direction?"▼":"→";/* @__PURE__ */
195
+ /* @__PURE__ */ve("div",{className:[u.body,c].filter(Boolean).join(" "),children:e}),r&&/* @__PURE__ */ve("div",{className:`border-t border-gray-100 ${u.edge}`,children:r})]})}function on({label:e,value:t,icon:r,delta:n,className:a=""}){const l=U(),i="number"==typeof t&&l?Z(t,l):t,s="up"===n?.direction?"text-green-600":"down"===n?.direction?"text-red-600":"text-gray-500",o="up"===n?.direction?"▲":"down"===n?.direction?"▼":"→";/* @__PURE__ */
188
196
  return we("div",{className:`rounded-lg border border-gray-200 bg-white p-4 shadow-sm ${a}`.trim(),children:[
189
197
  /* @__PURE__ */we("div",{className:"flex items-center justify-between",children:[
190
198
  /* @__PURE__ */ve("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),r&&/* @__PURE__ */ve("span",{className:"text-gray-400",children:r})]}),
191
199
  /* @__PURE__ */we("div",{className:"mt-2 flex items-baseline gap-2",children:[
192
- /* @__PURE__ */ve("span",{className:"text-2xl font-semibold text-gray-900",children:i}),n&&/* @__PURE__ */we("span",{className:`text-xs font-medium ${s}`,children:[o," ",n.value]})]})]})}var an={default:"text-gray-900",secondary:"text-gray-500",tertiary:"text-gray-400",disabled:"text-gray-300",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600",link:"text-blue-600",inherit:""},ln={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},sn={normal:"font-normal",medium:"font-medium",semibold:"font-semibold"};function on({children:e,tone:t="default",size:r="sm",weight:n="normal",truncate:a=!1,as:l="span",className:i="",...s}){/* @__PURE__ */
193
- return ve(l,{className:[an[t],ln[r],sn[n],a?"block truncate":"",i].filter(Boolean).join(" "),title:s.title??(a&&"string"==typeof e?e:void 0),htmlFor:s.htmlFor,children:e})}var cn={1:"text-2xl font-semibold",2:"text-xl font-semibold",3:"text-lg font-semibold",4:"text-base font-semibold",5:"text-sm font-semibold"};function dn({children:e,level:t=2,tone:r="default",className:n=""}){/* @__PURE__ */
194
- return ve(`h${t}`,{className:[cn[t],an[r],n].filter(Boolean).join(" "),children:e})}function un({children:e,tone:t="secondary",size:r="sm",className:n=""}){/* @__PURE__ */
195
- return ve("p",{className:[an[t],ln[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var hn={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},mn={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},pn={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function gn({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
196
- return ve("div",{className:["flex flex-col",hn[t],r?mn[r]:"",n?pn[n]:"",a].filter(Boolean).join(" "),children:e})}function fn({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
197
- return ve("div",{className:["flex",a?"flex-wrap":"",hn[t],mn[r],n?pn[n]:"",l].filter(Boolean).join(" "),children:e})}var bn={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},xn={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",6:"sm:grid-cols-6",12:"sm:grid-cols-12"},yn={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",6:"lg:grid-cols-6",12:"lg:grid-cols-12"};function vn({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
198
- return ve("div",{className:["grid",bn[t],r?xn[r]:"",n?yn[n]:"",hn[a],l].filter(Boolean).join(" "),children:e})}var wn={sm:"my-2",md:"my-4",lg:"my-6"};function kn({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=oe();if("vertical"===e)/* @__PURE__ */
200
+ /* @__PURE__ */ve("span",{className:"text-2xl font-semibold text-gray-900",children:i}),n&&/* @__PURE__ */we("span",{className:`text-xs font-medium ${s}`,children:[o," ",n.value]})]})]})}var cn={default:"text-gray-900",secondary:"text-gray-500",tertiary:"text-gray-400",disabled:"text-gray-300",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600",link:"text-blue-600",inherit:""},dn={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},un={normal:"font-normal",medium:"font-medium",semibold:"font-semibold"};function hn({children:e,tone:t="default",size:r="sm",weight:n="normal",truncate:a=!1,as:l="span",className:i="",...s}){/* @__PURE__ */
201
+ return ve(l,{className:[cn[t],dn[r],un[n],a?"block truncate":"",i].filter(Boolean).join(" "),title:s.title??(a&&"string"==typeof e?e:void 0),htmlFor:s.htmlFor,children:e})}var mn={1:"text-2xl font-semibold",2:"text-xl font-semibold",3:"text-lg font-semibold",4:"text-base font-semibold",5:"text-sm font-semibold"};function pn({children:e,level:t=2,tone:r="default",className:n=""}){/* @__PURE__ */
202
+ return ve(`h${t}`,{className:[mn[t],cn[r],n].filter(Boolean).join(" "),children:e})}function gn({children:e,tone:t="secondary",size:r="sm",className:n=""}){/* @__PURE__ */
203
+ return ve("p",{className:[cn[t],dn[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var fn={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},bn={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},xn={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function yn({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
204
+ return ve("div",{className:["flex flex-col",fn[t],r?bn[r]:"",n?xn[n]:"",a].filter(Boolean).join(" "),children:e})}function vn({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
205
+ return ve("div",{className:["flex",a?"flex-wrap":"",fn[t],bn[r],n?xn[n]:"",l].filter(Boolean).join(" "),children:e})}var wn={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},kn={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",6:"sm:grid-cols-6",12:"sm:grid-cols-12"},Nn={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",6:"lg:grid-cols-6",12:"lg:grid-cols-12"};function Mn({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
206
+ return ve("div",{className:["grid",wn[t],r?kn[r]:"",n?Nn[n]:"",fn[a],l].filter(Boolean).join(" "),children:e})}var $n={sm:"my-2",md:"my-4",lg:"my-6"};function Cn({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=oe();if("vertical"===e)/* @__PURE__ */
199
207
  return ve("span",{role:"presentation",className:`inline-block h-full min-h-[1em] w-px shrink-0 self-stretch bg-gray-200 ${a}`.trim()});if(!t)/* @__PURE__ */
200
- return ve("hr",{className:`border-0 border-t border-gray-200 ${wn[n]} ${a}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",s="right"===r?"w-4 shrink-0":"flex-1";
208
+ return ve("hr",{className:`border-0 border-t border-gray-200 ${$n[n]} ${a}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",s="right"===r?"w-4 shrink-0":"flex-1";
201
209
  /* @__PURE__ */
202
- return we("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${wn[n]} ${a}`.trim(),children:[
210
+ return we("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${$n[n]} ${a}`.trim(),children:[
203
211
  /* @__PURE__ */ve("span",{"aria-hidden":"true",className:`${i} border-t border-gray-200`}),
204
212
  /* @__PURE__ */ve("span",{id:l,className:"shrink-0 text-xs font-medium text-gray-500",children:t}),
205
- /* @__PURE__ */ve("span",{"aria-hidden":"true",className:`${s} border-t border-gray-200`})]})}var Nn={text:"rounded",rect:"rounded-md",circle:"rounded-full"},Mn=e=>"number"==typeof e?`${e}px`:e;function $n({variant:e="text",width:t,height:r,lines:n=1,className:a=""}){const l=`animate-pulse bg-gray-200 ${Nn[e]} ${a}`.trim();if("circle"===e){const e=Mn(r??t)??"2.5rem";/* @__PURE__ */
206
- return ve("span",{className:`inline-block ${l}`,style:{width:e,height:e},"aria-hidden":"true"})}const i={width:Mn(t)??"100%",height:Mn(r)??("text"===e?"1rem":"4rem")};/* @__PURE__ */
207
- return ve("span","text"===e&&n>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:n},(e,t)=>/* @__PURE__ */ve("span",{className:`block ${l}`,style:{...i,width:t===n-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var Cn={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},Ln={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},Dn={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},Pn={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function jn({items:e,columns:t=1,bordered:r=!1,size:n="md",title:a,className:l="",emptyText:i="—"}){const s="number"==typeof t?{base:t}:t,o=s.base??1,c=Math.max(o,s.sm??0,s.lg??0),d="sm"===n?"px-3 py-2":"px-4 py-3",u="sm"===n?"text-xs":"text-sm";/* @__PURE__ */
213
+ /* @__PURE__ */ve("span",{"aria-hidden":"true",className:`${s} border-t border-gray-200`})]})}var Ln={text:"rounded",rect:"rounded-md",circle:"rounded-full"},Dn=e=>"number"==typeof e?`${e}px`:e;function jn({variant:e="text",width:t,height:r,lines:n=1,className:a=""}){const l=`animate-pulse bg-gray-200 ${Ln[e]} ${a}`.trim();if("circle"===e){const e=Dn(r??t)??"2.5rem";/* @__PURE__ */
214
+ return ve("span",{className:`inline-block ${l}`,style:{width:e,height:e},"aria-hidden":"true"})}const i={width:Dn(t)??"100%",height:Dn(r)??("text"===e?"1rem":"4rem")};/* @__PURE__ */
215
+ return ve("span","text"===e&&n>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:n},(e,t)=>/* @__PURE__ */ve("span",{className:`block ${l}`,style:{...i,width:t===n-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var Pn={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},Sn={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},zn={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},An={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function Bn({items:e,columns:t=1,bordered:r=!1,size:n="md",title:a,className:l="",emptyText:i="—"}){const s="number"==typeof t?{base:t}:t,o=s.base??1,c=Math.max(o,s.sm??0,s.lg??0),d="sm"===n?"px-3 py-2":"px-4 py-3",u="sm"===n?"text-xs":"text-sm";/* @__PURE__ */
208
216
  return we("div",{className:[r?"rounded-lg border border-gray-200 bg-white":"",l].filter(Boolean).join(" "),children:[a&&/* @__PURE__ */ve("div",{className:`${d} ${r?"border-b border-gray-100":""} text-sm font-semibold text-gray-900`.trim(),children:a}),
209
- /* @__PURE__ */ve("dl",{className:["grid",Cn[o],s.sm?Ln[s.sm]:"",s.lg?Dn[s.lg]:"",r?"":"gap-x-6 gap-y-3",r?"":"px-4 py-3"===d?"py-1":""].filter(Boolean).join(" "),children:e.map((e,t)=>/* @__PURE__ */we("div",{className:[e.span?Pn[c]:"",r?`${d} border-b border-gray-100 last:border-b-0`:""].filter(Boolean).join(" "),children:[
217
+ /* @__PURE__ */ve("dl",{className:["grid",Pn[o],s.sm?Sn[s.sm]:"",s.lg?zn[s.lg]:"",r?"":"gap-x-6 gap-y-3",r?"":"px-4 py-3"===d?"py-1":""].filter(Boolean).join(" "),children:e.map((e,t)=>/* @__PURE__ */we("div",{className:[e.span?An[c]:"",r?`${d} border-b border-gray-100 last:border-b-0`:""].filter(Boolean).join(" "),children:[
210
218
  /* @__PURE__ */ve("dt",{className:`${u} text-gray-500`,children:e.label}),
211
- /* @__PURE__ */ve("dd",{className:`mt-0.5 min-w-0 break-words ${u} text-gray-900`,children:null===e.value||void 0===e.value||""===e.value?i:e.value})]},e.key??t))})]})}function zn({name:e,value:t,description:r,controlId:n,unknownText:a="—",quiet:l=!1,className:i=""}){const s=null==t||""===t,o=l?"text-gray-500":"text-gray-800",c=s?"text-gray-400":l?"text-gray-500":"text-gray-900";/* @__PURE__ */
219
+ /* @__PURE__ */ve("dd",{className:`mt-0.5 min-w-0 break-words ${u} text-gray-900`,children:null===e.value||void 0===e.value||""===e.value?i:e.value})]},e.key??t))})]})}function Fn({name:e,value:t,description:r,controlId:n,unknownText:a="—",quiet:l=!1,className:i=""}){const s=null==t||""===t,o=l?"text-gray-500":"text-gray-800",c=s?"text-gray-400":l?"text-gray-500":"text-gray-900";/* @__PURE__ */
212
220
  return we("div",{className:i,children:[
213
221
  /* @__PURE__ */we("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children:[n?/* @__PURE__ */ve("label",{htmlFor:n,className:`min-w-0 text-sm font-medium ${o}`,children:e}):/* @__PURE__ */ve("span",{className:`min-w-0 text-sm font-medium ${o}`,children:e}),
214
- /* @__PURE__ */ve("span",{className:`shrink-0 text-sm ${c}`,children:s?a:t})]}),r&&/* @__PURE__ */ve("p",{className:"mt-1 text-xs leading-relaxed text-gray-500",children:r})]})}var An={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function Sn({count:e=0,max:t=99,dot:r=!1,tone:n="danger",showZero:a=!1,children:l,className:i=""}){const s=r||e>0||0===e&&a,o=U(),c=e>t?`${Z(t,o)}+`:Z(e,o),d=s?/* @__PURE__ */ve("span",r?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${An[n]}`,"aria-hidden":l?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${An[n]}`,children:c}):null;return l?/* @__PURE__ */we("span",{className:`relative inline-flex ${i}`.trim(),children:[l,d&&/* @__PURE__ */ve("span",{className:"absolute -right-1.5 -top-1.5 flex",children:d})]}):d}var Bn={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},Fn={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function Tn({title:e,value:t,precision:r,prefix:n,suffix:a,tone:l="default",size:i="md",className:s=""}){const o=U(),c="number"!=typeof t?t:null!=r?G(t,r,o):o?Z(t,o):t;/* @__PURE__ */
222
+ /* @__PURE__ */ve("span",{className:`shrink-0 text-sm ${c}`,children:s?a:t})]}),r&&/* @__PURE__ */ve("p",{className:"mt-1 text-xs leading-relaxed text-gray-500",children:r})]})}var En={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function Tn({count:e=0,max:t=99,dot:r=!1,tone:n="danger",showZero:a=!1,children:l,className:i=""}){const s=r||e>0||0===e&&a,o=U(),c=e>t?`${Z(t,o)}+`:Z(e,o),d=l?"":i,u=s?/* @__PURE__ */ve("span",r?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${En[n]} ${d}`.trim(),"aria-hidden":l?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${En[n]} ${d}`.trim(),children:c}):null;return l?/* @__PURE__ */we("span",{className:`relative inline-flex ${i}`.trim(),children:[l,u&&/* @__PURE__ */ve("span",{className:"absolute -right-1.5 -top-1.5 flex",children:u})]}):u}var In={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},On={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function Rn({title:e,value:t,precision:r,prefix:n,suffix:a,tone:l="default",size:i="md",className:s=""}){const o=U(),c="number"!=typeof t?t:null!=r?G(t,r,o):o?Z(t,o):t;/* @__PURE__ */
215
223
  return we("div",{className:s,children:[e&&/* @__PURE__ */ve("div",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
216
- /* @__PURE__ */we("div",{className:`mt-1 flex items-baseline gap-1 ${Fn[l]}`,children:[n&&/* @__PURE__ */ve("span",{className:"text-sm",children:n}),
217
- /* @__PURE__ */ve("span",{className:`font-semibold tabular-nums ${Bn[i]}`,children:c}),a&&/* @__PURE__ */ve("span",{className:"text-sm",children:a})]})]})}var En={xs:24,sm:32,md:40,lg:56},In={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function On(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function Rn({src:e,name:t,size:r="md",status:n,className:a=""}){const l=En[r],i=Math.max(8,Math.round(.28*l)),[s,o]=ie(!1);ce(()=>{o(!1)},[e]);const c=Boolean(e)&&!s;
224
+ /* @__PURE__ */we("div",{className:`mt-1 flex items-baseline gap-1 ${On[l]}`,children:[n&&/* @__PURE__ */ve("span",{className:"text-sm",children:n}),
225
+ /* @__PURE__ */ve("span",{className:`font-semibold tabular-nums ${In[i]}`,children:c}),a&&/* @__PURE__ */ve("span",{className:"text-sm",children:a})]})]})}var Wn={xs:24,sm:32,md:40,lg:56},Hn={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function _n(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function qn({src:e,name:t,size:r="md",status:n,className:a=""}){const l=Wn[r],i=Math.max(8,Math.round(.28*l)),[s,o]=ie(!1);de(()=>{o(!1)},[e]);const c=Boolean(e)&&!s;
218
226
  /* @__PURE__ */
219
- return we("span",{className:`relative inline-flex shrink-0 ${a}`.trim(),style:{width:l,height:l},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[c?/* @__PURE__ */ve("img",{src:e,alt:"",onError:()=>o(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */ve("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*l)},children:On(t)}),n&&/* @__PURE__ */ve("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${In[n]}`,style:{width:i,height:i}})]})}function Wn({children:e,max:t,size:r="md",className:n=""}){const a=he.toArray(e),l=t?a.slice(0,t):a,i=t?a.length-l.length:0,s=En[r],o=Math.round(.3*s),c=U();/* @__PURE__ */
220
- return we("div",{className:`flex items-center ${n}`.trim(),children:[l.map((e,t)=>/* @__PURE__ */ve("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-o},children:e},t)),i>0&&/* @__PURE__ */we("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:s,height:s,marginLeft:-o,fontSize:Math.round(.36*s)},children:["+",Z(i,c)]})]})}var Hn={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"}},_n={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white"};function qn({tone:e}){const t={className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
227
+ return we("span",{className:`relative inline-flex shrink-0 ${a}`.trim(),style:{width:l,height:l},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[c?/* @__PURE__ */ve("img",{src:e,alt:"",onError:()=>o(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */ve("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*l)},children:_n(t)}),n&&/* @__PURE__ */ve("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${Hn[n]}`,style:{width:i,height:i}})]})}function Un({children:e,max:t,size:r="md",className:n=""}){const a=he.toArray(e),l=t?a.slice(0,t):a,i=t?a.length-l.length:0,s=Wn[r],o=Math.round(.3*s),c=U();/* @__PURE__ */
228
+ return we("div",{className:`flex items-center ${n}`.trim(),children:[l.map((e,t)=>/* @__PURE__ */ve("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-o},children:e},t)),i>0&&/* @__PURE__ */we("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:s,height:s,marginLeft:-o,fontSize:Math.round(.36*s)},children:["+",Z(i,c)]})]})}var Kn={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"}},Vn={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white"};function Yn({tone:e}){const t={className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
221
229
  return ve("svg",{...t,children:/* @__PURE__ */ve("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.7-9.3a1 1 0 00-1.4-1.4L9 10.6 7.7 9.3a1 1 0 00-1.4 1.4l2 2a1 1 0 001.4 0l4-4z",clipRule:"evenodd"})});case"warning":/* @__PURE__ */
222
230
  return ve("svg",{...t,children:/* @__PURE__ */ve("path",{fillRule:"evenodd",d:"M8.3 2.8a2 2 0 013.4 0l6 10A2 2 0 0116 16H4a2 2 0 01-1.7-3.2l6-10zM10 7a1 1 0 00-1 1v3a1 1 0 102 0V8a1 1 0 00-1-1zm0 7a1 1 0 100 2 1 1 0 000-2z",clipRule:"evenodd"})});case"danger":/* @__PURE__ */
223
231
  return ve("svg",{...t,children:/* @__PURE__ */ve("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.7 7.3a1 1 0 00-1.4 1.4L8.6 10l-1.3 1.3a1 1 0 101.4 1.4L10 11.4l1.3 1.3a1 1 0 001.4-1.4L11.4 10l1.3-1.3a1 1 0 10-1.4-1.4L10 8.6 8.7 7.3z",clipRule:"evenodd"})});default:/* @__PURE__ */
224
- return ve("svg",{...t,children:/* @__PURE__ */ve("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9 9a1 1 0 012 0v4a1 1 0 11-2 0V9zm1-4a1 1 0 100 2 1 1 0 000-2z",clipRule:"evenodd"})})}}function Un({tone:e="info",emphasis:t="subtle",title:r,children:n,icon:a,action:l,onDismiss:i,sticky:s=!1,className:o=""}){const c=Hn[e],d="solid"===t,u=K().banner,h=d?_n[e]:c.box,m=s?"sticky top-0 z-30":"",p=/* @__PURE__ */we(ke,{children:[r&&/* @__PURE__ */ve("div",{className:("font-semibold "+(d?"":"text-gray-900")).trim(),children:r}),n&&/* @__PURE__ */ve("div",{className:`${d?"":"text-gray-700"} ${r?"mt-0.5":""}`.trim(),children:n})]});/* @__PURE__ */
232
+ return ve("svg",{...t,children:/* @__PURE__ */ve("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9 9a1 1 0 012 0v4a1 1 0 11-2 0V9zm1-4a1 1 0 100 2 1 1 0 000-2z",clipRule:"evenodd"})})}}function Zn({tone:e="info",emphasis:t="subtle",title:r,children:n,icon:a,action:l,onDismiss:i,sticky:s=!1,className:o=""}){const c=Kn[e],d="solid"===t,u=K().banner,h=d?Vn[e]:c.box,m=s?"sticky top-0 z-30":"",p=/* @__PURE__ */we(ke,{children:[r&&/* @__PURE__ */ve("div",{className:("font-semibold "+(d?"":"text-gray-900")).trim(),children:r}),n&&/* @__PURE__ */ve("div",{className:`${d?"":"text-gray-700"} ${r?"mt-0.5":""}`.trim(),children:n})]});/* @__PURE__ */
225
233
  return we("div",{role:"danger"===e?"alert":"status",className:`${m} flex items-start gap-3 rounded-lg border px-4 py-3 ${h} ${o}`.trim(),children:[
226
- /* @__PURE__ */ve("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:a??/* @__PURE__ */ve(qn,{tone:e})}),null==l?/* @__PURE__ */ve("div",{className:"min-w-0 flex-1 text-sm",children:p}):
234
+ /* @__PURE__ */ve("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:a??/* @__PURE__ */ve(Yn,{tone:e})}),null==l?/* @__PURE__ */ve("div",{className:"min-w-0 flex-1 text-sm",children:p}):
227
235
  /* @__PURE__ */we("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
228
236
  /* @__PURE__ */ve("div",{className:"min-w-0 grow basis-48 text-sm",children:p}),
229
- /* @__PURE__ */ve("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */ve("button",{type:"button",onClick:i,"aria-label":u.dismiss,className:"shrink-0 "+(d?"opacity-80 hover:opacity-100":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ve("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})}var Kn=(e,t)=>`${e}-tab-${t}`,Vn=(e,t)=>`${e}-panel-${t}`,Yn={underline:"flex items-center gap-1 border-b border-gray-200",pill:"inline-flex items-center gap-1 rounded-lg bg-gray-100 p-1"};function Zn(e,t){return"pill"===e?"inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 "+(t?"bg-blue-600 text-white shadow-sm":"text-gray-600 hover:text-gray-900"):"-mb-px inline-flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 "+(t?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:border-gray-300 hover:text-gray-900")}function Gn({items:e,value:t,onChange:r,variant:n="underline",idPrefix:a,className:l="","aria-label":i,"aria-labelledby":s}){const o=se([]),c=(t,r)=>{for(let n=1;n<=e.length;n+=1){const a=((t+r*n)%e.length+e.length)%e.length;if(!e[a]?.disabled)return a}return null},d=t=>{const r=1===t?e.map((e,t)=>t):e.map((t,r)=>e.length-1-r);for(const t of r)if(!e[t]?.disabled)return t;return null};/* @__PURE__ */
230
- return ve("div",{role:"tablist","aria-label":i,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=c(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=c(a,-1);else if("Home"===n.key)l=d(1);else{if("End"!==n.key)return;l=d(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),o.current[l]?.focus())},className:`${Yn[n]} ${l}`.trim(),children:e.map((e,l)=>{const i=e.id===t;/* @__PURE__ */
231
- return we("button",{ref:e=>{o.current[l]=e},type:"button",role:"tab",id:a?Kn(a,e.id):void 0,"aria-controls":a?Vn(a,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:Zn(n,i),children:[e.icon&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e.icon}),e.label]},e.id)})})}var Jn=()=>/* @__PURE__ */ve("svg",{viewBox:"0 0 12 12",fill:"none",className:"h-3.5 w-3.5","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M2.5 6.5L5 9l4.5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})});function Xn({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
232
- return ve("ol",{"aria-label":n,className:`grid items-start ${a}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,n)=>{const a=n<l?"complete":n===l?"current":"upcoming",i="complete"===a&&!!r,s=/* @__PURE__ */ve("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===a?"bg-blue-600 text-white":"","current"===a?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===a?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===a?/* @__PURE__ */ve(Jn,{}):n+1}),o=/* @__PURE__ */we("span",{className:"min-w-0 text-center",children:[
237
+ /* @__PURE__ */ve("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */ve("button",{type:"button",onClick:i,"aria-label":u.dismiss,className:"shrink-0 "+(d?"opacity-80 hover:opacity-100":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ve("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})}var Gn=(e,t)=>`${e}-tab-${t}`,Jn=(e,t)=>`${e}-panel-${t}`,Xn={underline:"flex items-center gap-1 border-b border-gray-200",pill:"inline-flex items-center gap-1 rounded-lg bg-gray-100 p-1"};function Qn(e,t){return"pill"===e?"inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 "+(t?"bg-blue-600 text-white shadow-sm":"text-gray-600 hover:text-gray-900"):"-mb-px inline-flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 "+(t?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:border-gray-300 hover:text-gray-900")}function ea({items:e,value:t,onChange:r,variant:n="underline",idPrefix:a,className:l="","aria-label":i,"aria-labelledby":s}){const o=se([]),c=(t,r)=>{for(let n=1;n<=e.length;n+=1){const a=((t+r*n)%e.length+e.length)%e.length;if(!e[a]?.disabled)return a}return null},d=t=>{const r=1===t?e.map((e,t)=>t):e.map((t,r)=>e.length-1-r);for(const t of r)if(!e[t]?.disabled)return t;return null};/* @__PURE__ */
238
+ return ve("div",{role:"tablist","aria-label":i,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=c(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=c(a,-1);else if("Home"===n.key)l=d(1);else{if("End"!==n.key)return;l=d(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),o.current[l]?.focus())},className:`${Xn[n]} ${l}`.trim(),children:e.map((e,l)=>{const i=e.id===t;/* @__PURE__ */
239
+ return we("button",{ref:e=>{o.current[l]=e},type:"button",role:"tab",id:a?Gn(a,e.id):void 0,"aria-controls":a?Jn(a,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:Qn(n,i),children:[e.icon&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e.icon}),e.label]},e.id)})})}var ta=()=>/* @__PURE__ */ve("svg",{viewBox:"0 0 12 12",fill:"none",className:"h-3.5 w-3.5","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M2.5 6.5L5 9l4.5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})});function ra({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
240
+ return ve("ol",{"aria-label":n,className:`grid items-start ${a}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,n)=>{const a=n<l?"complete":n===l?"current":"upcoming",i="complete"===a&&!!r,s=/* @__PURE__ */ve("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===a?"bg-blue-600 text-white":"","current"===a?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===a?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===a?/* @__PURE__ */ve(ta,{}):n+1}),o=/* @__PURE__ */we("span",{className:"min-w-0 text-center",children:[
233
241
  /* @__PURE__ */ve("span",{className:"block text-sm font-medium "+("upcoming"===a?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */ve("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
234
- return we("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(n<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */we("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-1.5 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[s,o]}):/* @__PURE__ */we("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-1.5 px-2 text-center",children:[s,o]})]},t.id)})})}function Qn({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,className:l=""}){const[i,s]=ie(t),o=r??i;/* @__PURE__ */
242
+ return we("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(n<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */we("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-1.5 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[s,o]}):/* @__PURE__ */we("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-1.5 px-2 text-center",children:[s,o]})]},t.id)})})}function na({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,className:l=""}){const[i,s]=ie(t),o=r??i;/* @__PURE__ */
235
243
  return ve("div",{className:`divide-y divide-gray-100 overflow-hidden rounded-lg border border-gray-200 ${l}`.trim(),children:e.map(e=>{const t=o.includes(e.id);/* @__PURE__ */
236
244
  return we("div",{children:[
237
245
  /* @__PURE__ */we("button",{type:"button",disabled:e.disabled,"aria-expanded":t,onClick:()=>(e=>{const t=o.includes(e)?o.filter(t=>t!==e):a?[...o,e]:[e];void 0===r&&s(t),n?.(t)})(e.id),className:"flex w-full items-center justify-between gap-3 px-4 py-3 text-left text-sm font-medium text-gray-900 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:[
238
246
  /* @__PURE__ */ve("span",{children:e.title}),
239
- /* @__PURE__ */ve("svg",{className:"h-4 w-4 shrink-0 text-gray-400 transition-transform "+(t?"rotate-180":""),viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M6 8l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t&&/* @__PURE__ */ve("div",{className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}var ea={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},ta={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function ra(e,t="subtle"){return"solid"===t?ta[e]:ea[e]}var na=de({});function aa({groups:e,children:t}){/* @__PURE__ */
240
- return ve(na.Provider,{value:e,children:t})}function la({status:e,label:t,emphasis:r="subtle"}){const n=ra(ge(na)[e]??"neutral",r),a=t??e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());/* @__PURE__ */
241
- return ve("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${n}`,children:a})}function ia({colorClass:e,tone:t,children:r,size:n="sm",capitalize:a=!1,closable:l=!1,onClose:i,closeLabel:s,className:o=""}){const c=e??ea[t??"neutral"],d="xs"===n?"px-2 py-0.5 text-[10px]":"md"===n?"px-2.5 py-0.5 text-xs":"px-2 py-0.5 text-xs",u=a?"capitalize":"",h=K().badge,m=s??("string"==typeof r?h.removeItem(r):h.remove),p="xs"===n?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
242
- return we("span",{className:["inline-flex items-center rounded-full font-medium",d,u,c,o].filter(Boolean).join(" "),children:[r,l&&/* @__PURE__ */ve("button",{type:"button",onClick:i,"aria-label":m,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */ve("svg",{className:p,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]})}function sa({title:e,message:t,description:r,hint:n,variant:a,frameless:l,icon:i,children:s}){const o=l?"none":a??"dashed",c="boolean"!=typeof i&&null!=i?i:null,d=!c&&(i??"card"!==o),u=K().emptyState,h=t??(e?void 0:u.message),m=r??n;/* @__PURE__ */
243
- return we("div",{className:`flex flex-col items-center justify-center text-center ${"card"===o?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===o?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[c&&/* @__PURE__ */ve("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */ve("svg",{className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),e&&/* @__PURE__ */ve("h3",{className:"text-sm font-medium text-gray-900",children:e}),h&&/* @__PURE__ */ve("p",{className:"text-sm text-gray-500 "+(e?"mt-2":""),children:h}),m&&/* @__PURE__ */ve("p",{className:"text-xs text-gray-400 mt-1",children:m}),s&&/* @__PURE__ */ve("div",{className:"mt-4",children:s})]})}function oa({title:t,description:r,subtitle:n,actions:a,children:l,icon:i,breadcrumbs:s}){const o=r??n,c=a??l;/* @__PURE__ */
247
+ /* @__PURE__ */ve("svg",{className:"h-4 w-4 shrink-0 text-gray-400 transition-transform "+(t?"rotate-180":""),viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M6 8l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t&&/* @__PURE__ */ve("div",{className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}var aa={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},la={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function ia(e,t="subtle"){return"solid"===t?la[e]:aa[e]}var sa=ue({});function oa({groups:e,children:t}){/* @__PURE__ */
248
+ return ve(sa.Provider,{value:e,children:t})}function ca({status:e,label:t,emphasis:r="subtle"}){const n=ia(ge(sa)[e]??"neutral",r),a=t??e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());/* @__PURE__ */
249
+ return ve("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${n}`,children:a})}function da({colorClass:e,tone:t,children:r,size:n="sm",capitalize:a=!1,closable:l=!1,onClose:i,closeLabel:s,className:o=""}){const c=e??aa[t??"neutral"],d="xs"===n?"px-2 py-0.5 text-[10px]":"md"===n?"px-2.5 py-0.5 text-xs":"px-2 py-0.5 text-xs",u=a?"capitalize":"",h=K().badge,m=s??("string"==typeof r?h.removeItem(r):h.remove),p="xs"===n?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
250
+ return we("span",{className:["inline-flex items-center rounded-full font-medium",d,u,c,o].filter(Boolean).join(" "),children:[r,l&&/* @__PURE__ */ve("button",{type:"button",onClick:i,"aria-label":m,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */ve("svg",{className:p,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]})}function ua({title:e,message:t,description:r,hint:n,variant:a,frameless:l,icon:i,children:s}){const o=l?"none":a??"dashed",c="boolean"!=typeof i&&null!=i?i:null,d=!c&&(i??"card"!==o),u=K().emptyState,h=t??(e?void 0:u.message),m=r??n;/* @__PURE__ */
251
+ return we("div",{className:`flex flex-col items-center justify-center text-center ${"card"===o?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===o?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[c&&/* @__PURE__ */ve("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */ve("svg",{className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),e&&/* @__PURE__ */ve("h3",{className:"text-sm font-medium text-gray-900",children:e}),h&&/* @__PURE__ */ve("p",{className:"text-sm text-gray-500 "+(e?"mt-2":""),children:h}),m&&/* @__PURE__ */ve("p",{className:"text-xs text-gray-400 mt-1",children:m}),s&&/* @__PURE__ */ve("div",{className:"mt-4",children:s})]})}function ha({title:t,description:r,subtitle:n,actions:a,children:l,icon:i,breadcrumbs:s}){const o=r??n,c=a??l;/* @__PURE__ */
244
252
  return we("div",{className:"mb-6",children:[s&&s.length>0&&/* @__PURE__ */ve(e,{items:s,className:"mb-3"}),
245
253
  /* @__PURE__ */we("div",{className:"flex items-start justify-between gap-4",children:[
246
254
  /* @__PURE__ */we("div",{children:[
247
- /* @__PURE__ */we("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */ve("span",{className:"shrink-0 text-gray-400",children:i}),t]}),o&&/* @__PURE__ */ve("p",{className:"mt-1 text-sm text-gray-500",children:o})]}),c&&/* @__PURE__ */ve("div",{className:"flex items-center gap-2",children:c})]})]})}var ca=["success","warning","danger"];function da(e){return"string"==typeof e&&ca.includes(e)}function ua(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=ha(t),a=ha(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function ha(e){return null!=e&&Number.isFinite(e)?e:null}var ma={success:{tone:"success",fill:"bg-green-500",ink:"text-gray-900",word:"ok"},warning:{tone:"warning",fill:"bg-amber-500",ink:"text-amber-600",word:"warning"},danger:{tone:"danger",fill:"bg-red-500",ink:"text-red-600",word:"critical"}};var pa=/* @__PURE__ */new Set;function ga(e,t){if(null==e)return null;if(da(e))return ma[e];const r=function(e){const t="string"==typeof e?JSON.stringify(e):"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e?String(e):Object.prototype.toString.call(e);return t.length>32?`${t.slice(0,31)}…`:t}(e);return function(e,t){const r=`${e}:${t}`;pa.has(r)||(pa.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${ca.join(" | ")}. Rendering an "unknown severity" marker — a health marker must never silently disappear. If this came from a backend rollup, map it to the shell's vocabulary at the fetch boundary (see isSeverityTone).`))}(t,r),{tone:null,fill:"bg-gray-300 border border-red-500",ink:"text-gray-900",word:`unrecognised severity ${r}`,token:r}}function fa({at:e,title:t,className:r}){/* @__PURE__ */
248
- return ve("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var ba=e=>Math.min(100,Math.max(0,e));function xa({label:e,value:t,max:r=100,warn:n,crit:a,severity:l,detail:i,formatValue:s,emptyLabel:o,size:c="sm",ariaLabel:d,className:u=""}){const h=K().meter,m=U(),p=o??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var b,x;null==f&&(b=`MetricBar:max:${String(r)}`,x=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,pa.has(b)||(pa.add(b),console.error(x)));const y=ga(l,"MetricBar"),v=null!=g?y??(null==(w=ua(g,n,a))?null:ma[w]):null;var w;const k=ha(n),N=ha(a),M=null!=g&&null!=f?ba(g/f*100):0,$=null!=g?(s??(e=>100===f?J(e,1,m):Z(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=k||null!=N),L="md"===c?"h-2":"h-1.5",D=null!=g&&null!=f,P=/* @__PURE__ */we("div",{...D?{role:"meter","aria-label":d??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":f,"aria-valuenow":Math.min(f,Math.max(0,g)),"aria-valuetext":$}:{"aria-hidden":!0},className:D&&v?`relative mt-2 ${L} rounded-full bg-gray-200`:`relative mt-2 ${L} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[D&&
249
- /* @__PURE__ */ve("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${M}%`}}),C&&null!=f&&null!=k&&/* @__PURE__ */ve(fa,{at:ba(k/f*100),title:h.warningAt(k),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=N&&/* @__PURE__ */ve(fa,{at:ba(N/f*100),title:h.criticalAt(N),className:"bg-gray-500"})]}),j=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
255
+ /* @__PURE__ */we("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */ve("span",{className:"shrink-0 text-gray-400",children:i}),t]}),o&&/* @__PURE__ */ve("p",{className:"mt-1 text-sm text-gray-500",children:o})]}),c&&/* @__PURE__ */ve("div",{className:"flex items-center gap-2",children:c})]})]})}var ma=["success","warning","danger"];function pa(e){return"string"==typeof e&&ma.includes(e)}function ga(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=fa(t),a=fa(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function fa(e){return null!=e&&Number.isFinite(e)?e:null}var ba={success:{tone:"success",fill:"bg-green-500",ink:"text-gray-900",word:"ok"},warning:{tone:"warning",fill:"bg-amber-500",ink:"text-amber-600",word:"warning"},danger:{tone:"danger",fill:"bg-red-500",ink:"text-red-600",word:"critical"}};var xa=/* @__PURE__ */new Set;function ya(e,t){if(null==e)return null;if(pa(e))return ba[e];const r=function(e){const t="string"==typeof e?JSON.stringify(e):"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e?String(e):Object.prototype.toString.call(e);return t.length>32?`${t.slice(0,31)}…`:t}(e);return function(e,t){const r=`${e}:${t}`;xa.has(r)||(xa.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${ma.join(" | ")}. Rendering an "unknown severity" marker — a health marker must never silently disappear. If this came from a backend rollup, map it to the shell's vocabulary at the fetch boundary (see isSeverityTone).`))}(t,r),{tone:null,fill:"bg-gray-300 border border-red-500",ink:"text-gray-900",word:`unrecognised severity ${r}`,token:r}}function va({at:e,title:t,className:r}){/* @__PURE__ */
256
+ return ve("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var wa=e=>Math.min(100,Math.max(0,e));function ka({label:e,value:t,max:r=100,warn:n,crit:a,severity:l,detail:i,formatValue:s,emptyLabel:o,size:c="sm",ariaLabel:d,className:u=""}){const h=K().meter,m=U(),p=o??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var b,x;null==f&&(b=`MetricBar:max:${String(r)}`,x=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,xa.has(b)||(xa.add(b),console.error(x)));const y=ya(l,"MetricBar"),v=null!=g?y??(null==(w=ga(g,n,a))?null:ba[w]):null;var w;const k=fa(n),N=fa(a),M=null!=g&&null!=f?wa(g/f*100):0,$=null!=g?(s??(e=>100===f?J(e,1,m):Z(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=k||null!=N),L="md"===c?"h-2":"h-1.5",D=null!=g&&null!=f,j=/* @__PURE__ */we("div",{...D?{role:"meter","aria-label":d??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":f,"aria-valuenow":Math.min(f,Math.max(0,g)),"aria-valuetext":$}:{"aria-hidden":!0},className:D&&v?`relative mt-2 ${L} rounded-full bg-gray-200`:`relative mt-2 ${L} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[D&&
257
+ /* @__PURE__ */ve("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${M}%`}}),C&&null!=f&&null!=k&&/* @__PURE__ */ve(va,{at:wa(k/f*100),title:h.warningAt(k),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=N&&/* @__PURE__ */ve(va,{at:wa(N/f*100),title:h.criticalAt(N),className:"bg-gray-500"})]}),P=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
250
258
  return we("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */ve("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
251
259
  /* @__PURE__ */we("div",{className:"mt-1 flex items-baseline gap-2",children:[
252
- /* @__PURE__ */ve("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${j}`,children:$}),
253
- /* @__PURE__ */ve("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:null!=g?i:p})]}),P]}:{className:u,children:[
260
+ /* @__PURE__ */ve("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${P}`,children:$}),
261
+ /* @__PURE__ */ve("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:null!=g?i:p})]}),j]}:{className:u,children:[
254
262
  /* @__PURE__ */we("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */ve("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
255
- /* @__PURE__ */ve("span",{className:`text-sm font-semibold tabular-nums ${j}`,children:$}),
256
- /* @__PURE__ */ve("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:null!=g?i:p})]}),P]})}function ya(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function va(e,t){const r=ya(e);if(null==r)return"no-reading";const n=ya(t);return null==n||0===n?"no-budget":r>n?"over":"within"}var wa=e=>Math.min(100,Math.max(0,e));function ka({label:e,elapsed:t,budget:r,grace:n,detail:a,formatDuration:l,emptyLabel:i,noBudgetLabel:s,size:o="sm",ariaLabel:c,className:d=""}){const u=K().meter,h=U(),m=l??(e=>function(e,t=V.meter){const r=Math.round(e),n=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return n>0?t.hoursMinutes(n,a):a>0?t.minutesSeconds(a,l):t.seconds(l)}(e,u)),p=i??u.noReading,g=s??u.noBudget,f=ya(t),b=ya(r),x=null!=b&&b>0?b:null,y=ya(n)??0,v="over"===va(t,r),w=null!=x?x+y:null,k=null!=x&&null!=w?wa(x/w*100):null,N=v&&y>0,M=null==w||null==f?0:v?N?k??0:0:wa(f/w*100),$=N?k??0:0,C=v?N&&null!=w&&null!=f?wa(f/w*100):100:0,L=Math.max(0,C-$),D=null!=f&&null!=x?f/x*100:null,P=null!=D?J(Math.round(D),0,h):null!=f?m(f):"—",j=a??(null==f?p:null==x?g:`${m(f)} / ${m(x)}`),z="md"===o?"h-2":"h-1.5",A=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",S=null!=f&&null!=x&&null!=w?/* @__PURE__ */we("div",{role:"meter","aria-label":c??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":w,"aria-valuenow":Math.min(w,f),"aria-valuetext":u.ofBudget(P),className:`relative mt-2 ${z} overflow-hidden rounded-full bg-gray-200`,children:[(!v||N)&&/* @__PURE__ */ve("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${M}%`}}),L>0&&/* @__PURE__ */ve("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${$}%`,width:`${L}%`}}),y>0&&null!=k&&/* @__PURE__ */ve("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${k}%`}})]}):null;/* @__PURE__ */
263
+ /* @__PURE__ */ve("span",{className:`text-sm font-semibold tabular-nums ${P}`,children:$}),
264
+ /* @__PURE__ */ve("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:null!=g?i:p})]}),j]})}function Na(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function Ma(e,t){const r=Na(e);if(null==r)return"no-reading";const n=Na(t);return null==n||0===n?"no-budget":r>n?"over":"within"}var $a=e=>Math.min(100,Math.max(0,e));function Ca({label:e,elapsed:t,budget:r,grace:n,detail:a,formatDuration:l,emptyLabel:i,noBudgetLabel:s,size:o="sm",ariaLabel:c,className:d=""}){const u=K().meter,h=U(),m=l??(e=>function(e,t=V.meter){const r=Math.round(e),n=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return n>0?t.hoursMinutes(n,a):a>0?t.minutesSeconds(a,l):t.seconds(l)}(e,u)),p=i??u.noReading,g=s??u.noBudget,f=Na(t),b=Na(r),x=null!=b&&b>0?b:null,y=Na(n)??0,v="over"===Ma(t,r),w=null!=x?x+y:null,k=null!=x&&null!=w?$a(x/w*100):null,N=v&&y>0,M=null==w||null==f?0:v?N?k??0:0:$a(f/w*100),$=N?k??0:0,C=v?N&&null!=w&&null!=f?$a(f/w*100):100:0,L=Math.max(0,C-$),D=null!=f&&null!=x?f/x*100:null,j=null!=D?J(Math.round(D),0,h):null!=f?m(f):"—",P=a??(null==f?p:null==x?g:`${m(f)} / ${m(x)}`),S="md"===o?"h-2":"h-1.5",z=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",A=null!=f&&null!=x&&null!=w?/* @__PURE__ */we("div",{role:"meter","aria-label":c??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":w,"aria-valuenow":Math.min(w,f),"aria-valuetext":u.ofBudget(j),className:`relative mt-2 ${S} overflow-hidden rounded-full bg-gray-200`,children:[(!v||N)&&/* @__PURE__ */ve("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${M}%`}}),L>0&&/* @__PURE__ */ve("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${$}%`,width:`${L}%`}}),y>0&&null!=k&&/* @__PURE__ */ve("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${k}%`}})]}):null;/* @__PURE__ */
257
265
  return we("div","md"===o?{className:d,children:[null!=e&&/* @__PURE__ */ve("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
258
266
  /* @__PURE__ */we("div",{className:"mt-1 flex items-baseline gap-2",children:[
259
- /* @__PURE__ */ve("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${A}`,children:P}),
260
- /* @__PURE__ */ve("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:j})]}),S]}:{className:d,children:[
267
+ /* @__PURE__ */ve("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${z}`,children:j}),
268
+ /* @__PURE__ */ve("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:P})]}),A]}:{className:d,children:[
261
269
  /* @__PURE__ */we("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */ve("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
262
- /* @__PURE__ */ve("span",{className:`text-sm font-semibold tabular-nums ${A}`,children:P}),
263
- /* @__PURE__ */ve("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:j})]}),S]})}var Na=864e5;function Ma(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const r=new Date(t).getUTCFullYear();return r<2e3||r>2100?null:t}function $a(e,t){return w(new Date(e).toISOString().slice(0,10),{locale:t})}var Ca=(e,t)=>`${e}-fill-${t}`,La=e=>`${e}-glow`,Da=e=>`${e}-reveal`,Pa=e=>`${e}-ground`;function ja(e,t,r,n){return"solid"===r?n:`url(#${Ca(e,t)})`}function za(e){return"solid"===e?void 0:"4 3"}function Aa({id:e,index:t,colour:r,variant:n,from:a,to:l}){const i=Ca(e,t);if("solid"===n)return null;if("gradient"===n||"gradient-reverse"===n){const e="gradient-reverse"===n;/* @__PURE__ */
270
+ /* @__PURE__ */ve("span",{className:`text-sm font-semibold tabular-nums ${z}`,children:j}),
271
+ /* @__PURE__ */ve("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:P})]}),A]})}var La=864e5;function Da(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const r=new Date(t).getUTCFullYear();return r<2e3||r>2100?null:t}function ja(e,t){return w(new Date(e).toISOString().slice(0,10),{locale:t})}var Pa=(e,t)=>`${e}-fill-${t}`,Sa=e=>`${e}-glow`,za=e=>`${e}-reveal`,Aa=e=>`${e}-ground`;function Ba(e,t,r,n){return"solid"===r?n:`url(#${Pa(e,t)})`}function Fa(e){return"solid"===e?void 0:"4 3"}function Ea({id:e,index:t,colour:r,variant:n,from:a,to:l}){const i=Pa(e,t);if("solid"===n)return null;if("gradient"===n||"gradient-reverse"===n){const e="gradient-reverse"===n;/* @__PURE__ */
264
272
  return we("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
265
273
  /* @__PURE__ */ve("stop",{offset:"0%",stopColor:r,stopOpacity:e?l:a}),
266
274
  /* @__PURE__ */ve("stop",{offset:"100%",stopColor:r,stopOpacity:e?a:l})]})}const s=/* @__PURE__ */ve("rect",{width:"100%",height:"100%",fill:r,fillOpacity:.45*a});return"duotone"===n?/* @__PURE__ */we("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
@@ -273,14 +281,14 @@ return we("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
273
281
  /* @__PURE__ */ve("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8})]}:"dotted"===n?{id:i,width:"8",height:"8",patternUnits:"userSpaceOnUse",children:[s,
274
282
  /* @__PURE__ */ve("circle",{cx:"2",cy:"2",r:"1.2",fill:r,fillOpacity:.85})]}:"lines"===n?{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",children:[s,
275
283
  /* @__PURE__ */ve("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"1.5",strokeOpacity:.8})]}:{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:[s,
276
- /* @__PURE__ */ve("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"2",strokeOpacity:.75})]})}function Sa({id:e,direction:t}){const r="center-out"===t?"rosh-viz-wipe-center":"right-to-left"===t?"rosh-viz-wipe-rtl":"rosh-viz-wipe";/* @__PURE__ */
277
- return ve("mask",{id:Da(e),maskUnits:"objectBoundingBox",maskContentUnits:"objectBoundingBox",children:/* @__PURE__ */ve("rect",{x:"0",y:"0",width:"1",height:"1",fill:"white",className:r})})}function Ba({id:e,fills:t=[],fadeFrom:r=.3,fadeTo:n=0,glow:a=!1,reveal:l=!1,background:i="none"}){/* @__PURE__ */
278
- return we("defs",{children:[t.map((t,a)=>/* @__PURE__ */ve(Aa,{id:e,index:a,colour:t.color,variant:t.variant??"gradient",from:r,to:n},a)),l&&/* @__PURE__ */ve(Sa,{id:e,direction:l}),a&&/* @__PURE__ */we("filter",{id:La(e),x:"-40%",y:"-40%",width:"180%",height:"180%",children:[
284
+ /* @__PURE__ */ve("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"2",strokeOpacity:.75})]})}function Ta({id:e,direction:t}){const r="center-out"===t?"rosh-viz-wipe-center":"right-to-left"===t?"rosh-viz-wipe-rtl":"rosh-viz-wipe";/* @__PURE__ */
285
+ return ve("mask",{id:za(e),maskUnits:"objectBoundingBox",maskContentUnits:"objectBoundingBox",children:/* @__PURE__ */ve("rect",{x:"0",y:"0",width:"1",height:"1",fill:"white",className:r})})}function Ia({id:e,fills:t=[],fadeFrom:r=.3,fadeTo:n=0,glow:a=!1,reveal:l=!1,background:i="none"}){/* @__PURE__ */
286
+ return we("defs",{children:[t.map((t,a)=>/* @__PURE__ */ve(Ea,{id:e,index:a,colour:t.color,variant:t.variant??"gradient",from:r,to:n},a)),l&&/* @__PURE__ */ve(Ta,{id:e,direction:l}),a&&/* @__PURE__ */we("filter",{id:Sa(e),x:"-40%",y:"-40%",width:"180%",height:"180%",children:[
279
287
  /* @__PURE__ */ve("feGaussianBlur",{stdDeviation:"3.5",result:"blur"}),
280
288
  /* @__PURE__ */we("feMerge",{children:[
281
289
  /* @__PURE__ */ve("feMergeNode",{in:"blur"}),
282
- /* @__PURE__ */ve("feMergeNode",{in:"SourceGraphic"})]})]}),"none"!==i&&/* @__PURE__ */ve(Fa,{id:Pa(e),variant:i})]})}function Fa({id:e,variant:t}){/* @__PURE__ */
283
- return ve("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */ve("circle",{cx:"2",cy:"2",r:"1",fill:"currentColor"})}:"grid"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */ve("path",{d:"M 20 0 L 0 0 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"cross-hatch"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */ve("path",{d:"M 0 0 L 20 20 M 20 0 L 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"plus"===t?{id:e,width:"16",height:"16",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */ve("path",{d:"M 8 4 L 8 12 M 4 8 L 12 8",fill:"none",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round"})}:{id:e,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:/* @__PURE__ */ve("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"currentColor",strokeWidth:"0.5"})})}var Ta={rise:"rosh-viz-rise",grow:"rosh-viz-grow",sweep:"rosh-viz-sweep",march:"rosh-viz-march",fade:"rosh-viz-fade"},Ea=(e,t=60)=>({animationDelay:e*t+"ms"}),Ia={receipt:/* @__PURE__ */we(ke,{children:[
290
+ /* @__PURE__ */ve("feMergeNode",{in:"SourceGraphic"})]})]}),"none"!==i&&/* @__PURE__ */ve(Oa,{id:Aa(e),variant:i})]})}function Oa({id:e,variant:t}){/* @__PURE__ */
291
+ return ve("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */ve("circle",{cx:"2",cy:"2",r:"1",fill:"currentColor"})}:"grid"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */ve("path",{d:"M 20 0 L 0 0 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"cross-hatch"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */ve("path",{d:"M 0 0 L 20 20 M 20 0 L 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"plus"===t?{id:e,width:"16",height:"16",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */ve("path",{d:"M 8 4 L 8 12 M 4 8 L 12 8",fill:"none",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round"})}:{id:e,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:/* @__PURE__ */ve("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"currentColor",strokeWidth:"0.5"})})}var Ra={rise:"rosh-viz-rise",grow:"rosh-viz-grow",sweep:"rosh-viz-sweep",march:"rosh-viz-march",fade:"rosh-viz-fade"},Wa=(e,t=60)=>({animationDelay:e*t+"ms"}),Ha={receipt:/* @__PURE__ */we(ke,{children:[
284
292
  /* @__PURE__ */ve("path",{d:"M3.4 1.9h5.2v7.2l-1.3-.9-1.3.9-1.3-.9-1.3.9z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
285
293
  /* @__PURE__ */ve("path",{d:"M4.9 4.4h2.2M4.9 6.1h2.2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),check:/* @__PURE__ */ve("path",{d:"M2.6 6.3 4.9 8.6 9.4 3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"}),doc:/* @__PURE__ */we(ke,{children:[
286
294
  /* @__PURE__ */ve("path",{d:"M3.5 1.9h3.4l2 2v6.2H3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
@@ -290,57 +298,57 @@ return ve("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSp
290
298
  /* @__PURE__ */ve("circle",{cx:"3.5",cy:"8.7",r:"1",fill:"currentColor"}),
291
299
  /* @__PURE__ */ve("circle",{cx:"8.4",cy:"8.7",r:"1",fill:"currentColor"})]}),flag:/* @__PURE__ */we(ke,{children:[
292
300
  /* @__PURE__ */ve("path",{d:"M3.8 1.7v8.6",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"}),
293
- /* @__PURE__ */ve("path",{d:"M3.8 2.5h4.8L7.5 4.4l1.1 1.9H3.8z",fill:"currentColor"})]})};function Oa({name:e}){/* @__PURE__ */
294
- return ve("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:Ia[e]})}function Ra(){/* @__PURE__ */
301
+ /* @__PURE__ */ve("path",{d:"M3.8 2.5h4.8L7.5 4.4l1.1 1.9H3.8z",fill:"currentColor"})]})};function _a({name:e}){/* @__PURE__ */
302
+ return ve("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:Ha[e]})}function qa(){/* @__PURE__ */
295
303
  return we("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
296
304
  /* @__PURE__ */ve("path",{d:"M4.2 2.2v11.6"}),
297
- /* @__PURE__ */ve("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function Wa(){/* @__PURE__ */
298
- return ve("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */ve("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var Ha=1e-6;function _a(e,t,r={}){const n=Number.isFinite(t)&&t>0?t:0,a=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(n<=0||a.length<2){const e=a[0]??0;return{anchorsMs:a,xs:a.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=a[a.length-1]-a[0],i=r.maxTimeShare??.3,s=Math.min(r.breakPx??48,n),o=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<a.length;e++){const t=a[e+1]-a[e];c.push(t),d.push(l>0?t/l*n:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,n-h*s);let p=0,g=0;for(let e=0;e<c.length;e++)u[e]||(p+=c[e],g+=1);const f=c.map((e,t)=>u[t]?s:0===g?0:p>0?m*e/p:m/g),b=function(e,t,r){const n=e.slice();let a=0;for(let e=0;e<n.length;e++)t[e]||n[e]>=r-Ha||(a+=r-n[e],n[e]=r);if(a<=Ha)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+Ha&&(l+=n[e]-r);if(l<=Ha)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+Ha||(n[e]-=i*(n[e]-r)/l);return n}(f,u,o),x=b.reduce((e,t,r)=>u[r]?e:e+t,0),y=b.map((e,t)=>u[t]?e:x>0?e*m/x:e),v=[0];for(let e=0;e<y.length;e++)v.push(v[e]+y[e]);v[v.length-1]=n;const w=v.slice(0,-1).map((e,t)=>({fromMs:a[t],toMs:a[t+1],gapMs:c[t],fromPx:e,toPx:v[t+1],wantPx:d[t],clampedPx:f[t],px:v[t+1]-e,compressed:u[t]}));return{anchorsMs:a,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=a[0])return 0;if(e>=a[a.length-1])return n;for(let t=0;t+1<a.length;t++){if(e>a[t+1])continue;const r=a[t+1]-a[t],n=r>0?(e-a[t])/r:0;return v[t]+n*(v[t+1]-v[t])}return n},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),n);for(let e=0;e+1<a.length;e++){if(t>v[e+1]&&e+2<a.length)continue;const r=v[e+1]-v[e],n=r>0?(t-v[e])/r:0;return a[e]+n*(a[e+1]-a[e])}return a[a.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function qa(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var Ua="mixed";function Ka(e,t){return 5.6*Math.max(e.length,t.length)+8}var Va=(e,t,r)=>Math.min(Math.max(e,t),r),Ya=e=>-(Math.cos(Math.PI*e)-1)/2;function Za(e,t){if(!(t>0))return{px:e.fromPx,ms:e.fromMs};if(t>=1||e.durationMs<=0)return{px:e.toPx,ms:e.toMs};const r=e.fromPx+(e.toPx-e.fromPx)*Ya(t);return{px:r,ms:e.msByPx(r)}}var Ga={lanes:{tag:0,laneA:17,laneH:30,rail:52,ruler:64,laneB:86,height:120},active:{tag:0,laneA:17,laneH:30,rail:38,ruler:50,laneB:74,height:108},none:{tag:0,laneA:16,laneH:14,rail:34,ruler:46,laneB:46,height:72}};function Ja(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var Xa=e=>5.6*e.length,Qa={default:{},dfm:{glyph:"doc",token:"var(--tl-dfm)"},shipment:{diamond:!0,glyph:"truck",token:"var(--tl-shipment)"},testing:{glyph:"flask",token:"var(--tl-testing)"},completion:{glyph:"check",token:"var(--tl-completion)"},inspection:{glyph:"flask",token:"var(--tl-inspection)"},invoice:{glyph:"receipt",token:"var(--tl-invoice)"},report:{}},el={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function tl(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:Qa[t].glyph??(r?"flag":void 0)}function rl(e,t,r=!1){const n=Qa[e],a=["rosh-tl-node","rosh-tl-mark",`is-${t}`];n.diamond&&a.push("is-diamond"),r&&a.push("is-provisional");const l="current"===t?"var(--tl-accent)":n.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:a.join(" "),style:i}}function nl(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var al="undefined"==typeof document?ce:ye;function ll(e,t){const[r,n]=ie(0);return al(()=>{const r=t?e.current:null;if(!r)return;const a=()=>{const e=r.getBoundingClientRect().width;e>0&&n(e)};if(a(),"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(a);return l.observe(r),()=>{l.disconnect()}},[e,t]),r}function il(e,t,r){const n=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&n.set(e.x,Math.max(n.get(e.x)??0,e.widthPx));const a=[...n.keys()].sort((e,t)=>e-t);if(r<=0||a.length<2)return e;const l=Math.max(0,a[0]),i=Math.min(r,a[a.length-1]),s=i-l,o=[];for(let e=0;e+1<a.length;e++){const t=(n.get(a[e])??0)/2+(n.get(a[e+1])??0)/2+8;o.push(Math.max(28,t,a[e+1]-a[e]))}const c=o.reduce((e,t)=>e+t,0),d=Math.min(Math.max(c,s),.8*r);if(d<=s+.5)return e;const u=l,h=r-i,m=u+h,p=Math.max(0,r-d),g=m>0?p*u/m:0,f=g,b=g+d,x=o.map(e=>c>0?e*d/c:0),y=e=>{if(e<=l)return u>0?e*g/u:f;if(e>=i)return h>0?b+(e-i)*(r-b)/h:b;let t=f;for(let r=0;r+1<a.length;r++){if(e>a[r+1]){t+=x[r];continue}const n=a[r+1]-a[r];return t+(n>0?(e-a[r])/n*x[r]:0)}return b};return{anchorsMs:e.anchorsMs,xs:e.xs.map(y),gaps:e.gaps.map(e=>({...e,fromPx:y(e.fromPx),toPx:y(e.toPx),px:y(e.toPx)-y(e.fromPx)})),xByMs:t=>y(e.xByMs(t)),msByPx:t=>e.msByPx((e=>{if(e<=f)return g>0?e*u/g:l;if(e>=b)return r-b>0?i+(e-b)*h/(r-b):i;let t=f;for(let r=0;r+1<a.length;r++){if(!(e>t+x[r]))return a[r]+(x[r]>0?(e-t)/x[r]*(a[r+1]-a[r]):0);t+=x[r]}return i})(t)),inCut:e.inCut}}function sl(e){if(!e||0===e.length)return null;const t=e.filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:null}function ol({marks:e,innerRef:t}){/* @__PURE__ */
305
+ /* @__PURE__ */ve("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function Ua(){/* @__PURE__ */
306
+ return ve("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */ve("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var Ka=1e-6;function Va(e,t,r={}){const n=Number.isFinite(t)&&t>0?t:0,a=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(n<=0||a.length<2){const e=a[0]??0;return{anchorsMs:a,xs:a.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=a[a.length-1]-a[0],i=r.maxTimeShare??.3,s=Math.min(r.breakPx??48,n),o=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<a.length;e++){const t=a[e+1]-a[e];c.push(t),d.push(l>0?t/l*n:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,n-h*s);let p=0,g=0;for(let e=0;e<c.length;e++)u[e]||(p+=c[e],g+=1);const f=c.map((e,t)=>u[t]?s:0===g?0:p>0?m*e/p:m/g),b=function(e,t,r){const n=e.slice();let a=0;for(let e=0;e<n.length;e++)t[e]||n[e]>=r-Ka||(a+=r-n[e],n[e]=r);if(a<=Ka)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+Ka&&(l+=n[e]-r);if(l<=Ka)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+Ka||(n[e]-=i*(n[e]-r)/l);return n}(f,u,o),x=b.reduce((e,t,r)=>u[r]?e:e+t,0),y=b.map((e,t)=>u[t]?e:x>0?e*m/x:e),v=[0];for(let e=0;e<y.length;e++)v.push(v[e]+y[e]);v[v.length-1]=n;const w=v.slice(0,-1).map((e,t)=>({fromMs:a[t],toMs:a[t+1],gapMs:c[t],fromPx:e,toPx:v[t+1],wantPx:d[t],clampedPx:f[t],px:v[t+1]-e,compressed:u[t]}));return{anchorsMs:a,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=a[0])return 0;if(e>=a[a.length-1])return n;for(let t=0;t+1<a.length;t++){if(e>a[t+1])continue;const r=a[t+1]-a[t],n=r>0?(e-a[t])/r:0;return v[t]+n*(v[t+1]-v[t])}return n},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),n);for(let e=0;e+1<a.length;e++){if(t>v[e+1]&&e+2<a.length)continue;const r=v[e+1]-v[e],n=r>0?(t-v[e])/r:0;return a[e]+n*(a[e+1]-a[e])}return a[a.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function Ya(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var Za="mixed";function Ga(e,t){return 5.6*Math.max(e.length,t.length)+8}var Ja=(e,t,r)=>Math.min(Math.max(e,t),r),Xa=e=>-(Math.cos(Math.PI*e)-1)/2;function Qa(e,t){if(!(t>0))return{px:e.fromPx,ms:e.fromMs};if(t>=1||e.durationMs<=0)return{px:e.toPx,ms:e.toMs};const r=e.fromPx+(e.toPx-e.fromPx)*Xa(t);return{px:r,ms:e.msByPx(r)}}var el={lanes:{tag:0,laneA:17,laneH:30,rail:52,ruler:64,laneB:86,height:120},active:{tag:0,laneA:17,laneH:30,rail:38,ruler:50,laneB:74,height:108},none:{tag:0,laneA:16,laneH:14,rail:34,ruler:46,laneB:46,height:72}};function tl(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var rl=e=>5.6*e.length,nl={default:{},dfm:{glyph:"doc",token:"var(--tl-dfm)"},shipment:{diamond:!0,glyph:"truck",token:"var(--tl-shipment)"},testing:{glyph:"flask",token:"var(--tl-testing)"},completion:{glyph:"check",token:"var(--tl-completion)"},inspection:{glyph:"flask",token:"var(--tl-inspection)"},invoice:{glyph:"receipt",token:"var(--tl-invoice)"},report:{}},al={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function ll(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:nl[t].glyph??(r?"flag":void 0)}function il(e,t,r=!1){const n=nl[e],a=["rosh-tl-node","rosh-tl-mark",`is-${t}`];n.diamond&&a.push("is-diamond"),r&&a.push("is-provisional");const l="current"===t?"var(--tl-accent)":n.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:a.join(" "),style:i}}function sl(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var ol="undefined"==typeof document?de:ye;function cl(e,t){const[r,n]=ie(0);return ol(()=>{const r=t?e.current:null;if(!r)return;const a=()=>{const e=r.getBoundingClientRect().width;e>0&&n(e)};if(a(),"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(a);return l.observe(r),()=>{l.disconnect()}},[e,t]),r}function dl(e,t,r){const n=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&n.set(e.x,Math.max(n.get(e.x)??0,e.widthPx));const a=[...n.keys()].sort((e,t)=>e-t);if(r<=0||a.length<2)return e;const l=Math.max(0,a[0]),i=Math.min(r,a[a.length-1]),s=i-l,o=[];for(let e=0;e+1<a.length;e++){const t=(n.get(a[e])??0)/2+(n.get(a[e+1])??0)/2+8;o.push(Math.max(28,t,a[e+1]-a[e]))}const c=o.reduce((e,t)=>e+t,0),d=Math.min(Math.max(c,s),.8*r);if(d<=s+.5)return e;const u=l,h=r-i,m=u+h,p=Math.max(0,r-d),g=m>0?p*u/m:0,f=g,b=g+d,x=o.map(e=>c>0?e*d/c:0),y=e=>{if(e<=l)return u>0?e*g/u:f;if(e>=i)return h>0?b+(e-i)*(r-b)/h:b;let t=f;for(let r=0;r+1<a.length;r++){if(e>a[r+1]){t+=x[r];continue}const n=a[r+1]-a[r];return t+(n>0?(e-a[r])/n*x[r]:0)}return b};return{anchorsMs:e.anchorsMs,xs:e.xs.map(y),gaps:e.gaps.map(e=>({...e,fromPx:y(e.fromPx),toPx:y(e.toPx),px:y(e.toPx)-y(e.fromPx)})),xByMs:t=>y(e.xByMs(t)),msByPx:t=>e.msByPx((e=>{if(e<=f)return g>0?e*u/g:l;if(e>=b)return r-b>0?i+(e-b)*h/(r-b):i;let t=f;for(let r=0;r+1<a.length;r++){if(!(e>t+x[r]))return a[r]+(x[r]>0?(e-t)/x[r]*(a[r+1]-a[r]):0);t+=x[r]}return i})(t)),inCut:e.inCut}}function ul(e){if(!e||0===e.length)return null;const t=e.filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:null}function hl({marks:e,innerRef:t}){/* @__PURE__ */
299
307
  return ve("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */we("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
300
308
  /* @__PURE__ */ve("span",{className:"rosh-tl-name",children:e.label}),
301
- /* @__PURE__ */ve("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function cl({startMs:e,endMs:t,axis:r,geo:n,reveal:a}){const l=K().timeline,i=y(U()),s=n.ruler,o=[],c=[],d=r.gaps.filter(e=>e.compressed),u=new Date(e);u.setUTCDate(u.getUTCDate()+(8-u.getUTCDay())%7);for(let e=u.getTime();e<t;e+=7*Na){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*Na)-t<14||o.push(
302
- /* @__PURE__ */ve("i",{className:"rosh-tl-tick is-week",style:{left:`${t}px`,top:`${s}px`,height:"3px"}},`wk-${e}`))}const h=d.map(e=>{const t=(e.fromPx+e.toPx)/2,r=Xa(l.days(Math.round(e.gapMs/Na)))/2+6;return[t-r,t+r]}),m=(e,t)=>h.some(([r,n])=>e<n&&t>r);o.push(
309
+ /* @__PURE__ */ve("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function ml({startMs:e,endMs:t,axis:r,geo:n,reveal:a}){const l=K().timeline,i=y(U()),s=n.ruler,o=[],c=[],d=r.gaps.filter(e=>e.compressed),u=new Date(e);u.setUTCDate(u.getUTCDate()+(8-u.getUTCDay())%7);for(let e=u.getTime();e<t;e+=7*La){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*La)-t<14||o.push(
310
+ /* @__PURE__ */ve("i",{className:"rosh-tl-tick is-week",style:{left:`${t}px`,top:`${s}px`,height:"3px"}},`wk-${e}`))}const h=d.map(e=>{const t=(e.fromPx+e.toPx)/2,r=rl(l.days(Math.round(e.gapMs/La)))/2+6;return[t-r,t+r]}),m=(e,t)=>h.some(([r,n])=>e<n&&t>r);o.push(
303
311
  /* @__PURE__ */ve("i",{"data-timeline-part":"start-tick",className:"rosh-tl-tick",style:{left:"0px",top:`${s}px`,height:"6px"}},"start"));const p=new Date(e);p.setUTCDate(1);let g=-1/0,f=!0;for(;p.getTime()<t;){const t=p.getTime();if(!(t<=e)&&!r.inCut(t)){const e=r.xByMs(t);if(o.push(
304
- /* @__PURE__ */ve("i",{className:"rosh-tl-tick",style:{left:`${e}px`,top:`${s}px`,height:"6px"}},`mo-${t}`)),e-g>=72||f){const r=f||0===p.getUTCMonth()?i.shortMonthYear(p.getUTCFullYear(),p.getUTCMonth()):i.monthsShort[p.getUTCMonth()];m(e,e+Xa(r))||(c.push(
312
+ /* @__PURE__ */ve("i",{className:"rosh-tl-tick",style:{left:`${e}px`,top:`${s}px`,height:"6px"}},`mo-${t}`)),e-g>=72||f){const r=f||0===p.getUTCMonth()?i.shortMonthYear(p.getUTCFullYear(),p.getUTCMonth()):i.monthsShort[p.getUTCMonth()];m(e,e+rl(r))||(c.push(
305
313
  /* @__PURE__ */ve("span",{className:"rosh-tl-month"+(a?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${s+9}px`,...a?{animationDelay:"420ms"}:{}},children:r},`mon-${t}`)),g=e,f=!1)}}p.setUTCMonth(p.getUTCMonth()+1)}/* @__PURE__ */
306
- return we("div",{"aria-hidden":"true","data-timeline-part":"ruler",children:[o,c,d.map(e=>{const t=Math.max(1,Math.round(e.gapMs/Na));/* @__PURE__ */
314
+ return we("div",{"aria-hidden":"true","data-timeline-part":"ruler",children:[o,c,d.map(e=>{const t=Math.max(1,Math.round(e.gapMs/La));/* @__PURE__ */
307
315
  return we("span",{"data-timeline-part":"break",className:"rosh-tl-rulercut"+(a?" rosh-tl-fade":""),style:{left:(e.fromPx+e.toPx)/2+"px",top:`${s}px`,...a?{animationDelay:"420ms"}:{}},children:[
308
316
  /* @__PURE__ */we("span",{className:"rosh-tl-cutglyph",children:[
309
317
  /* @__PURE__ */ve("i",{}),
310
318
  /* @__PURE__ */ve("i",{})]}),
311
- /* @__PURE__ */ve("span",{children:l.days(t)})]},`cut-${e.fromMs}`)})]})}function dl({pending:e,reveal:t}){const r=K().timeline,[n,a]=ie(!1),l=n?e:e.slice(0,2),i=e.length-l.length;/* @__PURE__ */
319
+ /* @__PURE__ */ve("span",{children:l.days(t)})]},`cut-${e.fromMs}`)})]})}function pl({pending:e,reveal:t}){const r=K().timeline,[n,a]=ie(!1),l=n?e:e.slice(0,2),i=e.length-l.length;/* @__PURE__ */
312
320
  return we("div",{className:"rosh-tl-pending","data-timeline-part":"pending",children:[
313
321
  /* @__PURE__ */ve("p",{className:"rosh-tl-pending-head",children:r.notReached}),
314
322
  /* @__PURE__ */ve("ol",{className:"rosh-tl-ghosts","aria-label":r.notReached,children:l.map((e,n)=>/* @__PURE__ */we("li",{className:t?"rosh-tl-fade":void 0,style:t?{animationDelay:440+60*n+"ms"}:void 0,children:[
315
- /* @__PURE__ */ve("span",{"aria-hidden":"true",className:"rosh-tl-node is-ghost"+(e.kind&&Qa[e.kind].diamond?" is-diamond":"")}),
316
- /* @__PURE__ */we("span",{children:[0===n&&/* @__PURE__ */ve("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */ve("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>a(!0),children:r.more(i)})]})}function ul({marks:e,pending:t,currentKey:r,todayMs:n,reveal:a,ariaLabel:l,step:i,nodeProps:s,onKeyDown:o}){const c=K().timeline,d=e.findIndex(e=>e.key===r),u=e.length>0&&null!==n?Math.round((n-e[e.length-1].ms)/Na):0;/* @__PURE__ */
323
+ /* @__PURE__ */ve("span",{"aria-hidden":"true",className:"rosh-tl-node is-ghost"+(e.kind&&nl[e.kind].diamond?" is-diamond":"")}),
324
+ /* @__PURE__ */we("span",{children:[0===n&&/* @__PURE__ */ve("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */ve("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>a(!0),children:r.more(i)})]})}function gl({marks:e,pending:t,currentKey:r,todayMs:n,reveal:a,ariaLabel:l,step:i,nodeProps:s,onKeyDown:o}){const c=K().timeline,d=e.findIndex(e=>e.key===r),u=e.length>0&&null!==n?Math.round((n-e[e.length-1].ms)/La):0;/* @__PURE__ */
317
325
  return we("div",{"data-timeline-part":"vertical",children:[
318
- /* @__PURE__ */ve("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:o,children:e.map((e,t)=>{const n=rl(e.kind,e.role),l=d>=0&&t<d,{glyph:o}=e;/* @__PURE__ */
319
- return we("li",{className:a?"rosh-tl-fade":void 0,style:a?Ea(t,i):void 0,...e.key===r?{"aria-current":"step"}:{},children:[
326
+ /* @__PURE__ */ve("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:o,children:e.map((e,t)=>{const n=il(e.kind,e.role),l=d>=0&&t<d,{glyph:o}=e;/* @__PURE__ */
327
+ return we("li",{className:a?"rosh-tl-fade":void 0,style:a?Wa(t,i):void 0,...e.key===r?{"aria-current":"step"}:{},children:[
320
328
  /* @__PURE__ */ve("i",{"aria-hidden":"true",className:`rosh-tl-vline text-blue-600${l?" is-on":" is-dash"}${l&&a?" rosh-tl-drawy":""}`}),
321
- /* @__PURE__ */we("button",{...s(e),className:`${n.className}${a?" rosh-tl-pop":""}`,style:{...n.style,...a?Ea(t,i):{}},children:[o&&/* @__PURE__ */ve(Oa,{name:o}),"current"===e.role&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(a?" is-on":"")})]}),
329
+ /* @__PURE__ */we("button",{...s(e),className:`${n.className}${a?" rosh-tl-pop":""}`,style:{...n.style,...a?Wa(t,i):{}},children:[o&&/* @__PURE__ */ve(_a,{name:o}),"current"===e.role&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(a?" is-on":"")})]}),
322
330
  /* @__PURE__ */we("span",{className:"rosh-tl-vrow","aria-hidden":"true",children:[
323
331
  /* @__PURE__ */ve("span",{className:"rosh-tl-name",children:e.label}),
324
332
  /* @__PURE__ */ve("span",{className:"rosh-tl-date",children:e.dateText})]})]},e.key)})}),u>0&&/* @__PURE__ */we("p",{className:"rosh-tl-vgap","aria-hidden":"true",children:[
325
333
  /* @__PURE__ */ve("i",{className:"rosh-tl-vline is-dash"}),
326
- /* @__PURE__ */ve("span",{children:c.daysToToday(u)})]}),t.length>0&&/* @__PURE__ */ve(dl,{pending:t,reveal:a})]})}function hl({axis:e,geo:t,fillTo:r,reveal:n,trackPx:a,tweened:l=!1}){/* @__PURE__ */
334
+ /* @__PURE__ */ve("span",{children:c.daysToToday(u)})]}),t.length>0&&/* @__PURE__ */ve(pl,{pending:t,reveal:a})]})}function fl({axis:e,geo:t,fillTo:r,reveal:n,trackPx:a,tweened:l=!1}){/* @__PURE__ */
327
335
  return we("div",{"aria-hidden":"true",children:[
328
336
  /* @__PURE__ */ve("div",{className:"rosh-tl-rail bg-gray-200",style:{top:`${t.rail}px`,height:"6px",width:`${a}px`}}),null!==r&&/* @__PURE__ */ve("div",{"data-timeline-part":"fill",className:`rosh-tl-fill bg-blue-600${l?" is-tweened":""}${n?" rosh-tl-draw":""}`,style:{top:`${t.rail}px`,height:"6px",width:`${Math.max(0,Math.min(e.xByMs(r),a))}px`}}),e.gaps.filter(e=>e.compressed).map(e=>/* @__PURE__ */we("div",{className:"rosh-tl-cut",style:{left:(e.fromPx+e.toPx)/2+"px",top:`${t.rail}px`,height:"6px"},children:[
329
337
  /* @__PURE__ */ve("i",{}),
330
- /* @__PURE__ */ve("i",{})]},`railcut-${e.fromMs}`))]})}function ml({geo:e,caption:t,endCaption:r,around:n,reveal:a,trackPx:l}){const i=e.rail-13-4,s=a?" rosh-tl-fade":"",o=a?{animationDelay:"420ms"}:{};/* @__PURE__ */
338
+ /* @__PURE__ */ve("i",{})]},`railcut-${e.fromMs}`))]})}function bl({geo:e,caption:t,endCaption:r,around:n,reveal:a,trackPx:l}){const i=e.rail-13-4,s=a?" rosh-tl-fade":"",o=a?{animationDelay:"420ms"}:{};/* @__PURE__ */
331
339
  return we("div",{"aria-hidden":"true","data-timeline-part":"start",children:[
332
- /* @__PURE__ */ve("i",{className:`rosh-tl-start${n?" is-around":""}${s}`,style:{left:"0px",top:`${e.rail+3}px`,...o}}),null!=t&&!1!==t&&/* @__PURE__ */ve("span",{className:`rosh-tl-edge${s}`,"data-timeline-part":"start-caption",style:{left:"0px",top:`${i}px`,...o},children:t}),null!=r&&!1!==r&&/* @__PURE__ */ve("span",{className:`rosh-tl-edge is-end${s}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...o},children:r})]})}function pl({x:e,geo:t,trackPx:r,label:n,reveal:a}){const l=K().timeline;/* @__PURE__ */
340
+ /* @__PURE__ */ve("i",{className:`rosh-tl-start${n?" is-around":""}${s}`,style:{left:"0px",top:`${e.rail+3}px`,...o}}),null!=t&&!1!==t&&/* @__PURE__ */ve("span",{className:`rosh-tl-edge${s}`,"data-timeline-part":"start-caption",style:{left:"0px",top:`${i}px`,...o},children:t}),null!=r&&!1!==r&&/* @__PURE__ */ve("span",{className:`rosh-tl-edge is-end${s}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...o},children:r})]})}function xl({x:e,geo:t,trackPx:r,label:n,reveal:a}){const l=K().timeline;/* @__PURE__ */
333
341
  return we("div",{"aria-hidden":"true","data-timeline-part":"today",children:[
334
342
  /* @__PURE__ */ve("div",{className:"rosh-tl-todayline"+(a?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${t.laneA}px`,height:t.ruler+20-t.laneA+"px",...a?{animationDelay:"420ms"}:{}}}),
335
- /* @__PURE__ */ve("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${qa(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function gl({nodes:e,geo:t,reveal:r}){const n=e.map(e=>{const t=e.members.map(e=>e.caption).filter(e=>!!e);return 0===t.length?null:{x:e.x,first:t[0],last:t[t.length-1]}}).filter(e=>null!==e).sort((e,t)=>e.x-t.x),a=[];let l=null;const i=()=>{l&&(a.push({x:(l.from+l.to)/2,text:l.first===l.last?l.first:`${l.first}–${l.last}`}),l=null)};for(const e of n){const t=e.first===e.last?e.first:`${e.first}–${e.last}`,r=Xa(t)/2;l&&e.x-r<l.right+6?(l.to=e.x,l.last=e.last,l.right=e.x+r):(i(),l={from:e.x,to:e.x,first:e.first,last:e.last,right:e.x+r})}return i(),/* @__PURE__ */ve("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */ve("span",{className:"rosh-tl-caption"+(r?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:`${t.laneA}px`,...r?{animationDelay:"360ms"}:{}},children:e.text},`${e.x}-${e.text}`))})}function fl({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
343
+ /* @__PURE__ */ve("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${Ya(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function yl({nodes:e,geo:t,reveal:r}){const n=e.map(e=>{const t=e.members.map(e=>e.caption).filter(e=>!!e);return 0===t.length?null:{x:e.x,first:t[0],last:t[t.length-1]}}).filter(e=>null!==e).sort((e,t)=>e.x-t.x),a=[];let l=null;const i=()=>{l&&(a.push({x:(l.from+l.to)/2,text:l.first===l.last?l.first:`${l.first}–${l.last}`}),l=null)};for(const e of n){const t=e.first===e.last?e.first:`${e.first}–${e.last}`,r=rl(t)/2;l&&e.x-r<l.right+6?(l.to=e.x,l.last=e.last,l.right=e.x+r):(i(),l={from:e.x,to:e.x,first:e.first,last:e.last,right:e.x+r})}return i(),/* @__PURE__ */ve("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */ve("span",{className:"rosh-tl-caption"+(r?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:`${t.laneA}px`,...r?{animationDelay:"360ms"}:{}},children:e.text},`${e.x}-${e.text}`))})}function vl({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
336
344
  return we("div",{"aria-hidden":"true","data-timeline-part":"phase",children:[
337
345
  /* @__PURE__ */ve("div",{className:"rosh-tl-phase border-gray-300",style:{left:`${n}px`,width:`${a}px`,top:t.laneB+t.laneH-4+"px"}}),
338
- /* @__PURE__ */we("span",{className:"rosh-tl-phase-label text-gray-500",style:{left:`${n+a/2}px`,top:`${t.laneB+t.laneH+5}px`},children:[e.label," · parallel"]})]})}function bl({nodes:e,trackPx:t,geo:r,activeKey:n,hoveredKey:a,currentKey:l}){const i=K().timeline,s=(e,t)=>null!==t&&(e.key===t||e.members.some(e=>e.key===t)),o=e.find(e=>e.key===a)??e.find(e=>s(e,n))??null;if(!o)return null;const c=o.mark,d=c?c.label:`×${o.members.length}`,u=c?c.dateText:function(e){const t=e[0].dateText,r=e[e.length-1].dateText;return t===r?t:`${t} – ${r}`}(o.members),h=c?c.widthPx:Ka(d,u),m=c?.onOpen;/* @__PURE__ */
339
- return we("div",{"data-timeline-part":"label",className:`rosh-tl-label${o.key===a?" is-hot":""}${s(o,l)?" is-current":""}`,style:{left:`${qa(o.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */ve("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */ve("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
340
- /* @__PURE__ */ve("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function xl({groups:e,trackPx:t,geo:r,startMs:n,endMs:a,currentKey:l,hoveredKey:i,reveal:s,step:o,zoomedKey:c,popId:d,aimBubble:u,openCluster:h,setOpenCluster:m,previewCluster:p,setPreviewCluster:g,setZoomKey:f,startCaptionPx:b}){const x=[];e.forEach((e,t)=>{if("cluster"===e.type){const n=`cluster-${e.members[0].key}`,a=(r=e.members,`${(r[0]?.label??"").replace(/\s*v?\d+$/i,"").trim()||(r[0]?.label??"")} ×${r.length}`);if(x.push({key:n,group:e,text:a,x:e.members.reduce((e,t)=>e+t.baseX,0)/e.members.length,index:t,lane:-1,left:0,widthPx:Math.ceil(Xa(a))+28}),n===c)for(const r of e.members)x.push({key:r.key,group:{type:"item",mark:r},text:r.label,x:r.x,index:t,lane:-1,left:0,widthPx:r.widthPx});return}var r;x.push({key:e.mark.key,group:e,text:e.mark.label,x:e.mark.x,index:t,lane:-1,left:0,widthPx:e.mark.widthPx})}),x.sort((e,t)=>e.x-t.x);const y=function(e,t,r,n,a={}){const l=t>0?t:0,i=n>0?n:1,s=a.gapPx??6,o=Math.max(1,a.laneCount??4),c=e.map((e,t)=>({item:e,index:t})).sort((e,t)=>(e.item.priority??0)-(t.item.priority??0)||e.item.ms-t.item.ms||e.index-t.index),d=Array.from({length:o},()=>[]),u=/* @__PURE__ */new Map;for(const{item:e}of c){const t=Math.max(0,e.widthPx);if(l<=0||t>l){u.set(e.key,-1);continue}const n=e.xPx??(e.ms-r)/i*l,a=Math.min(Math.max(n-t/2,0),l-t),c=a+t;let h=-1;for(let e=0;e<o;e++)if(d[e].every(e=>a>e.right+s||c+s<e.left)){d[e].push({left:a,right:c}),h=e;break}u.set(e.key,h)}return e.map(e=>({key:e.key,lane:u.get(e.key)??-1}))}([...b>0?[{key:"__rosh-tl-start__",ms:n,xPx:0,widthPx:b,priority:-2}]:[],...x.map(e=>({key:e.key,ms:"cluster"===e.group.type?e.group.members[0].ms:e.group.mark.ms,xPx:e.x,widthPx:e.widthPx,priority:"cluster"===e.group.type?-1:0}))],t,n,Math.max(a-n,Na),{laneCount:2}),v=new Map(y.map(e=>[e.key,e.lane]));for(const e of x)e.lane=v.get(e.key)??-1,e.left=qa(e.x,e.widthPx,t);const w=x.find(e=>e.key===(h??p)),k=e=>0===e?r.laneA:r.laneB,N=e=>0===e?r.rail-4:r.rail+6+3;/* @__PURE__ */
346
+ /* @__PURE__ */we("span",{className:"rosh-tl-phase-label text-gray-500",style:{left:`${n+a/2}px`,top:`${t.laneB+t.laneH+5}px`},children:[e.label," · parallel"]})]})}function wl({nodes:e,trackPx:t,geo:r,activeKey:n,hoveredKey:a,currentKey:l}){const i=K().timeline,s=(e,t)=>null!==t&&(e.key===t||e.members.some(e=>e.key===t)),o=e.find(e=>e.key===a)??e.find(e=>s(e,n))??null;if(!o)return null;const c=o.mark,d=c?c.label:`×${o.members.length}`,u=c?c.dateText:function(e){const t=e[0].dateText,r=e[e.length-1].dateText;return t===r?t:`${t} – ${r}`}(o.members),h=c?c.widthPx:Ga(d,u),m=c?.onOpen;/* @__PURE__ */
347
+ return we("div",{"data-timeline-part":"label",className:`rosh-tl-label${o.key===a?" is-hot":""}${s(o,l)?" is-current":""}`,style:{left:`${Ya(o.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */ve("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */ve("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
348
+ /* @__PURE__ */ve("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function kl({groups:e,trackPx:t,geo:r,startMs:n,endMs:a,currentKey:l,hoveredKey:i,reveal:s,step:o,zoomedKey:c,popId:d,aimBubble:u,openCluster:h,setOpenCluster:m,previewCluster:p,setPreviewCluster:g,setZoomKey:f,startCaptionPx:b}){const x=[];e.forEach((e,t)=>{if("cluster"===e.type){const n=`cluster-${e.members[0].key}`,a=(r=e.members,`${(r[0]?.label??"").replace(/\s*v?\d+$/i,"").trim()||(r[0]?.label??"")} ×${r.length}`);if(x.push({key:n,group:e,text:a,x:e.members.reduce((e,t)=>e+t.baseX,0)/e.members.length,index:t,lane:-1,left:0,widthPx:Math.ceil(rl(a))+28}),n===c)for(const r of e.members)x.push({key:r.key,group:{type:"item",mark:r},text:r.label,x:r.x,index:t,lane:-1,left:0,widthPx:r.widthPx});return}var r;x.push({key:e.mark.key,group:e,text:e.mark.label,x:e.mark.x,index:t,lane:-1,left:0,widthPx:e.mark.widthPx})}),x.sort((e,t)=>e.x-t.x);const y=function(e,t,r,n,a={}){const l=t>0?t:0,i=n>0?n:1,s=a.gapPx??6,o=Math.max(1,a.laneCount??4),c=e.map((e,t)=>({item:e,index:t})).sort((e,t)=>(e.item.priority??0)-(t.item.priority??0)||e.item.ms-t.item.ms||e.index-t.index),d=Array.from({length:o},()=>[]),u=/* @__PURE__ */new Map;for(const{item:e}of c){const t=Math.max(0,e.widthPx);if(l<=0||t>l){u.set(e.key,-1);continue}const n=e.xPx??(e.ms-r)/i*l,a=Math.min(Math.max(n-t/2,0),l-t),c=a+t;let h=-1;for(let e=0;e<o;e++)if(d[e].every(e=>a>e.right+s||c+s<e.left)){d[e].push({left:a,right:c}),h=e;break}u.set(e.key,h)}return e.map(e=>({key:e.key,lane:u.get(e.key)??-1}))}([...b>0?[{key:"__rosh-tl-start__",ms:n,xPx:0,widthPx:b,priority:-2}]:[],...x.map(e=>({key:e.key,ms:"cluster"===e.group.type?e.group.members[0].ms:e.group.mark.ms,xPx:e.x,widthPx:e.widthPx,priority:"cluster"===e.group.type?-1:0}))],t,n,Math.max(a-n,La),{laneCount:2}),v=new Map(y.map(e=>[e.key,e.lane]));for(const e of x)e.lane=v.get(e.key)??-1,e.left=Ya(e.x,e.widthPx,t);const w=x.find(e=>e.key===(h??p)),k=e=>0===e?r.laneA:r.laneB,N=e=>0===e?r.rail-4:r.rail+6+3;/* @__PURE__ */
341
349
  return we(ke,{children:[x.map(e=>{const t=Math.max(0,e.lane),n=Math.round(e.index*o+60);if("cluster"===e.group.type){const a=h===e.key,l=e.group.members.map(e=>e.x),i=()=>{g(null),a||f(null)};/* @__PURE__ */
342
350
  return we("div",{children:[
343
- /* @__PURE__ */we("button",{type:"button","data-timeline-part":"cluster",className:`rosh-tl-pill${Qa[e.group.kind]?.token?"":" text-blue-600"}${s?" rosh-tl-fade":""}`,"aria-expanded":a,"aria-controls":d,style:{left:`${e.left}px`,top:`${0===t?r.laneA+r.laneH-19:r.laneB}px`,color:Qa[e.group.kind]?.token,...s?{animationDelay:`${n}ms`}:{}},onMouseEnter:()=>{g(e.key),f(e.key)},onMouseLeave:i,onFocus:()=>{g(e.key),f(e.key)},onBlur:i,onClick:()=>{m(a?null:e.key),f(a?null:e.key)},children:[
351
+ /* @__PURE__ */we("button",{type:"button","data-timeline-part":"cluster",className:`rosh-tl-pill${nl[e.group.kind]?.token?"":" text-blue-600"}${s?" rosh-tl-fade":""}`,"aria-expanded":a,"aria-controls":d,style:{left:`${e.left}px`,top:`${0===t?r.laneA+r.laneH-19:r.laneB}px`,color:nl[e.group.kind]?.token,...s?{animationDelay:`${n}ms`}:{}},onMouseEnter:()=>{g(e.key),f(e.key)},onMouseLeave:i,onFocus:()=>{g(e.key),f(e.key)},onBlur:i,onClick:()=>{m(a?null:e.key),f(a?null:e.key)},children:[
344
352
  /* @__PURE__ */ve("i",{"aria-hidden":"true"}),e.text]}),
345
353
  /* @__PURE__ */ve("i",{"aria-hidden":"true",className:"rosh-tl-cspan",style:{left:`${Math.min(...l)}px`,width:`${Math.max(1,Math.max(...l)-Math.min(...l))}px`,top:`${N(t)}px`}})]},e.key)}const a=e.group.mark;if(e.lane<0)return a.key===i?/* @__PURE__ */we("div",{"aria-hidden":"true","data-timeline-part":"reveal",className:"rosh-tl-label is-reveal is-hot",style:{left:`${e.left}px`,top:`${r.laneA}px`,width:`${e.widthPx}px`},children:[
346
354
  /* @__PURE__ */ve("span",{className:"rosh-tl-name",children:a.label}),
@@ -352,24 +360,24 @@ return we("div",{children:[
352
360
  /* @__PURE__ */ve("p",{className:"rosh-tl-popover-head",children:w.text}),
353
361
  /* @__PURE__ */ve("ol",{children:w.group.members.map(e=>/* @__PURE__ */we("li",{children:[
354
362
  /* @__PURE__ */ve("span",{children:e.label}),
355
- /* @__PURE__ */ve("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function yl({thumb:e,value:t,snap:r,axis:n,geo:a,startMs:l,endMs:i,trackPx:s,layerRef:o,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=K().timeline,p=U(),g=se(!1),f=c?c.px:n.xByMs(t),b=c?c.ms:t,x=sl(e.stops),y=x?x.indexOf(t):-1,v=e=>{const r=o.current?.getBoundingClientRect();return r?n.msByPx(e-r.left):t},w=n=>{const a=r(n);a!==t&&e.onChange(a)},k=t=>{d?.(),g.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},N=t=>{g.current&&(g.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},M=e=>{if(!g.current)return;const t=v(e.clientX);w(t),h(function(e,t){if(!Number.isFinite(t))return null;const r=e.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms);for(let e=0;e+1<r.length;e++){const n=r[e],a=r[e+1];if(t<n.ms||t>a.ms)continue;const l=a.ms-n.ms;return{fromKey:n.key,toKey:a.key,t:l>0?Va((t-n.ms)/l,0,1):1,ms:t}}return null}(u,t))},$=e.valueText?e.valueText(b):$a(b,p),C=Math.max(1,Math.round((i-l)/Na));/* @__PURE__ */
363
+ /* @__PURE__ */ve("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function Nl({thumb:e,value:t,snap:r,axis:n,geo:a,startMs:l,endMs:i,trackPx:s,layerRef:o,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=K().timeline,p=U(),g=se(!1),f=c?c.px:n.xByMs(t),b=c?c.ms:t,x=ul(e.stops),y=x?x.indexOf(t):-1,v=e=>{const r=o.current?.getBoundingClientRect();return r?n.msByPx(e-r.left):t},w=n=>{const a=r(n);a!==t&&e.onChange(a)},k=t=>{d?.(),g.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},N=t=>{g.current&&(g.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},M=e=>{if(!g.current)return;const t=v(e.clientX);w(t),h(function(e,t){if(!Number.isFinite(t))return null;const r=e.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms);for(let e=0;e+1<r.length;e++){const n=r[e],a=r[e+1];if(t<n.ms||t>a.ms)continue;const l=a.ms-n.ms;return{fromKey:n.key,toKey:a.key,t:l>0?Ja((t-n.ms)/l,0,1):1,ms:t}}return null}(u,t))},$=e.valueText?e.valueText(b):ja(b,p),C=Math.max(1,Math.round((i-l)/La));/* @__PURE__ */
356
364
  return we(ke,{children:[
357
365
  /* @__PURE__ */ve("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:a.rail-9+"px",height:"24px"},onPointerDown:e=>{k(e),w(v(e.clientX))},onPointerMove:M,onPointerUp:N,onPointerCancel:N}),
358
- /* @__PURE__ */ve("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${qa(f,88,s)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):$a(b,p)}),
359
- /* @__PURE__ */ve("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":x&&x.length>0?x.length-1:C,"aria-valuenow":x&&x.length>0?Math.max(0,y):Math.round((t-l)/Na),"aria-valuetext":$,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:k,onPointerMove:M,onPointerUp:N,onPointerCancel:N,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(x&&x.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?x[Math.min(e+1,x.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?x[Math.max(e-1,0)]:"Home"===r?x[0]:"End"===r?x[x.length-1]:null}const n=(e.shiftKey?7:1)*Na;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function vl(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function wl({startMs:e,endMs:t,axis:r="linear",items:a,markers:l=[],pending:i=[],fillToMs:s,todayMs:o,labels:c="lanes",activeKey:d=null,onActivate:u,thumb:h,playback:m,edgeCaptions:p,phases:g=[],currentKey:f,zoomRange:b=null,motion:x=!0,ariaLabel:y,highlightKeys:v=null,onHoverChange:w,endMark:k=null}){const N="none"===c,M=re(Date.now,null),$=re(Ja,!1),C=o??M,L=se(null),D=K().timeline,P=U(),j=e=>$a(e,P),z=se(null),A=se(null),S=se(null),B=se(/* @__PURE__ */new Map),F=se(void 0),T=se(void 0),E=se(null),[I,O]=ie({}),[R,H]=ie(null),[_,q]=ie(null),[V,Y]=ie(null),[Z,G]=ie(null),[J,X]=ie(null),[Q,ee]=ie(null),te=oe(),ne=oe(),ae=ll(L,!0),de=ae>0?ae-(i.length>0&&!N?176:0):0,ue=de>0&&de-20<320,he=ll(z,!ue),me=he>0?he:600,pe=Ga[c],ge=N&&i.length>0,fe=ge?Math.max(0,me-36):me,be=r=>r>=e-Na&&r<=t+Na,xe=a.filter(e=>Number.isFinite(e.ms)&&be(e.ms)).slice().sort((e,t)=>e.ms-t.ms),ye="spread"===r?l.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],Ne=_a([e,...[...xe.map(e=>e.ms),...ye].filter(r=>r>e&&r<t),t],fe,"compressed"===(Me=r)?{}:"spread"===Me?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var Me;const $e=Ne.xByMs,Ce=xe.filter(e=>!e.provisional),Le=f??(Ce.length>0?Ce[Ce.length-1].key:null),De=xe.map((e,t)=>{const r=e.date??j(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?el[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:$e(e.ms),baseX:$e(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:tl(e,a,0===t&&"default"===a),role:e.key===Le?"current":n?"dot":"key",widthPx:N?Math.max(16,Xa(e.caption??"")+6):I[e.key]||Ka(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),Pe=l.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&be(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=j(t);return{key:r,ms:t,x:$e(t),baseX:$e(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??Qa[e.kind].glyph,role:"key",widthPx:I[r]||Ka(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),je=ge?(()=>{const e=i[i.length-1],r=i.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Na,x:me,baseX:me,kind:e.kind??"default",label:e.label,dateText:D.notReached,detail:r.length>0?D.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],ze=N&&k&&!ge?[{key:k.key,ms:t,x:fe,baseX:fe,kind:"default",label:k.label,dateText:k.dateText??j(t),detail:k.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Ae=[...De,...Pe,...je,...ze].sort((e,t)=>e.x-t.x||e.ms-t.ms),Se=p?.start??D.start(j(e)),Be=null==Se||!1===Se?0:"string"==typeof Se?Math.ceil(Xa(Se)):96,Fe="lanes"===c?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),s=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||s)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}(Ae):[],Te=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:Ua,members:t})}n=a}return r}(Ae),Ee=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ie=/* @__PURE__ */new Map;for(const e of Te)if("cluster"===e.type)for(const t of e.members)Ie.set(t.key,Ee(e));const Oe=V??Z??J,Re=Fe.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Oe)??Te.find(e=>"cluster"===e.type&&Ee(e)===Oe),We=e=>({x:e.baseX,widthPx:e.widthPx}),He=Re&&"cluster"===Re.type?Re.members.map(We):b?Ae.filter(e=>e.ms>=b[0]&&e.ms<=b[1]).map(We):[],_e=He.length>1?il(Ne,He,fe):Ne,qe=_e!==Ne;if(qe)for(const e of Ae)e.isCap||(e.x=_e.xByMs(e.ms));const Ue=Ae.some(e=>e.x<14),Ke=qe&&Re?Oe:null,Ve=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ye=ue?Ae.map(Ve):Te.flatMap(e=>{if("item"===e.type)return[Ve(e.mark)];const t=Ee(e);if(t===Ke&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ve);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ze=/* @__PURE__ */new Map;for(const e of Ye)for(const t of e.members)Ze.set(t.key,e.key);const Ge=Te.find(e=>"cluster"===e.type&&Ee(e)===Ke),Je=Ge&&"cluster"===Ge.type?{from:Math.min(...Ge.members.map(e=>e.x))-16,to:Math.max(...Ge.members.map(e=>e.x))+16}:null,Xe=se(Ke),[Qe,et]=ie(!1);ce(()=>{if(Xe.current===Ke)return;Xe.current=Ke,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[Ke]);const tt=Ae.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");al(()=>{const e=A.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}O(e=>function(e,t){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Math.abs((e[r]??0)-(t[r]??0))<.5)}(e,t)?e:t)},[tt]);const rt=`${c}|${r}|${Ae.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=ie(rt),lt=x&&nt===rt;ce(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,Ae.length-1)),st=sl(h?.stops),ot=r=>{const n=Math.min(Math.max(r,e),t);if(!st)return n;let a=st[0];for(const e of st)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=h?ot(h.valueMs):null,dt=m&&h?De.filter(e=>!st||st.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const s=l[t],o=l[t+1],c=e.xByMs(s.ms),d=e.xByMs(o.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:Va(350*u/100,450,1400)/n;i.push({fromKey:s.key,toKey:o.key,fromMs:s.ms,toMs:o.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(_e,dt,{speed:m?.speed,reducedMotion:$}),[ht,mt]=ie(null),pt=se(null),gt=se({segments:ut,value:ct,playback:m});ce(()=>{gt.current={segments:ut,value:ct,playback:m}});const ft=se(null),bt=le(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=le(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!m?.playing&&!!h;ce(()=>{if(!yt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void xt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(Za(t,0))):xt()},s=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:Za(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:Za(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=Za(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:Ya(l),ms:i.ms}};const s=e[t.index+1];return{cursor:s?{index:t.index+1,phase:"rest",t:0,restLeftMs:s.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(s)):xt()};return l(),n=requestAnimationFrame(s),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[yt,xt,bt]);const vt=De.filter(e=>!e.provisional),wt=h?ht?ht.ms:ct:void 0!==s?s:vt.length>0?null===C?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,C):null,kt=new Set(v??[]),Nt=Ae.filter(e=>kt.has(e.key)).map(e=>e.x),Mt=Nt.length>0?{from:Math.min(...Nt),to:Math.max(...Nt)}:null,$t=le(()=>{clearTimeout(F.current),clearTimeout(T.current),H(null),q(null),Y(null),G(null),X(null)},[]);ce(()=>()=>{clearTimeout(F.current),clearTimeout(T.current)},[]),ce(()=>{const e=E.current;e&&(E.current=null,B.current.get(e)?.focus())});const Ct=null!==_||null!==V||null!==Z||null!==J;ce(()=>{if(Ct)return W(e=>"Escape"===e.key&&($t(),!0))},[Ct,$t]);const Lt=le((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let a=r>0?Math.max(r,Math.min(t,me-r)):t;const l=e.parentElement;if(r>0&&l){const t=n(e),i=l.getBoundingClientRect().left,s=t.left+8+r-i,o=t.right-8-r-i;s<=o&&(a=Math.max(s,Math.min(a,o)))}e.style.left=`${a}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-a)}px`)},[me]),Dt=Ye.find(e=>e.key===_)??null,Pt=Dt?Dt.x:0;al(()=>{Lt(S.current,Pt)},[Lt,_,Pt]);const jt=ct??void 0,zt=se(null);ce(()=>{if(void 0===jt)return;const e=_e.xByMs(jt),t=zt.current;if(zt.current=e,null===t||e<=t)return;const r=[];for(const n of Ae){if(n.x<=t||n.x>e)continue;const a=B.current.get(Ze.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[jt]);const At=Ye.map(e=>e.key),St=Le?Ze.get(Le)??null:null,Bt=Q&&At.includes(Q)?Q:St&&At.includes(St)?St:At[0],Ft=e=>{const t=At.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?At.length-1:-1;r<0||r>At.length-1||(e.preventDefault(),ee(At[r]),B.current.get(At[r])?.focus())},Tt=()=>clearTimeout(T.current),Et=e=>{Tt(),X(e)},It=()=>{clearTimeout(T.current),T.current=setTimeout(()=>X(null),260)},Ot=e=>{Ke&&Ie.get(e)===Ke?Tt():(Tt(),X(null))},Rt=e=>{clearTimeout(F.current),H(e),q(e),w?.((e=>{const t=Ye.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{H(t=>t===e?null:t),clearTimeout(F.current),F.current=setTimeout(()=>q(t=>t===e?null:t),160),w?.(null)},Ht=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":nl(e),"aria-describedby":_===e.key?te:void 0,tabIndex:e.key===Bt?0:-1,ref:t=>{t?B.current.set(e.key,t):B.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),ee(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&u?.(e.key)}}),_t=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=D,r.events(t.length,t.map(nl))),"aria-describedby":_===e.key?te:void 0,tabIndex:e.key===Bt?0:-1,ref:t=>{t?B.current.set(e.key,t):B.current.delete(e.key)},onMouseEnter:()=>{e.openable?Et(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Tt(),Rt(e.key),ee(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Et(e.key);const r=e.members[0];ee(r.key),E.current=r.key}};var t,r},qt="lanes"!==c||Ae.length>1;if(ue)/* @__PURE__ */
360
- return ve("div",{ref:L,children:/* @__PURE__ */ve(ul,{marks:Ae.filter(e=>!e.isCap),pending:i,currentKey:Le,todayMs:C,reveal:lt,ariaLabel:y,step:it,nodeProps:Ht,onKeyDown:Ft})});const Ut=(e,t)=>null==e||!1===e?null:/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:pe.rail-3+"px"},children:e});/* @__PURE__ */
366
+ /* @__PURE__ */ve("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${Ya(f,88,s)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):ja(b,p)}),
367
+ /* @__PURE__ */ve("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":x&&x.length>0?x.length-1:C,"aria-valuenow":x&&x.length>0?Math.max(0,y):Math.round((t-l)/La),"aria-valuetext":$,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:k,onPointerMove:M,onPointerUp:N,onPointerCancel:N,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(x&&x.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?x[Math.min(e+1,x.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?x[Math.max(e-1,0)]:"Home"===r?x[0]:"End"===r?x[x.length-1]:null}const n=(e.shiftKey?7:1)*La;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function Ml(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function $l({startMs:e,endMs:t,axis:r="linear",items:n,markers:l=[],pending:i=[],fillToMs:s,todayMs:o,labels:c="lanes",activeKey:d=null,onActivate:u,thumb:h,playback:m,edgeCaptions:p,phases:g=[],currentKey:f,zoomRange:b=null,motion:x=!0,ariaLabel:y,highlightKeys:v=null,onHoverChange:w,endMark:k=null}){const N="none"===c,M=re(Date.now,null),$=re(tl,!1),C=o??M,L=se(null),D=K().timeline,j=U(),P=e=>ja(e,j),S=se(null),z=se(null),A=se(null),B=se(/* @__PURE__ */new Map),F=se(void 0),E=se(void 0),T=se(null),[I,O]=ie({}),[R,H]=ie(null),[_,q]=ie(null),[V,Y]=ie(null),[Z,G]=ie(null),[J,X]=ie(null),[Q,ee]=ie(null),te=oe(),ne=oe(),ae=cl(L,!0),ce=ae>0?ae-(i.length>0&&!N?176:0):0,ue=ce>0&&ce-20<320,he=cl(S,!ue),me=he>0?he:600,pe=el[c],ge=N&&i.length>0,fe=ge?Math.max(0,me-36):me,be=r=>r>=e-La&&r<=t+La,xe=n.filter(e=>Number.isFinite(e.ms)&&be(e.ms)).slice().sort((e,t)=>e.ms-t.ms),ye="spread"===r?l.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],Ne=Va([e,...[...xe.map(e=>e.ms),...ye].filter(r=>r>e&&r<t),t],fe,"compressed"===(Me=r)?{}:"spread"===Me?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var Me;const $e=Ne.xByMs,Ce=xe.filter(e=>!e.provisional),Le=f??(Ce.length>0?Ce[Ce.length-1].key:null),De=xe.map((e,t)=>{const r=e.date??P(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?al[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:$e(e.ms),baseX:$e(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:ll(e,a,0===t&&"default"===a),role:e.key===Le?"current":n?"dot":"key",widthPx:N?Math.max(16,rl(e.caption??"")+6):I[e.key]||Ga(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),je=l.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&be(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=P(t);return{key:r,ms:t,x:$e(t),baseX:$e(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??nl[e.kind].glyph,role:"key",widthPx:I[r]||Ga(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),Pe=ge?(()=>{const e=i[i.length-1],r=i.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+La,x:me,baseX:me,kind:e.kind??"default",label:e.label,dateText:D.notReached,detail:r.length>0?D.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],Se=N&&k&&!ge?[{key:k.key,ms:t,x:fe,baseX:fe,kind:"default",label:k.label,dateText:k.dateText??P(t),detail:k.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],ze=[...De,...je,...Pe,...Se].sort((e,t)=>e.x-t.x||e.ms-t.ms),Ae=p?.start??D.start(P(e)),Be=null==Ae||!1===Ae?0:"string"==typeof Ae?Math.ceil(rl(Ae)):96,Fe="lanes"===c?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),s=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||s)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}(ze):[],Ee=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:Za,members:t})}n=a}return r}(ze),Te=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ie=/* @__PURE__ */new Map;for(const e of Ee)if("cluster"===e.type)for(const t of e.members)Ie.set(t.key,Te(e));const Oe=V??Z??J,Re=Fe.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Oe)??Ee.find(e=>"cluster"===e.type&&Te(e)===Oe),We=e=>({x:e.baseX,widthPx:e.widthPx}),He=Re&&"cluster"===Re.type?Re.members.map(We):b?ze.filter(e=>e.ms>=b[0]&&e.ms<=b[1]).map(We):[],_e=He.length>1?dl(Ne,He,fe):Ne,qe=_e!==Ne;if(qe)for(const e of ze)e.isCap||(e.x=_e.xByMs(e.ms));const Ue=ze.some(e=>e.x<14),Ke=qe&&Re?Oe:null,Ve=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ye=ue?ze.map(Ve):Ee.flatMap(e=>{if("item"===e.type)return[Ve(e.mark)];const t=Te(e);if(t===Ke&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ve);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ze=/* @__PURE__ */new Map;for(const e of Ye)for(const t of e.members)Ze.set(t.key,e.key);const Ge=Ee.find(e=>"cluster"===e.type&&Te(e)===Ke),Je=Ge&&"cluster"===Ge.type?{from:Math.min(...Ge.members.map(e=>e.x))-16,to:Math.max(...Ge.members.map(e=>e.x))+16}:null,Xe=se(Ke),[Qe,et]=ie(!1);de(()=>{if(Xe.current===Ke)return;Xe.current=Ke,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[Ke]);const tt=ze.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");ol(()=>{const e=z.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}O(e=>function(e,t){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Math.abs((e[r]??0)-(t[r]??0))<.5)}(e,t)?e:t)},[tt]);const rt=`${c}|${r}|${ze.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=ie(rt),lt=x&&nt===rt;de(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,ze.length-1)),st=ul(h?.stops),ot=r=>{const n=Math.min(Math.max(r,e),t);if(!st)return n;let a=st[0];for(const e of st)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=h?ot(h.valueMs):null,dt=m&&h?De.filter(e=>!st||st.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const s=l[t],o=l[t+1],c=e.xByMs(s.ms),d=e.xByMs(o.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:Ja(350*u/100,450,1400)/n;i.push({fromKey:s.key,toKey:o.key,fromMs:s.ms,toMs:o.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(_e,dt,{speed:m?.speed,reducedMotion:$}),[ht,mt]=ie(null),pt=se(null),gt=se({segments:ut,value:ct,playback:m});de(()=>{gt.current={segments:ut,value:ct,playback:m}});const ft=se(null),bt=le(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=le(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!m?.playing&&!!h;de(()=>{if(!yt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void xt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(Qa(t,0))):xt()},s=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:Qa(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:Qa(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=Qa(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:Xa(l),ms:i.ms}};const s=e[t.index+1];return{cursor:s?{index:t.index+1,phase:"rest",t:0,restLeftMs:s.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(s)):xt()};return l(),n=requestAnimationFrame(s),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[yt,xt,bt]);const vt=De.filter(e=>!e.provisional),wt=h?ht?ht.ms:ct:void 0!==s?s:vt.length>0?null===C?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,C):null,kt=new Set(v??[]),Nt=ze.filter(e=>kt.has(e.key)).map(e=>e.x),Mt=Nt.length>0?{from:Math.min(...Nt),to:Math.max(...Nt)}:null,$t=le(()=>{clearTimeout(F.current),clearTimeout(E.current),H(null),q(null),Y(null),G(null),X(null)},[]);de(()=>()=>{clearTimeout(F.current),clearTimeout(E.current)},[]),de(()=>{const e=T.current;e&&(T.current=null,B.current.get(e)?.focus())});const Ct=null!==_||null!==V||null!==Z||null!==J;de(()=>{if(Ct)return W(e=>"Escape"===e.key&&($t(),!0))},[Ct,$t]);const Lt=le((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,me-r)):t;const l=e.parentElement;if(r>0&&l){const t=a(e),i=l.getBoundingClientRect().left,s=t.left+8+r-i,o=t.right-8-r-i;s<=o&&(n=Math.max(s,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[me]),Dt=Ye.find(e=>e.key===_)??null,jt=Dt?Dt.x:0;ol(()=>{Lt(A.current,jt)},[Lt,_,jt]);const Pt=ct??void 0,St=se(null);de(()=>{if(void 0===Pt)return;const e=_e.xByMs(Pt),t=St.current;if(St.current=e,null===t||e<=t)return;const r=[];for(const n of ze){if(n.x<=t||n.x>e)continue;const a=B.current.get(Ze.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[Pt]);const zt=Ye.map(e=>e.key),At=Le?Ze.get(Le)??null:null,Bt=Q&&zt.includes(Q)?Q:At&&zt.includes(At)?At:zt[0],Ft=e=>{const t=zt.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?zt.length-1:-1;r<0||r>zt.length-1||(e.preventDefault(),ee(zt[r]),B.current.get(zt[r])?.focus())},Et=()=>clearTimeout(E.current),Tt=e=>{Et(),X(e)},It=()=>{clearTimeout(E.current),E.current=setTimeout(()=>X(null),260)},Ot=e=>{Ke&&Ie.get(e)===Ke?Et():(Et(),X(null))},Rt=e=>{clearTimeout(F.current),H(e),q(e),w?.((e=>{const t=Ye.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{H(t=>t===e?null:t),clearTimeout(F.current),F.current=setTimeout(()=>q(t=>t===e?null:t),160),w?.(null)},Ht=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":sl(e),"aria-describedby":_===e.key?te:void 0,tabIndex:e.key===Bt?0:-1,ref:t=>{t?B.current.set(e.key,t):B.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),ee(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&u?.(e.key)}}),_t=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=D,r.events(t.length,t.map(sl))),"aria-describedby":_===e.key?te:void 0,tabIndex:e.key===Bt?0:-1,ref:t=>{t?B.current.set(e.key,t):B.current.delete(e.key)},onMouseEnter:()=>{e.openable?Tt(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Et(),Rt(e.key),ee(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Tt(e.key);const r=e.members[0];ee(r.key),T.current=r.key}};var t,r},qt="lanes"!==c||ze.length>1;if(ue)/* @__PURE__ */
368
+ return ve("div",{ref:L,children:/* @__PURE__ */ve(gl,{marks:ze.filter(e=>!e.isCap),pending:i,currentKey:Le,todayMs:C,reveal:lt,ariaLabel:y,step:it,nodeProps:Ht,onKeyDown:Ft})});const Ut=(e,t)=>null==e||!1===e?null:/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:pe.rail-3+"px"},children:e});/* @__PURE__ */
361
369
  return we("div",{ref:L,className:"rosh-tl-body"+(i.length>0&&!N?"":" is-solo"),children:[
362
- /* @__PURE__ */we("div",{className:"flex items-stretch gap-3",children:[N&&Ut(Se,!1),
363
- /* @__PURE__ */ve("div",{className:"rosh-tl-stage",style:{height:`${vl(pe,qt,g.length>0&&!N)}px`},children:/* @__PURE__ */we("div",{ref:z,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Je)return;const t=z.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Je.from&&r<=Je.to?Tt():It()},onMouseLeave:It,children:[!N&&/* @__PURE__ */ve(ol,{marks:Ae,innerRef:A}),
364
- /* @__PURE__ */ve(hl,{axis:_e,geo:pe,fillTo:wt,reveal:lt,trackPx:fe,tweened:!!h}),ge&&
370
+ /* @__PURE__ */we("div",{className:"flex items-stretch gap-3",children:[N&&Ut(Ae,!1),
371
+ /* @__PURE__ */ve("div",{className:"rosh-tl-stage",style:{height:`${Ml(pe,qt,g.length>0&&!N)}px`},children:/* @__PURE__ */we("div",{ref:S,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Je)return;const t=S.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Je.from&&r<=Je.to?Et():It()},onMouseLeave:It,children:[!N&&/* @__PURE__ */ve(hl,{marks:ze,innerRef:z}),
372
+ /* @__PURE__ */ve(fl,{axis:_e,geo:pe,fillTo:wt,reveal:lt,trackPx:fe,tweened:!!h}),ge&&
365
373
  /* @__PURE__ */ve("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${fe}px`,width:me-fe+"px",top:pe.rail+3-1+"px"}}),Mt&&/* @__PURE__ */ve("div",{"aria-hidden":"true",className:"rosh-tl-band","data-timeline-part":"highlight",style:{left:Mt.from-10+"px",width:Mt.to-Mt.from+20+"px",top:pe.rail-7+"px",height:"20px"}}),
366
- /* @__PURE__ */ve(cl,{startMs:e,endMs:t,axis:_e,geo:pe,reveal:lt}),
367
- /* @__PURE__ */ve(ml,{geo:pe,caption:N?null:Se,endCaption:N?null:p?.end,around:Ue,reveal:lt,trackPx:me}),N&&/* @__PURE__ */ve(gl,{nodes:Ye,geo:pe,reveal:lt}),null!==C&&C>e&&C<=t+Na&&/* @__PURE__ */ve(pl,{x:_e.xByMs(Math.min(C,t)),geo:pe,trackPx:me,label:j(C),reveal:lt}),!N&&g.map(e=>/* @__PURE__ */ve(fl,{phase:e,geo:pe,xOf:_e.xByMs},e.key)),
368
- /* @__PURE__ */ve("ol",{className:"rosh-tl-nodes","aria-label":y,onKeyDown:Ft,children:Ye.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${pe.rail+3}px`,a=lt?Ea(t,it):{},l=(e=>!!Mt&&e.x>=Mt.from-.5&&e.x<=Mt.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
369
- return ve("li",{children:/* @__PURE__ */ve("button",{...Ht(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:n,...a}})},e.key);if(!e.mark){const t=e.kind===Ua,i=rl(t?"default":e.kind,"key"),s=t?void 0:Qa[e.kind]?.glyph;/* @__PURE__ */
374
+ /* @__PURE__ */ve(ml,{startMs:e,endMs:t,axis:_e,geo:pe,reveal:lt}),
375
+ /* @__PURE__ */ve(bl,{geo:pe,caption:N?null:Ae,endCaption:N?null:p?.end,around:Ue,reveal:lt,trackPx:me}),N&&/* @__PURE__ */ve(yl,{nodes:Ye,geo:pe,reveal:lt}),null!==C&&C>e&&C<=t+La&&/* @__PURE__ */ve(xl,{x:_e.xByMs(Math.min(C,t)),geo:pe,trackPx:me,label:P(C),reveal:lt}),!N&&g.map(e=>/* @__PURE__ */ve(vl,{phase:e,geo:pe,xOf:_e.xByMs},e.key)),
376
+ /* @__PURE__ */ve("ol",{className:"rosh-tl-nodes","aria-label":y,onKeyDown:Ft,children:Ye.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${pe.rail+3}px`,a=lt?Wa(t,it):{},l=(e=>!!Mt&&e.x>=Mt.from-.5&&e.x<=Mt.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
377
+ return ve("li",{children:/* @__PURE__ */ve("button",{...Ht(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:n,...a}})},e.key);if(!e.mark){const t=e.kind===Za,i=il(t?"default":e.kind,"key"),s=t?void 0:nl[e.kind]?.glyph;/* @__PURE__ */
370
378
  return we("li",{...r(Le)?{"aria-current":"step"}:{},children:[
371
- /* @__PURE__ */we("button",{..._t(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(d)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:n,...a},children:[s&&/* @__PURE__ */ve(Oa,{name:s}),t&&/* @__PURE__ */we("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */we("i",{"aria-hidden":"true",className:"rosh-tl-count"+(lt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:n},children:["×",e.members.length]})]},e.key)}const i=e.mark,s=rl(i.kind,i.role,i.provisional),{glyph:o}=i;/* @__PURE__ */
372
- return ve("li",{...i.key===Le?{"aria-current":"step"}:{},children:/* @__PURE__ */we("button",{...Ht(i),className:`${s.className}${i.key===d?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...s.style,left:`${i.x}px`,top:n,...a},children:[o&&/* @__PURE__ */ve(Oa,{name:o}),"current"===i.role&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===c?/* @__PURE__ */ve(xl,{groups:Fe,trackPx:me,geo:pe,startMs:e,endMs:t,currentKey:Le,hoveredKey:R,reveal:lt,step:it,zoomedKey:Ke,popId:ne,aimBubble:Lt,startCaptionPx:Be,openCluster:V,setOpenCluster:Y,previewCluster:Z,setPreviewCluster:G,setZoomKey:X}):"active"===c?/* @__PURE__ */ve(bl,{nodes:Ye,trackPx:me,geo:pe,activeKey:d,hoveredKey:R,currentKey:Le}):null,Dt&&/* @__PURE__ */ve("div",{ref:S,id:te,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${pe.rail+6+6}px`},onMouseEnter:()=>{Tt(),Rt(Dt.key)},onMouseLeave:()=>{It(),Wt(Dt.key)},onFocus:()=>{Tt(),Rt(Dt.key)},onBlur:()=>{It(),Wt(Dt.key)},children:Dt.mark?/* @__PURE__ */we(ke,{children:[
379
+ /* @__PURE__ */we("button",{..._t(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(d)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:n,...a},children:[s&&/* @__PURE__ */ve(_a,{name:s}),t&&/* @__PURE__ */we("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */we("i",{"aria-hidden":"true",className:"rosh-tl-count"+(lt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:n},children:["×",e.members.length]})]},e.key)}const i=e.mark,s=il(i.kind,i.role,i.provisional),{glyph:o}=i;/* @__PURE__ */
380
+ return ve("li",{...i.key===Le?{"aria-current":"step"}:{},children:/* @__PURE__ */we("button",{...Ht(i),className:`${s.className}${i.key===d?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...s.style,left:`${i.x}px`,top:n,...a},children:[o&&/* @__PURE__ */ve(_a,{name:o}),"current"===i.role&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===c?/* @__PURE__ */ve(kl,{groups:Fe,trackPx:me,geo:pe,startMs:e,endMs:t,currentKey:Le,hoveredKey:R,reveal:lt,step:it,zoomedKey:Ke,popId:ne,aimBubble:Lt,startCaptionPx:Be,openCluster:V,setOpenCluster:Y,previewCluster:Z,setPreviewCluster:G,setZoomKey:X}):"active"===c?/* @__PURE__ */ve(wl,{nodes:Ye,trackPx:me,geo:pe,activeKey:d,hoveredKey:R,currentKey:Le}):null,Dt&&/* @__PURE__ */ve("div",{ref:A,id:te,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${pe.rail+6+6}px`},onMouseEnter:()=>{Et(),Rt(Dt.key)},onMouseLeave:()=>{It(),Wt(Dt.key)},onFocus:()=>{Et(),Rt(Dt.key)},onBlur:()=>{It(),Wt(Dt.key)},children:Dt.mark?/* @__PURE__ */we(ke,{children:[
373
381
  /* @__PURE__ */ve("span",{className:"rosh-tl-name",children:Dt.mark.label}),
374
382
  /* @__PURE__ */ve("span",{className:"rosh-tl-date",children:Dt.mark.dateText}),Dt.mark.preview?/* @__PURE__ */ve("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:Dt.mark.preview}):Dt.mark.detail&&/* @__PURE__ */ve("span",{className:"rosh-tl-detail",children:Dt.mark.detail}),(Dt.mark.onOpen??Dt.mark.onClick)&&/* @__PURE__ */ve("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(Dt.mark?.onOpen??Dt.mark?.onClick)?.(),children:D.openButton})]}):
375
383
  /* @__PURE__ */we("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
@@ -378,36 +386,36 @@ return ve("li",{...i.key===Le?{"aria-current":"step"}:{},children:/* @__PURE__ *
378
386
  /* @__PURE__ */we("p",{className:"rosh-tl-foldrow",children:[
379
387
  /* @__PURE__ */ve("span",{children:e.label}),
380
388
  /* @__PURE__ */ve("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */ve("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */ve("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),h&&null!==ct&&
381
- /* @__PURE__ */ve(yl,{thumb:h,value:ct,snap:ot,axis:_e,geo:pe,startMs:e,endMs:t,trackPx:me,layerRef:z,glide:ht,onScrub:m?xt:void 0,nodes:dt,onProgress:bt})]})}),N&&Ut(p?.end,!0)]}),i.length>0&&!N&&/* @__PURE__ */ve(dl,{pending:i,reveal:lt})]})}function kl({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const s=[...r?[/* @__PURE__ */ve("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
389
+ /* @__PURE__ */ve(Nl,{thumb:h,value:ct,snap:ot,axis:_e,geo:pe,startMs:e,endMs:t,trackPx:me,layerRef:S,glide:ht,onScrub:m?xt:void 0,nodes:dt,onProgress:bt})]})}),N&&Ut(p?.end,!0)]}),i.length>0&&!N&&/* @__PURE__ */ve(pl,{pending:i,reveal:lt})]})}function Cl({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const s=[...r?[/* @__PURE__ */ve("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
382
390
  return we("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
383
391
  /* @__PURE__ */we("div",{className:"rosh-tl-head",children:[
384
392
  /* @__PURE__ */we("div",{className:"rosh-tl-head-main",children:[e&&/* @__PURE__ */ve("span",{className:"rosh-tl-ico text-gray-500","aria-hidden":"true",children:e}),
385
393
  /* @__PURE__ */ve("h4",{className:"rosh-tl-title text-gray-800",children:t}),s.length>0&&/* @__PURE__ */ve("p",{className:"rosh-tl-meta text-gray-500",children:s.map((e,t)=>
386
- /* @__PURE__ */we(fe,{children:[t>0&&/* @__PURE__ */ve("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */ve("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */ve("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Nl({title:e,heading:t,subject:r,milestones:n,summary:a,endDate:l,phaseLabels:i,variant:s="card",edgeCaptions:o,highlightKeys:c=null,onHoverChange:d}){const u=re(Date.now,null),h=[],m=[],p=K().timeline,g=U();for(const e of n){const t=Ma(e.date??null);null===t?m.push({key:e.key,label:e.label,kind:e.kind}):h.push({...e,ms:t})}h.sort((e,t)=>e.ms-t.ms);const f=Ma(l??null);let b,x,y=!0;0===h.length?(x=f??u??0,b=x-30*Na,y=null!==f||null!==u):(b=h[0].ms,x=f??h[h.length-1].ms,x-b<Na&&(x=b+Na));const v=h.length>0?Math.max(0,Math.round((x-b)/Na)):0,w=a??(v>0?p.duration(v):void 0),k=[h.length>0?p.started($a(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,n.length):void 0],N=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),M={};for(const e of h)e.phase&&(M[e.phase]=M[e.phase]||[]).push(e.ms);const $=Object.entries(M).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),C="rail"===s,L=y&&/* @__PURE__ */ve("div",{className:"select-none",children:/* @__PURE__ */ve(wl,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:N,pending:m,phases:$,startMs:b,endMs:x,todayMs:u??void 0,edgeCaptions:o,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
387
- return ve("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */ve(kl,{icon:/* @__PURE__ */ve(Ra,{}),heading:t??e,subject:r,meta:k,children:L})})}var Ml=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),$l=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function Cl(e){if(e.order_qty<=0)return 0;let t=0;for(const r of $l)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function Ll(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Cl(t),0)/t.length}function Dl(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:s,msPerDayOfPlayback:o=500,markers:c=[]}=e,[d,u]=ie(null),h=K().production;ce(()=>{s?u(new Date(s).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=ie(!1),g=se(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};ce(()=>()=>f(),[]),ce(()=>{f()},[i]);const b=t.map(e=>Ma(e.date)).filter(e=>null!=e),x=re(Date.now,null)??Math.max(0,...b,...c.map(e=>Ma(e.date)??0),Ma(r??null)??0,Ma(n??null)??0),y=b.length?Math.min(...b):x,v=b.length?Math.max(...b):x,w=Ma(r??null)??y,k=Ma(n??null)??0,N=Ml.has((a||"").toLowerCase()),M=c.reduce((e,t)=>{const r=Ma(t.date);return null!=r&&r>e?r:e},0),$=(()=>{const e=[k,v,M,w+Na];return N||e.push(x),Math.max(...e)})(),C=Math.max(1,Math.round(($-w)/Na)),L=Ma(s??null)??v??w,D=Math.min(Math.max(d??L,w),$),P=t.find(e=>{const t=Ma(e.date);return null!=t&&t<=D})??null;let j=null;for(let e=t.length-1;e>=0;e--){const r=Ma(t[e].date);if(null!=r&&r>D){j=t[e];break}}const z=(()=>{if(P||!j||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${l}`,progress_number:h.start,date:r||new Date(w).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),A=P??z,S=P?Ma(P.date):z?w:null,B=j?Ma(j.date):null,F=!!(A&&j&&null!=S&&null!=B&&D>S&&D<B);let T,E;if(F&&null!=S&&null!=B){const e=(D-S)/Math.max(B-S,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of A?.items??[])r[e.part_number]=e;const n={};for(const e of j?.items??[])n[e.part_number]=e;const a=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const l=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:l.description??i.description??"",order_qty:s(l.order_qty??i.order_qty??0),casting:t(s(l.casting),s(i.casting)),cnc:t(s(l.cnc),s(i.cnc)),painting:t(s(l.painting),s(i.painting)),packing:t(s(l.packing),s(i.packing)),finished_goods:t(s(l.finished_goods),s(i.finished_goods)),stock_qty:t(s(l.stock_qty),s(i.stock_qty))}}),l=Ma(A?.est_completion_date),i=Ma(j?.est_completion_date);let s;s=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):A?.est_completion_date||j?.est_completion_date||null,T={id:`interp-${D}`,progress_number:h.estimated,date:new Date(D).toISOString().slice(0,10),created_by_name:"",est_completion_date:s,items:a,notes:""},E=A}else if(T=A??t[t.length-1]??null,T){const e=t.findIndex(e=>e.id===T.id);E=e>=0&&e<t.length-1?t[e+1]:null}else E=null;const I={};for(const e of E?.items??[])I[e.part_number]=e;const O=!(!i||T?.id===i),R=i?Math.min(Ma(s??null)??$,$):$,W=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:$,totalLeadDays:C,scrubMs:D,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),s&&u(new Date(s).getTime())},scrubbedAway:O,beforeAnchor:A,nextAfter:j,displayed:T,prevReport:E,prevByPN:I,isInterpolated:F,playing:m,startPlay:()=>{if(m)return void f();if(R<=w)return void u(R);p(!0),u(w);let e=performance.now(),t=w;const r=n=>{const a=n-e;if(e=n,t+=a/o*Na,t>=R)return u(R),g.current=null,void p(!1);u(t),g.current=requestAnimationFrame(r)};g.current=requestAnimationFrame(r)},stopPlay:f,reports:t,markers:c,poNumber:l,currentReportId:i,currentReportProgressNumber:W,estCompletionMs:Ma(n??null)}}function Pl({startMs:e,endMs:t,reports:r,markers:n,valueMs:a,activeId:l,onChange:i,onPickReport:s,onOpenReport:o,onOpenMarker:c,onDragStart:d,renderReportPreview:u,reportLabel:h,playback:m,edgeCaptions:p,bare:g=!1,endMark:f=null}){const b=K().production,x=U(),y=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),v=y.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:h(e),preview:e.preview??u?.(e),onOpen:o?()=>o(e.id):void 0})),w=new Map(y.map(({report:e,ms:t})=>[e.id,t])),k=y.map(({ms:e})=>e),N=c?n.map(e=>({...e,onOpen:c})):n;/* @__PURE__ */
388
- return ve("div",{className:"select-none",children:/* @__PURE__ */ve(wl,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:N,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),s(e)},playback:m,edgeCaptions:p,thumb:{valueMs:a,onChange:i,onDragStart:d,stops:k,ariaLabel:b.scrub,valueText:e=>{const t=(e=>y.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${$a(e,x)}`:$a(e,x)}},ariaLabel:b.label($a(e,x),$a(t,x))})})}function jl({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,onScrubProgress:l,heading:i,edgeCaptions:s,reportLabel:o=e=>e.progress_number,resetLabel:c,variant:d="card",onPlayStart:u}){const{reports:h,markers:m,poNumber:p,startMs:g,endMs:f,totalLeadDays:b,scrubMs:x,setScrubMs:y,displayed:v,scrubbedAway:w,resetToCurrent:k,currentReportId:N,currentReportProgressNumber:M,estCompletionMs:$}=e,C=function(e,t,r){const[n,a]=ie(!1),l=se(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),l.current||(l.current=!0,t(e[0])),a(!0))},stop:()=>{l.current=!1,a(!1)}}}(h.map(e=>Ma(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),y,u),L=K().production,D=U(),P=i??L.heading,j=e=>$a(e,D);if(0===h.length&&0===m.length)return null;const z=m.filter(e=>"shipment"===e.kind),A=m.filter(e=>"inspection"===e.kind),S=m.filter(e=>"invoice"===e.kind),B=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),F=v?Ll(v):0,T=h.find(e=>e.id===N),E=T?o(T):M,I=
394
+ /* @__PURE__ */we(fe,{children:[t>0&&/* @__PURE__ */ve("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */ve("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */ve("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Ll({title:e,heading:t,subject:r,milestones:n,summary:a,endDate:l,phaseLabels:i,variant:s="card",edgeCaptions:o,highlightKeys:c=null,onHoverChange:d}){const u=re(Date.now,null),h=[],m=[],p=K().timeline,g=U();for(const e of n){const t=Da(e.date??null);null===t?m.push({key:e.key,label:e.label,kind:e.kind}):h.push({...e,ms:t})}h.sort((e,t)=>e.ms-t.ms);const f=Da(l??null);let b,x,y=!0;0===h.length?(x=f??u??0,b=x-30*La,y=null!==f||null!==u):(b=h[0].ms,x=f??h[h.length-1].ms,x-b<La&&(x=b+La));const v=h.length>0?Math.max(0,Math.round((x-b)/La)):0,w=a??(v>0?p.duration(v):void 0),k=[h.length>0?p.started(ja(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,n.length):void 0],N=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),M={};for(const e of h)e.phase&&(M[e.phase]=M[e.phase]||[]).push(e.ms);const $=Object.entries(M).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),C="rail"===s,L=y&&/* @__PURE__ */ve("div",{className:"select-none",children:/* @__PURE__ */ve($l,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:N,pending:m,phases:$,startMs:b,endMs:x,todayMs:u??void 0,edgeCaptions:o,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
395
+ return ve("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */ve(Cl,{icon:/* @__PURE__ */ve(qa,{}),heading:t??e,subject:r,meta:k,children:L})})}var Dl=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),jl=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function Pl(e){if(e.order_qty<=0)return 0;let t=0;for(const r of jl)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function Sl(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Pl(t),0)/t.length}function zl(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:s,msPerDayOfPlayback:o=500,markers:c=[]}=e,[d,u]=ie(null),h=K().production;de(()=>{s?u(new Date(s).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=ie(!1),g=se(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};de(()=>()=>f(),[]),de(()=>{f()},[i]);const b=t.map(e=>Da(e.date)).filter(e=>null!=e),x=re(Date.now,null)??Math.max(0,...b,...c.map(e=>Da(e.date)??0),Da(r??null)??0,Da(n??null)??0),y=b.length?Math.min(...b):x,v=b.length?Math.max(...b):x,w=Da(r??null)??y,k=Da(n??null)??0,N=Dl.has((a||"").toLowerCase()),M=c.reduce((e,t)=>{const r=Da(t.date);return null!=r&&r>e?r:e},0),$=(()=>{const e=[k,v,M,w+La];return N||e.push(x),Math.max(...e)})(),C=Math.max(1,Math.round(($-w)/La)),L=Da(s??null)??v??w,D=Math.min(Math.max(d??L,w),$),j=t.find(e=>{const t=Da(e.date);return null!=t&&t<=D})??null;let P=null;for(let e=t.length-1;e>=0;e--){const r=Da(t[e].date);if(null!=r&&r>D){P=t[e];break}}const S=(()=>{if(j||!P||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${l}`,progress_number:h.start,date:r||new Date(w).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),z=j??S,A=j?Da(j.date):S?w:null,B=P?Da(P.date):null,F=!!(z&&P&&null!=A&&null!=B&&D>A&&D<B);let E,T;if(F&&null!=A&&null!=B){const e=(D-A)/Math.max(B-A,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of z?.items??[])r[e.part_number]=e;const n={};for(const e of P?.items??[])n[e.part_number]=e;const a=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const l=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:l.description??i.description??"",order_qty:s(l.order_qty??i.order_qty??0),casting:t(s(l.casting),s(i.casting)),cnc:t(s(l.cnc),s(i.cnc)),painting:t(s(l.painting),s(i.painting)),packing:t(s(l.packing),s(i.packing)),finished_goods:t(s(l.finished_goods),s(i.finished_goods)),stock_qty:t(s(l.stock_qty),s(i.stock_qty))}}),l=Da(z?.est_completion_date),i=Da(P?.est_completion_date);let s;s=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):z?.est_completion_date||P?.est_completion_date||null,E={id:`interp-${D}`,progress_number:h.estimated,date:new Date(D).toISOString().slice(0,10),created_by_name:"",est_completion_date:s,items:a,notes:""},T=z}else if(E=z??t[t.length-1]??null,E){const e=t.findIndex(e=>e.id===E.id);T=e>=0&&e<t.length-1?t[e+1]:null}else T=null;const I={};for(const e of T?.items??[])I[e.part_number]=e;const O=!(!i||E?.id===i),R=i?Math.min(Da(s??null)??$,$):$,W=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:$,totalLeadDays:C,scrubMs:D,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),s&&u(new Date(s).getTime())},scrubbedAway:O,beforeAnchor:z,nextAfter:P,displayed:E,prevReport:T,prevByPN:I,isInterpolated:F,playing:m,startPlay:()=>{if(m)return void f();if(R<=w)return void u(R);p(!0),u(w);let e=performance.now(),t=w;const r=n=>{const a=n-e;if(e=n,t+=a/o*La,t>=R)return u(R),g.current=null,void p(!1);u(t),g.current=requestAnimationFrame(r)};g.current=requestAnimationFrame(r)},stopPlay:f,reports:t,markers:c,poNumber:l,currentReportId:i,currentReportProgressNumber:W,estCompletionMs:Da(n??null)}}function Al({startMs:e,endMs:t,reports:r,markers:n,valueMs:a,activeId:l,onChange:i,onPickReport:s,onOpenReport:o,onOpenMarker:c,onDragStart:d,renderReportPreview:u,reportLabel:h,playback:m,edgeCaptions:p,bare:g=!1,endMark:f=null}){const b=K().production,x=U(),y=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),v=y.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:h(e),preview:e.preview??u?.(e),onOpen:o?()=>o(e.id):void 0})),w=new Map(y.map(({report:e,ms:t})=>[e.id,t])),k=y.map(({ms:e})=>e),N=c?n.map(e=>({...e,onOpen:c})):n;/* @__PURE__ */
396
+ return ve("div",{className:"select-none",children:/* @__PURE__ */ve($l,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:N,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),s(e)},playback:m,edgeCaptions:p,thumb:{valueMs:a,onChange:i,onDragStart:d,stops:k,ariaLabel:b.scrub,valueText:e=>{const t=(e=>y.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${ja(e,x)}`:ja(e,x)}},ariaLabel:b.label(ja(e,x),ja(t,x))})})}function Bl({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,onScrubProgress:l,heading:i,edgeCaptions:s,reportLabel:o=e=>e.progress_number,resetLabel:c,variant:d="card",onPlayStart:u}){const{reports:h,markers:m,poNumber:p,startMs:g,endMs:f,totalLeadDays:b,scrubMs:x,setScrubMs:y,displayed:v,scrubbedAway:w,resetToCurrent:k,currentReportId:N,currentReportProgressNumber:M,estCompletionMs:$}=e,C=function(e,t,r){const[n,a]=ie(!1),l=se(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),l.current||(l.current=!0,t(e[0])),a(!0))},stop:()=>{l.current=!1,a(!1)}}}(h.map(e=>Da(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),y,u),L=K().production,D=U(),j=i??L.heading,P=e=>ja(e,D);if(0===h.length&&0===m.length)return null;const S=m.filter(e=>"shipment"===e.kind),z=m.filter(e=>"inspection"===e.kind),A=m.filter(e=>"invoice"===e.kind),B=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),F=v?Sl(v):0,E=h.find(e=>e.id===N),T=E?o(E):M,I=
389
397
  /* @__PURE__ */we("button",{type:"button",onClick:C.toggle,"aria-pressed":C.playing,title:C.playing?L.pause:L.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[C.playing?/* @__PURE__ */ve("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M2 1.5h2.3v7H2zM5.7 1.5H8v7H5.7z"})}):/* @__PURE__ */ve("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M2 1.2 8.4 5 2 8.8z"})}),
390
- /* @__PURE__ */ve("span",{children:C.playing?L.pause:L.play})]}),O=w&&(c??E)?/* @__PURE__ */ve("button",{type:"button",onClick:()=>{C.stop(),k()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(E))}):null,[R,W]=X(L.showing),H=e=>/* @__PURE__ */ve("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */we(ke,{children:[e&&R,
398
+ /* @__PURE__ */ve("span",{children:C.playing?L.pause:L.play})]}),O=w&&(c??T)?/* @__PURE__ */ve("button",{type:"button",onClick:()=>{C.stop(),k()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(T))}):null,[R,W]=X(L.showing),H=e=>/* @__PURE__ */ve("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */we(ke,{children:[e&&R,
391
399
  /* @__PURE__ */ve("b",{className:"font-medium",children:o(v)}),e&&W,
392
- /* @__PURE__ */we("span",{className:"text-gray-500",children:[" · ",j(new Date(v.date).getTime())," · ",L.overall(Math.round(F))," · ",L.inStock(B)]})]}):/* @__PURE__ */ve("span",{className:"text-gray-500",children:L.noReport})});if("rail"===d){const e=null!=$&&$>=f&&f>g,i=e?{key:"__estimate__",label:L.estimatedCompletion,dateText:j($)}:null;/* @__PURE__ */
400
+ /* @__PURE__ */we("span",{className:"text-gray-500",children:[" · ",P(new Date(v.date).getTime())," · ",L.overall(Math.round(F))," · ",L.inStock(B)]})]}):/* @__PURE__ */ve("span",{className:"text-gray-500",children:L.noReport})});if("rail"===d){const e=null!=$&&$>=f&&f>g,i=e?{key:"__estimate__",label:L.estimatedCompletion,dateText:P($)}:null;/* @__PURE__ */
393
401
  return we("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
394
- /* @__PURE__ */ve(Pl,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:o,edgeCaptions:{start:s?.start??L.start,end:s?.end??(e?L.estDone:void 0)},onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}}),
402
+ /* @__PURE__ */ve(Al,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:o,edgeCaptions:{start:s?.start??L.start,end:s?.end??(e?L.estDone:void 0)},onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}}),
395
403
  /* @__PURE__ */we("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[I,O,H(!1)]})]})}/* @__PURE__ */
396
- return ve("div",{className:"shrink-0",children:/* @__PURE__ */ve(kl,{icon:/* @__PURE__ */ve(Wa,{}),heading:P,subject:p,meta:[`${j(g)} → ${j(f)}`,L.leadTime(b)],actions:/* @__PURE__ */we(ke,{children:[O,I]}),footer:/* @__PURE__ */we(ke,{children:[H(!0),
404
+ return ve("div",{className:"shrink-0",children:/* @__PURE__ */ve(Cl,{icon:/* @__PURE__ */ve(Ua,{}),heading:j,subject:p,meta:[`${P(g)} → ${P(f)}`,L.leadTime(b)],actions:/* @__PURE__ */we(ke,{children:[O,I]}),footer:/* @__PURE__ */we(ke,{children:[H(!0),
397
405
  /* @__PURE__ */we("div",{className:"rosh-tl-legend",children:[h.length>0&&/* @__PURE__ */we("span",{className:"border-gray-200 text-gray-500",children:[
398
- /* @__PURE__ */ve("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),z.length>0&&/* @__PURE__ */we("span",{className:"border-gray-200 text-gray-500",children:[
399
- /* @__PURE__ */ve("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */ve(Oa,{name:"truck"})}),L.shipment]}),A.length>0&&/* @__PURE__ */we("span",{className:"border-gray-200 text-gray-500",children:[
400
- /* @__PURE__ */ve("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */ve(Oa,{name:"flask"})}),L.inspection]}),S.length>0&&/* @__PURE__ */we("span",{className:"border-gray-200 text-gray-500",children:[
401
- /* @__PURE__ */ve("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */ve(Oa,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */ve(Pl,{startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:o,edgeCaptions:s,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}})})})}var zl=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function Al({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:n,qtyField:a="instruction",showNewIndicator:l=!1,getInstructionQty:i=e=>e.quantity,getActualQty:s=e=>e.actual_qty,isFilled:o,isNew:c=e=>Boolean(e._isNew),className:d,style:u}){const h=K().containers,m=o?e.filter(o):e,p=e=>zl(i(e)),g=e=>zl(s(e)),f=m.some(e=>null!=s(e)&&g(e)>0),b=e=>f?p(e):"actual"===a?s(e)??i(e)??0:i(e)??0,x=m.reduce((e,t)=>e+zl(b(t)),0),y=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+zl(b(t)),0),w=m.reduce((e,t)=>e+p(t),0),k=m.reduce((e,t)=>e+g(t),0),N=e=>t?.(e)??0,M=r??(e=>N(e)*p(e)),$=n??(e=>N(e)*g(e)),C=m.reduce((e,t)=>e+M(t),0),L=m.reduce((e,t)=>e+$(t),0),D=f?Math.max(C,L):"actual"===a&&L||C,P=D<=34.65?"20ft":"40ft",j="20ft"===P?33:67,z=D>0?Math.max(1,Math.ceil(D/j)):0,A=z*j,S=D>0&&D>=.95*A&&D<=1.1*A;if(0===m.length)return null;const B=(e,t)=>j>0?Math.max(0,Math.min((e-t*j)/j*100,100)):0;/* @__PURE__ */
406
+ /* @__PURE__ */ve("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),S.length>0&&/* @__PURE__ */we("span",{className:"border-gray-200 text-gray-500",children:[
407
+ /* @__PURE__ */ve("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */ve(_a,{name:"truck"})}),L.shipment]}),z.length>0&&/* @__PURE__ */we("span",{className:"border-gray-200 text-gray-500",children:[
408
+ /* @__PURE__ */ve("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */ve(_a,{name:"flask"})}),L.inspection]}),A.length>0&&/* @__PURE__ */we("span",{className:"border-gray-200 text-gray-500",children:[
409
+ /* @__PURE__ */ve("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */ve(_a,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */ve(Al,{startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:o,edgeCaptions:s,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}})})})}var Fl=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function El({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:n,qtyField:a="instruction",showNewIndicator:l=!1,getInstructionQty:i=e=>e.quantity,getActualQty:s=e=>e.actual_qty,isFilled:o,isNew:c=e=>Boolean(e._isNew),className:d,style:u}){const h=K().containers,m=o?e.filter(o):e,p=e=>Fl(i(e)),g=e=>Fl(s(e)),f=m.some(e=>null!=s(e)&&g(e)>0),b=e=>f?p(e):"actual"===a?s(e)??i(e)??0:i(e)??0,x=m.reduce((e,t)=>e+Fl(b(t)),0),y=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+Fl(b(t)),0),w=m.reduce((e,t)=>e+p(t),0),k=m.reduce((e,t)=>e+g(t),0),N=e=>t?.(e)??0,M=r??(e=>N(e)*p(e)),$=n??(e=>N(e)*g(e)),C=m.reduce((e,t)=>e+M(t),0),L=m.reduce((e,t)=>e+$(t),0),D=f?Math.max(C,L):"actual"===a&&L||C,j=D<=34.65?"20ft":"40ft",P="20ft"===j?33:67,S=D>0?Math.max(1,Math.ceil(D/P)):0,z=S*P,A=D>0&&D>=.95*z&&D<=1.1*z;if(0===m.length)return null;const B=(e,t)=>P>0?Math.max(0,Math.min((e-t*P)/P*100,100)):0;/* @__PURE__ */
402
410
  return we("div",{className:`mt-2 px-1 space-y-2 ${d??""}`.trim(),style:u,children:[
403
411
  /* @__PURE__ */we("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
404
412
  /* @__PURE__ */we("span",{children:[`${h.items(m.length)} · ${h.pieces(x)}`,f&&w!==k&&/* @__PURE__ */ve("span",{className:"ml-1 text-gray-400",children:h.split(w,k)})]}),l&&y>0&&/* @__PURE__ */we("span",{className:"flex items-center gap-1 text-green-600",children:[
405
- /* @__PURE__ */ve("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(y,v)]})]}),D>0?/* @__PURE__ */we("div",{className:"space-y-1.5",children:[Array.from({length:z}).map((e,t)=>{const r=B(C,t),n=B(L,t),a=f,l=Math.max(r,n),i=Math.min(r,n),s=r>=n,o=a?s?"bg-blue-500":"bg-green-500":"bg-blue-500",c=a?s?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
413
+ /* @__PURE__ */ve("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(y,v)]})]}),D>0?/* @__PURE__ */we("div",{className:"space-y-1.5",children:[Array.from({length:S}).map((e,t)=>{const r=B(C,t),n=B(L,t),a=f,l=Math.max(r,n),i=Math.min(r,n),s=r>=n,o=a?s?"bg-blue-500":"bg-green-500":"bg-blue-500",c=a?s?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
406
414
  return we("div",{className:"flex items-center gap-2",children:[
407
- /* @__PURE__ */ve("span",{className:"text-[10px] text-gray-400 w-8 shrink-0",children:P}),
415
+ /* @__PURE__ */ve("span",{className:"text-[10px] text-gray-400 w-8 shrink-0",children:j}),
408
416
  /* @__PURE__ */we("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
409
417
  /* @__PURE__ */ve("div",{className:`absolute inset-y-0 left-0 ${o} transition-all`,style:{width:`${l}%`}}),a&&i>0&&/* @__PURE__ */ve("div",{className:`absolute inset-y-0 left-0 ${c} transition-all`,style:{width:`${i}%`}})]}),
410
- /* @__PURE__ */ve("span",{className:"text-[10px] text-gray-500 w-16 text-right",children:a?h.fill(Math.min(L-t*j,j),j):h.fill(Math.min(C-t*j,j),j)})]},`bar-${t}`)}),
418
+ /* @__PURE__ */ve("span",{className:"text-[10px] text-gray-500 w-16 text-right",children:a?h.fill(Math.min(L-t*P,P),P):h.fill(Math.min(C-t*P,P),P)})]},`bar-${t}`)}),
411
419
  /* @__PURE__ */we("div",{className:"flex items-center justify-between text-xs pt-0.5",children:[
412
420
  /* @__PURE__ */we("span",{className:"text-gray-500 inline-flex items-center gap-1",children:[h.total,f?/* @__PURE__ */we(ke,{children:[
413
421
  /* @__PURE__ */we("span",{className:"inline-flex items-center gap-1 text-blue-700",children:[
@@ -415,27 +423,27 @@ return we("div",{className:"flex items-center gap-2",children:[
415
423
  /* @__PURE__ */ve("span",{className:"text-gray-400",children:"/"}),
416
424
  /* @__PURE__ */we("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
417
425
  /* @__PURE__ */ve("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),h.loaded(L)]})]}):/* @__PURE__ */ve("b",{className:"text-gray-700",children:h.volume(D)})]}),
418
- /* @__PURE__ */we("span",{className:"font-medium "+(S?"text-green-600":"text-gray-500"),children:[S&&"✓ ",z," × ",P]})]})]}):/* @__PURE__ */ve("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var Sl=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g;function Bl(e){const t=/^[a-zA-Z][a-zA-Z0-9+.-]*:/.exec(e.trim());return null===t||/^(?:https?|mailto|tel):$/i.test(t[0])}function Fl(e){const t=[];let r,n=0,a=0;for(Sl.lastIndex=0;null!==(r=Sl.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
426
+ /* @__PURE__ */we("span",{className:"font-medium "+(A?"text-green-600":"text-gray-500"),children:[A&&"✓ ",S," × ",j]})]})]}):/* @__PURE__ */ve("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var Tl=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g;function Il(e){const t=/^[a-zA-Z][a-zA-Z0-9+.-]*:/.exec(e.trim());return null===t||/^(?:https?|mailto|tel):$/i.test(t[0])}function Ol(e){const t=[];let r,n=0,a=0;for(Tl.lastIndex=0;null!==(r=Tl.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
419
427
  /* @__PURE__ */we("span",{className:"text-gray-400",children:["[",r[1],"]"]},a++)):void 0!==r[3]?t.push(
420
- /* @__PURE__ */ve("a",{href:Bl(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},a++)):void 0!==r[5]?t.push(
428
+ /* @__PURE__ */ve("a",{href:Il(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},a++)):void 0!==r[5]?t.push(
421
429
  /* @__PURE__ */ve("strong",{className:"font-semibold text-gray-900",children:r[5]},a++)):void 0!==r[6]?t.push(
422
- /* @__PURE__ */ve("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},a++)):void 0!==r[7]&&t.push(/* @__PURE__ */ve("em",{children:r[7]},a++)),n=Sl.lastIndex;return n<e.length&&t.push(e.slice(n)),t}function Tl({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),r=K().markdown;/* @__PURE__ */
430
+ /* @__PURE__ */ve("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},a++)):void 0!==r[7]&&t.push(/* @__PURE__ */ve("em",{children:r[7]},a++)),n=Tl.lastIndex;return n<e.length&&t.push(e.slice(n)),t}function Rl({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),r=K().markdown;/* @__PURE__ */
423
431
  return we("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-dashed border-gray-300 bg-gray-50 px-3 py-2.5",children:[
424
432
  /* @__PURE__ */ve("svg",{className:"mt-0.5 h-4 w-4 shrink-0 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M3 6a1.5 1.5 0 0 1 1.5-1.5h1.1l.4-.9a1 1 0 0 1 .9-.6h6.2a1 1 0 0 1 .9.6l.4.9h1.1A1.5 1.5 0 0 1 18 6v8.5A1.5 1.5 0 0 1 16.5 16h-13A1.5 1.5 0 0 1 2 14.5V6Zm7.5 1.5a3.25 3.25 0 1 0 0 6.5 3.25 3.25 0 0 0 0-6.5Z"})}),
425
433
  /* @__PURE__ */we("span",{className:"text-xs text-gray-500",children:[
426
- /* @__PURE__ */ve("span",{className:"font-medium text-gray-600",children:`${r.screenshot} — `}),t]})]})}function El(e,t){const r=[];for(const n of e){const e=t.exec(n);e?r.push(e[1]):r.length&&(r[r.length-1]+=" "+n.trim())}return r}var Il=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function Ol(e,t){const r=e.split("\n"),n=r[0],a=/^(#{2,4})\s+(.*)$/.exec(n);if(a&&1===r.length){const e=a[1].length;/* @__PURE__ */
427
- return ve(`h${e}`,{className:2===e?"mt-2 text-[13px] font-semibold uppercase tracking-wide text-gray-500":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:Fl(a[2])},t)}if(1===r.length&&/^---+$/.test(n))/* @__PURE__ */
428
- return ve("hr",{className:"border-gray-200"},t);if(function(e){return e.length>=2&&e[0].includes("|")&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(e[1])&&e[1].includes("-")}(r))return function(e,t){const r=Il(e[0]),n=e.slice(2).map(Il);/* @__PURE__ */
434
+ /* @__PURE__ */ve("span",{className:"font-medium text-gray-600",children:`${r.screenshot} — `}),t]})]})}function Wl(e,t){const r=[];for(const n of e){const e=t.exec(n);e?r.push(e[1]):r.length&&(r[r.length-1]+=" "+n.trim())}return r}var Hl=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function _l(e,t){const r=e.split("\n"),n=r[0],a=/^(#{2,4})\s+(.*)$/.exec(n);if(a&&1===r.length){const e=a[1].length;/* @__PURE__ */
435
+ return ve(`h${e}`,{className:2===e?"mt-2 text-[13px] font-semibold uppercase tracking-wide text-gray-500":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:Ol(a[2])},t)}if(1===r.length&&/^---+$/.test(n))/* @__PURE__ */
436
+ return ve("hr",{className:"border-gray-200"},t);if(function(e){return e.length>=2&&e[0].includes("|")&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(e[1])&&e[1].includes("-")}(r))return function(e,t){const r=Hl(e[0]),n=e.slice(2).map(Hl);/* @__PURE__ */
429
437
  return ve("div",{className:"my-1 overflow-x-auto rounded-lg border border-gray-200",children:/* @__PURE__ */we("table",{className:"w-full border-collapse text-sm",children:[
430
- /* @__PURE__ */ve("thead",{children:/* @__PURE__ */ve("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */ve("th",{className:"border-b border-gray-200 px-3 py-1.5 text-left font-semibold text-gray-700",children:Fl(e)},t))})}),
431
- /* @__PURE__ */ve("tbody",{children:n.map((e,t)=>/* @__PURE__ */ve("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */ve("td",{className:"border-t border-gray-100 px-3 py-1.5 align-top text-gray-700",children:Fl(e)},t))},t))})]})},t)}(r,t);if(/^>\s?/.test(n)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
432
- return ve("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-50/60 px-3 py-2 text-gray-700",children:Fl(e)},t)}const l=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(n);if(l&&1===r.length)/* @__PURE__ */
433
- return ve(Tl,{alt:l[1]},t);if(/^[-*]\s+/.test(n)){const e=El(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
434
- return ve("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */ve("li",{children:Fl(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(n);if(i){const e=El(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
435
- return ve("ol",{start:Number(i[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */ve("li",{className:"pl-1",children:Fl(e)},t))},t)}/* @__PURE__ */
436
- return ve("p",{children:Fl(r.join(" "))},t)}var Rl=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/;function Wl(e){const t=e.replace(/\r\n/g,"\n").split("\n"),r=[];let n=[];const a=()=>{for(const e of n.join("\n").split(/\n{2,}/)){const t=e.replace(/\s+$/,"");""!==t.trim()&&r.push({text:t})}n=[]};for(let e=0;e<t.length;e+=1){const l=Rl.exec(t[e]);if(!(null!==l&&!("`"===l[2][0]&&l[3].includes("`")))){n.push(t[e]);continue}a();const[,i,s,o]=l,c=[];for(e+=1;e<t.length;e+=1){const r=Rl.exec(t[e]);if(null!==r&&r[2][0]===s[0]&&r[2].length>=s.length&&""===r[3])break;c.push(i?t[e].replace(new RegExp(`^ {0,${i.length}}`),""):t[e])}r.push({fence:{lang:o.split(/[ \t]/)[0],code:c.join("\n")}})}return a(),r}function Hl({children:e,className:t}){/* @__PURE__ */
437
- return ve("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:Wl(e??"").map((e,t)=>"fence"in e?function({lang:e,code:t},r){/* @__PURE__ */
438
- return ve("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */ve("code",{children:t})},r)}(e.fence,t):Ol(e.text,t))})}var _l=({open:e})=>/* @__PURE__ */ve("svg",{className:"h-3.5 w-3.5 shrink-0 text-gray-400 transition-transform "+(e?"rotate-90":""),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */ve("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 0 1 .02-1.06L11.168 10 7.23 6.29a.75.75 0 1 1 1.04-1.08l4.5 4.25a.75.75 0 0 1 0 1.08l-4.5 4.25a.75.75 0 0 1-1.06-.02Z",clipRule:"evenodd"})});function ql({docs:e,loading:t=!1,categoryOrder:r,canEdit:n=!1,onNew:a,onEdit:l,renderBody:i,emptyMessage:s}){const o=K(),[c,d]=ie(""),[u,h]=ie(null),[m,p]=ie({}),g=c.trim().toLowerCase(),f=ue(()=>{const t=/* @__PURE__ */new Map;for(const r of e){let e=t.get(r.category);e||(e={key:r.category,label:r.category_label||r.category,docs:[]},t.set(r.category,e)),e.docs.push(r)}if(!r?.length)return[...t.values()];const n=new Map(r.map((e,t)=>[e,t]));return[...t.values()].sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0))},[e,r]),b=e=>!g||e.title.toLowerCase().includes(g)||e.body.toLowerCase().includes(g)||e.category_label.toLowerCase().includes(g),x=ue(()=>f.map(e=>({...e,docs:e.docs.filter(b)})).filter(e=>e.docs.length>0),[f,g]),y=ue(()=>x.flatMap(e=>e.docs),[x]),v=(u?y.find(e=>e.slug===u):void 0)??y[0]??null,w=e=>!!g||(m[e]??e===v?.category);/* @__PURE__ */
438
+ /* @__PURE__ */ve("thead",{children:/* @__PURE__ */ve("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */ve("th",{className:"border-b border-gray-200 px-3 py-1.5 text-left font-semibold text-gray-700",children:Ol(e)},t))})}),
439
+ /* @__PURE__ */ve("tbody",{children:n.map((e,t)=>/* @__PURE__ */ve("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */ve("td",{className:"border-t border-gray-100 px-3 py-1.5 align-top text-gray-700",children:Ol(e)},t))},t))})]})},t)}(r,t);if(/^>\s?/.test(n)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
440
+ return ve("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-50/60 px-3 py-2 text-gray-700",children:Ol(e)},t)}const l=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(n);if(l&&1===r.length)/* @__PURE__ */
441
+ return ve(Rl,{alt:l[1]},t);if(/^[-*]\s+/.test(n)){const e=Wl(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
442
+ return ve("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */ve("li",{children:Ol(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(n);if(i){const e=Wl(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
443
+ return ve("ol",{start:Number(i[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */ve("li",{className:"pl-1",children:Ol(e)},t))},t)}/* @__PURE__ */
444
+ return ve("p",{children:Ol(r.join(" "))},t)}var ql=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/;function Ul(e){const t=e.replace(/\r\n/g,"\n").split("\n"),r=[];let n=[];const a=()=>{for(const e of n.join("\n").split(/\n{2,}/)){const t=e.replace(/\s+$/,"");""!==t.trim()&&r.push({text:t})}n=[]};for(let e=0;e<t.length;e+=1){const l=ql.exec(t[e]);if(!(null!==l&&!("`"===l[2][0]&&l[3].includes("`")))){n.push(t[e]);continue}a();const[,i,s,o]=l,c=[];for(e+=1;e<t.length;e+=1){const r=ql.exec(t[e]);if(null!==r&&r[2][0]===s[0]&&r[2].length>=s.length&&""===r[3])break;c.push(i?t[e].replace(new RegExp(`^ {0,${i.length}}`),""):t[e])}r.push({fence:{lang:o.split(/[ \t]/)[0],code:c.join("\n")}})}return a(),r}function Kl({children:e,className:t}){/* @__PURE__ */
445
+ return ve("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:Ul(e??"").map((e,t)=>"fence"in e?function({lang:e,code:t},r){/* @__PURE__ */
446
+ return ve("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */ve("code",{children:t})},r)}(e.fence,t):_l(e.text,t))})}var Vl=({open:e})=>/* @__PURE__ */ve("svg",{className:"h-3.5 w-3.5 shrink-0 text-gray-400 transition-transform "+(e?"rotate-90":""),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */ve("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 0 1 .02-1.06L11.168 10 7.23 6.29a.75.75 0 1 1 1.04-1.08l4.5 4.25a.75.75 0 0 1 0 1.08l-4.5 4.25a.75.75 0 0 1-1.06-.02Z",clipRule:"evenodd"})});function Yl({docs:e,loading:t=!1,categoryOrder:r,canEdit:n=!1,onNew:a,onEdit:l,renderBody:i,emptyMessage:s}){const o=K(),[c,d]=ie(""),[u,h]=ie(null),[m,p]=ie({}),g=c.trim().toLowerCase(),f=ce(()=>{const t=/* @__PURE__ */new Map;for(const r of e){let e=t.get(r.category);e||(e={key:r.category,label:r.category_label||r.category,docs:[]},t.set(r.category,e)),e.docs.push(r)}if(!r?.length)return[...t.values()];const n=new Map(r.map((e,t)=>[e,t]));return[...t.values()].sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0))},[e,r]),b=e=>!g||e.title.toLowerCase().includes(g)||e.body.toLowerCase().includes(g)||e.category_label.toLowerCase().includes(g),x=ce(()=>f.map(e=>({...e,docs:e.docs.filter(b)})).filter(e=>e.docs.length>0),[f,g]),y=ce(()=>x.flatMap(e=>e.docs),[x]),v=(u?y.find(e=>e.slug===u):void 0)??y[0]??null,w=e=>!!g||(m[e]??e===v?.category);/* @__PURE__ */
439
447
  return we("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
440
448
  /* @__PURE__ */we("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
441
449
  /* @__PURE__ */we("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
@@ -446,7 +454,7 @@ return we("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
446
454
  /* @__PURE__ */ve("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */ve("p",{className:"px-3 py-6 text-center text-xs text-gray-400",children:o.help.loading}):0===x.length?/* @__PURE__ */ve("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:g?o.help.noResults:s??o.help.empty}):x.map(e=>{const t=w(e.key);/* @__PURE__ */
447
455
  return we("div",{className:"py-0.5",children:[
448
456
  /* @__PURE__ */we("button",{type:"button",onClick:()=>{return t=e.key,p(e=>({...e,[t]:!w(t)}));var t},className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-left text-[10px] font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
449
- /* @__PURE__ */ve(_l,{open:t}),
457
+ /* @__PURE__ */ve(Vl,{open:t}),
450
458
  /* @__PURE__ */ve("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=v?.slug===e.slug;/* @__PURE__ */
451
459
  return we("button",{type:"button",onClick:()=>h(e.slug),className:"w-full text-left pl-8 pr-3 py-1.5 text-sm flex items-center gap-1.5 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
452
460
  /* @__PURE__ */ve("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */ve("span",{className:"ml-auto shrink-0 text-[10px] text-amber-600",children:o.help.draft})]},e.slug)})]},e.key)})})]}),
@@ -455,53 +463,53 @@ return we("button",{type:"button",onClick:()=>h(e.slug),className:"w-full text-l
455
463
  /* @__PURE__ */we("div",{className:"min-w-0",children:[
456
464
  /* @__PURE__ */ve("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:v.title}),
457
465
  /* @__PURE__ */we("p",{className:"text-xs text-gray-500 mt-0.5",children:[v.category_label,!1===v.is_published&&/* @__PURE__ */we("span",{className:"ml-2 text-amber-600",children:["· ",o.help.draft]})]})]}),n&&l&&/* @__PURE__ */ve("button",{type:"button",onClick:()=>l(v),className:"shrink-0 text-sm text-blue-600 hover:underline",children:o.help.edit})]}),
458
- /* @__PURE__ */ve("div",{className:"flex-1 overflow-auto px-5 py-4",children:i?i(v):v.body?/* @__PURE__ */ve(Hl,{children:v.body}):/* @__PURE__ */ve("p",{className:"text-sm text-gray-500 italic",children:o.help.noBody})})]}):/* @__PURE__ */ve("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:/* @__PURE__ */ve("p",{className:"text-sm text-gray-500",children:t?o.help.loading:o.help.pickArticle})})})]})}var Ul={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50"};function Kl({children:e,onClick:t,variant:r="primary",hotkey:n,disabled:a=!1,type:l="button",title:i,className:s=""}){const o=p(n??"");/* @__PURE__ */
459
- return we("button",{type:l,onClick:t,disabled:a,title:i,className:`w-full inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors disabled:opacity-50 ${Ul[r]} ${s}`,children:[e,n&&/* @__PURE__ */ve("kbd",{className:"kbd-submit rounded border px-1.5 py-0.5 text-[10px] font-medium",children:o})]})}function Vl(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-1.5 h-5 rounded-full text-[11px] font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function Yl({children:e,count:t}){return null==t?/* @__PURE__ */ve("p",{className:"px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */we("p",{className:"flex items-center justify-between gap-2 px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:[
466
+ /* @__PURE__ */ve("div",{className:"flex-1 overflow-auto px-5 py-4",children:i?i(v):v.body?/* @__PURE__ */ve(Kl,{children:v.body}):/* @__PURE__ */ve("p",{className:"text-sm text-gray-500 italic",children:o.help.noBody})})]}):/* @__PURE__ */ve("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:/* @__PURE__ */ve("p",{className:"text-sm text-gray-500",children:t?o.help.loading:o.help.pickArticle})})})]})}var Zl={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50"};function Gl({children:e,onClick:t,variant:r="primary",hotkey:n,disabled:a=!1,type:l="button",title:i,className:s=""}){const o=p(n??"");/* @__PURE__ */
467
+ return we("button",{type:l,onClick:t,disabled:a,title:i,className:`w-full inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors disabled:opacity-50 ${Zl[r]} ${s}`,children:[e,n&&/* @__PURE__ */ve("kbd",{className:"kbd-submit rounded border px-1.5 py-0.5 text-[10px] font-medium",children:o})]})}function Jl(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-1.5 h-5 rounded-full text-[11px] font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function Xl({children:e,count:t}){return null==t?/* @__PURE__ */ve("p",{className:"px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */we("p",{className:"flex items-center justify-between gap-2 px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:[
460
468
  /* @__PURE__ */ve("span",{className:"min-w-0 truncate",children:e}),
461
- /* @__PURE__ */ve("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function Zl(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 py-1.5 pl-2.5 pr-2.5 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function Gl({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:s=0}){const o=ga(i,"SidebarNavItem"),c=K().severity,d=o?(h=c,(u=o).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */we(ke,{children:[null!=a&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4 "+(r?"text-blue-600":"text-gray-400"),children:a}),o&&
469
+ /* @__PURE__ */ve("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function Ql(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 py-1.5 pl-2.5 pr-2.5 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function ei({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:s=0}){const o=ya(i,"SidebarNavItem"),c=K().severity,d=o?(h=c,(u=o).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */we(ke,{children:[null!=a&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4 "+(r?"text-blue-600":"text-gray-400"),children:a}),o&&
462
470
  /* @__PURE__ */ve("span",{"aria-hidden":"true",title:d,className:`shrink-0 h-1.5 w-1.5 rounded-full ${o.fill}`}),
463
- /* @__PURE__ */ve("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),o&&/* @__PURE__ */ve("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */ve("span",{className:Vl(r),children:t}),null!=l&&/* @__PURE__ */ve("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
464
- return ve("button",1===s?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */ve("span",{className:Zl(r),children:m})}:{type:"button",onClick:n,className:"flex w-full items-center justify-between gap-2 rounded-lg px-2.5 py-1.5 text-sm text-left "+(r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:m})}function Jl({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=oe(),[i,s]=ne(()=>{if(a){let e=null;try{e=window.localStorage.getItem(a)}catch{}if("1"===e||"0"===e)return"1"===e}return n},n),o=!i&&he.toArray(r).some(e=>me(e)&&!0===e.props.active);/* @__PURE__ */
471
+ /* @__PURE__ */ve("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),o&&/* @__PURE__ */ve("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */ve("span",{className:Jl(r),children:t}),null!=l&&/* @__PURE__ */ve("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
472
+ return ve("button",1===s?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */ve("span",{className:Ql(r),children:m})}:{type:"button",onClick:n,className:"flex w-full items-center justify-between gap-2 rounded-lg px-2.5 py-1.5 text-sm text-left "+(r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:m})}function ti({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=oe(),[i,s]=ne(()=>{if(a){let e=null;try{e=window.localStorage.getItem(a)}catch{}if("1"===e||"0"===e)return"1"===e}return n},n),o=!i&&he.toArray(r).some(e=>me(e)&&!0===e.props.active);/* @__PURE__ */
465
473
  return we("div",{children:[
466
474
  /* @__PURE__ */we("button",{type:"button",onClick:()=>{const e=!i;if(s(e),a)try{window.localStorage.setItem(a,e?"1":"0")}catch{}},"aria-expanded":i,"aria-controls":l,className:"flex w-full items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm font-medium text-left "+(o?"bg-blue-50 text-blue-700":"text-gray-800 hover:bg-gray-100"),children:[
467
475
  /* @__PURE__ */ve("span",{className:"min-w-0 truncate",title:e,children:e}),
468
- /* @__PURE__ */ve("svg",{className:"mr-auto ml-0.5 size-3 shrink-0 text-gray-400 transition-transform "+(i?"":"-rotate-90"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.6,"aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})}),null!=t&&t>0&&/* @__PURE__ */ve("span",{className:Vl(o),children:t})]}),
469
- /* @__PURE__ */ve("div",{id:l,role:"group","aria-label":e,hidden:!i,children:r})]})}function Xl({items:e,activeKey:t,onSelect:r,brand:n,actions:a,className:l}){/* @__PURE__ */
476
+ /* @__PURE__ */ve("svg",{className:"mr-auto ml-0.5 size-3 shrink-0 text-gray-400 transition-transform "+(i?"":"-rotate-90"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.6,"aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})}),null!=t&&t>0&&/* @__PURE__ */ve("span",{className:Jl(o),children:t})]}),
477
+ /* @__PURE__ */ve("div",{id:l,role:"group","aria-label":e,hidden:!i,children:r})]})}function ri({items:e,activeKey:t,onSelect:r,brand:n,actions:a,className:l}){/* @__PURE__ */
470
478
  return we("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[n&&/* @__PURE__ */ve("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:n}),
471
479
  /* @__PURE__ */ve("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const n=e.key===t;/* @__PURE__ */
472
480
  return we("button",{type:"button",disabled:e.disabled,"aria-current":n?"page":void 0,onClick:()=>!e.disabled&&r?.(e.key),className:"relative inline-flex items-center gap-1.5 px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40 "+(n?"text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.icon&&/* @__PURE__ */ve("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
473
- /* @__PURE__ */ve("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */ve("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-1.5 text-[11px] font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */ve("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */ve("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var Ql=/(^|[\s:])!?z-/,ei=/* @__PURE__ */ve("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),ti=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function ri({trigger:e,items:t,align:r="end",side:a="bottom","aria-label":s,className:o="",triggerClassName:c,menuClassName:d="",minWidth:u=180,linkAs:h,disabled:m,id:p,"aria-describedby":g}){const[f,b]=ie(!1),[x,y]=ie(-1),v=se(null),w=se(null),k=se(null),N=se({text:"",at:0}),M=oe(),$=oe(),C=p??$,L=le(e=>{b(!1),e&&w.current?.focus()},[]),D=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(ti(t[l]))return l}return-1},P=()=>k.current?.closest("[data-popup-menu-tree]")??null;ce(()=>{if(!f)return;const e=e=>{const t=e.target;v.current?.contains(t)||P()?.contains(t)||L(!1)};document.addEventListener("pointerdown",e,!0);const t=H(()=>L(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[f,L]);const j=le(()=>{const e=P(),t=w.current;if(!e||!t)return;const i=e.style;i.left="0px",i.top="0px",i.maxWidth="none",i.maxHeight="none";const s={width:e.offsetWidth,height:e.offsetHeight},o=l({trigger:t.getBoundingClientRect(),menu:s,bounds:n(t),align:r,side:a});i.left=`${o.left}px`,i.top=`${o.top}px`,i.maxWidth=`${o.maxWidth}px`,i.maxHeight=`${o.maxHeight}px`,i.overflowY=s.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=r},[r,a]);Q(()=>{f&&j()}),ce(()=>{if(f)return i(()=>w.current,j)},[f,j]),ce(()=>{if(!f)return;const e=k.current,r=ti(t[x])?e?.querySelector(`[data-dropdown-index="${x}"]`):null;(r??e)?.focus({preventScroll:!0})},[f,x]),ce(()=>{if(f)return W(e=>"Escape"===e.key&&(L(!0),!0))},[f,L]);const z=e=>{y(e),b(!0)},A=e=>{e.disabled||(L(!0),e.onSelect())},S=h??"a",B=(e,t)=>({"data-dropdown-index":e,tabIndex:e===x?0:-1,onMouseEnter:()=>{t.disabled||y(e)}}),T=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
481
+ /* @__PURE__ */ve("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */ve("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-1.5 text-[11px] font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */ve("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */ve("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var ni=/(^|[\s:])!?z-/,ai=/* @__PURE__ */ve("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),li=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function ii({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":l,className:o="",triggerClassName:c,menuClassName:d="",minWidth:u=180,linkAs:h,disabled:m,id:p,"aria-describedby":g}){const[f,b]=ie(!1),[x,y]=ie(-1),v=se(null),w=se(null),k=se(null),N=se({text:"",at:0}),M=oe(),$=oe(),C=p??$,L=le(e=>{b(!1),e&&w.current?.focus()},[]),D=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(li(t[l]))return l}return-1},j=()=>k.current?.closest("[data-popup-menu-tree]")??null;de(()=>{if(!f)return;const e=e=>{const t=e.target;v.current?.contains(t)||j()?.contains(t)||L(!1)};document.addEventListener("pointerdown",e,!0);const t=H(()=>L(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[f,L]);const P=le(()=>{const e=j(),t=w.current;if(!e||!t)return;const l=e.style;l.left="0px",l.top="0px",l.maxWidth="none",l.maxHeight="none";const s={width:e.offsetWidth,height:e.offsetHeight},o=i({trigger:t.getBoundingClientRect(),menu:s,bounds:a(t),align:r,side:n});l.left=`${o.left}px`,l.top=`${o.top}px`,l.maxWidth=`${o.maxWidth}px`,l.maxHeight=`${o.maxHeight}px`,l.overflowY=s.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=r},[r,n]);Q(()=>{f&&P()}),de(()=>{if(f)return s(()=>w.current,P)},[f,P]),de(()=>{if(!f)return;const e=k.current,r=li(t[x])?e?.querySelector(`[data-dropdown-index="${x}"]`):null;(r??e)?.focus({preventScroll:!0})},[f,x]),de(()=>{if(f)return W(e=>"Escape"===e.key&&(L(!0),!0),()=>k.current)},[f,L]);const S=e=>{y(e),b(!0)},z=e=>{e.disabled||(L(!0),e.onSelect())},A=h??"a",B=(e,t)=>({"data-dropdown-index":e,tabIndex:e===x?0:-1,onMouseEnter:()=>{t.disabled||y(e)}}),E=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
474
482
  return ve("div",{role:"separator",children:/* @__PURE__ */ve(I,{})},e.key);if("label"===e.type)/* @__PURE__ */
475
483
  return ve("div",{id:`${M}-label-${t}`,children:/* @__PURE__ */ve(O,{children:e.label})},e.key);if("checkbox"===e.type){const r=R(!1,e.disabled,"");/* @__PURE__ */
476
484
  return we("button",{type:"button",role:"menuitemcheckbox","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>(e=>{e.disabled||e.onSelect()})(e),...B(t,e),children:[
477
- /* @__PURE__ */ve("span",{"aria-hidden":!0,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(e.checked?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:e.checked&&ei}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=R(!1,e.disabled,"");/* @__PURE__ */
478
- return we("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>A(e),...B(t,e),children:[
479
- /* @__PURE__ */ve("span",{"aria-hidden":!0,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e.checked&&ei}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=R(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */we("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...B(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */we(S,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>L(!0),...B(t,e),children:[e.icon,e.label]},e.key)}const r=R(e.danger,e.disabled,"");/* @__PURE__ */
480
- return we("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>A(e),...B(t,e),children:[e.icon,e.label]},e.key)},E={...Ql.test(d)?{}:{zIndex:_.popup},minWidth:u};/* @__PURE__ */
485
+ /* @__PURE__ */ve("span",{"aria-hidden":!0,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(e.checked?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:e.checked&&ai}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=R(!1,e.disabled,"");/* @__PURE__ */
486
+ return we("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>z(e),...B(t,e),children:[
487
+ /* @__PURE__ */ve("span",{"aria-hidden":!0,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e.checked&&ai}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=R(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */we("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...B(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */we(A,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>L(!0),...B(t,e),children:[e.icon,e.label]},e.key)}const r=R(e.danger,e.disabled,"");/* @__PURE__ */
488
+ return we("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>z(e),...B(t,e),children:[e.icon,e.label]},e.key)},T={...ni.test(d)?{}:{zIndex:_.popup},minWidth:u};/* @__PURE__ */
481
489
  return we("div",{ref:v,className:`relative inline-flex ${o}`.trim(),children:[
482
- /* @__PURE__ */ve("button",{ref:w,id:C,type:"button","aria-haspopup":"menu","aria-expanded":f,"aria-controls":f?M:void 0,"aria-label":s,"aria-describedby":g,disabled:m,onClick:()=>f?L(!1):z(D(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),z(D(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),z(D(t.length-1,-1)))},className:c??"inline-flex items-center justify-center rounded-md text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60",children:e}),f&&
483
- /* @__PURE__ */ve(F,{portal:!0,className:d,style:E,children:/* @__PURE__ */ve("div",{ref:k,id:M,role:"menu","aria-orientation":"vertical","aria-label":s,"aria-labelledby":s?void 0:C,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),y(D(x+1,1));else if("ArrowUp"===e.key)e.preventDefault(),y(D(x-1,-1));else if("Home"===e.key)e.preventDefault(),y(D(0,1));else if("End"===e.key)e.preventDefault(),y(D(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),L(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),n=e.key.toLowerCase(),a=r-N.current.at<500?N.current.text+n:n;N.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,s=l?x+1:Math.max(x,0),o=k.current,c=t.length;for(let r=0;r<c;r+=1){const n=((s+r)%c+c)%c;if(ti(t[n])&&(o?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void y(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(T(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(T(t[r],r)),r+=1;const s="label"===t[l-1]?.type?`${M}-label-${l-1}`:void 0;e.push(/* @__PURE__ */ve("div",{role:"group","aria-labelledby":s,children:i},`group:${n.key}`))}return e})()})})]})}function ni(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function ai({at:e,onClose:t,children:r,owner:a,"aria-label":l,minWidth:i=180,className:s="",autoFocus:o=!0}){const d=se(null),[u,h]=ie(null),m=se(t);m.current=t,Q(()=>{const t=d.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},l=c({point:e,menu:r,bounds:n(a??null)});h(e=>e&&e.left===l.left&&e.top===l.top&&e.maxHeight===l.maxHeight?e:{left:l.left,top:l.top,maxHeight:l.maxHeight,scroll:r.height>l.maxHeight})},[e.x,e.y,a]);const p=se(null),g=se(!1);ce(()=>(p.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!d.current?.contains(e)||p.current?.focus?.({preventScroll:!0})}),[]),ce(()=>{u&&!g.current&&o&&(g.current=!0,ni(d.current)[0]?.focus({preventScroll:!0}))},[u,o]),ce(()=>{if(o)return;const e=e=>{if(d.current?.contains(document.activeElement))return;const t=ni(d.current),r="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;r&&(e.preventDefault(),r.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[o]),ce(()=>W(e=>"Escape"===e.key&&(m.current(),!0)),[]),ce(()=>{const e=()=>m.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const f=le(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void m.current();const t=ni(d.current);if(0===t.length)return;const r=t.indexOf(document.activeElement),n="ArrowDown"===e.key?(r+1)%t.length:"ArrowUp"===e.key?r<=0?t.length-1:r-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;n<0||(e.preventDefault(),t[n].focus())},[]),b=u?{left:u.left,top:u.top,maxHeight:u.maxHeight,...u.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
484
- return ve(F,{portal:!0,minWidth:i,style:b,onClose:t,className:s,children:/* @__PURE__ */ve(T.Provider,{value:!0,children:/* @__PURE__ */ve("div",{ref:d,role:"menu","aria-label":l,"data-context-menu":"",onKeyDown:f,children:r})})})}function li(){const[e,t]=ie(null),r=le(()=>t(null),[]),n=le((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(E(n))return!1;e.preventDefault();const a=e.target instanceof Element?e.target:null;let{clientX:l,clientY:i}=e;if(0===l&&0===i&&a){const e=a.getBoundingClientRect();l=e.left,i=e.bottom}return t({x:l,y:i,data:r,owner:a}),!0},[]),a=le(e=>{n(e,void 0)},[n]);return{open:n,onContextMenu:a,close:r,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:r}}}var ii='[role="treeitem"]';function si(e){return[...e.querySelectorAll(ii)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function oi({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=se(null);Q(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(ii)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??si(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=le(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(ii);if(!t||!r||e.target!==r||e.defaultPrevented)return;const n=si(t),i=n.indexOf(r),s=Number(r.getAttribute("aria-level")??"1"),o=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(ii))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":o(n[i+1]);break;case"ArrowUp":o(n[i-1]);break;case"Home":o(n[0]);break;case"End":o(n[n.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=n[i+1];t&&Number(t.getAttribute("aria-level")??"1")>s?o(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(n[e].getAttribute("aria-level")??"1")<s){o(n[e]);break}}},[a]);/* @__PURE__ */
485
- return ve("div",{...a,ref:l,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${n}`.trim(),children:r})}function ci({children:e,hidden:t,className:r=""}){/* @__PURE__ */
486
- return ve("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}function di({children:e}){/* @__PURE__ */
487
- return ve("div",{role:"presentation",className:"px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e})}function ui({label:e,level:t=1,icon:r,preview:n,selected:a=!1,expanded:l,onToggle:i,onSelect:s,muted:o=!1,badge:c,actions:d,actionsPinned:u=!1,rename:h,drop:m,dragging:p=!1,rowProps:g,className:f=""}){const b=void 0!==l,x=a?"bg-blue-50 text-blue-700":"into"===m?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
490
+ /* @__PURE__ */ve("button",{ref:w,id:C,type:"button","aria-haspopup":"menu","aria-expanded":f,"aria-controls":f?M:void 0,"aria-label":l,"aria-describedby":g,disabled:m,onClick:()=>f?L(!1):S(D(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),S(D(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),S(D(t.length-1,-1)))},className:c??"inline-flex items-center justify-center rounded-md text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60",children:e}),f&&
491
+ /* @__PURE__ */ve(F,{portal:!0,className:d,style:T,children:/* @__PURE__ */ve("div",{ref:k,id:M,role:"menu","aria-orientation":"vertical","aria-label":l,"aria-labelledby":l?void 0:C,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),y(D(x+1,1));else if("ArrowUp"===e.key)e.preventDefault(),y(D(x-1,-1));else if("Home"===e.key)e.preventDefault(),y(D(0,1));else if("End"===e.key)e.preventDefault(),y(D(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),L(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),n=e.key.toLowerCase(),a=r-N.current.at<500?N.current.text+n:n;N.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,s=l?x+1:Math.max(x,0),o=k.current,c=t.length;for(let r=0;r<c;r+=1){const n=((s+r)%c+c)%c;if(li(t[n])&&(o?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void y(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(E(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(E(t[r],r)),r+=1;const s="label"===t[l-1]?.type?`${M}-label-${l-1}`:void 0;e.push(/* @__PURE__ */ve("div",{role:"group","aria-labelledby":s,children:i},`group:${n.key}`))}return e})()})})]})}function si(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function oi({at:e,onClose:t,children:r,owner:n,"aria-label":l,minWidth:i=180,className:s="",autoFocus:o=!0}){const d=se(null),[u,h]=ie(null),m=se(t);m.current=t,Q(()=>{const t=d.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},l=c({point:e,menu:r,bounds:a(n??null)});h(e=>e&&e.left===l.left&&e.top===l.top&&e.maxHeight===l.maxHeight?e:{left:l.left,top:l.top,maxHeight:l.maxHeight,scroll:r.height>l.maxHeight})},[e.x,e.y,n]);const p=se(null),g=se(!1);de(()=>(p.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!d.current?.contains(e)||p.current?.focus?.({preventScroll:!0})}),[]),de(()=>{u&&!g.current&&o&&(g.current=!0,si(d.current)[0]?.focus({preventScroll:!0}))},[u,o]),de(()=>{if(o)return;const e=e=>{if(d.current?.contains(document.activeElement))return;const t=si(d.current),r="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;r&&(e.preventDefault(),r.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[o]),de(()=>W(e=>"Escape"===e.key&&(m.current(),!0),()=>d.current),[]),de(()=>{const e=()=>m.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const f=le(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void m.current();const t=si(d.current);if(0===t.length)return;const r=t.indexOf(document.activeElement),n="ArrowDown"===e.key?(r+1)%t.length:"ArrowUp"===e.key?r<=0?t.length-1:r-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;n<0||(e.preventDefault(),t[n].focus())},[]),b=u?{left:u.left,top:u.top,maxHeight:u.maxHeight,...u.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
492
+ return ve(F,{portal:!0,minWidth:i,style:b,onClose:t,className:s,children:/* @__PURE__ */ve(E.Provider,{value:!0,children:/* @__PURE__ */ve("div",{ref:d,role:"menu","aria-label":l,"data-context-menu":"",onKeyDown:f,children:r})})})}function ci(){const[e,t]=ie(null),r=le(()=>t(null),[]),n=le((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(T(n))return!1;e.preventDefault();const a=e.target instanceof Element?e.target:null;let{clientX:l,clientY:i}=e;if(0===l&&0===i&&a){const e=a.getBoundingClientRect();l=e.left,i=e.bottom}return t({x:l,y:i,data:r,owner:a}),!0},[]),a=le(e=>{n(e,void 0)},[n]);return{open:n,onContextMenu:a,close:r,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:r}}}var di='[role="treeitem"]';function ui(e){return[...e.querySelectorAll(di)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function hi({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=se(null);Q(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(di)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??ui(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=le(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(di);if(!t||!r||e.target!==r||e.defaultPrevented)return;const n=ui(t),i=n.indexOf(r),s=Number(r.getAttribute("aria-level")??"1"),o=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(di))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":o(n[i+1]);break;case"ArrowUp":o(n[i-1]);break;case"Home":o(n[0]);break;case"End":o(n[n.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=n[i+1];t&&Number(t.getAttribute("aria-level")??"1")>s?o(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(n[e].getAttribute("aria-level")??"1")<s){o(n[e]);break}}},[a]);/* @__PURE__ */
493
+ return ve("div",{...a,ref:l,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${n}`.trim(),children:r})}function mi({children:e,hidden:t,className:r=""}){/* @__PURE__ */
494
+ return ve("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}function pi({children:e}){/* @__PURE__ */
495
+ return ve("div",{role:"presentation",className:"px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e})}function gi({label:e,level:t=1,icon:r,preview:n,selected:a=!1,expanded:l,onToggle:i,onSelect:s,muted:o=!1,badge:c,actions:d,actionsPinned:u=!1,rename:h,drop:m,dragging:p=!1,rowProps:g,className:f=""}){const b=void 0!==l,x=a?"bg-blue-50 text-blue-700":"into"===m?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
488
496
  return we("div",{...g,role:"treeitem","aria-level":t,"aria-selected":a,"aria-expanded":b?l:void 0,tabIndex:a?0:-1,"data-drop":m,onKeyDown:e=>{g?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented||("Enter"!==e.key&&" "!==e.key||!s?("ArrowRight"===e.key&&b&&!l&&i||"ArrowLeft"===e.key&&b&&l&&i)&&(e.preventDefault(),i()):(e.preventDefault(),s()))},onClick:e=>{g?.onClick?.(e),e.defaultPrevented||s?.()},className:["group/treerow relative flex min-h-8 cursor-pointer select-none items-center gap-1.5 rounded-md px-2 py-1 text-sm","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",x,"into"===m?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",p?"opacity-40":"",f].filter(Boolean).join(" "),children:["before"===m&&/* @__PURE__ */ve("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===m&&/* @__PURE__ */ve("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),
489
497
  /* @__PURE__ */ve("span",b?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),i?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:(y=!!l,/* @__PURE__ */ve("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(y?"rotate-90":""),children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}))}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=r&&/* @__PURE__ */ve("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(a?"text-blue-600":"text-gray-500"),children:r}),
490
- /* @__PURE__ */we("span",{className:"relative flex min-w-0 flex-1 items-center gap-1.5",children:[h??/* @__PURE__ */we("span",{className:`min-w-0 truncate ${a?"font-semibold":"font-medium"} ${o?"text-gray-400 line-through":""}`,children:[e,null!=n&&/* @__PURE__ */ve("span",{className:"ml-2 font-normal text-gray-500",children:n})]}),null!=c&&!1!==c&&/* @__PURE__ */ve("span",{className:"shrink-0 rounded bg-gray-100 px-1 py-0.5 text-[10px] font-medium tabular-nums text-gray-500",children:c}),null!=d&&/* @__PURE__ */ve("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(u||o?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:d})]})]});var y}function hi({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=K().tree,l=r?a.dropHere:t??a.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
498
+ /* @__PURE__ */we("span",{className:"relative flex min-w-0 flex-1 items-center gap-1.5",children:[h??/* @__PURE__ */we("span",{className:`min-w-0 truncate ${a?"font-semibold":"font-medium"} ${o?"text-gray-400 line-through":""}`,children:[e,null!=n&&/* @__PURE__ */ve("span",{className:"ml-2 font-normal text-gray-500",children:n})]}),null!=c&&!1!==c&&/* @__PURE__ */ve("span",{className:"shrink-0 rounded bg-gray-100 px-1 py-0.5 text-[10px] font-medium tabular-nums text-gray-500",children:c}),null!=d&&/* @__PURE__ */ve("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(u||o?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:d})]})]});var y}function fi({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=K().tree,l=r?a.dropHere:t??a.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
491
499
  return ve("div",{...n,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */we("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
492
- /* @__PURE__ */ve("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */ve("span",{className:i,children:l})})}var mi="button[data-icon-rail-button]:not([disabled])";function pi({"aria-label":e,orientation:t="vertical",children:r,className:n=""}){const a=se(null);Q(()=>{const e=a.current;if(!e)return;const t=[...e.querySelectorAll(mi)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===r?0:-1});/* @__PURE__ */
493
- return ve("div",{ref:a,role:"toolbar","aria-label":e,"aria-orientation":t,"data-orientation":t,onKeyDown:e=>{const r=a.current;if(!r)return;const n=[...r.querySelectorAll(mi)],l=n.indexOf(e.target);if(l<0)return;const i="vertical"===t?"ArrowUp":"ArrowLeft",s="vertical"===t?"ArrowDown":"ArrowRight",o=e.key===s?(l+1)%n.length:e.key===i?(l-1+n.length)%n.length:"Home"===e.key?0:"End"===e.key?n.length-1:-1;if(!(o<0)){e.preventDefault();for(const e of n)e.tabIndex=e===n[o]?0:-1;n[o].focus()}},className:`flex gap-1 ${"vertical"===t?"flex-col items-center":"flex-row items-center"} ${n}`.trim(),children:r})}function gi({label:e,icon:t,active:r,disabled:n,onClick:a,badge:l,tooltipSide:i="right",className:o=""}){const c=/* @__PURE__ */ve("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof r?r:void 0,disabled:n,onClick:n?void 0:a,className:["relative inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg transition-colors","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",!0===r?"bg-blue-50 text-blue-700":"text-gray-600 hover:bg-gray-100 hover:text-gray-900",o].filter(Boolean).join(" "),children:void 0===l||!1===l||0===l?t:/* @__PURE__ */ve(Sn,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:t})});/* @__PURE__ */
494
- return ve(s,{content:e,side:i,children:c})}var fi=6e4;function bi({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=ie(null);return ce(()=>{if(!e||null!==n)return;let l=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const r=t.includes("?")?"&":"?",n=await fetch(`${t}${r}t=${Date.now()}`,{cache:"no-store"});if(!n.ok)return;const i=await n.json(),s=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},r),o=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",o),()=>{l=!0,clearInterval(s),document.removeEventListener("visibilitychange",o)}},[e,t,r,n]),n}function xi({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=bi({currentVersion:e,versionUrl:t,pollMs:r}),s=K();if(null===i)return null;const o=a??(()=>window.location.reload());/* @__PURE__ */
495
- return ve("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-[9999] w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */we(Un,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */ve(L,{type:"button",variant:"primary",size:"md",onClick:o,children:s.update.refreshNow}),children:[
500
+ /* @__PURE__ */ve("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */ve("span",{className:i,children:l})})}var bi="button[data-icon-rail-button]:not([disabled])";function xi({"aria-label":e,orientation:t="vertical",children:r,className:n=""}){const a=se(null);Q(()=>{const e=a.current;if(!e)return;const t=[...e.querySelectorAll(bi)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===r?0:-1});/* @__PURE__ */
501
+ return ve("div",{ref:a,role:"toolbar","aria-label":e,"aria-orientation":t,"data-orientation":t,onKeyDown:e=>{const r=a.current;if(!r)return;const n=[...r.querySelectorAll(bi)],l=n.indexOf(e.target);if(l<0)return;const i="vertical"===t?"ArrowUp":"ArrowLeft",s="vertical"===t?"ArrowDown":"ArrowRight",o=e.key===s?(l+1)%n.length:e.key===i?(l-1+n.length)%n.length:"Home"===e.key?0:"End"===e.key?n.length-1:-1;if(!(o<0)){e.preventDefault();for(const e of n)e.tabIndex=e===n[o]?0:-1;n[o].focus()}},className:`flex gap-1 ${"vertical"===t?"flex-col items-center":"flex-row items-center"} ${n}`.trim(),children:r})}function yi({label:e,icon:t,active:r,disabled:a,onClick:l,badge:i,tooltipSide:s="right",className:o=""}){const c=/* @__PURE__ */ve("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof r?r:void 0,disabled:a,onClick:a?void 0:l,className:["relative inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg transition-colors","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",!0===r?"bg-blue-50 text-blue-700":"text-gray-600 hover:bg-gray-100 hover:text-gray-900",o].filter(Boolean).join(" "),children:void 0===i||!1===i||0===i?t:/* @__PURE__ */ve(Tn,{count:"number"==typeof i?i:void 0,dot:!0===i,max:99,children:t})});/* @__PURE__ */
502
+ return ve(n,{content:e,side:s,children:c})}var vi=6e4;function wi({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=ie(null);return de(()=>{if(!e||null!==n)return;let l=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const r=t.includes("?")?"&":"?",n=await fetch(`${t}${r}t=${Date.now()}`,{cache:"no-store"});if(!n.ok)return;const i=await n.json(),s=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},r),o=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",o),()=>{l=!0,clearInterval(s),document.removeEventListener("visibilitychange",o)}},[e,t,r,n]),n}function ki({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=wi({currentVersion:e,versionUrl:t,pollMs:r}),s=K();if(null===i)return null;const o=a??(()=>window.location.reload());/* @__PURE__ */
503
+ return ve("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-[9999] w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */we(Zn,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */ve(L,{type:"button",variant:"primary",size:"md",onClick:o,children:s.update.refreshNow}),children:[
496
504
  /* @__PURE__ */ve("span",{className:"font-medium",children:n??s.update.available}),
497
- /* @__PURE__ */we("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var yi={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},vi={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function wi({onClose:e}){const t=K().dialog;/* @__PURE__ */
498
- return ve("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */ve("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M6 6l8 8M14 6l-8 8"})})})}function ki({open:e,onClose:t,side:r="right",size:n="md",title:a,description:l,footer:i,children:s,blocking:o=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=se(null),g=oe(),f=oe(),b=oe();if(q(e),z(p,e,c),A(e),ce(()=>{if(e)return W(()=>(o||t(),!0))},[e,o,t]),!e)return null;const x="bottom"===r,y=x?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
505
+ /* @__PURE__ */we("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var Ni={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Mi={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function $i({onClose:e}){const t=K().dialog;/* @__PURE__ */
506
+ return ve("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */ve("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */ve("path",{d:"M6 6l8 8M14 6l-8 8"})})})}function Ci({open:e,onClose:t,side:r="right",size:n="md",title:a,description:l,footer:i,children:s,blocking:o=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=se(null),g=oe(),f=oe(),b=oe();if(q(e),S(p,e,c),z(e),de(()=>{if(e)return W(()=>(o||t(),!0),()=>p.current)},[e,o,t]),!e)return null;const x="bottom"===r,y=x?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
499
507
  return we("div",{className:"fixed inset-0",style:{zIndex:_.overlay},role:"presentation",children:[
500
508
  /* @__PURE__ */ve("div",{className:"fixed inset-0 bg-black/30",onClick:o?void 0:t,"aria-hidden":"true"}),
501
- /* @__PURE__ */we("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":a?b:u,"aria-label":a||u?void 0:d,"aria-describedby":h??(l?f:s?g:void 0),style:y,className:["fixed flex flex-col bg-white shadow-xl",x?"":`w-full max-w-full ${yi[n]}`,vi[r],x?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */we("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
509
+ /* @__PURE__ */we("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":a?b:u,"aria-label":a||u?void 0:d,"aria-describedby":h??(l?f:s?g:void 0),style:y,className:["fixed flex flex-col bg-white shadow-xl",x?"":`w-full max-w-full ${Ni[n]}`,Mi[r],x?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */we("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
502
510
  /* @__PURE__ */we("div",{className:"min-w-0",children:[
503
- /* @__PURE__ */ve("h2",{id:b,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */ve("p",{id:f,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!o&&/* @__PURE__ */ve(wi,{onClose:t})]}):!o&&/* @__PURE__ */ve("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */ve(wi,{onClose:t})}),
504
- /* @__PURE__ */we("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */ve("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(o?"":"pr-8")).trim(),children:l}),s]}),i&&/* @__PURE__ */ve("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function Ni({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:s,isLoading:o=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=K().kanban,f=U(),b=c??g.loading,x=h??g.dropHere,y=p??g.addItem,[v,w]=ie(null),[k,N]=ie(null),M=ue(()=>{const n={};for(const e of t)n[e.value]=[];for(const t of e)(n[r(t)]??=[]).push(t);if(s)for(const e of Object.keys(n))n[e].sort(s);return n},[e,t,r,s]),$=()=>{w(null),N(null)},C=se(null),L=se(/* @__PURE__ */new Map);Q(()=>{if(null!==v)return;const e=C.current;if(!e)return;const t=/* @__PURE__ */new Map,r=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const n=e.dataset.kanbanCard,a=e.getBoundingClientRect();t.set(n,a);const l=L.current.get(n);if(l){const t=l.left-a.left,n=l.top-a.top;(t||n)&&r.push([e,t,n])}}),L.current=t,r.length){for(const[e,t,n]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${n}px)`;requestAnimationFrame(()=>{for(const[e]of r)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[M,v]);return o?/* @__PURE__ */ve("div",{className:"text-sm text-gray-500 p-4",children:b}):0!==e.length||u?/* @__PURE__ */ve("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */ve("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=M[e.value]??[],r=null!==k&&k.col===e.value,s=null!==v?t.findIndex(e=>n(e)===v):-1,o=r&&(-1===s||k.index!==s&&k.index!==s+1)?k.index:-1;/* @__PURE__ */
511
+ /* @__PURE__ */ve("h2",{id:b,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */ve("p",{id:f,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!o&&/* @__PURE__ */ve($i,{onClose:t})]}):!o&&/* @__PURE__ */ve("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */ve($i,{onClose:t})}),
512
+ /* @__PURE__ */we("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */ve("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(o?"":"pr-8")).trim(),children:l}),s]}),i&&/* @__PURE__ */ve("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function Li({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:s,isLoading:o=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=K().kanban,f=U(),b=c??g.loading,x=h??g.dropHere,y=p??g.addItem,[v,w]=ie(null),[k,N]=ie(null),M=ce(()=>{const n={};for(const e of t)n[e.value]=[];for(const t of e)(n[r(t)]??=[]).push(t);if(s)for(const e of Object.keys(n))n[e].sort(s);return n},[e,t,r,s]),$=()=>{w(null),N(null)},C=se(null),L=se(/* @__PURE__ */new Map);Q(()=>{if(null!==v)return;const e=C.current;if(!e)return;const t=/* @__PURE__ */new Map,r=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const n=e.dataset.kanbanCard,a=e.getBoundingClientRect();t.set(n,a);const l=L.current.get(n);if(l){const t=l.left-a.left,n=l.top-a.top;(t||n)&&r.push([e,t,n])}}),L.current=t,r.length){for(const[e,t,n]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${n}px)`;requestAnimationFrame(()=>{for(const[e]of r)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[M,v]);return o?/* @__PURE__ */ve("div",{className:"text-sm text-gray-500 p-4",children:b}):0!==e.length||u?/* @__PURE__ */ve("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */ve("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=M[e.value]??[],r=null!==k&&k.col===e.value,s=null!==v?t.findIndex(e=>n(e)===v):-1,o=r&&(-1===s||k.index!==s&&k.index!==s+1)?k.index:-1;/* @__PURE__ */
505
513
  return we("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(r?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:t=>{t.preventDefault(),(e=>{if(v&&k&&k.col===e){const t=(M[e]??[]).findIndex(e=>n(e)===v),r=-1!==t;if(!r||k.index!==t&&k.index!==t+1){const n=r&&k.index>t?k.index-1:k.index;a(v,e,n)}}$()})(e.value)},children:[
506
514
  /* @__PURE__ */we("div",{className:`flex items-center justify-between px-3 py-2 rounded-t-xl text-sm font-medium ${e.accent??"text-gray-700 bg-gray-100"}`,children:[
507
515
  /* @__PURE__ */we("span",{className:"flex items-center gap-2",children:[
@@ -510,50 +518,50 @@ return we("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray
510
518
  /* @__PURE__ */we("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>N(r=>r&&r.col===e.value&&r.index===t.length?r:{col:e.value,index:t.length}),children:[t.map((r,a)=>{const s=n(r),c=s===v;/* @__PURE__ */
511
519
  return we(fe,{children:[o===a&&/* @__PURE__ */ve("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
512
520
  /* @__PURE__ */ve("div",{"data-kanban-card":s,draggable:!0,onDragStart:e=>{w(s);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:r=>{r.stopPropagation();const l=null!==v?t.findIndex(e=>n(e)===v):-1,i=-1!==l&&l<a?a+1:a;N(t=>t&&t.col===e.value&&t.index===i?t:{col:e.value,index:i})},onDragEnd:$,onClick:i?()=>i(r):void 0,style:null===v?void 0:{opacity:c?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(i?"cursor-pointer":""),children:l(r)})]},s)}),t.length>0&&o===t.length&&/* @__PURE__ */ve("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===t.length&&/* @__PURE__ */ve("div",{className:"text-[11px] text-center rounded-lg transition-all duration-150 "+(r?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:x})]}),m&&/* @__PURE__ */ve("div",{className:"p-2 pt-0",children:/* @__PURE__ */we("button",{type:"button",onClick:()=>m(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 py-1.5 text-xs font-medium text-gray-500 opacity-0 transition hover:bg-gray-100 hover:text-gray-700 focus-visible:opacity-100 group-hover:opacity-100",children:[
513
- /* @__PURE__ */ve("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),y]})})]},e.value)})})}):/* @__PURE__ */ve(ke,{children:d??/* @__PURE__ */ve("div",{className:"text-sm text-gray-500 p-4",children:g.empty})})}var Mi="inline-flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-40";function $i({page:e,pageCount:t,onPageChange:r,siblingCount:n=1,showEdges:a=!1,className:l=""}){const i=K().pagination,s=U();if(t<=1)return null;const o=function(e,t,r){const n=/* @__PURE__ */new Set([1,t]);for(let a=e-r;a<=e+r;a++)a>=1&&a<=t&&n.add(a);const a=[...n].sort((e,t)=>e-t),l=[];let i=0;for(const e of a)i&&e-i>1&&l.push("…"),l.push(e),i=e;return l}(e,t,n),c=n=>{n>=1&&n<=t&&n!==e&&r(n)};/* @__PURE__ */
514
- return we("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[a&&/* @__PURE__ */ve("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${Mi} text-gray-600 hover:bg-gray-100`,children:"«"}),
515
- /* @__PURE__ */ve("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${Mi} text-gray-600 hover:bg-gray-100`,children:"‹"}),o.map((t,r)=>"…"===t?/* @__PURE__ */ve("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */ve("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${Mi} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:Z(t,s)},t)),
516
- /* @__PURE__ */ve("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${Mi} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */ve("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${Mi} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function Ci(e){const t={};if(!e)return t;for(const[r,n]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||(t[r]=n);return t}var Li=e=>Array.isArray(e.columns),Di=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",Pi="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",ji={sm:"px-2 py-1.5",md:"px-3 py-2"},zi={left:"text-left",right:"text-right",center:"text-center"};function Ai({direction:e}){/* @__PURE__ */
521
+ /* @__PURE__ */ve("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),y]})})]},e.value)})})}):/* @__PURE__ */ve(ke,{children:d??/* @__PURE__ */ve("div",{className:"text-sm text-gray-500 p-4",children:g.empty})})}var Di="inline-flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-40";function ji({page:e,pageCount:t,onPageChange:r,siblingCount:n=1,showEdges:a=!1,className:l=""}){const i=K().pagination,s=U();if(t<=1)return null;const o=function(e,t,r){const n=/* @__PURE__ */new Set([1,t]);for(let a=e-r;a<=e+r;a++)a>=1&&a<=t&&n.add(a);const a=[...n].sort((e,t)=>e-t),l=[];let i=0;for(const e of a)i&&e-i>1&&l.push("…"),l.push(e),i=e;return l}(e,t,n),c=n=>{n>=1&&n<=t&&n!==e&&r(n)};/* @__PURE__ */
522
+ return we("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[a&&/* @__PURE__ */ve("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${Di} text-gray-600 hover:bg-gray-100`,children:"«"}),
523
+ /* @__PURE__ */ve("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${Di} text-gray-600 hover:bg-gray-100`,children:"‹"}),o.map((t,r)=>"…"===t?/* @__PURE__ */ve("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */ve("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${Di} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:Z(t,s)},t)),
524
+ /* @__PURE__ */ve("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${Di} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */ve("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${Di} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function Pi(e){const t={};if(!e)return t;for(const[r,n]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||(t[r]=n);return t}var Si=e=>Array.isArray(e.columns),zi=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",Ai="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",Bi={sm:"px-2 py-1.5",md:"px-3 py-2"},Fi={left:"text-left",right:"text-right",center:"text-center"};function Ei({direction:e}){/* @__PURE__ */
517
525
  return we("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
518
526
  /* @__PURE__ */ve("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */ve("path",{d:"M4 0L8 5H0z"})}),
519
- /* @__PURE__ */ve("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */ve("path",{d:"M4 5L0 0h8z"})})]})}function Si({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:s=!1,bordered:o=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:g,emptyText:f,selection:b,footer:x,virtualized:y,stackOnNarrow:v=!1,stackBelow:w,className:k=""}){const N=K(),M=f??N.table.empty,$=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!y,L=C?e:e.flatMap(e=>{if(!Li(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),D=e=>C?{role:e}:{},P=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[j,z]=ie(0),A=y?.overscan??6,S=y?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/y.rowHeight)-A);z(e=>e===t?e:t)}:void 0,B=y?Math.ceil(y.height/y.rowHeight)+2*A:t.length,F=y?Math.min(j,Math.max(0,t.length-B)):0,T=Math.min(t.length,F+B),E=y?F*y.rowHeight:0,I=y?(t.length-T)*y.rowHeight:0,O=se(null),[R,W]=ie(0);Q(()=>{if(!y)return;const e=O.current?.offsetHeight??0;W(t=>t===e?t:e)});const H=e=>e.sortField??e.key,_=e=>n&&n.field===H(e)?n.direction:null,q=L.flatMap(e=>Li(e)?e.columns:[e]),U=L.some(Li),V=/* @__PURE__ */new Map;if(C)for(const e of L)if(Li(e))for(const t of e.columns)V.set(t,P(e.title,e.label));const Y=e=>{const t=P(e.title,e.label),r=V.get(e);return t&&r?`${r} · ${t}`:t},Z=new Set(b?.selected??[]),G=b?t.map((e,t)=>$(e,t)):[],J=G.length>0&&G.every(e=>Z.has(e)),X=G.some(e=>Z.has(e)),ee=b?36:0,te=q.length+(b?1:0),re=q.some(e=>"left"===e.fixed),ne=C&&!b&&q.some(e=>e.cardCorner),ae=g??"a",le=`${ji[c]} ${"sm"===c?"text-xs":"text-sm"}`,oe=(e,t,r,n=0)=>{const l=_(e),i=zi[e.align??(e.numeric?"right":"left")],s="left"===e.fixed,o=!(!e.sortable||!a);/* @__PURE__ */
520
- return ve("th",{scope:"col",...D("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===l?"ascending":"desc"===l?"descending":o?"none":void 0,style:{width:e.width,...s?{left:(de[t]??0)+ee}:{},...y?{top:n}:{}},className:[le,i,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs",s?y?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":y?"sticky z-10 bg-gray-50":"",C&&o?"rosh-dt-sort":"",C?Di(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:o?/* @__PURE__ */we("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=H(e),r=_(e),n=e.sortFirst??"asc";a(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":C?V.get(e):void 0,className:`inline-flex items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[e.title,
521
- /* @__PURE__ */ve(Ai,{direction:l})]}):e.title},e.key)};let ce=0;const de=q.map(e=>{if("left"!==e.fixed)return null;const t=ce;return ce+=e.width??0,t}),ue=/* @__PURE__ */we(ke,{children:[
522
- /* @__PURE__ */we("div",{onScroll:S,style:y?{maxHeight:y.height}:void 0,className:`relative overflow-x-auto ${y?"overflow-y-auto":""} ${o?"rounded-lg border border-gray-200":""}${C?" rosh-dt-scroll":""}`.trim(),children:[s&&
527
+ /* @__PURE__ */ve("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */ve("path",{d:"M4 5L0 0h8z"})})]})}function Ti({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:s=!1,bordered:o=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:g,emptyText:f,selection:b,footer:x,virtualized:y,stackOnNarrow:v=!1,stackBelow:w,className:k=""}){const N=K(),M=f??N.table.empty,$=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!y,L=C?e:e.flatMap(e=>{if(!Si(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),D=e=>C?{role:e}:{},j=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[P,S]=ie(0),z=y?.overscan??6,A=y?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/y.rowHeight)-z);S(e=>e===t?e:t)}:void 0,B=y?Math.ceil(y.height/y.rowHeight)+2*z:t.length,F=y?Math.min(P,Math.max(0,t.length-B)):0,E=Math.min(t.length,F+B),T=y?F*y.rowHeight:0,I=y?(t.length-E)*y.rowHeight:0,O=se(null),[R,W]=ie(0);Q(()=>{if(!y)return;const e=O.current?.offsetHeight??0;W(t=>t===e?t:e)});const H=e=>e.sortField??e.key,_=e=>n&&n.field===H(e)?n.direction:null,q=L.flatMap(e=>Si(e)?e.columns:[e]),U=L.some(Si),V=/* @__PURE__ */new Map;if(C)for(const e of L)if(Si(e))for(const t of e.columns)V.set(t,j(e.title,e.label));const Y=e=>{const t=j(e.title,e.label),r=V.get(e);return t&&r?`${r} · ${t}`:t},Z=new Set(b?.selected??[]),G=b?t.map((e,t)=>$(e,t)):[],J=G.length>0&&G.every(e=>Z.has(e)),X=G.some(e=>Z.has(e)),ee=b?36:0,te=q.length+(b?1:0),re=q.some(e=>"left"===e.fixed),ne=C&&!b&&q.some(e=>e.cardCorner),ae=g??"a",le=`${Bi[c]} ${"sm"===c?"text-xs":"text-sm"}`,oe=(e,t,r,n=0)=>{const l=_(e),i=Fi[e.align??(e.numeric?"right":"left")],s="left"===e.fixed,o=!(!e.sortable||!a);/* @__PURE__ */
528
+ return ve("th",{scope:"col",...D("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===l?"ascending":"desc"===l?"descending":o?"none":void 0,style:{width:e.width,...s?{left:(de[t]??0)+ee}:{},...y?{top:n}:{}},className:[le,i,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs",s?y?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":y?"sticky z-10 bg-gray-50":"",C&&o?"rosh-dt-sort":"",C?zi(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:o?/* @__PURE__ */we("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=H(e),r=_(e),n=e.sortFirst??"asc";a(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":C?V.get(e):void 0,className:`inline-flex items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[e.title,
529
+ /* @__PURE__ */ve(Ei,{direction:l})]}):e.title},e.key)};let ce=0;const de=q.map(e=>{if("left"!==e.fixed)return null;const t=ce;return ce+=e.width??0,t}),ue=/* @__PURE__ */we(ke,{children:[
530
+ /* @__PURE__ */we("div",{onScroll:A,style:y?{maxHeight:y.height}:void 0,className:`relative overflow-x-auto ${y?"overflow-y-auto":""} ${o?"rounded-lg border border-gray-200":""}${C?" rosh-dt-scroll":""}`.trim(),children:[s&&
523
531
  /* @__PURE__ */we("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
524
532
  /* @__PURE__ */ve("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-gray-200 border-t-blue-600"}),
525
533
  /* @__PURE__ */ve("span",{className:"sr-only",children:N.table.loading})]}),
526
534
  /* @__PURE__ */we("table",{...D("table"),className:(C?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */ve("caption",{className:"sr-only",children:i}),
527
535
  /* @__PURE__ */we("thead",{...D("rowgroup"),className:C?"rosh-dt-head":void 0,children:[
528
- /* @__PURE__ */we("tr",{ref:O,...D("row"),className:"border-b border-gray-200 bg-gray-50",children:[b&&/* @__PURE__ */ve("th",{scope:"col",...D("columnheader"),rowSpan:U?2:void 0,style:{width:36,...y?{top:0}:{}},className:[le,re||y?"sticky z-20 bg-gray-50":"",re?"left-0":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */ve(We,{"aria-label":N.table.selectAll,checked:J,indeterminate:X&&!J,onChange:()=>{if(!b)return;const e=new Set(G);b.onChange(J?b.selected.filter(t=>!e.has(t)):[...b.selected,...G.filter(e=>!Z.has(e))])}})}),L.map((e,t)=>Li(e)?/* @__PURE__ */ve("th",{scope:"colgroup",...D("columnheader"),colSpan:e.columns.length,style:y?{top:0}:void 0,className:[le,"text-center","font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs","border-b border-gray-200",y?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:e.title},e.key??`group-${t}`):oe(e,q.indexOf(e),U?2:1))]}),U&&/* @__PURE__ */ve("tr",{...D("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>Li(e)?e.columns:[]).map(e=>oe(e,q.indexOf(e),1,R))})]}),
529
- /* @__PURE__ */ve("tbody",{...D("rowgroup"),className:C?"rosh-dt-body":void 0,children:0!==t.length||s?/* @__PURE__ */we(ke,{children:[E>0&&/* @__PURE__ */ve("tr",{"aria-hidden":"true",children:/* @__PURE__ */ve("td",{colSpan:te,style:{height:E,padding:0,border:0}})}),t.slice(F,T).map((e,t)=>{const r=F+t,n=h?.(e,r),a=!!n?.current,l=m?.(e,r),i=void 0===l&&p?()=>p(e,r):void 0,s=void 0!==l||void 0!==i;let o=!1;const c=(e,t)=>{if(o=!0,!s)return e;const r=[Pi,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */ve(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */ve("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=q.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(s&&!o){const e=q.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=q.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const g=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
530
- return we("tr",{...Ci(n),...D("row"),style:y?{height:y.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:g(n?.onFocus),onBlur:g(n?.onBlur),"aria-current":a&&!s?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[C?b?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",C&&ne?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",s?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",u?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[b&&(()=>{const t=$(e,r);/* @__PURE__ */
531
- return ve("td",{...D("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,re?"sticky left-0 z-10 bg-white":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */ve(We,{"aria-label":N.table.selectRow,checked:Z.has(t),onChange:()=>(e=>{b&&b.onChange(Z.has(e)?b.selected.filter(t=>t!==e):[...b.selected,e])})(t)})})})(),q.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ne&&!!e.cardCorner,l=C&&!a&&"wide"!==e.only;/* @__PURE__ */
532
- return ve("td",{...D("cell"),"data-label":l?Y(e):void 0,style:r?{left:(de[t]??0)+ee}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",C?Di(e):"",le,zi[e.align??(e.numeric?"right":"left")],e.numeric&&!C?"font-mono":"","text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:C?
533
- /* @__PURE__ */ve("span",{className:e.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:n}):n},e.key)})]},$(e,r))}),I>0&&/* @__PURE__ */ve("tr",{"aria-hidden":"true",children:/* @__PURE__ */ve("td",{colSpan:te,style:{height:I,padding:0,border:0}})})]}):/* @__PURE__ */ve("tr",{...D("row"),className:C?"rosh-dt-empty":void 0,children:/* @__PURE__ */ve("td",{...D("cell"),colSpan:te,className:`${le} py-10 text-center text-gray-500`,children:M})})})]}),x]}),l&&l.pageCount>1&&/* @__PURE__ */ve("div",{className:C?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */ve($i,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
534
- return ve("div",C?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${k}`.trim(),children:/* @__PURE__ */ve("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */ve("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:ue})})}:{className:`rosh-dt-stack ${k}`.trim(),children:ue}:{className:k,children:ue})}function Bi({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const s=K().list,o=n??r,c=r>=o,d=t>0?s.selectedNotShown(e,t):e>0?s.selected(e):"";/* @__PURE__ */
535
- return we(ke,{children:[i,d?`${d} — `:"",c?null!=n?s.allLoaded(o,a):s.count(o,a):s.loadedOf(r,o,a),l?` · ${s.loadingMore}`:""]})}function Fi({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=K().list;/* @__PURE__ */
536
+ /* @__PURE__ */we("tr",{ref:O,...D("row"),className:"border-b border-gray-200 bg-gray-50",children:[b&&/* @__PURE__ */ve("th",{scope:"col",...D("columnheader"),rowSpan:U?2:void 0,style:{width:36,...y?{top:0}:{}},className:[le,re||y?"sticky z-20 bg-gray-50":"",re?"left-0":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */ve(_e,{"aria-label":N.table.selectAll,checked:J,indeterminate:X&&!J,onChange:()=>{if(!b)return;const e=new Set(G);b.onChange(J?b.selected.filter(t=>!e.has(t)):[...b.selected,...G.filter(e=>!Z.has(e))])}})}),L.map((e,t)=>Si(e)?/* @__PURE__ */ve("th",{scope:"colgroup",...D("columnheader"),colSpan:e.columns.length,style:y?{top:0}:void 0,className:[le,"text-center","font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs","border-b border-gray-200",y?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:e.title},e.key??`group-${t}`):oe(e,q.indexOf(e),U?2:1))]}),U&&/* @__PURE__ */ve("tr",{...D("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>Si(e)?e.columns:[]).map(e=>oe(e,q.indexOf(e),1,R))})]}),
537
+ /* @__PURE__ */ve("tbody",{...D("rowgroup"),className:C?"rosh-dt-body":void 0,children:0!==t.length||s?/* @__PURE__ */we(ke,{children:[T>0&&/* @__PURE__ */ve("tr",{"aria-hidden":"true",children:/* @__PURE__ */ve("td",{colSpan:te,style:{height:T,padding:0,border:0}})}),t.slice(F,E).map((e,t)=>{const r=F+t,n=h?.(e,r),a=!!n?.current,l=m?.(e,r),i=void 0===l&&p?()=>p(e,r):void 0,s=void 0!==l||void 0!==i;let o=!1;const c=(e,t)=>{if(o=!0,!s)return e;const r=[Ai,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */ve(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */ve("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=q.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(s&&!o){const e=q.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=q.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const g=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
538
+ return we("tr",{...Pi(n),...D("row"),style:y?{height:y.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:g(n?.onFocus),onBlur:g(n?.onBlur),"aria-current":a&&!s?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[C?b?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",C&&ne?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",s?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",u?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[b&&(()=>{const t=$(e,r);/* @__PURE__ */
539
+ return ve("td",{...D("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,re?"sticky left-0 z-10 bg-white":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */ve(_e,{"aria-label":N.table.selectRow,checked:Z.has(t),onChange:()=>(e=>{b&&b.onChange(Z.has(e)?b.selected.filter(t=>t!==e):[...b.selected,e])})(t)})})})(),q.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ne&&!!e.cardCorner,l=C&&!a&&"wide"!==e.only;/* @__PURE__ */
540
+ return ve("td",{...D("cell"),"data-label":l?Y(e):void 0,style:r?{left:(de[t]??0)+ee}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",C?zi(e):"",le,Fi[e.align??(e.numeric?"right":"left")],e.numeric&&!C?"font-mono":"","text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:C?
541
+ /* @__PURE__ */ve("span",{className:e.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:n}):n},e.key)})]},$(e,r))}),I>0&&/* @__PURE__ */ve("tr",{"aria-hidden":"true",children:/* @__PURE__ */ve("td",{colSpan:te,style:{height:I,padding:0,border:0}})})]}):/* @__PURE__ */ve("tr",{...D("row"),className:C?"rosh-dt-empty":void 0,children:/* @__PURE__ */ve("td",{...D("cell"),colSpan:te,className:`${le} py-10 text-center text-gray-500`,children:M})})})]}),x]}),l&&l.pageCount>1&&/* @__PURE__ */ve("div",{className:C?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */ve(ji,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
542
+ return ve("div",C?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${k}`.trim(),children:/* @__PURE__ */ve("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */ve("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:ue})})}:{className:`rosh-dt-stack ${k}`.trim(),children:ue}:{className:k,children:ue})}function Ii({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const s=K().list,o=n??r,c=r>=o,d=t>0?s.selectedNotShown(e,t):e>0?s.selected(e):"";/* @__PURE__ */
543
+ return we(ke,{children:[i,d?`${d} — `:"",c?null!=n?s.allLoaded(o,a):s.count(o,a):s.loadedOf(r,o,a),l?` · ${s.loadingMore}`:""]})}function Oi({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=K().list;/* @__PURE__ */
536
544
  return we("div",{className:`flex flex-col items-center justify-center text-center ${"card"===n?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===n?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
537
545
  /* @__PURE__ */ve("svg",{className:"h-10 w-10 text-red-300 mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,"aria-hidden":"true",children:/* @__PURE__ */ve("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m0 3.75h.008M10.34 3.94l-8.4 14.55A1.5 1.5 0 003.24 21h17.52a1.5 1.5 0 001.3-2.51l-8.4-14.55a1.5 1.5 0 00-2.6 0z"})}),
538
546
  /* @__PURE__ */ve("h3",{className:"text-sm font-medium text-gray-900",children:e??a.loadError}),
539
- /* @__PURE__ */ve("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */ve("div",{className:"mt-4",children:/* @__PURE__ */ve(L,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function Ti({data:e,width:t=120,height:r=32,stroke:n="currentColor",fill:a,strokeWidth:l=1.5,showDots:i=!1,className:s,style:o}){if(0===e.length)return null;const c=Math.max(...e),d=Math.min(...e),u=c-d||1,h=l+(i?2:0),m=e=>r-h-(e-d)/u*(r-2*h),p=1===e.length?[[0,r/2],[t,r/2]]:e.map((r,n)=>[n*t/(e.length-1),m(r)]),g=p.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "),f=`${g} L${t.toFixed(2)},${r} L0,${r} Z`;/* @__PURE__ */
547
+ /* @__PURE__ */ve("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */ve("div",{className:"mt-4",children:/* @__PURE__ */ve(L,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function Ri({data:e,width:t=120,height:r=32,stroke:n="currentColor",fill:a,strokeWidth:l=1.5,showDots:i=!1,className:s,style:o}){if(0===e.length)return null;const c=Math.max(...e),d=Math.min(...e),u=c-d||1,h=l+(i?2:0),m=e=>r-h-(e-d)/u*(r-2*h),p=1===e.length?[[0,r/2],[t,r/2]]:e.map((r,n)=>[n*t/(e.length-1),m(r)]),g=p.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "),f=`${g} L${t.toFixed(2)},${r} L0,${r} Z`;/* @__PURE__ */
540
548
  return we("svg",{className:s,style:o,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[a&&/* @__PURE__ */ve("path",{d:f,fill:a,stroke:"none"}),
541
- /* @__PURE__ */ve("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */ve("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}function Ei({data:e,labels:t,height:r=120,color:n="currentColor",colors:a,max:l,gap:i=6,className:s,style:o}){const c=U();if(0===e.length)return null;const d=l??(Math.max(...e,0)||1);/* @__PURE__ */
549
+ /* @__PURE__ */ve("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */ve("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}function Wi({data:e,labels:t,height:r=120,color:n="currentColor",colors:a,max:l,gap:i=6,className:s,style:o}){const c=U();if(0===e.length)return null;const d=l??(Math.max(...e,0)||1);/* @__PURE__ */
542
550
  return we("div",{className:s,style:o,children:[
543
- /* @__PURE__ */ve("div",{className:"flex items-end",style:{height:r,gap:i},children:e.map((e,r)=>/* @__PURE__ */ve("div",{className:"flex flex-1 flex-col justify-end",style:{height:"100%"},children:/* @__PURE__ */ve("div",{className:"w-full rounded-t",style:{height:`${Math.max(0,e/d*100)}%`,minHeight:e>0?2:0,backgroundColor:a?.[r]??n},title:null!=t?.[r]?`${t[r]}: ${Z(e,c)}`:Z(e,c)})},r))}),t&&/* @__PURE__ */ve("div",{className:"mt-1 flex",style:{gap:i},children:t.map((e,t)=>/* @__PURE__ */ve("div",{className:"flex-1 truncate text-center text-[10px] text-gray-400",children:e},t))})]})}var Ii=["var(--rosh-donut-1)","var(--rosh-donut-2)","var(--rosh-donut-3)","var(--rosh-donut-4)","var(--rosh-donut-5)","var(--rosh-donut-6)","var(--rosh-donut-7)","var(--rosh-donut-8)"];function Oi({segments:e,size:t=120,thickness:r=16,centerLabel:n,className:a,style:l}){const i=e.reduce((e,t)=>e+Math.max(0,t.value),0)||1,s=(t-r)/2,o=t/2,c=2*Math.PI*s;let d=0;/* @__PURE__ */
551
+ /* @__PURE__ */ve("div",{className:"flex items-end",style:{height:r,gap:i},children:e.map((e,r)=>/* @__PURE__ */ve("div",{className:"flex flex-1 flex-col justify-end",style:{height:"100%"},children:/* @__PURE__ */ve("div",{className:"w-full rounded-t",style:{height:`${Math.max(0,e/d*100)}%`,minHeight:e>0?2:0,backgroundColor:a?.[r]??n},title:null!=t?.[r]?`${t[r]}: ${Z(e,c)}`:Z(e,c)})},r))}),t&&/* @__PURE__ */ve("div",{className:"mt-1 flex",style:{gap:i},children:t.map((e,t)=>/* @__PURE__ */ve("div",{className:"flex-1 truncate text-center text-[10px] text-gray-400",children:e},t))})]})}var Hi=["var(--rosh-donut-1)","var(--rosh-donut-2)","var(--rosh-donut-3)","var(--rosh-donut-4)","var(--rosh-donut-5)","var(--rosh-donut-6)","var(--rosh-donut-7)","var(--rosh-donut-8)"];function _i({segments:e,size:t=120,thickness:r=16,centerLabel:n,className:a,style:l}){const i=e.reduce((e,t)=>e+Math.max(0,t.value),0)||1,s=(t-r)/2,o=t/2,c=2*Math.PI*s;let d=0;/* @__PURE__ */
544
552
  return we("div",{className:`relative inline-flex items-center justify-center ${a??""}`.trim(),style:{width:t,height:t,...l},children:[
545
553
  /* @__PURE__ */we("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-hidden":"true",style:{transform:"rotate(-90deg)"},children:[
546
- /* @__PURE__ */ve("circle",{cx:o,cy:o,r:s,fill:"none",stroke:"var(--rosh-donut-track)",strokeWidth:r}),e.map((e,t)=>{const n=Math.max(0,e.value)/i*c,a=/* @__PURE__ */ve("circle",{cx:o,cy:o,r:s,fill:"none",stroke:e.color??Ii[t%Ii.length],strokeWidth:r,strokeDasharray:`${n} ${c-n}`,strokeDashoffset:-d},t);return d+=n,a})]}),null!=n&&/* @__PURE__ */ve("div",{className:"absolute text-center text-sm font-semibold text-gray-900",children:n})]})}var Ri=(e,t)=>Number.isInteger(e)?Z(e,t):G(e,1,t);function Wi({series:e,labels:t,height:r=160,strokeWidth:n=2,showDots:a=!1,max:l,min:i,showScale:s=!1,showLegend:o=!1,className:c,style:d}){const u=U(),h=e.filter(e=>e.data.length>0);if(0===h.length)return null;const m=h.flatMap(e=>e.data),p=l??Math.max(...m),g=i??Math.min(...m),f=p-g||1,b=e=>e.color??"currentColor";/* @__PURE__ */
554
+ /* @__PURE__ */ve("circle",{cx:o,cy:o,r:s,fill:"none",stroke:"var(--rosh-donut-track)",strokeWidth:r}),e.map((e,t)=>{const n=Math.max(0,e.value)/i*c,a=/* @__PURE__ */ve("circle",{cx:o,cy:o,r:s,fill:"none",stroke:e.color??Hi[t%Hi.length],strokeWidth:r,strokeDasharray:`${n} ${c-n}`,strokeDashoffset:-d},t);return d+=n,a})]}),null!=n&&/* @__PURE__ */ve("div",{className:"absolute text-center text-sm font-semibold text-gray-900",children:n})]})}var qi=(e,t)=>Number.isInteger(e)?Z(e,t):G(e,1,t);function Ui({series:e,labels:t,height:r=160,strokeWidth:n=2,showDots:a=!1,max:l,min:i,showScale:s=!1,showLegend:o=!1,className:c,style:d}){const u=U(),h=e.filter(e=>e.data.length>0);if(0===h.length)return null;const m=h.flatMap(e=>e.data),p=l??Math.max(...m),g=i??Math.min(...m),f=p-g||1,b=e=>e.color??"currentColor";/* @__PURE__ */
547
555
  return we("div",{className:c,style:d,children:[o&&h.some(e=>e.label)&&/* @__PURE__ */ve("div",{className:"mb-1.5 flex flex-wrap items-center gap-x-3 gap-y-0.5",children:h.map((e,t)=>e.label&&/* @__PURE__ */we("span",{className:"flex items-center gap-1 text-xs text-gray-500",children:[
548
556
  /* @__PURE__ */ve("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:b(e)}}),e.label]},t))}),
549
557
  /* @__PURE__ */we("div",{className:"flex",children:[s&&/* @__PURE__ */we("div",{className:"flex flex-col justify-between pr-1.5 text-right text-[10px] leading-none text-gray-400",style:{height:r},children:[
550
- /* @__PURE__ */ve("span",{children:Ri(p,u)}),
551
- /* @__PURE__ */ve("span",{children:Ri(g+f/2,u)}),
552
- /* @__PURE__ */ve("span",{children:Ri(g,u)})]}),
558
+ /* @__PURE__ */ve("span",{children:qi(p,u)}),
559
+ /* @__PURE__ */ve("span",{children:qi(g+f/2,u)}),
560
+ /* @__PURE__ */ve("span",{children:qi(g,u)})]}),
553
561
  /* @__PURE__ */we("svg",{className:"min-w-0 flex-1",width:"100%",height:r,viewBox:"0 0 100 100",preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[s&&[0,50,100].map(e=>/* @__PURE__ */ve("line",{x1:0,y1:e,x2:100,y2:e,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1,vectorEffect:"non-scaling-stroke"},e)),h.map((e,r)=>{const l=function(e,t,r){return 1===e.length?[[0,100-(e[0]-t)/r*100],[100,100-(e[0]-t)/r*100]]:e.map((n,a)=>[100*a/(e.length-1),100-(n-t)/r*100])}(e.data,g,f),i=function(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")}(l);/* @__PURE__ */
554
562
  return we("g",{children:[e.fill&&/* @__PURE__ */ve("path",{d:`${i} L100,100 L0,100 Z`,fill:e.fill,stroke:"none"}),
555
- /* @__PURE__ */ve("path",{d:i,fill:"none",stroke:b(e),strokeWidth:n,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"}),a&&e.data.length>1&&l.map(([r,a],l)=>/* @__PURE__ */ve("path",{d:`M${r.toFixed(2)},${a.toFixed(2)} h0.01`,stroke:b(e),strokeWidth:2.5*n,strokeLinecap:"round",vectorEffect:"non-scaling-stroke",children:/* @__PURE__ */ve("title",{children:`${null!=t?.[l]?`${t[l]}: `:""}${e.label?`${e.label} `:""}${Z(e.data[l],u)}`})},l))]},r)})]})]}),t&&/* @__PURE__ */ve("div",{className:"mt-1 flex justify-between "+(s?"pl-6":""),children:t.map((e,t)=>/* @__PURE__ */ve("div",{className:"truncate text-[10px] text-gray-400",children:e},t))})]})}var Hi={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},_i=[12,18,14,22,19,27,24,31,28,35,30,38],qi=["J","F","M","A","M","J","J","A","S","O","N","D"],Ui=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function Ki(){/* @__PURE__ */
556
- return ve(aa,{groups:Hi,children:/* @__PURE__ */ve("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */we("div",{className:"mx-auto max-w-6xl space-y-6",children:[
563
+ /* @__PURE__ */ve("path",{d:i,fill:"none",stroke:b(e),strokeWidth:n,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"}),a&&e.data.length>1&&l.map(([r,a],l)=>/* @__PURE__ */ve("path",{d:`M${r.toFixed(2)},${a.toFixed(2)} h0.01`,stroke:b(e),strokeWidth:2.5*n,strokeLinecap:"round",vectorEffect:"non-scaling-stroke",children:/* @__PURE__ */ve("title",{children:`${null!=t?.[l]?`${t[l]}: `:""}${e.label?`${e.label} `:""}${Z(e.data[l],u)}`})},l))]},r)})]})]}),t&&/* @__PURE__ */ve("div",{className:"mt-1 flex justify-between "+(s?"pl-6":""),children:t.map((e,t)=>/* @__PURE__ */ve("div",{className:"truncate text-[10px] text-gray-400",children:e},t))})]})}var Ki={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},Vi=[12,18,14,22,19,27,24,31,28,35,30,38],Yi=["J","F","M","A","M","J","J","A","S","O","N","D"],Zi=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function Gi(){/* @__PURE__ */
564
+ return ve(oa,{groups:Ki,children:/* @__PURE__ */ve("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */we("div",{className:"mx-auto max-w-6xl space-y-6",children:[
557
565
  /* @__PURE__ */we("div",{className:"flex items-center justify-between gap-4",children:[
558
566
  /* @__PURE__ */we("div",{children:[
559
567
  /* @__PURE__ */ve("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
@@ -562,46 +570,46 @@ return ve(aa,{groups:Hi,children:/* @__PURE__ */ve("div",{className:"h-full over
562
570
  /* @__PURE__ */ve(L,{variant:"secondary",size:"sm",children:"Export"}),
563
571
  /* @__PURE__ */ve(L,{size:"sm",children:"New report"})]})]}),
564
572
  /* @__PURE__ */we("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
565
- /* @__PURE__ */ve(nn,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
566
- /* @__PURE__ */ve(nn,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
567
- /* @__PURE__ */ve(nn,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
568
- /* @__PURE__ */ve(nn,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
573
+ /* @__PURE__ */ve(on,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
574
+ /* @__PURE__ */ve(on,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
575
+ /* @__PURE__ */ve(on,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
576
+ /* @__PURE__ */ve(on,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
569
577
  /* @__PURE__ */we("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[
570
- /* @__PURE__ */ve(rn,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */ve("div",{className:"text-blue-600",children:/* @__PURE__ */ve(Ei,{data:_i,labels:qi,height:160})})}),
571
- /* @__PURE__ */ve(rn,{header:"Traffic sources",children:/* @__PURE__ */we("div",{className:"flex items-center gap-4",children:[
572
- /* @__PURE__ */ve(Oi,{size:120,segments:[{label:"Direct",value:45},{label:"Search",value:30},{label:"Social",value:15},{label:"Email",value:10}],centerLabel:/* @__PURE__ */ve("span",{className:"text-gray-900",children:"100%"})}),
578
+ /* @__PURE__ */ve(sn,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */ve("div",{className:"text-blue-600",children:/* @__PURE__ */ve(Wi,{data:Vi,labels:Yi,height:160})})}),
579
+ /* @__PURE__ */ve(sn,{header:"Traffic sources",children:/* @__PURE__ */we("div",{className:"flex items-center gap-4",children:[
580
+ /* @__PURE__ */ve(_i,{size:120,segments:[{label:"Direct",value:45},{label:"Search",value:30},{label:"Social",value:15},{label:"Email",value:10}],centerLabel:/* @__PURE__ */ve("span",{className:"text-gray-900",children:"100%"})}),
573
581
  /* @__PURE__ */we("ul",{className:"space-y-1.5 text-sm text-gray-600",children:[
574
582
  /* @__PURE__ */we("li",{className:"flex items-center gap-2",children:[
575
- /* @__PURE__ */ve(Vi,{c:Ii[0]}),"Direct · 45%"]}),
583
+ /* @__PURE__ */ve(Ji,{c:Hi[0]}),"Direct · 45%"]}),
576
584
  /* @__PURE__ */we("li",{className:"flex items-center gap-2",children:[
577
- /* @__PURE__ */ve(Vi,{c:Ii[1]}),"Search · 30%"]}),
585
+ /* @__PURE__ */ve(Ji,{c:Hi[1]}),"Search · 30%"]}),
578
586
  /* @__PURE__ */we("li",{className:"flex items-center gap-2",children:[
579
- /* @__PURE__ */ve(Vi,{c:Ii[2]}),"Social · 15%"]}),
587
+ /* @__PURE__ */ve(Ji,{c:Hi[2]}),"Social · 15%"]}),
580
588
  /* @__PURE__ */we("li",{className:"flex items-center gap-2",children:[
581
- /* @__PURE__ */ve(Vi,{c:Ii[3]}),"Email · 10%"]})]})]})})]}),
582
- /* @__PURE__ */ve(rn,{header:"Recent orders",padded:!1,children:/* @__PURE__ */we("table",{className:"w-full text-sm",children:[
589
+ /* @__PURE__ */ve(Ji,{c:Hi[3]}),"Email · 10%"]})]})]})})]}),
590
+ /* @__PURE__ */ve(sn,{header:"Recent orders",padded:!1,children:/* @__PURE__ */we("table",{className:"w-full text-sm",children:[
583
591
  /* @__PURE__ */ve("thead",{children:/* @__PURE__ */we("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
584
592
  /* @__PURE__ */ve("th",{className:"px-4 py-2 font-medium",children:"Order"}),
585
593
  /* @__PURE__ */ve("th",{className:"px-4 py-2 font-medium",children:"Customer"}),
586
594
  /* @__PURE__ */ve("th",{className:"px-4 py-2 font-medium",children:"Total"}),
587
595
  /* @__PURE__ */ve("th",{className:"px-4 py-2 font-medium",children:"Status"})]})}),
588
- /* @__PURE__ */ve("tbody",{className:"divide-y divide-gray-100",children:Ui.map(e=>/* @__PURE__ */we("tr",{className:"text-gray-700",children:[
596
+ /* @__PURE__ */ve("tbody",{className:"divide-y divide-gray-100",children:Zi.map(e=>/* @__PURE__ */we("tr",{className:"text-gray-700",children:[
589
597
  /* @__PURE__ */ve("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:e.id}),
590
598
  /* @__PURE__ */ve("td",{className:"px-4 py-2",children:/* @__PURE__ */we("span",{className:"flex items-center gap-2",children:[
591
- /* @__PURE__ */ve(Rn,{size:"xs",name:e.customer}),e.customer]})}),
599
+ /* @__PURE__ */ve(qn,{size:"xs",name:e.customer}),e.customer]})}),
592
600
  /* @__PURE__ */ve("td",{className:"px-4 py-2",children:e.total}),
593
- /* @__PURE__ */ve("td",{className:"px-4 py-2",children:/* @__PURE__ */ve(la,{status:e.status})})]},e.id))})]})}),
601
+ /* @__PURE__ */ve("td",{className:"px-4 py-2",children:/* @__PURE__ */ve(ca,{status:e.status})})]},e.id))})]})}),
594
602
  /* @__PURE__ */we("p",{className:"flex items-center gap-2 text-xs text-gray-400",children:[
595
- /* @__PURE__ */ve("span",{className:"text-emerald-600",children:/* @__PURE__ */ve(Ti,{data:_i,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}function Vi({c:e}){/* @__PURE__ */
596
- return ve("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:e}})}var Yi={active:"success",invited:"queued",suspended:"danger",pending:"pending"},Zi=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function Gi(){const[e,t]=ie(1),[r,n]=ie(""),[a,l]=ie("");/* @__PURE__ */
597
- return ve(aa,{groups:Yi,children:/* @__PURE__ */ve("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */we("div",{className:"mx-auto max-w-5xl space-y-4",children:[
603
+ /* @__PURE__ */ve("span",{className:"text-emerald-600",children:/* @__PURE__ */ve(Ri,{data:Vi,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}function Ji({c:e}){/* @__PURE__ */
604
+ return ve("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:e}})}var Xi={active:"success",invited:"queued",suspended:"danger",pending:"pending"},Qi=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function es(){const[e,t]=ie(1),[r,n]=ie(""),[a,l]=ie("");/* @__PURE__ */
605
+ return ve(oa,{groups:Xi,children:/* @__PURE__ */ve("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */we("div",{className:"mx-auto max-w-5xl space-y-4",children:[
598
606
  /* @__PURE__ */we("div",{className:"flex items-center justify-between gap-4",children:[
599
607
  /* @__PURE__ */ve("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
600
608
  /* @__PURE__ */ve(L,{size:"sm",children:"Invite member"})]}),
601
- /* @__PURE__ */we(rn,{padded:!1,children:[
609
+ /* @__PURE__ */we(sn,{padded:!1,children:[
602
610
  /* @__PURE__ */we("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
603
- /* @__PURE__ */ve("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */ve(ze,{value:a,onChange:e=>l(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */ve(Ji,{})})}),
604
- /* @__PURE__ */ve("div",{className:"w-40",children:/* @__PURE__ */ve(Oe,{value:r,onChange:n,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
611
+ /* @__PURE__ */ve("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */ve(Se,{value:a,onChange:e=>l(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */ve(ts,{})})}),
612
+ /* @__PURE__ */ve("div",{className:"w-40",children:/* @__PURE__ */ve(We,{value:r,onChange:n,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
605
613
  /* @__PURE__ */ve(L,{variant:"secondary",size:"sm",children:"Filter"})]}),
606
614
  /* @__PURE__ */we("table",{className:"w-full text-sm",children:[
607
615
  /* @__PURE__ */ve("thead",{children:/* @__PURE__ */we("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
@@ -609,63 +617,63 @@ return ve(aa,{groups:Yi,children:/* @__PURE__ */ve("div",{className:"h-full over
609
617
  /* @__PURE__ */ve("th",{className:"px-4 py-2 font-medium",children:"Role"}),
610
618
  /* @__PURE__ */ve("th",{className:"px-4 py-2 font-medium",children:"Status"}),
611
619
  /* @__PURE__ */ve("th",{className:"px-4 py-2 font-medium text-right",children:"Actions"})]})}),
612
- /* @__PURE__ */ve("tbody",{className:"divide-y divide-gray-100",children:Zi.map(e=>/* @__PURE__ */we("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
620
+ /* @__PURE__ */ve("tbody",{className:"divide-y divide-gray-100",children:Qi.map(e=>/* @__PURE__ */we("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
613
621
  /* @__PURE__ */we("td",{className:"px-4 py-2.5",children:[
614
622
  /* @__PURE__ */ve("div",{className:"font-medium text-gray-900",children:e.name}),
615
623
  /* @__PURE__ */ve("div",{className:"text-xs text-gray-400",children:e.email})]}),
616
624
  /* @__PURE__ */ve("td",{className:"px-4 py-2.5",children:e.role}),
617
- /* @__PURE__ */ve("td",{className:"px-4 py-2.5",children:/* @__PURE__ */ve(la,{status:e.status})}),
625
+ /* @__PURE__ */ve("td",{className:"px-4 py-2.5",children:/* @__PURE__ */ve(ca,{status:e.status})}),
618
626
  /* @__PURE__ */ve("td",{className:"px-4 py-2.5 text-right",children:/* @__PURE__ */ve(L,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
619
627
  /* @__PURE__ */we("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
620
628
  /* @__PURE__ */ve("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
621
- /* @__PURE__ */ve($i,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function Ji(){/* @__PURE__ */
629
+ /* @__PURE__ */ve(ji,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function ts(){/* @__PURE__ */
622
630
  return we("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[
623
631
  /* @__PURE__ */ve("circle",{cx:"9",cy:"9",r:"6"}),
624
- /* @__PURE__ */ve("path",{d:"M14 14l3 3",strokeLinecap:"round"})]})}function Xi(){const[e,t]=ie("pro"),[r,n]=ie(!0),[a,l]=ie("us");/* @__PURE__ */
632
+ /* @__PURE__ */ve("path",{d:"M14 14l3 3",strokeLinecap:"round"})]})}function rs(){const[e,t]=ie("pro"),[r,n]=ie(!0),[a,l]=ie("us");/* @__PURE__ */
625
633
  return ve("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */we("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
626
634
  /* @__PURE__ */we("div",{children:[
627
635
  /* @__PURE__ */ve("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
628
636
  /* @__PURE__ */ve("p",{className:"text-sm text-gray-500",children:"Update your profile and preferences."})]}),
629
- /* @__PURE__ */ve(rn,{header:"Profile",children:/* @__PURE__ */we("div",{className:"space-y-4",children:[
637
+ /* @__PURE__ */ve(sn,{header:"Profile",children:/* @__PURE__ */we("div",{className:"space-y-4",children:[
630
638
  /* @__PURE__ */we("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
631
- /* @__PURE__ */ve(qe,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */ve(ze,{id:"fn",defaultValue:"Alice"})}),
632
- /* @__PURE__ */ve(qe,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */ve(ze,{id:"ln",defaultValue:"Nguyen"})})]}),
633
- /* @__PURE__ */ve(qe,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */ve(ze,{id:"email",type:"email",defaultValue:"alice@acme.co"})}),
634
- /* @__PURE__ */ve(qe,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */ve(Ae,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
635
- /* @__PURE__ */ve(rn,{header:"Preferences",children:/* @__PURE__ */we("div",{className:"space-y-4",children:[
639
+ /* @__PURE__ */ve(Ke,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */ve(Se,{id:"fn",defaultValue:"Alice"})}),
640
+ /* @__PURE__ */ve(Ke,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */ve(Se,{id:"ln",defaultValue:"Nguyen"})})]}),
641
+ /* @__PURE__ */ve(Ke,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */ve(Se,{id:"email",type:"email",defaultValue:"alice@acme.co"})}),
642
+ /* @__PURE__ */ve(Ke,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */ve(ze,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
643
+ /* @__PURE__ */ve(sn,{header:"Preferences",children:/* @__PURE__ */we("div",{className:"space-y-4",children:[
636
644
  /* @__PURE__ */we("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
637
- /* @__PURE__ */ve(qe,{label:"Country",htmlFor:"country",children:/* @__PURE__ */ve(Oe,{value:a,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
638
- /* @__PURE__ */ve(qe,{label:"Plan",children:/* @__PURE__ */we("div",{className:"space-y-1.5 pt-1",children:[
639
- /* @__PURE__ */ve(_e,{name:"plan",checked:"free"===e,onChange:()=>t("free"),label:"Free"}),
640
- /* @__PURE__ */ve(_e,{name:"plan",checked:"pro"===e,onChange:()=>t("pro"),label:"Pro"}),
641
- /* @__PURE__ */ve(_e,{name:"plan",checked:"team"===e,onChange:()=>t("team"),label:"Team"})]})})]}),
642
- /* @__PURE__ */ve(We,{checked:r,onChange:n,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
645
+ /* @__PURE__ */ve(Ke,{label:"Country",htmlFor:"country",children:/* @__PURE__ */ve(We,{value:a,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
646
+ /* @__PURE__ */ve(Ke,{label:"Plan",children:/* @__PURE__ */we("div",{className:"space-y-1.5 pt-1",children:[
647
+ /* @__PURE__ */ve(Ue,{name:"plan",checked:"free"===e,onChange:()=>t("free"),label:"Free"}),
648
+ /* @__PURE__ */ve(Ue,{name:"plan",checked:"pro"===e,onChange:()=>t("pro"),label:"Pro"}),
649
+ /* @__PURE__ */ve(Ue,{name:"plan",checked:"team"===e,onChange:()=>t("team"),label:"Team"})]})})]}),
650
+ /* @__PURE__ */ve(_e,{checked:r,onChange:n,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
643
651
  /* @__PURE__ */we("div",{className:"flex items-center justify-end gap-2",children:[
644
652
  /* @__PURE__ */ve(L,{variant:"secondary",children:"Cancel"}),
645
- /* @__PURE__ */ve(L,{type:"submit",children:"Save changes"})]})]})})}var Qi=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function es(){const[e,t]=ie(!0),[r,n]=ie("us"),a=Qi.reduce((e,t)=>e+t.qty*t.price,0),l=a+9;/* @__PURE__ */
653
+ /* @__PURE__ */ve(L,{type:"submit",children:"Save changes"})]})]})})}var ns=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function as(){const[e,t]=ie(!0),[r,n]=ie("us"),a=ns.reduce((e,t)=>e+t.qty*t.price,0),l=a+9;/* @__PURE__ */
646
654
  return ve("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */we("div",{className:"mx-auto max-w-5xl space-y-5",children:[
647
655
  /* @__PURE__ */ve("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
648
656
  /* @__PURE__ */we("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
649
657
  /* @__PURE__ */we("form",{className:"space-y-5 lg:col-span-2",onSubmit:e=>e.preventDefault(),children:[
650
- /* @__PURE__ */ve(rn,{header:"Contact",children:/* @__PURE__ */ve("div",{className:"space-y-4",children:/* @__PURE__ */ve(qe,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */ve(ze,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
651
- /* @__PURE__ */ve(rn,{header:"Shipping address",children:/* @__PURE__ */we("div",{className:"space-y-4",children:[
658
+ /* @__PURE__ */ve(sn,{header:"Contact",children:/* @__PURE__ */ve("div",{className:"space-y-4",children:/* @__PURE__ */ve(Ke,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */ve(Se,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
659
+ /* @__PURE__ */ve(sn,{header:"Shipping address",children:/* @__PURE__ */we("div",{className:"space-y-4",children:[
652
660
  /* @__PURE__ */we("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
653
- /* @__PURE__ */ve(qe,{label:"First name",required:!0,children:/* @__PURE__ */ve(ze,{placeholder:"Alice"})}),
654
- /* @__PURE__ */ve(qe,{label:"Last name",required:!0,children:/* @__PURE__ */ve(ze,{placeholder:"Nguyen"})})]}),
655
- /* @__PURE__ */ve(qe,{label:"Address",required:!0,children:/* @__PURE__ */ve(ze,{placeholder:"123 Market St"})}),
661
+ /* @__PURE__ */ve(Ke,{label:"First name",required:!0,children:/* @__PURE__ */ve(Se,{placeholder:"Alice"})}),
662
+ /* @__PURE__ */ve(Ke,{label:"Last name",required:!0,children:/* @__PURE__ */ve(Se,{placeholder:"Nguyen"})})]}),
663
+ /* @__PURE__ */ve(Ke,{label:"Address",required:!0,children:/* @__PURE__ */ve(Se,{placeholder:"123 Market St"})}),
656
664
  /* @__PURE__ */we("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[
657
- /* @__PURE__ */ve(qe,{label:"City",children:/* @__PURE__ */ve(ze,{placeholder:"San Francisco"})}),
658
- /* @__PURE__ */ve(qe,{label:"ZIP",children:/* @__PURE__ */ve(ze,{placeholder:"94103"})}),
659
- /* @__PURE__ */ve(qe,{label:"Country",children:/* @__PURE__ */ve(Oe,{value:r,onChange:n,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
660
- /* @__PURE__ */ve(We,{checked:e,onChange:t,label:"Billing address same as shipping"})]})}),
661
- /* @__PURE__ */ve(rn,{header:"Payment",children:/* @__PURE__ */we("div",{className:"space-y-4",children:[
662
- /* @__PURE__ */ve(qe,{label:"Card number",required:!0,children:/* @__PURE__ */ve(ze,{placeholder:"1234 5678 9012 3456"})}),
665
+ /* @__PURE__ */ve(Ke,{label:"City",children:/* @__PURE__ */ve(Se,{placeholder:"San Francisco"})}),
666
+ /* @__PURE__ */ve(Ke,{label:"ZIP",children:/* @__PURE__ */ve(Se,{placeholder:"94103"})}),
667
+ /* @__PURE__ */ve(Ke,{label:"Country",children:/* @__PURE__ */ve(We,{value:r,onChange:n,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
668
+ /* @__PURE__ */ve(_e,{checked:e,onChange:t,label:"Billing address same as shipping"})]})}),
669
+ /* @__PURE__ */ve(sn,{header:"Payment",children:/* @__PURE__ */we("div",{className:"space-y-4",children:[
670
+ /* @__PURE__ */ve(Ke,{label:"Card number",required:!0,children:/* @__PURE__ */ve(Se,{placeholder:"1234 5678 9012 3456"})}),
663
671
  /* @__PURE__ */we("div",{className:"grid grid-cols-2 gap-4",children:[
664
- /* @__PURE__ */ve(qe,{label:"Expiry",required:!0,children:/* @__PURE__ */ve(ze,{placeholder:"MM / YY"})}),
665
- /* @__PURE__ */ve(qe,{label:"CVC",required:!0,children:/* @__PURE__ */ve(ze,{placeholder:"123"})})]})]})})]}),
672
+ /* @__PURE__ */ve(Ke,{label:"Expiry",required:!0,children:/* @__PURE__ */ve(Se,{placeholder:"MM / YY"})}),
673
+ /* @__PURE__ */ve(Ke,{label:"CVC",required:!0,children:/* @__PURE__ */ve(Se,{placeholder:"123"})})]})]})})]}),
666
674
  /* @__PURE__ */we("div",{className:"space-y-4",children:[
667
- /* @__PURE__ */we(rn,{header:"Order summary",children:[
668
- /* @__PURE__ */ve("ul",{className:"space-y-2 text-sm",children:Qi.map(e=>/* @__PURE__ */we("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
675
+ /* @__PURE__ */we(sn,{header:"Order summary",children:[
676
+ /* @__PURE__ */ve("ul",{className:"space-y-2 text-sm",children:ns.map(e=>/* @__PURE__ */we("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
669
677
  /* @__PURE__ */we("span",{children:[e.name," ",
670
678
  /* @__PURE__ */we("span",{className:"text-gray-400",children:["×",e.qty]})]}),
671
679
  /* @__PURE__ */we("span",{children:["$",e.qty*e.price]})]},e.name))}),
@@ -680,11 +688,11 @@ return ve("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
680
688
  /* @__PURE__ */ve("span",{children:"Total"}),
681
689
  /* @__PURE__ */we("span",{children:["$",l]})]})]}),
682
690
  /* @__PURE__ */we(L,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
683
- /* @__PURE__ */ve(Un,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var ts=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],rs=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know…",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported…",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by…",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th…",time:"Yest"}];function ns(){const[e,t]=ie(1),r=rs.find(t=>t.id===e)??rs[0];/* @__PURE__ */
691
+ /* @__PURE__ */ve(Zn,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var ls=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],is=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know…",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported…",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by…",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th…",time:"Yest"}];function ss(){const[e,t]=ie(1),r=is.find(t=>t.id===e)??is[0];/* @__PURE__ */
684
692
  return ve("div",{className:"h-full",children:/* @__PURE__ */ve(d,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */we("div",{className:"flex h-full flex-col p-2",children:[
685
- /* @__PURE__ */ve(L,{block:!0,className:"mb-2",children:"Compose"}),ts.map((e,t)=>/* @__PURE__ */we("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
693
+ /* @__PURE__ */ve(L,{block:!0,className:"mb-2",children:"Compose"}),ls.map((e,t)=>/* @__PURE__ */we("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
686
694
  /* @__PURE__ */ve("span",{children:e.label}),null!=e.count&&/* @__PURE__ */ve("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */we("div",{className:"flex h-full",children:[
687
- /* @__PURE__ */ve("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:rs.map(r=>/* @__PURE__ */we("button",{onClick:()=>t(r.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
695
+ /* @__PURE__ */ve("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:is.map(r=>/* @__PURE__ */we("button",{onClick:()=>t(r.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
688
696
  /* @__PURE__ */we("div",{className:"flex items-center justify-between gap-2",children:[
689
697
  /* @__PURE__ */ve("span",{className:"truncate text-sm "+(r.unread?"font-semibold text-gray-900":"text-gray-700"),children:r.from}),
690
698
  /* @__PURE__ */ve("span",{className:"shrink-0 text-[11px] text-gray-400",children:r.time})]}),
@@ -697,7 +705,7 @@ return ve("div",{className:"h-full",children:/* @__PURE__ */ve(d,{side:"left",de
697
705
  /* @__PURE__ */ve(L,{variant:"ghost",size:"sm",children:"Archive"}),
698
706
  /* @__PURE__ */ve(L,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
699
707
  /* @__PURE__ */we("div",{className:"flex items-center gap-3 border-b border-gray-100 p-4",children:[
700
- /* @__PURE__ */ve(Rn,{name:r.from}),
708
+ /* @__PURE__ */ve(qn,{name:r.from}),
701
709
  /* @__PURE__ */we("div",{className:"min-w-0",children:[
702
710
  /* @__PURE__ */ve("div",{className:"text-sm font-medium text-gray-900",children:r.from}),
703
711
  /* @__PURE__ */we("div",{className:"text-xs text-gray-400",children:["to me · ",r.time]})]})]}),
@@ -705,259 +713,259 @@ return ve("div",{className:"h-full",children:/* @__PURE__ */ve(d,{side:"left",de
705
713
  /* @__PURE__ */ve("p",{children:"Hi,"}),
706
714
  /* @__PURE__ */we("p",{children:[r.preview," The full details are attached — happy to walk through anything on a quick call."]}),
707
715
  /* @__PURE__ */we("p",{children:["Best,",
708
- /* @__PURE__ */ve("br",{}),r.from]})]})]})]})})})}var as=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],ls=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function is(){const[e,t]=ie(1),r=as.find(t=>t.id===e)??as[0];/* @__PURE__ */
709
- return ve("div",{className:"h-full",children:/* @__PURE__ */ve(d,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */ve("div",{className:"h-full overflow-auto",children:as.map(r=>/* @__PURE__ */we("button",{onClick:()=>t(r.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
710
- /* @__PURE__ */ve(Rn,{name:r.name,status:r.status}),
716
+ /* @__PURE__ */ve("br",{}),r.from]})]})]})]})})})}var os=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],cs=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function ds(){const[e,t]=ie(1),r=os.find(t=>t.id===e)??os[0];/* @__PURE__ */
717
+ return ve("div",{className:"h-full",children:/* @__PURE__ */ve(d,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */ve("div",{className:"h-full overflow-auto",children:os.map(r=>/* @__PURE__ */we("button",{onClick:()=>t(r.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
718
+ /* @__PURE__ */ve(qn,{name:r.name,status:r.status}),
711
719
  /* @__PURE__ */we("div",{className:"min-w-0 flex-1",children:[
712
720
  /* @__PURE__ */we("div",{className:"flex items-center justify-between gap-2",children:[
713
721
  /* @__PURE__ */ve("span",{className:"truncate text-sm font-medium text-gray-900",children:r.name}),
714
722
  /* @__PURE__ */ve("span",{className:"shrink-0 text-[11px] text-gray-400",children:r.time})]}),
715
723
  /* @__PURE__ */ve("div",{className:"truncate text-xs text-gray-500",children:r.last})]})]},r.id))}),children:/* @__PURE__ */we("div",{className:"flex h-full flex-col",children:[
716
724
  /* @__PURE__ */we("div",{className:"flex items-center gap-3 border-b border-gray-200 p-3",children:[
717
- /* @__PURE__ */ve(Rn,{name:r.name,status:r.status,size:"sm"}),
725
+ /* @__PURE__ */ve(qn,{name:r.name,status:r.status,size:"sm"}),
718
726
  /* @__PURE__ */we("div",{children:[
719
727
  /* @__PURE__ */ve("div",{className:"text-sm font-medium text-gray-900",children:r.name}),
720
728
  /* @__PURE__ */ve("div",{className:"text-xs text-gray-400 capitalize",children:r.status})]})]}),
721
- /* @__PURE__ */ve("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:ls.map((e,t)=>/* @__PURE__ */ve("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */ve("div",{style:{maxWidth:"75%"},className:"rounded-2xl px-3 py-2 text-sm "+(e.mine?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm"),children:e.text})},t))}),
729
+ /* @__PURE__ */ve("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:cs.map((e,t)=>/* @__PURE__ */ve("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */ve("div",{style:{maxWidth:"75%"},className:"rounded-2xl px-3 py-2 text-sm "+(e.mine?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm"),children:e.text})},t))}),
722
730
  /* @__PURE__ */we("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
723
- /* @__PURE__ */ve("div",{className:"flex-1",children:/* @__PURE__ */ve(ze,{placeholder:"Type a message…"})}),
724
- /* @__PURE__ */ve(L,{type:"submit",children:"Send"})]})]})})})}var ss={featured:"success",new:"active",draft:"draft"},os=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,t)=>({id:t,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][t],tag:["featured","new","draft"][t%3],bg:e}));function cs(){const[e,t]=ie("all"),r="all"===e?os:os.filter(t=>t.tag===e);/* @__PURE__ */
725
- return ve(aa,{groups:ss,children:/* @__PURE__ */ve("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */we("div",{className:"mx-auto max-w-5xl space-y-4",children:[
731
+ /* @__PURE__ */ve("div",{className:"flex-1",children:/* @__PURE__ */ve(Se,{placeholder:"Type a message…"})}),
732
+ /* @__PURE__ */ve(L,{type:"submit",children:"Send"})]})]})})})}var us={featured:"success",new:"active",draft:"draft"},hs=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,t)=>({id:t,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][t],tag:["featured","new","draft"][t%3],bg:e}));function ms(){const[e,t]=ie("all"),r="all"===e?hs:hs.filter(t=>t.tag===e);/* @__PURE__ */
733
+ return ve(oa,{groups:us,children:/* @__PURE__ */ve("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */we("div",{className:"mx-auto max-w-5xl space-y-4",children:[
726
734
  /* @__PURE__ */we("div",{className:"flex items-center justify-between gap-4",children:[
727
735
  /* @__PURE__ */ve("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
728
736
  /* @__PURE__ */ve(L,{size:"sm",children:"Upload"})]}),
729
- /* @__PURE__ */ve(Gn,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
730
- /* @__PURE__ */ve("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */we(rn,{padded:!1,className:"overflow-hidden",children:[
731
- /* @__PURE__ */ve("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */ve("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */ve(la,{status:e.tag})})}),
737
+ /* @__PURE__ */ve(ea,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
738
+ /* @__PURE__ */ve("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */we(sn,{padded:!1,className:"overflow-hidden",children:[
739
+ /* @__PURE__ */ve("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */ve("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */ve(ca,{status:e.tag})})}),
732
740
  /* @__PURE__ */we("div",{className:"flex items-center justify-between gap-2 p-3",children:[
733
741
  /* @__PURE__ */ve("span",{className:"truncate text-sm font-medium text-gray-900",children:e.title}),
734
- /* @__PURE__ */ve("span",{className:"text-xs text-gray-400",children:"2.4 MB"})]})]},e.id))})]})})})}var ds={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function us({mode:e="login"}){const[t,r]=ie(!0),n=ds[e];/* @__PURE__ */
742
+ /* @__PURE__ */ve("span",{className:"text-xs text-gray-400",children:"2.4 MB"})]})]},e.id))})]})})})}var ps={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function gs({mode:e="login"}){const[t,r]=ie(!0),n=ps[e];/* @__PURE__ */
735
743
  return ve("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */we("div",{className:"w-full max-w-sm",children:[
736
744
  /* @__PURE__ */we("div",{className:"mb-6 text-center",children:[
737
745
  /* @__PURE__ */ve("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
738
746
  /* @__PURE__ */ve("h1",{className:"text-lg font-semibold text-gray-900",children:n.title}),
739
747
  /* @__PURE__ */ve("p",{className:"text-sm text-gray-500",children:n.subtitle})]}),
740
- /* @__PURE__ */ve(rn,{children:/* @__PURE__ */we("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===e&&/* @__PURE__ */ve(qe,{label:"Name",htmlFor:"au-name",children:/* @__PURE__ */ve(ze,{id:"au-name",placeholder:"Alice Nguyen"})}),
741
- /* @__PURE__ */ve(qe,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */ve(ze,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */ve(qe,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */ve(ze,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */we("div",{className:"flex items-center justify-between",children:[
742
- /* @__PURE__ */ve(We,{checked:t,onChange:r,label:"Remember me"}),
748
+ /* @__PURE__ */ve(sn,{children:/* @__PURE__ */we("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===e&&/* @__PURE__ */ve(Ke,{label:"Name",htmlFor:"au-name",children:/* @__PURE__ */ve(Se,{id:"au-name",placeholder:"Alice Nguyen"})}),
749
+ /* @__PURE__ */ve(Ke,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */ve(Se,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */ve(Ke,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */ve(Se,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */we("div",{className:"flex items-center justify-between",children:[
750
+ /* @__PURE__ */ve(_e,{checked:t,onChange:r,label:"Remember me"}),
743
751
  /* @__PURE__ */ve("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
744
752
  /* @__PURE__ */ve(L,{type:"submit",block:!0,children:n.cta})]})}),
745
753
  /* @__PURE__ */ve("p",{className:"mt-4 text-center text-sm text-gray-500",children:/* @__PURE__ */we(ke,"register"===e?{children:["Already have an account? ",
746
754
  /* @__PURE__ */ve("a",{href:"#",className:"text-blue-600 hover:underline",children:"Sign in"})]}:{children:["New here? ",
747
- /* @__PURE__ */ve("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var hs={403:e=>({title:e.forbidden,body:e.forbiddenBody}),404:e=>({title:e.notFound,body:e.notFoundBody}),500:e=>({title:e.serverError,body:e.serverErrorBody})};function ms({code:e=404,actions:t}){const r=hs[e](K().errors);/* @__PURE__ */
755
+ /* @__PURE__ */ve("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var fs={403:e=>({title:e.forbidden,body:e.forbiddenBody}),404:e=>({title:e.notFound,body:e.notFoundBody}),500:e=>({title:e.serverError,body:e.serverErrorBody})};function bs({code:e=404,actions:t}){const r=fs[e](K().errors);/* @__PURE__ */
748
756
  return we("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
749
757
  /* @__PURE__ */ve("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:e}),
750
758
  /* @__PURE__ */ve("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:r.title}),
751
- /* @__PURE__ */ve("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */ve("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function ps({pick:e}){/* @__PURE__ */
752
- return ve(ke,{children:e(K().errors)})}var gs=class extends be{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),this.props.onError?.(e,t)}componentDidUpdate(e){if(!this.state.error)return;const t=e.resetKeys??[],r=this.props.resetKeys??[];(t.length!==r.length||t.some((e,t)=>!Object.is(e,r[t])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
759
+ /* @__PURE__ */ve("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */ve("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function xs({pick:e}){/* @__PURE__ */
760
+ return ve(ke,{children:e(K().errors)})}var ys=class extends be{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),this.props.onError?.(e,t)}componentDidUpdate(e){if(!this.state.error)return;const t=e.resetKeys??[],r=this.props.resetKeys??[];(t.length!==r.length||t.some((e,t)=>!Object.is(e,r[t])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
753
761
  /* @__PURE__ */we("div",{className:"flex h-full flex-col",children:[
754
- /* @__PURE__ */ve("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */ve(ms,{code:500,actions:/* @__PURE__ */we(ke,{children:[
755
- /* @__PURE__ */ve(L,{onClick:this.reset,children:/* @__PURE__ */ve(ps,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */we("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
756
- /* @__PURE__ */ve("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */ve(ps,{pick:e=>e.details})}),
757
- /* @__PURE__ */ve("pre",{className:"mt-2 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-700",children:e.stack??e.message})]})]}):this.props.children}};function fs(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function bs(e){const t=fs();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function xs(){return fs()?.matches??!1}function ys(){return!1}function vs(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),l=Math.min(t,r,n);let i=0,s=0;const o=(a+l)/2;if(a!==l){const e=a-l;s=o>.5?e/(2-a-l):e/(a+l),i=a===t?((r-n)/e+(r<n?6:0))/6:a===r?((n-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*s,100*o]}function ws(e,t,r){r/=100;const n=(t/=100)*Math.min(r,1-r),a=t=>{const a=(t+e/30)%12;return r-n*Math.max(Math.min(a-3,9-a,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(a(0))}${l(a(8))}${l(a(4))}`}function ks(e){const t=e||"system";return"system"===t?xs()?"dark":"light":t}function Ns(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=vs(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",ws(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",ws(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",ws(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",ws(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",ws(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",ws(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",ws(r,Math.min(n+20,100),Math.min(a+46,98)))}else t.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(e=>t.style.removeProperty(e))}function Ms(e,t,r,n,a){const l=document.documentElement;if(e){const e=e=>`${parseInt(e.slice(1,3),16)} ${parseInt(e.slice(3,5),16)} ${parseInt(e.slice(5,7),16)}`;if(t&&l.style.setProperty("--custom-bg-color",t),r&&(l.style.setProperty("--window-header-rgb",e(r)),l.style.setProperty("--window-footer-rgb",e(r))),n&&l.style.setProperty("--window-content-rgb",e(n)),a){l.style.setProperty("--custom-button-color",a);const[e,t,r]=vs(a);l.style.setProperty("--custom-button-hover",ws(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}function $s(e){document.documentElement.setAttribute("data-theme",ks(e.theme)),Ns(e.accent_color??null),Ms(e.accent_color??null,e.custom_bg_color??null,e.custom_title_color??null,e.custom_window_color??null,e.custom_button_color??null)}function Cs(){const{prefs:e}=g(),t=xe(bs,xs,ys),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,l=e.custom_title_color||null,i=e.custom_window_color||null,s=e.custom_button_color||null,o="system"===r?t?"dark":"light":r;return ce(()=>(document.documentElement.setAttribute("data-theme",o),()=>document.documentElement.removeAttribute("data-theme")),[o]),ce(()=>{Ns(n)},[n]),ce(()=>{Ms(n,a,l,i,s)},[n,a,l,i,s]),{theme:r,resolved:o}}function Ls({label:e="Not available"}){/* @__PURE__ */
758
- return ve("span",{className:"text-gray-400",role:"img","aria-label":e,children:k})}function Ds({value:e,precise:t,className:r}){const n=N(e);if(!n)/* @__PURE__ */return ve(Ls,{});const a="string"==typeof e?e:n.toISOString();/* @__PURE__ */
759
- return ve("time",{dateTime:a,title:$(a),className:r,children:M(n,{precise:t})})}function Ps(e,t=300){const[r,n]=ie(e);return ce(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function js(e,t){ce(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var zs=8,As=["var(--viz-series-1)","var(--viz-series-2)","var(--viz-series-3)","var(--viz-series-4)","var(--viz-series-5)","var(--viz-series-6)","var(--viz-series-7)","var(--viz-series-8)"],Ss={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},Bs={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function Fs(e){return As[e]??Bs.muted}function Ts(e,t,r){return t||(r?Ss[r]:Fs(e))}function Es(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function Is(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function Os(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function Rs(e){if(!Number.isFinite(e)||e<=0)return 1;const t=10**Math.floor(Math.log10(e)),r=e/t;return(r<=1?1:r<=2?2:r<=2.5?2.5:r<=5?5:10)*t}function Ws(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),s=a>0&&l>0?Math.log10(a)-i:0,o=e=>{if(s<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/s*(t.to-t.from)};return o.domain=[l,a],o.range=t,o.ticks=e=>{if(e<2||s<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},o}function Hs(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function _s(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function qs(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}var Us=e=>e.toFixed(2);function Ks(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Us(e)},${Us(t)}`).join(" ")}function Vs(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Us(e.start)},${Us(e.y)}`,t+=` L${Us(e.end)},${Us(e.y)}`}),t}function Ys(e){if(e.length<3)return Ks(e);const t=e.length,r=[],n=[];for(let a=0;a<t-1;a+=1){const t=e[a+1][0]-e[a][0];r.push(t),n.push(0===t?0:(e[a+1][1]-e[a][1])/t)}const a=[n[0]];for(let e=1;e<t-1;e+=1)a.push(n[e-1]*n[e]<=0?0:(n[e-1]+n[e])/2);a.push(n[t-2]);for(let e=0;e<t-1;e+=1){if(0===n[e]){a[e]=0,a[e+1]=0;continue}const t=a[e]/n[e],r=a[e+1]/n[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);a[e]=i*t*n[e],a[e+1]=i*r*n[e]}}let l=`M${Us(e[0][0])},${Us(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${Us(e[n][0]+t)},${Us(e[n][1]+a[n]*t)} ${Us(e[n+1][0]-t)},${Us(e[n+1][1]-a[n+1]*t)} ${Us(e[n+1][0])},${Us(e[n+1][1])}`}return l}function Zs(e,t=0){if(e.length<3)return Ks(e);const r=e.map(e=>e[1]),n=Math.min(...r),a=Math.max(...r),l=e=>Math.min(a,Math.max(n,e)),i=(1-t)/6;let s=`M${Us(e[0][0])},${Us(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],n=e[t],a=e[t+1],o=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(o[0]-n[0])*i,h=l(a[1]-(o[1]-n[1])*i);s+=` C${Us(c)},${Us(d)} ${Us(u)},${Us(h)} ${Us(a[0])},${Us(a[1])}`}return s}function Gs(e){if(e.length<2)return Ks(e);let t=`M${Us(e[0][0])},${Us(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],s=(n+l)/2;t+=` C${Us(s)},${Us(a)} ${Us(s)},${Us(i)} ${Us(l)},${Us(i)}`}return t}function Js(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Us(e[0][0])},${Us(e[0][1])}`:"monotone"===t?Ys(e):"spline"===t?Zs(e,r):"bump"===t?Gs(e):Ks(e)}function Xs(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${Us(a[0])},${Us(r)} L${Us(n[0])},${Us(r)} Z`}function Qs(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Us(e)},${Us(t)}`).join(" L")} Z`}function eo(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const s=a+2*i*Math.PI/n;return[e+r*Math.cos(s),t+r*Math.sin(s)]})}function to(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${to(e,t,r,n,a,l)} ${to(e,t,r,n,l,a+2*Math.PI)}`}const s=Math.abs(i)>Math.PI?1:0,o=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=o(n,a),[u,h]=o(n,l);if(r<=0)return`M${Us(e)},${Us(t)} L${Us(c)},${Us(d)} A${Us(n)},${Us(n)} 0 ${s} 1 ${Us(u)},${Us(h)} Z`;const[m,p]=o(r,l),[g,f]=o(r,a);return`M${Us(c)},${Us(d)} A${Us(n)},${Us(n)} 0 ${s} 1 ${Us(u)},${Us(h)} L${Us(m)},${Us(p)} A${Us(r)},${Us(r)} 0 ${s} 0 ${Us(g)},${Us(f)} Z`}function ro(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const n=Math.max(...e),a=Math.min(...e),l=t*t,i=r*r;return Math.max(i*n/l,l/(i*a))}function no(e,t,r,n){const a=n?r.height:r.width,l=a>0?t/a:0;let i=0;return{tiles:e.map(e=>{const s=t>0?e.value/t*a:0,o=n?{...e,x:r.x,y:r.y+i,width:l,height:s}:{...e,x:r.x+i,y:r.y,width:s,height:l};return i+=s,o}),rest:n?{x:r.x+l,y:r.y,width:r.width-l,height:r.height}:{x:r.x,y:r.y+l,width:r.width,height:r.height-l}}}function ao(e,t,r){const n=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===n.length||t<=0||r<=0)return[];const a=n.reduce((e,t)=>e+t.value,0),l=t*r,i=[];let s={x:0,y:0,width:t,height:r},o=[],c=0,d=[...n.map(e=>({...e,value:e.value/a*l}))];for(;d.length>0;){const e=d[0],t=Math.min(s.width,s.height),r=s.width>=s.height,n=ro(o.map(e=>e.value),c,t),a=ro([...o.map(e=>e.value),e.value],c+e.value,t);if(0===o.length||a<=n)o.push(e),c+=e.value,d=d.slice(1);else{const e=no(o,c,s,r);i.push(...e.tiles),s=e.rest,o=[],c=0}}o.length>0&&i.push(...no(o,c,s,s.width>=s.height).tiles);const u=new Map(e.map(e=>[e.key,e.value]));return i.map(e=>({...e,value:u.get(e.key)??e.value}))}var lo=de({highlighted:null,setHighlighted:()=>{}});function io({children:e}){const[t,r]=ie(null),n=ue(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
760
- return ve(lo.Provider,{value:n,children:e})}function so(){return ge(lo)}function oo(e,t,r=.22){return null===t?null:t===e?1:r}function co(e,t="none"){if("none"===t||0===e.length)return null;if("last"===t){for(let t=e.length-1;t>=0;t-=1)if("number"==typeof e[t]&&Number.isFinite(e[t]))return t;return null}let r=null;return e.forEach((n,a)=>{if("number"!=typeof n||!Number.isFinite(n))return;if(null===r)return void(r=a);const l=e[r];("max"===t?n>l:n<l)&&(r=a)}),r}function uo(e,t=720){const[r,n]=ie(t);return ce(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&n(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function ho({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:s=30,animate:o=!0,className:c,emptyLabel:d}){const u=K().charts,h=U(),m=r??(e=>Z(e,h)),p=d??u.nothingToRank;if(0===e.length)/* @__PURE__ */
761
- return ve("p",{className:`text-sm text-gray-500 ${c??""}`,children:p});const g=co(e.map(e=>e.value),a),f=n??(null===g?void 0:e[g]?.key),b=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),x=Fs(0);/* @__PURE__ */
762
- return ve("ol",{className:`m-0 list-none p-0 ${c??""}`,style:{display:"grid",rowGap:`${Math.max(4,s-i)}px`},children:e.map((e,t)=>{const r=e.key===f,n=r?l?Ss[l]:Fs(1):f?Bs.muted:x,a=Number.isFinite(e.value)?e.value:null,s=null!==a&&b>0?Math.max(0,Math.min(1,a/b)):0;/* @__PURE__ */
762
+ /* @__PURE__ */ve("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */ve(bs,{code:500,actions:/* @__PURE__ */we(ke,{children:[
763
+ /* @__PURE__ */ve(L,{onClick:this.reset,children:/* @__PURE__ */ve(xs,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */we("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
764
+ /* @__PURE__ */ve("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */ve(xs,{pick:e=>e.details})}),
765
+ /* @__PURE__ */ve("pre",{className:"mt-2 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-700",children:e.stack??e.message})]})]}):this.props.children}};function vs(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function ws(e){const t=vs();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function ks(){return vs()?.matches??!1}function Ns(){return!1}function Ms(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),l=Math.min(t,r,n);let i=0,s=0;const o=(a+l)/2;if(a!==l){const e=a-l;s=o>.5?e/(2-a-l):e/(a+l),i=a===t?((r-n)/e+(r<n?6:0))/6:a===r?((n-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*s,100*o]}function $s(e,t,r){r/=100;const n=(t/=100)*Math.min(r,1-r),a=t=>{const a=(t+e/30)%12;return r-n*Math.max(Math.min(a-3,9-a,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(a(0))}${l(a(8))}${l(a(4))}`}function Cs(e){const t=e||"system";return"system"===t?ks()?"dark":"light":t}function Ls(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Ms(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",$s(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",$s(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",$s(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",$s(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",$s(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",$s(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",$s(r,Math.min(n+20,100),Math.min(a+46,98)))}else t.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(e=>t.style.removeProperty(e))}function Ds(e,t,r,n,a){const l=document.documentElement;if(e){const e=e=>`${parseInt(e.slice(1,3),16)} ${parseInt(e.slice(3,5),16)} ${parseInt(e.slice(5,7),16)}`;if(t&&l.style.setProperty("--custom-bg-color",t),r&&(l.style.setProperty("--window-header-rgb",e(r)),l.style.setProperty("--window-footer-rgb",e(r))),n&&l.style.setProperty("--window-content-rgb",e(n)),a){l.style.setProperty("--custom-button-color",a);const[e,t,r]=Ms(a);l.style.setProperty("--custom-button-hover",$s(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}function js(e){document.documentElement.setAttribute("data-theme",Cs(e.theme)),Ls(e.accent_color??null),Ds(e.accent_color??null,e.custom_bg_color??null,e.custom_title_color??null,e.custom_window_color??null,e.custom_button_color??null)}function Ps(){const{prefs:e}=g(),t=xe(ws,ks,Ns),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,l=e.custom_title_color||null,i=e.custom_window_color||null,s=e.custom_button_color||null,o="system"===r?t?"dark":"light":r;return de(()=>(document.documentElement.setAttribute("data-theme",o),()=>document.documentElement.removeAttribute("data-theme")),[o]),de(()=>{Ls(n)},[n]),de(()=>{Ds(n,a,l,i,s)},[n,a,l,i,s]),{theme:r,resolved:o}}function Ss({label:e="Not available"}){/* @__PURE__ */
766
+ return ve("span",{className:"text-gray-400",role:"img","aria-label":e,children:k})}function zs({value:e,precise:t,className:r}){const n=N(e);if(!n)/* @__PURE__ */return ve(Ss,{});const a="string"==typeof e?e:n.toISOString();/* @__PURE__ */
767
+ return ve("time",{dateTime:a,title:$(a),className:r,children:M(n,{precise:t})})}function As(e,t=300){const[r,n]=ie(e);return de(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function Bs(e,t){de(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var Fs=8,Es=["var(--viz-series-1)","var(--viz-series-2)","var(--viz-series-3)","var(--viz-series-4)","var(--viz-series-5)","var(--viz-series-6)","var(--viz-series-7)","var(--viz-series-8)"],Ts={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},Is={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function Os(e){return Es[e]??Is.muted}function Rs(e,t,r){return t||(r?Ts[r]:Os(e))}function Ws(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function Hs(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function _s(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function qs(e){if(!Number.isFinite(e)||e<=0)return 1;const t=10**Math.floor(Math.log10(e)),r=e/t;return(r<=1?1:r<=2?2:r<=2.5?2.5:r<=5?5:10)*t}function Us(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),s=a>0&&l>0?Math.log10(a)-i:0,o=e=>{if(s<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/s*(t.to-t.from)};return o.domain=[l,a],o.range=t,o.ticks=e=>{if(e<2||s<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},o}function Ks(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function Vs(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function Ys(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}var Zs=e=>e.toFixed(2);function Gs(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Zs(e)},${Zs(t)}`).join(" ")}function Js(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Zs(e.start)},${Zs(e.y)}`,t+=` L${Zs(e.end)},${Zs(e.y)}`}),t}function Xs(e){if(e.length<3)return Gs(e);const t=e.length,r=[],n=[];for(let a=0;a<t-1;a+=1){const t=e[a+1][0]-e[a][0];r.push(t),n.push(0===t?0:(e[a+1][1]-e[a][1])/t)}const a=[n[0]];for(let e=1;e<t-1;e+=1)a.push(n[e-1]*n[e]<=0?0:(n[e-1]+n[e])/2);a.push(n[t-2]);for(let e=0;e<t-1;e+=1){if(0===n[e]){a[e]=0,a[e+1]=0;continue}const t=a[e]/n[e],r=a[e+1]/n[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);a[e]=i*t*n[e],a[e+1]=i*r*n[e]}}let l=`M${Zs(e[0][0])},${Zs(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${Zs(e[n][0]+t)},${Zs(e[n][1]+a[n]*t)} ${Zs(e[n+1][0]-t)},${Zs(e[n+1][1]-a[n+1]*t)} ${Zs(e[n+1][0])},${Zs(e[n+1][1])}`}return l}function Qs(e,t=0){if(e.length<3)return Gs(e);const r=e.map(e=>e[1]),n=Math.min(...r),a=Math.max(...r),l=e=>Math.min(a,Math.max(n,e)),i=(1-t)/6;let s=`M${Zs(e[0][0])},${Zs(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],n=e[t],a=e[t+1],o=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(o[0]-n[0])*i,h=l(a[1]-(o[1]-n[1])*i);s+=` C${Zs(c)},${Zs(d)} ${Zs(u)},${Zs(h)} ${Zs(a[0])},${Zs(a[1])}`}return s}function eo(e){if(e.length<2)return Gs(e);let t=`M${Zs(e[0][0])},${Zs(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],s=(n+l)/2;t+=` C${Zs(s)},${Zs(a)} ${Zs(s)},${Zs(i)} ${Zs(l)},${Zs(i)}`}return t}function to(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Zs(e[0][0])},${Zs(e[0][1])}`:"monotone"===t?Xs(e):"spline"===t?Qs(e,r):"bump"===t?eo(e):Gs(e)}function ro(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${Zs(a[0])},${Zs(r)} L${Zs(n[0])},${Zs(r)} Z`}function no(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Zs(e)},${Zs(t)}`).join(" L")} Z`}function ao(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const s=a+2*i*Math.PI/n;return[e+r*Math.cos(s),t+r*Math.sin(s)]})}function lo(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${lo(e,t,r,n,a,l)} ${lo(e,t,r,n,l,a+2*Math.PI)}`}const s=Math.abs(i)>Math.PI?1:0,o=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=o(n,a),[u,h]=o(n,l);if(r<=0)return`M${Zs(e)},${Zs(t)} L${Zs(c)},${Zs(d)} A${Zs(n)},${Zs(n)} 0 ${s} 1 ${Zs(u)},${Zs(h)} Z`;const[m,p]=o(r,l),[g,f]=o(r,a);return`M${Zs(c)},${Zs(d)} A${Zs(n)},${Zs(n)} 0 ${s} 1 ${Zs(u)},${Zs(h)} L${Zs(m)},${Zs(p)} A${Zs(r)},${Zs(r)} 0 ${s} 0 ${Zs(g)},${Zs(f)} Z`}function io(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const n=Math.max(...e),a=Math.min(...e),l=t*t,i=r*r;return Math.max(i*n/l,l/(i*a))}function so(e,t,r,n){const a=n?r.height:r.width,l=a>0?t/a:0;let i=0;return{tiles:e.map(e=>{const s=t>0?e.value/t*a:0,o=n?{...e,x:r.x,y:r.y+i,width:l,height:s}:{...e,x:r.x+i,y:r.y,width:s,height:l};return i+=s,o}),rest:n?{x:r.x+l,y:r.y,width:r.width-l,height:r.height}:{x:r.x,y:r.y+l,width:r.width,height:r.height-l}}}function oo(e,t,r){const n=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===n.length||t<=0||r<=0)return[];const a=n.reduce((e,t)=>e+t.value,0),l=t*r,i=[];let s={x:0,y:0,width:t,height:r},o=[],c=0,d=[...n.map(e=>({...e,value:e.value/a*l}))];for(;d.length>0;){const e=d[0],t=Math.min(s.width,s.height),r=s.width>=s.height,n=io(o.map(e=>e.value),c,t),a=io([...o.map(e=>e.value),e.value],c+e.value,t);if(0===o.length||a<=n)o.push(e),c+=e.value,d=d.slice(1);else{const e=so(o,c,s,r);i.push(...e.tiles),s=e.rest,o=[],c=0}}o.length>0&&i.push(...so(o,c,s,s.width>=s.height).tiles);const u=new Map(e.map(e=>[e.key,e.value]));return i.map(e=>({...e,value:u.get(e.key)??e.value}))}var co=ue({highlighted:null,setHighlighted:()=>{}});function uo({children:e}){const[t,r]=ie(null),n=ce(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
768
+ return ve(co.Provider,{value:n,children:e})}function ho(){return ge(co)}function mo(e,t,r=.22){return null===t?null:t===e?1:r}function po(e,t="none"){if("none"===t||0===e.length)return null;if("last"===t){for(let t=e.length-1;t>=0;t-=1)if("number"==typeof e[t]&&Number.isFinite(e[t]))return t;return null}let r=null;return e.forEach((n,a)=>{if("number"!=typeof n||!Number.isFinite(n))return;if(null===r)return void(r=a);const l=e[r];("max"===t?n>l:n<l)&&(r=a)}),r}function go(e,t=720){const[r,n]=ie(t);return de(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&n(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function fo({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:s=30,animate:o=!0,className:c,emptyLabel:d}){const u=K().charts,h=U(),m=r??(e=>Z(e,h)),p=d??u.nothingToRank;if(0===e.length)/* @__PURE__ */
769
+ return ve("p",{className:`text-sm text-gray-500 ${c??""}`,children:p});const g=po(e.map(e=>e.value),a),f=n??(null===g?void 0:e[g]?.key),b=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),x=Os(0);/* @__PURE__ */
770
+ return ve("ol",{className:`m-0 list-none p-0 ${c??""}`,style:{display:"grid",rowGap:`${Math.max(4,s-i)}px`},children:e.map((e,t)=>{const r=e.key===f,n=r?l?Ts[l]:Os(1):f?Is.muted:x,a=Number.isFinite(e.value)?e.value:null,s=null!==a&&b>0?Math.max(0,Math.min(1,a/b)):0;/* @__PURE__ */
763
771
  return we("li",{className:"grid gap-1",children:[
764
772
  /* @__PURE__ */we("div",{className:"flex items-baseline justify-between gap-3",children:[
765
773
  /* @__PURE__ */we("span",{className:"truncate font-mono text-xs text-gray-600 "+(r?"font-semibold":""),title:e.label,children:[e.label,r&&/* @__PURE__ */ve("span",{className:"sr-only",children:` ${u.emphasised}`})]}),
766
774
  /* @__PURE__ */ve("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-gray-700",style:r?{color:n}:void 0,children:null===a?"—":m(a)})]}),
767
- /* @__PURE__ */ve("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */ve("div",{className:`rounded-sm ${o?Ta.grow:""}`,style:{width:`${(100*s).toFixed(2)}%`,height:i,backgroundColor:n,minWidth:s>0?2:0,...o?Ea(t):{}}})})]},e.key)})})}var mo=e=>Math.max(0,Math.min(1,e));function po({value:e,segments:t,objective:r,label:n,detail:a,formatValue:l,tone:i,className:s,unavailableLabel:o}){const c=K().charts,d=U(),u=l??(e=>J(100*e,1,d)),h=o??c.notEnough;if(null==e||!Number.isFinite(e))/* @__PURE__ */
775
+ /* @__PURE__ */ve("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */ve("div",{className:`rounded-sm ${o?Ra.grow:""}`,style:{width:`${(100*s).toFixed(2)}%`,height:i,backgroundColor:n,minWidth:s>0?2:0,...o?Wa(t):{}}})})]},e.key)})})}var bo=e=>Math.max(0,Math.min(1,e));function xo({value:e,segments:t,objective:r,label:n,detail:a,formatValue:l,tone:i,className:s,unavailableLabel:o}){const c=K().charts,d=U(),u=l??(e=>J(100*e,1,d)),h=o??c.notEnough;if(null==e||!Number.isFinite(e))/* @__PURE__ */
768
776
  return we("div",{className:s,children:[n&&/* @__PURE__ */ve("p",{className:"text-sm font-medium text-gray-700",children:n}),
769
- /* @__PURE__ */ve("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=mo(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=Ss[g],b=[t?.length?t.map(e=>`${e.label} ${u(e.value)}`).join(" · "):"",a??"",null!=r?(p?c.objectiveMet:c.objectiveMissed)(u(r)):""].filter(Boolean).join(" · ");/* @__PURE__ */
777
+ /* @__PURE__ */ve("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=bo(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=Ts[g],b=[t?.length?t.map(e=>`${e.label} ${u(e.value)}`).join(" · "):"",a??"",null!=r?(p?c.objectiveMet:c.objectiveMissed)(u(r)):""].filter(Boolean).join(" · ");/* @__PURE__ */
770
778
  return we("div",{className:s,children:[
771
779
  /* @__PURE__ */we("div",{className:"mb-1.5 flex items-baseline justify-between gap-3",children:[
772
780
  /* @__PURE__ */ve("span",{className:"text-sm font-medium text-gray-700",children:n}),
773
781
  /* @__PURE__ */ve("span",{className:"text-sm font-semibold tabular-nums",style:{color:f},children:u(e)})]}),
774
782
  /* @__PURE__ */we("div",{className:"relative w-full rounded-full bg-gray-200",style:{height:12},role:"meter","aria-valuenow":Number((100*m).toFixed(2)),"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":u(e),"aria-label":n,children:[
775
- /* @__PURE__ */ve("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */ve("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*mo(e.value)).toFixed(2)}%`,backgroundColor:Ss[e.tone??(0===r?g:"neutral")]}},`${e.label}-${r}`))}:{className:"h-full rounded-full",style:{width:`${(100*m).toFixed(2)}%`,backgroundColor:f}}),null!=r&&/* @__PURE__ */ve("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*mo(r)).toFixed(2)}%`,height:20,backgroundColor:Bs.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */ve("p",{className:"mt-1.5 text-xs text-gray-500",children:b})]})}var go={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function fo({label:e,value:t,unit:r,delta:n,deltaTone:a,trend:l,trendTone:i,footnote:s,className:o}){const c=K().charts,d=U(),u=null==n?null:n>0?"up":n<0?"down":"flat",h=a?Ss[a]:void 0,m=i?Ss[i]:Ts(0);/* @__PURE__ */
783
+ /* @__PURE__ */ve("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */ve("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*bo(e.value)).toFixed(2)}%`,backgroundColor:Ts[e.tone??(0===r?g:"neutral")]}},`${e.label}-${r}`))}:{className:"h-full rounded-full",style:{width:`${(100*m).toFixed(2)}%`,backgroundColor:f}}),null!=r&&/* @__PURE__ */ve("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*bo(r)).toFixed(2)}%`,height:20,backgroundColor:Is.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */ve("p",{className:"mt-1.5 text-xs text-gray-500",children:b})]})}var yo={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function vo({label:e,value:t,unit:r,delta:n,deltaTone:a,trend:l,trendTone:i,footnote:s,className:o}){const c=K().charts,d=U(),u=null==n?null:n>0?"up":n<0?"down":"flat",h=a?Ts[a]:void 0,m=i?Ts[i]:Rs(0);/* @__PURE__ */
776
784
  return we("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${o??""}`,children:[
777
785
  /* @__PURE__ */ve("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
778
786
  /* @__PURE__ */we("span",{className:"flex items-baseline gap-1.5",children:[
779
787
  /* @__PURE__ */ve("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:t}),r&&/* @__PURE__ */ve("span",{className:"text-sm font-medium text-gray-500",children:r})]}),u&&/* @__PURE__ */we("span",{className:"text-xs font-medium",style:h?{color:h}:void 0,children:[
780
- /* @__PURE__ */ve("span",{"aria-hidden":"true",children:go[u].glyph})," ",Z(Math.abs(n),d),
781
- /* @__PURE__ */we("span",{className:"sr-only",children:[" ",c[go[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */ve(Ti,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-1.5 w-full"}),s&&/* @__PURE__ */ve("span",{className:"mt-1 text-xs text-gray-500",children:s})]})}function bo({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=K().charts,s=a??i.loading,o=`${oe()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
788
+ /* @__PURE__ */ve("span",{"aria-hidden":"true",children:yo[u].glyph})," ",Z(Math.abs(n),d),
789
+ /* @__PURE__ */we("span",{className:"sr-only",children:[" ",c[yo[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */ve(Ri,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-1.5 w-full"}),s&&/* @__PURE__ */ve("span",{className:"mt-1 text-xs text-gray-500",children:s})]})}function wo({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=K().charts,s=a??i.loading,o=`${oe()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
782
790
  return ve("div",{className:l,children:/* @__PURE__ */we("svg",{width:"100%",height:e,viewBox:`0 0 ${t} ${e}`,role:"img","aria-label":s,"aria-busy":"true",children:[
783
791
  /* @__PURE__ */ve("defs",{children:/* @__PURE__ */we("linearGradient",{id:o,x1:"0",y1:"0",x2:"1",y2:"0",children:[
784
- /* @__PURE__ */ve("stop",{offset:"0%",stopColor:Bs.surface,stopOpacity:"0"}),
785
- /* @__PURE__ */ve("stop",{offset:"45%",stopColor:Bs.surface,stopOpacity:"0.55"}),
786
- /* @__PURE__ */ve("stop",{offset:"55%",stopColor:Bs.surface,stopOpacity:"0.55"}),
787
- /* @__PURE__ */ve("stop",{offset:"100%",stopColor:Bs.surface,stopOpacity:"0"})]})}),Array.from({length:5},(e,t)=>{const r=u+(h-u)*t/4;/* @__PURE__ */
788
- return ve("line",{x1:c,y1:r,x2:d,y2:r,stroke:Bs.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */ve("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:Bs.grid},`t${t}`)),"bars"===r?Array.from({length:n},(e,t)=>{const r=(d-c)/n,a=.35+.4*Math.abs(Math.sin(1.1*(t+1))),l=(h-u)*a;/* @__PURE__ */
789
- return ve("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:Bs.grid},t)}):/* @__PURE__ */ve("path",{d:`M48,${h} C${c+.25*(d-c)},${u+.35*(h-u)} ${c+.55*(d-c)},${u+.15*(h-u)} ${d},${u+.55*(h-u)} L${d},${h} Z`,fill:Bs.grid}),
790
- /* @__PURE__ */ve("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${o})`})]})})}function xo({shape:e,colour:t}){const r="shrink-0";switch(e){case"circle":/* @__PURE__ */
792
+ /* @__PURE__ */ve("stop",{offset:"0%",stopColor:Is.surface,stopOpacity:"0"}),
793
+ /* @__PURE__ */ve("stop",{offset:"45%",stopColor:Is.surface,stopOpacity:"0.55"}),
794
+ /* @__PURE__ */ve("stop",{offset:"55%",stopColor:Is.surface,stopOpacity:"0.55"}),
795
+ /* @__PURE__ */ve("stop",{offset:"100%",stopColor:Is.surface,stopOpacity:"0"})]})}),Array.from({length:5},(e,t)=>{const r=u+(h-u)*t/4;/* @__PURE__ */
796
+ return ve("line",{x1:c,y1:r,x2:d,y2:r,stroke:Is.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */ve("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:Is.grid},`t${t}`)),"bars"===r?Array.from({length:n},(e,t)=>{const r=(d-c)/n,a=.35+.4*Math.abs(Math.sin(1.1*(t+1))),l=(h-u)*a;/* @__PURE__ */
797
+ return ve("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:Is.grid},t)}):/* @__PURE__ */ve("path",{d:`M48,${h} C${c+.25*(d-c)},${u+.35*(h-u)} ${c+.55*(d-c)},${u+.15*(h-u)} ${d},${u+.55*(h-u)} L${d},${h} Z`,fill:Is.grid}),
798
+ /* @__PURE__ */ve("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${o})`})]})})}function ko({shape:e,colour:t}){const r="shrink-0";switch(e){case"circle":/* @__PURE__ */
791
799
  return ve("span",{className:`${r} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:t}});case"circle-outline":/* @__PURE__ */
792
800
  return ve("span",{className:`${r} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:t}});case"rounded-square-outline":/* @__PURE__ */
793
801
  return ve("span",{className:`${r} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:t}});case"square":/* @__PURE__ */
794
802
  return ve("span",{className:`${r} h-2.5 w-2.5`,style:{backgroundColor:t}});case"bar":/* @__PURE__ */
795
803
  return ve("span",{className:`${r} h-1 w-4 rounded-full`,style:{backgroundColor:t}});case"bar-vertical":/* @__PURE__ */
796
804
  return ve("span",{className:`${r} h-3.5 w-1 rounded-full`,style:{backgroundColor:t}});default:/* @__PURE__ */
797
- return ve("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function yo({entries:e,interactive:t,fallbackSwatch:r}){const{highlighted:n,setHighlighted:a}=so();/* @__PURE__ */
805
+ return ve("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function No({entries:e,interactive:t,fallbackSwatch:r}){const{highlighted:n,setHighlighted:a}=ho();/* @__PURE__ */
798
806
  return ve("ul",{className:"m-0 flex flex-wrap items-center gap-x-4 gap-y-1 p-0",children:e.map((e,l)=>{const i=t&&null!==n&&n!==e.key,s=/* @__PURE__ */we(ke,{children:[
799
- /* @__PURE__ */ve(xo,{shape:e.swatch??r,colour:Ts(l,e.color,e.tone)}),e.label]});/* @__PURE__ */
800
- return ve("li",{className:"list-none",children:t?/* @__PURE__ */ve("button",{type:"button",onMouseEnter:()=>a(e.key),onMouseLeave:()=>a(null),onFocus:()=>a(e.key),onBlur:()=>a(null),className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(i?"opacity-40":""),children:s}):/* @__PURE__ */ve("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:s})},e.key)})})}function vo({title:e,subtitle:t,legend:r,table:n,tableLabel:a,busy:l=!1,loading:i=!1,skeletonVariant:s="area",skeletonHeight:o,interactiveLegend:c=!0,legendSwatch:d="rounded-square",actions:u,children:h,className:m}){const p=K().charts;/* @__PURE__ */
801
- return ve(io,{children:/* @__PURE__ */we("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${m??""}`,"aria-busy":l||i||void 0,children:[
807
+ /* @__PURE__ */ve(ko,{shape:e.swatch??r,colour:Rs(l,e.color,e.tone)}),e.label]});/* @__PURE__ */
808
+ return ve("li",{className:"list-none",children:t?/* @__PURE__ */ve("button",{type:"button",onMouseEnter:()=>a(e.key),onMouseLeave:()=>a(null),onFocus:()=>a(e.key),onBlur:()=>a(null),className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(i?"opacity-40":""),children:s}):/* @__PURE__ */ve("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:s})},e.key)})})}function Mo({title:e,subtitle:t,legend:r,table:n,tableLabel:a,busy:l=!1,loading:i=!1,skeletonVariant:s="area",skeletonHeight:o,interactiveLegend:c=!0,legendSwatch:d="rounded-square",actions:u,children:h,className:m}){const p=K().charts;/* @__PURE__ */
809
+ return ve(uo,{children:/* @__PURE__ */we("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${m??""}`,"aria-busy":l||i||void 0,children:[
802
810
  /* @__PURE__ */we("header",{className:"flex items-start justify-between gap-4",children:[
803
811
  /* @__PURE__ */we("div",{className:"min-w-0",children:[
804
- /* @__PURE__ */ve("h3",{className:"truncate text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */ve("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),u&&/* @__PURE__ */ve("div",{className:"shrink-0",children:u})]}),i?/* @__PURE__ */ve(bo,{variant:s,height:o}):/* @__PURE__ */ve("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:h}),!i&&r&&r.length>1&&/* @__PURE__ */ve(yo,{entries:r,interactive:c,fallbackSwatch:d}),!i&&n&&/* @__PURE__ */we("details",{className:"border-t border-gray-100 pt-3",children:[
812
+ /* @__PURE__ */ve("h3",{className:"truncate text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */ve("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),u&&/* @__PURE__ */ve("div",{className:"shrink-0",children:u})]}),i?/* @__PURE__ */ve(wo,{variant:s,height:o}):/* @__PURE__ */ve("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:h}),!i&&r&&r.length>1&&/* @__PURE__ */ve(No,{entries:r,interactive:c,fallbackSwatch:d}),!i&&n&&/* @__PURE__ */we("details",{className:"border-t border-gray-100 pt-3",children:[
805
813
  /* @__PURE__ */ve("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:a??p.showTable}),
806
- /* @__PURE__ */ve("div",{className:"mt-3 overflow-x-auto",style:{color:Bs.label},children:n})]})]})})}function wo({variant:e="solid",title:t,rows:r,footnote:n,emphasisKey:a,className:l}){const i="glass"===e;/* @__PURE__ */
814
+ /* @__PURE__ */ve("div",{className:"mt-3 overflow-x-auto",style:{color:Is.label},children:n})]})]})})}function $o({variant:e="solid",title:t,rows:r,footnote:n,emphasisKey:a,className:l}){const i="glass"===e;/* @__PURE__ */
807
815
  return we("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${i?"":"bg-white shadow-xl ring-1 ring-black/5"} ${l??""}`,style:i?B():void 0,children:[t&&/* @__PURE__ */ve("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
808
816
  /* @__PURE__ */ve("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:r.map(e=>/* @__PURE__ */we("li",{className:"flex items-center gap-2.5",style:a&&e.key!==a?{opacity:.45}:void 0,children:[
809
- /* @__PURE__ */ve("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??Bs.muted}}),
817
+ /* @__PURE__ */ve("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??Is.muted}}),
810
818
  /* @__PURE__ */ve("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
811
- /* @__PURE__ */ve("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */ve("p",{className:"mt-2 text-[11px] text-gray-500",children:n})]})}function ko({cx:e,cy:t,color:r,variant:n="default",pulse:a=!1,title:l}){const i="border"===n?3:"colored-border"===n?1.5:0,s="border"===n?3:3.5;/* @__PURE__ */
812
- return we("g",{children:[a&&/* @__PURE__ */ve("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:s,fill:r,fillOpacity:.45}),"border"===n&&/* @__PURE__ */ve("circle",{cx:e,cy:t,r:s+i,fill:Bs.surface}),
813
- /* @__PURE__ */ve("circle",{cx:e,cy:t,r:s,fill:"colored-border"===n?Bs.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */ve("title",{children:l})})]})}function No({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:s}){const o=K().charts,c=se(null),d=e.length-1,[u,h]=r,m=i??Ts(0),p=e=>0===d?0:e/d*l,g=e=>"number"==typeof e&&Number.isFinite(e),f=t.filter(g),b=Math.max(...f,1),x=e=>a-e/b*(a-6),y=[];e.forEach((e,r)=>{if(!g(t[r]))return;const n=y[y.length-1];n&&n.to===r-1?n.to=r:y.push({from:r,to:r})});const v=y.map(e=>{const r=[];for(let n=e.from;n<=e.to;n+=1)r.push(`${n===e.from?"M":"L"}${p(n).toFixed(2)},${x(t[n]).toFixed(2)}`);return`${r.join(" ")} L${p(e.to).toFixed(2)},${a} L${p(e.from).toFixed(2)},${a} Z`}).join(" "),w=(e,t)=>{const r=Math.max(0,Math.min(d,t));n("from"===e?[Math.min(r,h-1),h]:[u,Math.max(r,u+1)])},k=e=>t=>{const r=t.shiftKey?5:1,n="from"===e?u:h;"ArrowLeft"===t.key&&(t.preventDefault(),w(e,n-r)),"ArrowRight"===t.key&&(t.preventDefault(),w(e,n+r)),"Home"===t.key&&(t.preventDefault(),w(e,0)),"End"===t.key&&(t.preventDefault(),w(e,d))},N=se(null),M=e=>t=>{N.current=e,t.currentTarget.setPointerCapture(t.pointerId)},$=e=>t=>{N.current===e&&w(e,(e=>{const t=c.current?.getBoundingClientRect();if(!t||0===t.width)return u;const r=Math.max(0,Math.min(1,(e-t.left)/t.width));return Math.round(r*d)})(t.clientX))},C=e=>()=>{N.current===e&&(N.current=null)},L=t=>{const r="from"===t?u:h;/* @__PURE__ */
819
+ /* @__PURE__ */ve("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */ve("p",{className:"mt-2 text-[11px] text-gray-500",children:n})]})}function Co({cx:e,cy:t,color:r,variant:n="default",pulse:a=!1,title:l}){const i="border"===n?3:"colored-border"===n?1.5:0,s="border"===n?3:3.5;/* @__PURE__ */
820
+ return we("g",{children:[a&&/* @__PURE__ */ve("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:s,fill:r,fillOpacity:.45}),"border"===n&&/* @__PURE__ */ve("circle",{cx:e,cy:t,r:s+i,fill:Is.surface}),
821
+ /* @__PURE__ */ve("circle",{cx:e,cy:t,r:s,fill:"colored-border"===n?Is.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */ve("title",{children:l})})]})}function Lo({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:s}){const o=K().charts,c=se(null),d=e.length-1,[u,h]=r,m=i??Rs(0),p=e=>0===d?0:e/d*l,g=e=>"number"==typeof e&&Number.isFinite(e),f=t.filter(g),b=Math.max(...f,1),x=e=>a-e/b*(a-6),y=[];e.forEach((e,r)=>{if(!g(t[r]))return;const n=y[y.length-1];n&&n.to===r-1?n.to=r:y.push({from:r,to:r})});const v=y.map(e=>{const r=[];for(let n=e.from;n<=e.to;n+=1)r.push(`${n===e.from?"M":"L"}${p(n).toFixed(2)},${x(t[n]).toFixed(2)}`);return`${r.join(" ")} L${p(e.to).toFixed(2)},${a} L${p(e.from).toFixed(2)},${a} Z`}).join(" "),w=(e,t)=>{const r=Math.max(0,Math.min(d,t));n("from"===e?[Math.min(r,h-1),h]:[u,Math.max(r,u+1)])},k=e=>t=>{const r=t.shiftKey?5:1,n="from"===e?u:h;"ArrowLeft"===t.key&&(t.preventDefault(),w(e,n-r)),"ArrowRight"===t.key&&(t.preventDefault(),w(e,n+r)),"Home"===t.key&&(t.preventDefault(),w(e,0)),"End"===t.key&&(t.preventDefault(),w(e,d))},N=se(null),M=e=>t=>{N.current=e,t.currentTarget.setPointerCapture(t.pointerId)},$=e=>t=>{N.current===e&&w(e,(e=>{const t=c.current?.getBoundingClientRect();if(!t||0===t.width)return u;const r=Math.max(0,Math.min(1,(e-t.left)/t.width));return Math.round(r*d)})(t.clientX))},C=e=>()=>{N.current===e&&(N.current=null)},L=t=>{const r="from"===t?u:h;/* @__PURE__ */
814
822
  return ve("rect",{x:p(r)-4.5,y:0,width:9,height:a,rx:3,fill:m,className:"cursor-ew-resize rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",tabIndex:0,role:"slider","aria-label":"from"===t?o.windowStart:o.windowEnd,"aria-valuemin":0,"aria-valuemax":d,"aria-valuenow":r,"aria-valuetext":e[r],style:{touchAction:"none"},onKeyDown:k(t),onPointerDown:M(t),onPointerMove:$(t),onPointerUp:C(t),onPointerCancel:C(t)},t)};/* @__PURE__ */
815
823
  return ve("div",{className:s,children:/* @__PURE__ */we("svg",{ref:c,width:"100%",height:a,viewBox:`0 0 ${l} ${a}`,role:"group","aria-label":o.window(e[u],e[h],e.length),children:[
816
- /* @__PURE__ */ve("path",{d:v,fill:Bs.grid}),
817
- /* @__PURE__ */ve("rect",{x:0,y:0,width:p(u),height:a,fill:Bs.surface,fillOpacity:.72}),
818
- /* @__PURE__ */ve("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:Bs.surface,fillOpacity:.72}),
819
- /* @__PURE__ */ve("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}function Mo(e,t,r){const n=(t/2+8).toFixed(1),a=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${n}px), calc(100% - 184px))`;var t};return e<=r/2?{left:a(e)}:{right:a(r-e)}}function $o({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:s=4,formatValue:o,yAxisLabel:c,xTickAnchor:d="center",children:u,tooltip:h,ariaLabel:m,className:p,emptyLabel:g}){const f=K().charts,b=U(),x=o??(e=>Z(e,b)),y=g??f.noData,v=se(null),w=uo(v),k=n??w,[N,M]=ie(null),$=oe();if(ce(()=>{if(null!==N)return W(e=>"Escape"===e.key&&(M(null),!0))},[N]),0===e.length)/* @__PURE__ */
820
- return ve("div",{className:p,ref:v,children:/* @__PURE__ */ve("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:y})});const C={top:12,right:16,bottom:26,left:c?58:48},L=C.left,D=Math.max(L+1,k-C.right),P=C.top,j=r-C.bottom,z=t.filter(Number.isFinite),A=l??Math.min(0,...z),S=Es([A,i??Rs(Math.max(...z,0))],{from:j,to:P}),B=Is(e.length,{from:L,to:D},a),F=S.ticks(s+1),T=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor(k/84))));/* @__PURE__ */
824
+ /* @__PURE__ */ve("path",{d:v,fill:Is.grid}),
825
+ /* @__PURE__ */ve("rect",{x:0,y:0,width:p(u),height:a,fill:Is.surface,fillOpacity:.72}),
826
+ /* @__PURE__ */ve("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:Is.surface,fillOpacity:.72}),
827
+ /* @__PURE__ */ve("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}function Do(e,t,r){const n=(t/2+8).toFixed(1),a=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${n}px), calc(100% - 184px))`;var t};return e<=r/2?{left:a(e)}:{right:a(r-e)}}function jo({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:s=4,formatValue:o,yAxisLabel:c,xTickAnchor:d="center",children:u,tooltip:h,ariaLabel:m,className:p,emptyLabel:g}){const f=K().charts,b=U(),x=o??(e=>Z(e,b)),y=g??f.noData,v=se(null),w=go(v),k=n??w,[N,M]=ie(null),$=oe();if(de(()=>{if(null!==N)return W(e=>"Escape"===e.key&&(M(null),!0))},[N]),0===e.length)/* @__PURE__ */
828
+ return ve("div",{className:p,ref:v,children:/* @__PURE__ */ve("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:y})});const C={top:12,right:16,bottom:26,left:c?58:48},L=C.left,D=Math.max(L+1,k-C.right),j=C.top,P=r-C.bottom,S=t.filter(Number.isFinite),z=l??Math.min(0,...S),A=Ws([z,i??qs(Math.max(...S,0))],{from:P,to:j}),B=Hs(e.length,{from:L,to:D},a),F=A.ticks(s+1),E=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor(k/84))));/* @__PURE__ */
821
829
  return we("div",{className:`relative ${p??""}`,ref:v,children:[
822
830
  /* @__PURE__ */we("svg",{width:"100%",height:r,viewBox:`0 0 ${k} ${r}`,role:"img","aria-label":m,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>M(null),onBlur:()=>M(null),onKeyDown:t=>{if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;M(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
823
- /* @__PURE__ */ve("defs",{children:/* @__PURE__ */ve("clipPath",{id:$,children:/* @__PURE__ */ve("rect",{x:L,y:P,width:D-L,height:j-P})})}),F.map(e=>/* @__PURE__ */ve("line",{x1:L,y1:S(e),x2:D,y2:S(e),stroke:Bs.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
824
- /* @__PURE__ */ve("line",{x1:L,y1:S(Math.max(A,0)),x2:D,y2:S(Math.max(A,0)),stroke:Bs.axis,strokeWidth:1,shapeRendering:"crispEdges"}),F.map(e=>/* @__PURE__ */ve("text",{x:L-8,y:S(e)+4,textAnchor:"end",fontSize:11,fill:Bs.label,style:{fontVariantNumeric:"tabular-nums"},children:x(e)},`t${e}`)),c&&/* @__PURE__ */ve("text",{x:14,y:(P+j)/2,transform:`rotate(-90 14 ${(P+j)/2})`,textAnchor:"middle",fontSize:11,fill:Bs.label,children:c}),
825
- /* @__PURE__ */ve("g",{clipPath:`url(#${$})`,children:u({x:B,y:S,left:L,right:D,top:P,bottom:j,width:k,height:r,clipId:$,active:N})}),e.map((e,t)=>t%T===0?/* @__PURE__ */ve("text",{x:"start"===d?B(t):B.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Bs.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */ve("rect",{x:B.center(r)-(D-L)/e.length/2,y:P,width:(D-L)/e.length,height:j-P,fill:"transparent",onMouseEnter:()=>M(r)},`h${r}`))]}),h&&null!==N&&
826
- /* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 z-10",style:Mo(B.center(N),B.bandwidth,k),children:h(N)})]})}var Co=12,Lo=16,Do=26,Po=52,jo=e=>"number"==typeof e&&Number.isFinite(e);function zo({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:s=0,max:o,yTickCount:c=4,formatValue:d,yAxisLabel:u,referenceLines:h,labelEndpoints:m=!1,dots:p,dotVariant:g="border",pulse:f=!1,brush:b=!1,range:x,onRangeChange:y,loading:v=!1,animate:w=!0,reveal:k="left-to-right",fillVariant:N="gradient",gridStyle:M="solid",width:$,className:C,emptyLabel:L}){const D=K().charts,P=U(),j=d??(e=>Z(e,P)),z=L??D.noData,A=se(null),S=uo(A),B=$??S,[F,T]=ie(null),[E,I]=ie(null),{highlighted:O}=so(),R=oe();if(ce(()=>{if(null!==F)return W(e=>"Escape"===e.key&&(T(null),!0))},[F]),v)/* @__PURE__ */
827
- return ve("div",{className:C,ref:A,children:/* @__PURE__ */ve(bo,{height:r,width:$??S})});const H=t,_=x??E??[0,Math.max(0,H.length-1)],[q,V]=_,Y=e=>b?e.slice(q,V+1):e,G=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(jo)).map(e=>({...e,data:Y(e.data)}));if(t=Y(H),0===G.length||0===t.length)/* @__PURE__ */
828
- return ve("div",{className:C,ref:A,children:/* @__PURE__ */ve("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:z})});const X={left:Po,right:Math.max(Po+1,B-Lo),top:Co,bottom:r-Do},Q=Is(t.length,{from:X.left,to:X.right}),ee=t.map((e,t)=>G.reduce((e,r)=>e+(jo(r.data[t])?r.data[t]:0),0)),te=(e,t)=>ee[t]>0?e/ee[t]:null,re=[];if(n){let e=t.map(()=>0);for(const t of G)e=e.map((e,r)=>e+(jo(t.data[r])?t.data[r]:0)),re.push("percent"===a?e.map((e,t)=>te(e,t)):[...e])}const ne=l&&l.length>0?Os(l,{from:X.bottom,to:X.top}):null,ae=n?(re.at(-1)??[]).filter(jo):G.flatMap(e=>e.data.filter(jo)),le=Es([0,n&&"percent"===a?1:o??Rs(Math.max(...ae,0))],{from:X.bottom,to:X.top}),de=e=>ne?ne(e):le(e),ue=n&&"percent"===a?e=>J(Math.round(100*e),0,P):j,he=ne?ne.levels.map(e=>({value:e,y:ne(e)})):le.ticks(c+1).map(e=>({value:e,y:le(e)})),me=e=>r=>{r.preventDefault(),T(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},pe=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(B/96))));/* @__PURE__ */
829
- return we("div",{className:`relative ${C??""}`,ref:A,children:[
830
- /* @__PURE__ */we("svg",{width:"100%",height:r,viewBox:`0 0 ${B} ${r}`,role:"img","aria-label":D.overIntervals(G.map(e=>e.label),t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>T(null),onBlur:()=>T(null),onKeyDown:e=>{"ArrowRight"===e.key&&me(1)(e),"ArrowLeft"===e.key&&me(-1)(e)},children:[
831
+ /* @__PURE__ */ve("defs",{children:/* @__PURE__ */ve("clipPath",{id:$,children:/* @__PURE__ */ve("rect",{x:L,y:j,width:D-L,height:P-j})})}),F.map(e=>/* @__PURE__ */ve("line",{x1:L,y1:A(e),x2:D,y2:A(e),stroke:Is.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
832
+ /* @__PURE__ */ve("line",{x1:L,y1:A(Math.max(z,0)),x2:D,y2:A(Math.max(z,0)),stroke:Is.axis,strokeWidth:1,shapeRendering:"crispEdges"}),F.map(e=>/* @__PURE__ */ve("text",{x:L-8,y:A(e)+4,textAnchor:"end",fontSize:11,fill:Is.label,style:{fontVariantNumeric:"tabular-nums"},children:x(e)},`t${e}`)),c&&/* @__PURE__ */ve("text",{x:14,y:(j+P)/2,transform:`rotate(-90 14 ${(j+P)/2})`,textAnchor:"middle",fontSize:11,fill:Is.label,children:c}),
833
+ /* @__PURE__ */ve("g",{clipPath:`url(#${$})`,children:u({x:B,y:A,left:L,right:D,top:j,bottom:P,width:k,height:r,clipId:$,active:N})}),e.map((e,t)=>t%E===0?/* @__PURE__ */ve("text",{x:"start"===d?B(t):B.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Is.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */ve("rect",{x:B.center(r)-(D-L)/e.length/2,y:j,width:(D-L)/e.length,height:P-j,fill:"transparent",onMouseEnter:()=>M(r)},`h${r}`))]}),h&&null!==N&&
834
+ /* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 z-10",style:Do(B.center(N),B.bandwidth,k),children:h(N)})]})}var Po=12,So=16,zo=26,Ao=52,Bo=e=>"number"==typeof e&&Number.isFinite(e);function Fo({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:s=0,max:o,yTickCount:c=4,formatValue:d,yAxisLabel:u,referenceLines:h,labelEndpoints:m=!1,dots:p,dotVariant:g="border",pulse:f=!1,brush:b=!1,range:x,onRangeChange:y,loading:v=!1,animate:w=!0,reveal:k="left-to-right",fillVariant:N="gradient",gridStyle:M="solid",width:$,className:C,emptyLabel:L}){const D=K().charts,j=U(),P=d??(e=>Z(e,j)),S=L??D.noData,z=se(null),A=go(z),B=$??A,[F,E]=ie(null),[T,I]=ie(null),{highlighted:O}=ho(),R=oe();if(de(()=>{if(null!==F)return W(e=>"Escape"===e.key&&(E(null),!0))},[F]),v)/* @__PURE__ */
835
+ return ve("div",{className:C,ref:z,children:/* @__PURE__ */ve(wo,{height:r,width:$??A})});const H=t,_=x??T??[0,Math.max(0,H.length-1)],[q,V]=_,Y=e=>b?e.slice(q,V+1):e,G=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(Bo)).map(e=>({...e,data:Y(e.data)}));if(t=Y(H),0===G.length||0===t.length)/* @__PURE__ */
836
+ return ve("div",{className:C,ref:z,children:/* @__PURE__ */ve("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:S})});const X={left:Ao,right:Math.max(Ao+1,B-So),top:Po,bottom:r-zo},Q=Hs(t.length,{from:X.left,to:X.right}),ee=t.map((e,t)=>G.reduce((e,r)=>e+(Bo(r.data[t])?r.data[t]:0),0)),te=(e,t)=>ee[t]>0?e/ee[t]:null,re=[];if(n){let e=t.map(()=>0);for(const t of G)e=e.map((e,r)=>e+(Bo(t.data[r])?t.data[r]:0)),re.push("percent"===a?e.map((e,t)=>te(e,t)):[...e])}const ne=l&&l.length>0?_s(l,{from:X.bottom,to:X.top}):null,ae=n?(re.at(-1)??[]).filter(Bo):G.flatMap(e=>e.data.filter(Bo)),le=Ws([0,n&&"percent"===a?1:o??qs(Math.max(...ae,0))],{from:X.bottom,to:X.top}),ce=e=>ne?ne(e):le(e),ue=n&&"percent"===a?e=>J(Math.round(100*e),0,j):P,he=ne?ne.levels.map(e=>({value:e,y:ne(e)})):le.ticks(c+1).map(e=>({value:e,y:le(e)})),me=e=>r=>{r.preventDefault(),E(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},pe=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(B/96))));/* @__PURE__ */
837
+ return we("div",{className:`relative ${C??""}`,ref:z,children:[
838
+ /* @__PURE__ */we("svg",{width:"100%",height:r,viewBox:`0 0 ${B} ${r}`,role:"img","aria-label":D.overIntervals(G.map(e=>e.label),t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:e=>{"ArrowRight"===e.key&&me(1)(e),"ArrowLeft"===e.key&&me(-1)(e)},children:[
831
839
  /* @__PURE__ */ve("defs",{children:/* @__PURE__ */ve("clipPath",{id:R,children:/* @__PURE__ */ve("rect",{x:X.left,y:X.top,width:X.right-X.left,height:X.bottom-X.top})})}),
832
- /* @__PURE__ */ve(Ba,{id:R,fills:G.map((e,t)=>({color:Ts(e.slot,e.color,e.tone),variant:e.fillVariant??N})),fadeFrom:n?.42:.3,reveal:!!w&&k}),he.map(e=>/* @__PURE__ */ve("line",{x1:X.left,y1:e.y,x2:X.right,y2:e.y,stroke:Bs.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===M?"3 3":void 0},`grid-${e.value}`)),
833
- /* @__PURE__ */ve("line",{x1:X.left,y1:X.bottom,x2:X.right,y2:X.bottom,stroke:Bs.axis,strokeWidth:1,shapeRendering:"crispEdges"}),he.map(e=>/* @__PURE__ */ve("text",{x:X.left-8,y:e.y+4,textAnchor:"end",fontSize:11,fill:Bs.label,style:{fontVariantNumeric:"tabular-nums"},children:ue(e.value)},`ytick-${e.value}`)),u&&/* @__PURE__ */ve("text",{x:12,y:(X.top+X.bottom)/2,transform:`rotate(-90 12 ${(X.top+X.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:Bs.label,children:u}),
834
- /* @__PURE__ */ve("g",{clipPath:`url(#${R})`,mask:w&&k?`url(#${Da(R)})`:void 0,children:G.map((e,r)=>{const a=Ts(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),o=oo(e.key,O);if("step"===l){const r=t.map((t,r)=>({start:Q(r),end:Q.end(r),value:e.data[r]})).filter(e=>jo(e.value)).map(e=>({start:e.start,end:e.end,y:de(e.value)}));/* @__PURE__ */
835
- return ve("path",{d:Vs(r),fill:"none",stroke:a,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:o??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,a)=>{const l=n?re[r]?.[a]:e.data[a];return jo(l)?[Q.center(a),de(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*Q.bandwidth);/* @__PURE__ */
836
- return ve("g",{opacity:o??void 0,className:"rosh-viz-mark",children:t.map((t,i)=>{const s=n?re[r]?.[i]:e.data[i];if(!jo(s))return null;const o=de(s);/* @__PURE__ */
837
- return ve("rect",{x:Q.center(i)-l/2,y:o,width:l,height:Math.max(0,X.bottom-o),rx:2,fill:a,fillOpacity:.35,className:w?Ta.rise:void 0,style:w?Ea(i,26):void 0},i)})},e.key)}const d=Js(c,i,s),u=n&&r>0?t.map((e,t)=>[Q.center(t),de(re[r-1]?.[t]??0)-2]):null,h=u?Qs(d,u):Xs(d,c,X.bottom);/* @__PURE__ */
840
+ /* @__PURE__ */ve(Ia,{id:R,fills:G.map((e,t)=>({color:Rs(e.slot,e.color,e.tone),variant:e.fillVariant??N})),fadeFrom:n?.42:.3,reveal:!!w&&k}),he.map(e=>/* @__PURE__ */ve("line",{x1:X.left,y1:e.y,x2:X.right,y2:e.y,stroke:Is.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===M?"3 3":void 0},`grid-${e.value}`)),
841
+ /* @__PURE__ */ve("line",{x1:X.left,y1:X.bottom,x2:X.right,y2:X.bottom,stroke:Is.axis,strokeWidth:1,shapeRendering:"crispEdges"}),he.map(e=>/* @__PURE__ */ve("text",{x:X.left-8,y:e.y+4,textAnchor:"end",fontSize:11,fill:Is.label,style:{fontVariantNumeric:"tabular-nums"},children:ue(e.value)},`ytick-${e.value}`)),u&&/* @__PURE__ */ve("text",{x:12,y:(X.top+X.bottom)/2,transform:`rotate(-90 12 ${(X.top+X.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:Is.label,children:u}),
842
+ /* @__PURE__ */ve("g",{clipPath:`url(#${R})`,mask:w&&k?`url(#${za(R)})`:void 0,children:G.map((e,r)=>{const a=Rs(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),o=mo(e.key,O);if("step"===l){const r=t.map((t,r)=>({start:Q(r),end:Q.end(r),value:e.data[r]})).filter(e=>Bo(e.value)).map(e=>({start:e.start,end:e.end,y:ce(e.value)}));/* @__PURE__ */
843
+ return ve("path",{d:Js(r),fill:"none",stroke:a,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:o??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,a)=>{const l=n?re[r]?.[a]:e.data[a];return Bo(l)?[Q.center(a),ce(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*Q.bandwidth);/* @__PURE__ */
844
+ return ve("g",{opacity:o??void 0,className:"rosh-viz-mark",children:t.map((t,i)=>{const s=n?re[r]?.[i]:e.data[i];if(!Bo(s))return null;const o=ce(s);/* @__PURE__ */
845
+ return ve("rect",{x:Q.center(i)-l/2,y:o,width:l,height:Math.max(0,X.bottom-o),rx:2,fill:a,fillOpacity:.35,className:w?Ra.rise:void 0,style:w?Wa(i,26):void 0},i)})},e.key)}const d=to(c,i,s),u=n&&r>0?t.map((e,t)=>[Q.center(t),ce(re[r-1]?.[t]??0)-2]):null,h=u?no(d,u):ro(d,c,X.bottom);/* @__PURE__ */
838
846
  return we("g",{opacity:o??void 0,className:"rosh-viz-mark",children:[("area"===l||n)&&
839
- /* @__PURE__ */ve("path",{d:h,fill:ja(R,r,e.fillVariant??N,a),stroke:"none"}),
840
- /* @__PURE__ */ve("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:za(e.stroke??(e.forecast?"animated-dashed":"solid")),className:w&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?Ta.march:void 0})]},e.key)})}),h?.map((e,t)=>{const r=e.color??Ss[e.tone??"critical"],n=de(e.value);/* @__PURE__ */
847
+ /* @__PURE__ */ve("path",{d:h,fill:Ba(R,r,e.fillVariant??N,a),stroke:"none"}),
848
+ /* @__PURE__ */ve("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:Fa(e.stroke??(e.forecast?"animated-dashed":"solid")),className:w&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?Ra.march:void 0})]},e.key)})}),h?.map((e,t)=>{const r=e.color??Ts[e.tone??"critical"],n=ce(e.value);/* @__PURE__ */
841
849
  return we("g",{children:[
842
- /* @__PURE__ */ve("line",{x1:X.left,y1:n,x2:X.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */ve("text",{x:X.right-4,y:n-5,textAnchor:"end",fontSize:10.5,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(p??(m?"last":"none"))&&G.map((e,r)=>{const a=p??(m?"last":"none"),l=Ts(e.slot,e.color,e.tone),i=[...e.data].map(jo).lastIndexOf(!0),s="all"===a?t.map((e,t)=>t).filter(t=>jo(n?re[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
843
- return we("g",{children:[s.map(a=>{const s=n?re[r]?.[a]:e.data[a];return jo(s)?/* @__PURE__ */ve(ko,{cx:Q.center(a),cy:de(s),color:l,variant:g,pulse:f&&a===i,title:`${t[a]}: ${e.label} ${j(s)}`},a):null}),m&&i>=0&&jo(n?re[r]?.[i]:e.data[i])&&/* @__PURE__ */ve("text",{x:Q.center(i)-10,y:de(n?re[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:Bs.label,style:{fontVariantNumeric:"tabular-nums"},children:j(n?re[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%pe===0?/* @__PURE__ */ve("text",{x:Q.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Bs.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==F&&/* @__PURE__ */ve("line",{x1:Q.center(F),y1:X.top,x2:Q.center(F),y2:X.bottom,stroke:Bs.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */ve("rect",{x:Q(t),y:X.top,width:Math.max(1,Q.bandwidth),height:X.bottom-X.top,fill:"transparent",onMouseEnter:()=>T(t)},`hit-${t}`))]}),b&&H.length>2&&/* @__PURE__ */ve(No,{className:"mt-1",labels:H,width:B,data:e[0]?.data??[],range:_,onRangeChange:e=>{y?y(e):I(e)}}),null!==F&&
844
- /* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 z-10",style:Mo(Q.center(F),Q.bandwidth,B),children:/* @__PURE__ */ve(wo,{title:t[F],rows:G.map((e,t)=>({key:e.key,label:e.label,color:Ts(e.slot,e.color,e.tone),value:jo(e.data[F])?n&&"percent"===a?`${J(100*(te(e.data[F],F)??0),1,P)} · ${j(e.data[F])}`:j(e.data[F]):void 0})),footnote:n&&"percent"===a?D.inBucket(j(ee[F])):void 0})})]})}function Ao({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=220,width:l,max:i,formatValue:s,yAxisLabel:o,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:b="none"}){const x=oe(),{highlighted:y}=so(),v=K().charts,w=U(),k=s??(e=>Z(e,w));if(h)/* @__PURE__ */return ve(bo,{height:a,width:l,variant:"bars",className:c});const N=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),M=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},$=t.map((e,t)=>N.reduce((e,r)=>e+M(r,t),0)),C=t.map((e,t)=>N.reduce((e,r)=>e+Math.max(0,M(r,t)),0)),L=t.map((e,t)=>N.reduce((e,r)=>e+Math.min(0,M(r,t)),0)),D=r&&"percent"===n,P=(e,t)=>$[t]>0?e/$[t]:null,j=D?[1]:r?[...C,...L]:N.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
845
- return ve($o,{labels:t,values:j,height:a,width:l,max:D?1:i,formatValue:D?e=>J(Math.round(100*e),0,w):k,yAxisLabel:o,className:c,emptyLabel:d,ariaLabel:v.acrossCategories(N.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */ve(wo,{title:t[e],rows:N.map(t=>({key:t.key,label:t.label,color:Ts(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?D?`${J(100*(P(t.data[e],e)??0),1,w)} · ${k(t.data[e])}`:k(t.data[e]):void 0})),footnote:D?v.inCategory(k($[e])):void 0}),children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,s=co(r?$:N[0]?.data??[],b),o=l??(i>=0?i:s);/* @__PURE__ */
850
+ /* @__PURE__ */ve("line",{x1:X.left,y1:n,x2:X.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */ve("text",{x:X.right-4,y:n-5,textAnchor:"end",fontSize:10.5,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(p??(m?"last":"none"))&&G.map((e,r)=>{const a=p??(m?"last":"none"),l=Rs(e.slot,e.color,e.tone),i=[...e.data].map(Bo).lastIndexOf(!0),s="all"===a?t.map((e,t)=>t).filter(t=>Bo(n?re[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
851
+ return we("g",{children:[s.map(a=>{const s=n?re[r]?.[a]:e.data[a];return Bo(s)?/* @__PURE__ */ve(Co,{cx:Q.center(a),cy:ce(s),color:l,variant:g,pulse:f&&a===i,title:`${t[a]}: ${e.label} ${P(s)}`},a):null}),m&&i>=0&&Bo(n?re[r]?.[i]:e.data[i])&&/* @__PURE__ */ve("text",{x:Q.center(i)-10,y:ce(n?re[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:Is.label,style:{fontVariantNumeric:"tabular-nums"},children:P(n?re[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%pe===0?/* @__PURE__ */ve("text",{x:Q.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Is.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==F&&/* @__PURE__ */ve("line",{x1:Q.center(F),y1:X.top,x2:Q.center(F),y2:X.bottom,stroke:Is.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */ve("rect",{x:Q(t),y:X.top,width:Math.max(1,Q.bandwidth),height:X.bottom-X.top,fill:"transparent",onMouseEnter:()=>E(t)},`hit-${t}`))]}),b&&H.length>2&&/* @__PURE__ */ve(Lo,{className:"mt-1",labels:H,width:B,data:e[0]?.data??[],range:_,onRangeChange:e=>{y?y(e):I(e)}}),null!==F&&
852
+ /* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 z-10",style:Do(Q.center(F),Q.bandwidth,B),children:/* @__PURE__ */ve($o,{title:t[F],rows:G.map((e,t)=>({key:e.key,label:e.label,color:Rs(e.slot,e.color,e.tone),value:Bo(e.data[F])?n&&"percent"===a?`${J(100*(te(e.data[F],F)??0),1,j)} · ${P(e.data[F])}`:P(e.data[F]):void 0})),footnote:n&&"percent"===a?D.inBucket(P(ee[F])):void 0})})]})}function Eo({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=220,width:l,max:i,formatValue:s,yAxisLabel:o,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:b="none"}){const x=oe(),{highlighted:y}=ho(),v=K().charts,w=U(),k=s??(e=>Z(e,w));if(h)/* @__PURE__ */return ve(wo,{height:a,width:l,variant:"bars",className:c});const N=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),M=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},$=t.map((e,t)=>N.reduce((e,r)=>e+M(r,t),0)),C=t.map((e,t)=>N.reduce((e,r)=>e+Math.max(0,M(r,t)),0)),L=t.map((e,t)=>N.reduce((e,r)=>e+Math.min(0,M(r,t)),0)),D=r&&"percent"===n,j=(e,t)=>$[t]>0?e/$[t]:null,P=D?[1]:r?[...C,...L]:N.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
853
+ return ve(jo,{labels:t,values:P,height:a,width:l,max:D?1:i,formatValue:D?e=>J(Math.round(100*e),0,w):k,yAxisLabel:o,className:c,emptyLabel:d,ariaLabel:v.acrossCategories(N.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */ve($o,{title:t[e],rows:N.map(t=>({key:t.key,label:t.label,color:Rs(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?D?`${J(100*(j(t.data[e],e)??0),1,w)} · ${k(t.data[e])}`:k(t.data[e]):void 0})),footnote:D?v.inCategory(k($[e])):void 0}),children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,s=po(r?$:N[0]?.data??[],b),o=l??(i>=0?i:s);/* @__PURE__ */
846
854
  return we("g",{children:[
847
- /* @__PURE__ */ve(Ba,{id:x,glow:p}),t.map((t,a)=>{const l=e.bandwidth/(r?1:Math.max(1,N.length));let i=0,s=0;const c=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return N.map((t,d)=>{const h=t.data[a];if(!Number.isFinite(h))return null;const f=D?P(h,a):h;if(null===f)return null;const b=Ts(t.slot,t.color,t.tone),v=r?e(a):e(a)+d*l;let w,k,M=!0;if(r){const e=f>=0?i:s,t=e+f;f>=0?i=t:s=t,w=n(Math.max(e,t)),k=n(Math.min(e,t)),M=0===e}else w=Math.min(n(f),c),k=Math.max(n(f),c);const $=Math.max(0,k-w-(r&&!M?2:0)),C=null===o||o===a,L=C?b:g?Bs.muted:b,j=oo(t.key,y);/* @__PURE__ */
848
- return ve("rect",{x:v,y:w,width:Math.max(1,l),height:$,rx:u,fill:L,fillOpacity:j??(C?1:g?.32:.45),filter:p&&o===a?`url(#${La(x)})`:void 0,className:"rosh-viz-mark"+(m?` ${Ta.rise}`:""),style:m?Ea(a*(r?1:N.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */ve("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:Bs.axis,strokeWidth:1})]})}})}var So=3;function Bo({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:s,yDomain:o,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=K().charts,g=U(),f=l??(e=>Z(e,g)),b=i??(e=>Z(e,g)),x=m??p.noObservations,y=se(null),v=uo(y),w=r??v,k=oe(),[N,M]=ie(null);ce(()=>{if(null!==N)return W(e=>"Escape"===e.key&&(M(null),!0))},[N]);const $=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.filter(e=>e.points.length>0).slice(0,3),L=s||o?C.map(e=>({...e,points:e.points.filter(e=>$(e.x,s)&&$(e.y,o))})).filter(e=>e.points.length>0):C,D=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
849
- return ve("div",{className:h,ref:y,children:/* @__PURE__ */ve("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:x})});const P=L.flatMap(e=>e.points),j=P.some(e=>null!=e.size),z=14,A=20,S=34,B=52,F=Math.max(B+1,w-A),T=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,Rs(Math.max(...e))];return"log"===r?Ws(i,n):Es(i,n)},E=T(P.map(e=>e.x),s,c,{from:B,to:F}),I=T(P.map(e=>e.y),o,d,{from:t-S,to:z}),O=_s([0,Math.max(...P.map(e=>e.size??1))],{from:u[0],to:u[1]}),R=N?L[N.s]:void 0,H=N&&R?R.points[N.i]:void 0,_=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
855
+ /* @__PURE__ */ve(Ia,{id:x,glow:p}),t.map((t,a)=>{const l=e.bandwidth/(r?1:Math.max(1,N.length));let i=0,s=0;const c=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return N.map((t,d)=>{const h=t.data[a];if(!Number.isFinite(h))return null;const f=D?j(h,a):h;if(null===f)return null;const b=Rs(t.slot,t.color,t.tone),v=r?e(a):e(a)+d*l;let w,k,M=!0;if(r){const e=f>=0?i:s,t=e+f;f>=0?i=t:s=t,w=n(Math.max(e,t)),k=n(Math.min(e,t)),M=0===e}else w=Math.min(n(f),c),k=Math.max(n(f),c);const $=Math.max(0,k-w-(r&&!M?2:0)),C=null===o||o===a,L=C?b:g?Is.muted:b,P=mo(t.key,y);/* @__PURE__ */
856
+ return ve("rect",{x:v,y:w,width:Math.max(1,l),height:$,rx:u,fill:L,fillOpacity:P??(C?1:g?.32:.45),filter:p&&o===a?`url(#${Sa(x)})`:void 0,className:"rosh-viz-mark"+(m?` ${Ra.rise}`:""),style:m?Wa(a*(r?1:N.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */ve("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:Is.axis,strokeWidth:1})]})}})}var To=3;function Io({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:s,yDomain:o,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=K().charts,g=U(),f=l??(e=>Z(e,g)),b=i??(e=>Z(e,g)),x=m??p.noObservations,y=se(null),v=go(y),w=r??v,k=oe(),[N,M]=ie(null);de(()=>{if(null!==N)return W(e=>"Escape"===e.key&&(M(null),!0))},[N]);const $=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.filter(e=>e.points.length>0).slice(0,3),L=s||o?C.map(e=>({...e,points:e.points.filter(e=>$(e.x,s)&&$(e.y,o))})).filter(e=>e.points.length>0):C,D=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
857
+ return ve("div",{className:h,ref:y,children:/* @__PURE__ */ve("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:x})});const j=L.flatMap(e=>e.points),P=j.some(e=>null!=e.size),S=14,z=20,A=34,B=52,F=Math.max(B+1,w-z),E=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,qs(Math.max(...e))];return"log"===r?Us(i,n):Ws(i,n)},T=E(j.map(e=>e.x),s,c,{from:B,to:F}),I=E(j.map(e=>e.y),o,d,{from:t-A,to:S}),O=Vs([0,Math.max(...j.map(e=>e.size??1))],{from:u[0],to:u[1]}),R=N?L[N.s]:void 0,H=N&&R?R.points[N.i]:void 0,_=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
850
858
  return we("div",{className:`relative ${h??""}`,ref:y,children:[
851
859
  /* @__PURE__ */we("svg",{width:"100%",height:t,viewBox:`0 0 ${w} ${t}`,role:"img","aria-label":p.scatter(L.map(e=>e.label),a??p.yAxis,n??p.xAxis)+(D>0?`. ${p.outsideRange(D)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>M(null),onBlur:()=>M(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=N?_.findIndex(e=>e.s===N.s&&e.i===N.i):0;M(_[Math.min(_.length-1,Math.max(0,r+t))])},children:[
852
- /* @__PURE__ */ve("defs",{children:/* @__PURE__ */ve("clipPath",{id:k,children:/* @__PURE__ */ve("rect",{x:B-u[1],y:z-u[1],width:F-B+2*u[1],height:t-S-z+2*u[1]})})}),I.ticks(5).map(e=>/* @__PURE__ */we("g",{children:[
853
- /* @__PURE__ */ve("line",{x1:B,y1:I(e),x2:F,y2:I(e),stroke:Bs.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
854
- /* @__PURE__ */ve("text",{x:B-8,y:I(e)+4,textAnchor:"end",fontSize:11,fill:Bs.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),E.ticks(5).map(e=>/* @__PURE__ */ve("text",{x:E(e),y:t-12,textAnchor:"middle",fontSize:11,fill:Bs.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */ve("text",{x:(B+F)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:Bs.label,children:n}),a&&/* @__PURE__ */ve("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:Bs.label,children:a}),
855
- /* @__PURE__ */ve("g",{clipPath:`url(#${k})`,children:L.map((e,t)=>{const r=Ts(t,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */ve("circle",{cx:E(n.x),cy:I(n.y),r:j?O(n.size??0):u[0]+1,fill:r,fillOpacity:N&&N.s!==t?.25:.62,stroke:Bs.surface,strokeWidth:2,onMouseEnter:()=>M({s:t,i:a})},`${e.key}-${a}`))})})]}),N&&R&&H&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve(wo,{title:H.label??R.label,rows:[{key:"x",label:n??p.xAxis,color:Ts(N.s,R.color,R.tone),value:f(H.x)},{key:"y",label:a??p.yAxis,color:Ts(N.s,R.color,R.tone),value:b(H.y)},...null!=H.size?[{key:"size",label:p.size,color:Bs.muted,value:Z(H.size,g)}]:[]],footnote:H.label?R.label:void 0})})]})}function Fo({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=220,width:l,max:i,min:s,formatValue:o,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=K().charts,b=U(),x=o??(e=>Z(e,b)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=Ts(0,d,u);/* @__PURE__ */
856
- return ve($o,{labels:t,values:v,height:a,width:l,max:i,min:s,formatValue:x,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(y,t.length),tooltip:r=>/* @__PURE__ */ve(wo,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:x(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:x(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */ve("g",{children:e.map((e,r)=>/* @__PURE__ */ve("rect",{x:t(r),y:a(e.high),width:Math.max(1,t.bandwidth),height:Math.max(1,a(e.low)-a(e.high)),rx:g,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */we("g",{children:[(()=>{const r=e.map((e,r)=>[t.center(r),a(e.high)]),l=e.map((e,r)=>[t.center(r),a(e.low)]);/* @__PURE__ */
860
+ /* @__PURE__ */ve("defs",{children:/* @__PURE__ */ve("clipPath",{id:k,children:/* @__PURE__ */ve("rect",{x:B-u[1],y:S-u[1],width:F-B+2*u[1],height:t-A-S+2*u[1]})})}),I.ticks(5).map(e=>/* @__PURE__ */we("g",{children:[
861
+ /* @__PURE__ */ve("line",{x1:B,y1:I(e),x2:F,y2:I(e),stroke:Is.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
862
+ /* @__PURE__ */ve("text",{x:B-8,y:I(e)+4,textAnchor:"end",fontSize:11,fill:Is.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),T.ticks(5).map(e=>/* @__PURE__ */ve("text",{x:T(e),y:t-12,textAnchor:"middle",fontSize:11,fill:Is.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */ve("text",{x:(B+F)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:Is.label,children:n}),a&&/* @__PURE__ */ve("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:Is.label,children:a}),
863
+ /* @__PURE__ */ve("g",{clipPath:`url(#${k})`,children:L.map((e,t)=>{const r=Rs(t,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */ve("circle",{cx:T(n.x),cy:I(n.y),r:P?O(n.size??0):u[0]+1,fill:r,fillOpacity:N&&N.s!==t?.25:.62,stroke:Is.surface,strokeWidth:2,onMouseEnter:()=>M({s:t,i:a})},`${e.key}-${a}`))})})]}),N&&R&&H&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve($o,{title:H.label??R.label,rows:[{key:"x",label:n??p.xAxis,color:Rs(N.s,R.color,R.tone),value:f(H.x)},{key:"y",label:a??p.yAxis,color:Rs(N.s,R.color,R.tone),value:b(H.y)},...null!=H.size?[{key:"size",label:p.size,color:Is.muted,value:Z(H.size,g)}]:[]],footnote:H.label?R.label:void 0})})]})}function Oo({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=220,width:l,max:i,min:s,formatValue:o,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=K().charts,b=U(),x=o??(e=>Z(e,b)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=Rs(0,d,u);/* @__PURE__ */
864
+ return ve(jo,{labels:t,values:v,height:a,width:l,max:i,min:s,formatValue:x,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(y,t.length),tooltip:r=>/* @__PURE__ */ve($o,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:x(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:x(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */ve("g",{children:e.map((e,r)=>/* @__PURE__ */ve("rect",{x:t(r),y:a(e.high),width:Math.max(1,t.bandwidth),height:Math.max(1,a(e.low)-a(e.high)),rx:g,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */we("g",{children:[(()=>{const r=e.map((e,r)=>[t.center(r),a(e.high)]),l=e.map((e,r)=>[t.center(r),a(e.low)]);/* @__PURE__ */
857
865
  return we(ke,{children:[
858
- /* @__PURE__ */ve("path",{d:Qs(Js(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
859
- /* @__PURE__ */ve("path",{d:Js(r,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
860
- /* @__PURE__ */ve("path",{d:Js(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */ve("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:Bs.axis,strokeWidth:1})]})})}function To({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:s=3,connectors:o=!0}){const c=K().charts,d=U(),u=n??(e=>Z(e,d));let h=0;const m=e.map(e=>{if(e.total){const t={from:0,to:h,value:h,total:!0};return{...e,...t}}const t=h;return h+=e.value,{...e,from:t,to:h,value:e.value,total:!1}}),p=m.flatMap(e=>[e.from,e.to]);/* @__PURE__ */
861
- return ve($o,{labels:e.map(e=>e.label),values:p,height:t,width:r,formatValue:u,yAxisLabel:a,className:l,emptyLabel:i,bandPadding:.36,ariaLabel:c.waterfall(e.length,u(m[0]?.from??0),u(h)),tooltip:e=>{const t=m[e],r=t?.total?Ss.neutral:t.value>=0?Ss.good:Ss.critical;/* @__PURE__ */
862
- return ve(wo,{title:t?.label,rows:[{key:"step",color:r,label:t?.total?c.balance:t.value>=0?c.increase:c.decrease,value:t?.total?u(t.to):`${t.value>=0?"+":"−"}${u(Math.abs(t.value))}`},...t?.total?[]:[{key:"running",label:c.runningTotal,color:Ss.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */we("g",{children:[o&&m.slice(0,-1).map((r,n)=>
863
- /* @__PURE__ */ve("line",{x1:e.end(n),y1:t(r.to),x2:e(n+1),y2:t(r.to),stroke:Bs.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${n}`)),m.map((n,a)=>{const l=n.total?Ss.neutral:n.value>=0?Ss.good:Ss.critical,i=Math.min(t(n.from),t(n.to)),o=Math.max(1,Math.abs(t(n.to)-t(n.from)));/* @__PURE__ */
864
- return ve("rect",{x:e(a),y:i,width:Math.max(1,e.bandwidth),height:o,rx:s,fill:l,fillOpacity:null===r||r===a?1:.45},a)})]})})}function Eo({values:e,bins:t=10,precomputed:r,height:n=220,width:a,color:l,tone:i,formatBound:s,formatCount:o,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=K().charts,p=U(),g=s??(e=>Number.isInteger(e)?Z(e,p):G(e,1,p)),f=o??(e=>Z(e,p)),b=c??m.countAxis,x=d??m.distribution,y=r??qs(e??[],t),v=Ts(0,l,i),w=y.map(e=>g(e.from)),k=y.map(e=>e.count);/* @__PURE__ */
865
- return ve($o,{labels:w,values:k,height:n,width:a,bandPadding:0,xTickAnchor:"start",formatValue:f,yAxisLabel:b,className:u,emptyLabel:h,ariaLabel:m.histogram(x,y.length,(e??[]).length),tooltip:e=>/* @__PURE__ */ve(wo,{title:`${g(y[e].from)} – ${g(y[e].to)}`,rows:[{key:"count",label:m.observations,color:v,value:f(y[e].count)}]}),children:({x:e,y:t,bottom:r,active:n})=>/* @__PURE__ */ve("g",{children:y.map((a,l)=>/* @__PURE__ */ve("rect",{x:e(l)+.5,y:t(a.count),width:Math.max(1,e.bandwidth-1),height:Math.max(0,r-t(a.count)),fill:v,fillOpacity:null===n||n===l?.85:.42},l))})})}function Io({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:s,className:o,emptyLabel:c}){const d=K().charts,u=U(),h=l??(e=>Z(e,u)),m=s??d.distribution,p=Ts(0,n,a),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
866
- return ve($o,{labels:e.map(e=>e.label),values:g,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:o,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
867
- return ve(wo,{title:r.label,rows:[{key:"max",label:d.maximum,color:p,value:h(r.max)},{key:"q3",label:d.q3,color:p,value:h(r.q3)},{key:"median",label:d.median,color:p,value:h(r.median)},{key:"q1",label:d.q1,color:p,value:h(r.q1)},{key:"min",label:d.minimum,color:p,value:h(r.min)}],emphasisKey:"median",footnote:r.outliers?.length?d.outliers(r.outliers.length):void 0})},children:({x:t,y:r,active:n})=>/* @__PURE__ */ve("g",{children:e.map((e,a)=>{const l=t.center(a),i=Math.max(6,t.bandwidth);/* @__PURE__ */
866
+ /* @__PURE__ */ve("path",{d:no(to(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
867
+ /* @__PURE__ */ve("path",{d:to(r,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
868
+ /* @__PURE__ */ve("path",{d:to(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */ve("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:Is.axis,strokeWidth:1})]})})}function Ro({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:s=3,connectors:o=!0}){const c=K().charts,d=U(),u=n??(e=>Z(e,d));let h=0;const m=e.map(e=>{if(e.total){const t={from:0,to:h,value:h,total:!0};return{...e,...t}}const t=h;return h+=e.value,{...e,from:t,to:h,value:e.value,total:!1}}),p=m.flatMap(e=>[e.from,e.to]);/* @__PURE__ */
869
+ return ve(jo,{labels:e.map(e=>e.label),values:p,height:t,width:r,formatValue:u,yAxisLabel:a,className:l,emptyLabel:i,bandPadding:.36,ariaLabel:c.waterfall(e.length,u(m[0]?.from??0),u(h)),tooltip:e=>{const t=m[e],r=t?.total?Ts.neutral:t.value>=0?Ts.good:Ts.critical;/* @__PURE__ */
870
+ return ve($o,{title:t?.label,rows:[{key:"step",color:r,label:t?.total?c.balance:t.value>=0?c.increase:c.decrease,value:t?.total?u(t.to):`${t.value>=0?"+":"−"}${u(Math.abs(t.value))}`},...t?.total?[]:[{key:"running",label:c.runningTotal,color:Ts.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */we("g",{children:[o&&m.slice(0,-1).map((r,n)=>
871
+ /* @__PURE__ */ve("line",{x1:e.end(n),y1:t(r.to),x2:e(n+1),y2:t(r.to),stroke:Is.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${n}`)),m.map((n,a)=>{const l=n.total?Ts.neutral:n.value>=0?Ts.good:Ts.critical,i=Math.min(t(n.from),t(n.to)),o=Math.max(1,Math.abs(t(n.to)-t(n.from)));/* @__PURE__ */
872
+ return ve("rect",{x:e(a),y:i,width:Math.max(1,e.bandwidth),height:o,rx:s,fill:l,fillOpacity:null===r||r===a?1:.45},a)})]})})}function Wo({values:e,bins:t=10,precomputed:r,height:n=220,width:a,color:l,tone:i,formatBound:s,formatCount:o,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=K().charts,p=U(),g=s??(e=>Number.isInteger(e)?Z(e,p):G(e,1,p)),f=o??(e=>Z(e,p)),b=c??m.countAxis,x=d??m.distribution,y=r??Ys(e??[],t),v=Rs(0,l,i),w=y.map(e=>g(e.from)),k=y.map(e=>e.count);/* @__PURE__ */
873
+ return ve(jo,{labels:w,values:k,height:n,width:a,bandPadding:0,xTickAnchor:"start",formatValue:f,yAxisLabel:b,className:u,emptyLabel:h,ariaLabel:m.histogram(x,y.length,(e??[]).length),tooltip:e=>/* @__PURE__ */ve($o,{title:`${g(y[e].from)} – ${g(y[e].to)}`,rows:[{key:"count",label:m.observations,color:v,value:f(y[e].count)}]}),children:({x:e,y:t,bottom:r,active:n})=>/* @__PURE__ */ve("g",{children:y.map((a,l)=>/* @__PURE__ */ve("rect",{x:e(l)+.5,y:t(a.count),width:Math.max(1,e.bandwidth-1),height:Math.max(0,r-t(a.count)),fill:v,fillOpacity:null===n||n===l?.85:.42},l))})})}function Ho({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:s,className:o,emptyLabel:c}){const d=K().charts,u=U(),h=l??(e=>Z(e,u)),m=s??d.distribution,p=Rs(0,n,a),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
874
+ return ve(jo,{labels:e.map(e=>e.label),values:g,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:o,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
875
+ return ve($o,{title:r.label,rows:[{key:"max",label:d.maximum,color:p,value:h(r.max)},{key:"q3",label:d.q3,color:p,value:h(r.q3)},{key:"median",label:d.median,color:p,value:h(r.median)},{key:"q1",label:d.q1,color:p,value:h(r.q1)},{key:"min",label:d.minimum,color:p,value:h(r.min)}],emphasisKey:"median",footnote:r.outliers?.length?d.outliers(r.outliers.length):void 0})},children:({x:t,y:r,active:n})=>/* @__PURE__ */ve("g",{children:e.map((e,a)=>{const l=t.center(a),i=Math.max(6,t.bandwidth);/* @__PURE__ */
868
876
  return we("g",{opacity:null!==n&&n!==a?.45:1,children:[
869
877
  /* @__PURE__ */ve("line",{x1:l,y1:r(e.max),x2:l,y2:r(e.q3),stroke:p,strokeWidth:1.5}),
870
878
  /* @__PURE__ */ve("line",{x1:l,y1:r(e.q1),x2:l,y2:r(e.min),stroke:p,strokeWidth:1.5}),
871
879
  /* @__PURE__ */ve("line",{x1:l-i/4,y1:r(e.max),x2:l+i/4,y2:r(e.max),stroke:p,strokeWidth:1.5}),
872
880
  /* @__PURE__ */ve("line",{x1:l-i/4,y1:r(e.min),x2:l+i/4,y2:r(e.min),stroke:p,strokeWidth:1.5}),
873
881
  /* @__PURE__ */ve("rect",{x:l-i/2,y:r(e.q3),width:i,height:Math.max(1,r(e.q1)-r(e.q3)),rx:2,fill:p,fillOpacity:.22,stroke:p,strokeWidth:1.5}),
874
- /* @__PURE__ */ve("line",{x1:l-i/2,y1:r(e.median),x2:l+i/2,y2:r(e.median),stroke:p,strokeWidth:3}),(e.outliers??[]).map((e,t)=>/* @__PURE__ */ve("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:Bs.surface,strokeWidth:1.5},t))]},a)})})})}function Oo({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:s,emptyLabel:o}){const c=K().charts,d=U(),u=a??(e=>Number.isInteger(e)?Z(e,d):G(e,2,d)),h=i??c.price,m=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),p=Math.min(...m),g=Math.max(...m),f=.08*(g-p)||1;/* @__PURE__ */
875
- return ve($o,{labels:e.map(e=>e.label),values:m,height:r,width:n,min:p-f,max:g+f,bandPadding:.42,formatValue:u,yAxisLabel:l,className:s,emptyLabel:o,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],n=r.close>=r.open,a=n?Ss.good:Ss.critical;/* @__PURE__ */
876
- return ve(wo,{title:r.label,rows:[{key:"open",label:c.open,color:a,value:u(r.open)},{key:"high",label:c.high,color:a,value:u(r.high)},{key:"low",label:c.low,color:a,value:u(r.low)},{key:"close",label:c.close,color:a,value:u(r.close)}],emphasisKey:"close",footnote:n?c.closedAbove:c.closedBelow})},children:({x:r,y:n,active:a})=>/* @__PURE__ */ve("g",{children:e.map((e,l)=>{const i=e.close>=e.open,s=i?Ss.good:Ss.critical,o=r.center(l),c=Math.max(3,r.bandwidth),d=null!==a&&a!==l,u=n(Math.max(e.open,e.close)),h=Math.max(1,Math.abs(n(e.close)-n(e.open)));/* @__PURE__ */
882
+ /* @__PURE__ */ve("line",{x1:l-i/2,y1:r(e.median),x2:l+i/2,y2:r(e.median),stroke:p,strokeWidth:3}),(e.outliers??[]).map((e,t)=>/* @__PURE__ */ve("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:Is.surface,strokeWidth:1.5},t))]},a)})})})}function _o({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:s,emptyLabel:o}){const c=K().charts,d=U(),u=a??(e=>Number.isInteger(e)?Z(e,d):G(e,2,d)),h=i??c.price,m=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),p=Math.min(...m),g=Math.max(...m),f=.08*(g-p)||1;/* @__PURE__ */
883
+ return ve(jo,{labels:e.map(e=>e.label),values:m,height:r,width:n,min:p-f,max:g+f,bandPadding:.42,formatValue:u,yAxisLabel:l,className:s,emptyLabel:o,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],n=r.close>=r.open,a=n?Ts.good:Ts.critical;/* @__PURE__ */
884
+ return ve($o,{title:r.label,rows:[{key:"open",label:c.open,color:a,value:u(r.open)},{key:"high",label:c.high,color:a,value:u(r.high)},{key:"low",label:c.low,color:a,value:u(r.low)},{key:"close",label:c.close,color:a,value:u(r.close)}],emphasisKey:"close",footnote:n?c.closedAbove:c.closedBelow})},children:({x:r,y:n,active:a})=>/* @__PURE__ */ve("g",{children:e.map((e,l)=>{const i=e.close>=e.open,s=i?Ts.good:Ts.critical,o=r.center(l),c=Math.max(3,r.bandwidth),d=null!==a&&a!==l,u=n(Math.max(e.open,e.close)),h=Math.max(1,Math.abs(n(e.close)-n(e.open)));/* @__PURE__ */
877
885
  return we("g",{opacity:d?.45:1,children:[
878
886
  /* @__PURE__ */ve("line",{x1:o,y1:n(e.high),x2:o,y2:n(e.low),stroke:s,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */ve("rect",{x:o-c/2,y:u,width:c,height:h,rx:1,fill:i?s:"transparent",fillOpacity:i?.85:1,stroke:s,strokeWidth:1.5}):/* @__PURE__ */we(ke,{children:[
879
887
  /* @__PURE__ */ve("line",{x1:o-c/2,y1:n(e.open),x2:o,y2:n(e.open),stroke:s,strokeWidth:2}),
880
- /* @__PURE__ */ve("line",{x1:o,y1:n(e.close),x2:o+c/2,y2:n(e.close),stroke:s,strokeWidth:2})]})]},l)})})})}function Ro({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:s,label:o,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=K().charts,p=U(),g=s??(e=>Z(e,p)),f=o??m.intensity,b=d??m.noActivity,x=se(null),y=uo(x),v=a??y,w=oe(),[k,N]=ie(null);if(ce(()=>{if(null!==k)return W(e=>"Escape"===e.key&&(N(null),!0))},[k]),0===e.length||0===t.length)/* @__PURE__ */
881
- return ve("div",{className:c,ref:x,children:/* @__PURE__ */ve("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const M=l??Ts(0),$=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=n??L+26+26,P=Math.max(2,(Math.max(97,v)-C)/t.length),j=e=>{const t=$>0?Math.max(0,Math.min(1,e/$)):0;return`color-mix(in oklab, ${M} ${(8+92*t).toFixed(1)}%, ${Bs.surface})`};/* @__PURE__ */
888
+ /* @__PURE__ */ve("line",{x1:o,y1:n(e.close),x2:o+c/2,y2:n(e.close),stroke:s,strokeWidth:2})]})]},l)})})})}function qo({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:s,label:o,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=K().charts,p=U(),g=s??(e=>Z(e,p)),f=o??m.intensity,b=d??m.noActivity,x=se(null),y=go(x),v=a??y,w=oe(),[k,N]=ie(null);if(de(()=>{if(null!==k)return W(e=>"Escape"===e.key&&(N(null),!0))},[k]),0===e.length||0===t.length)/* @__PURE__ */
889
+ return ve("div",{className:c,ref:x,children:/* @__PURE__ */ve("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const M=l??Rs(0),$=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=n??L+26+26,j=Math.max(2,(Math.max(97,v)-C)/t.length),P=e=>{const t=$>0?Math.max(0,Math.min(1,e/$)):0;return`color-mix(in oklab, ${M} ${(8+92*t).toFixed(1)}%, ${Is.surface})`};/* @__PURE__ */
882
890
  return we("div",{className:`relative ${c??""}`,ref:x,children:[
883
891
  /* @__PURE__ */we("svg",{width:"100%",height:D,viewBox:`0 0 ${v} ${D}`,role:"img","aria-label":m.heatmap(f,e.length,t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>N(null),onBlur:()=>N(null),onKeyDown:r=>{const n="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,a="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===n&&0===a||(r.preventDefault(),N(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+n)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+a))})))},children:[
884
892
  /* @__PURE__ */ve("defs",{children:/* @__PURE__ */we("linearGradient",{id:w,x1:"0",x2:"1",children:[
885
- /* @__PURE__ */ve("stop",{offset:"0",stopColor:j(0)}),
886
- /* @__PURE__ */ve("stop",{offset:"1",stopColor:j($)})]})}),e.map((e,t)=>/* @__PURE__ */ve("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:Bs.label,children:e},`r${t}`)),e.map((e,n)=>t.map((t,a)=>{const l=r[n]?.[a]??0,i=k&&(k.r!==n||k.c!==a);/* @__PURE__ */
887
- return ve("rect",{x:C+a*P+u/2,y:26*n+u/2,width:Math.max(1,P-u),height:26-u,rx:h,fill:j(l),opacity:i?.55:1,onMouseEnter:()=>N({r:n,c:a}),children:/* @__PURE__ */ve("title",{children:`${e} · ${t}: ${g(l)}`})},`${n}-${a}`)})),t.map((e,r)=>r%Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor((v-C)/56))))===0?/* @__PURE__ */ve("text",{x:C+r*P+P/2,y:L+15,textAnchor:"middle",fontSize:11,fill:Bs.label,children:e},`c${r}`):null),
893
+ /* @__PURE__ */ve("stop",{offset:"0",stopColor:P(0)}),
894
+ /* @__PURE__ */ve("stop",{offset:"1",stopColor:P($)})]})}),e.map((e,t)=>/* @__PURE__ */ve("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:Is.label,children:e},`r${t}`)),e.map((e,n)=>t.map((t,a)=>{const l=r[n]?.[a]??0,i=k&&(k.r!==n||k.c!==a);/* @__PURE__ */
895
+ return ve("rect",{x:C+a*j+u/2,y:26*n+u/2,width:Math.max(1,j-u),height:26-u,rx:h,fill:P(l),opacity:i?.55:1,onMouseEnter:()=>N({r:n,c:a}),children:/* @__PURE__ */ve("title",{children:`${e} · ${t}: ${g(l)}`})},`${n}-${a}`)})),t.map((e,r)=>r%Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor((v-C)/56))))===0?/* @__PURE__ */ve("text",{x:C+r*j+j/2,y:L+15,textAnchor:"middle",fontSize:11,fill:Is.label,children:e},`c${r}`):null),
888
896
  /* @__PURE__ */ve("rect",{x:C,y:L+26,width:Math.min(180,Math.max(40,v-C)),height:8,rx:4,fill:`url(#${w})`}),
889
- /* @__PURE__ */ve("text",{x:C,y:L+48,fontSize:10.5,fill:Bs.label,children:"0"}),
890
- /* @__PURE__ */ve("text",{x:C+Math.min(180,Math.max(40,v-C)),y:L+48,textAnchor:"end",fontSize:10.5,fill:Bs.label,style:{fontVariantNumeric:"tabular-nums"},children:g($)})]}),k&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */ve(wo,{title:`${e[k.r]} · ${t[k.c]}`,rows:[{key:"v",label:f,color:M,value:null==r[k.r]?.[k.c]?void 0:g(r[k.r][k.c])}]})})]})}function Wo({caption:e,head:t,rows:r}){/* @__PURE__ */
897
+ /* @__PURE__ */ve("text",{x:C,y:L+48,fontSize:10.5,fill:Is.label,children:"0"}),
898
+ /* @__PURE__ */ve("text",{x:C+Math.min(180,Math.max(40,v-C)),y:L+48,textAnchor:"end",fontSize:10.5,fill:Is.label,style:{fontVariantNumeric:"tabular-nums"},children:g($)})]}),k&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */ve($o,{title:`${e[k.r]} · ${t[k.c]}`,rows:[{key:"v",label:f,color:M,value:null==r[k.r]?.[k.c]?void 0:g(r[k.r][k.c])}]})})]})}function Uo({caption:e,head:t,rows:r}){/* @__PURE__ */
891
899
  return we("table",{className:"sr-only",children:[
892
900
  /* @__PURE__ */ve("caption",{children:e}),
893
901
  /* @__PURE__ */ve("thead",{children:/* @__PURE__ */ve("tr",{children:t.map(e=>/* @__PURE__ */ve("th",{scope:"col",children:e},e))})}),
894
- /* @__PURE__ */ve("tbody",{children:r.map((e,t)=>/* @__PURE__ */ve("tr",{children:e.map((e,t)=>/* @__PURE__ */ve("td",{children:e},t))},t))})]})}var Ho=3,_o=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function qo({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:s=!0,className:o,emptyLabel:c}){const d=K().charts,u=U(),h=i??(e=>Z(e,u)),m=c??d.nothingToCompare,p=oe(),[g,f]=ie(null),{highlighted:b}=so(),x=t.slice(0,3);if(e.length<3||0===x.length)/* @__PURE__ */
895
- return ve("p",{className:`text-sm text-gray-500 ${o??""}`,children:m});const y=r/2,v=r/2,w=r/2-46,k=Hs(e.length),N=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...x.map(e=>e.values[t]??0).filter(Number.isFinite))),M=(e,t)=>{const r=Math.max(0,Math.min(1,t/N[e])),n=k.center(e)-k.step/2;return[y+w*r*Math.cos(n),v+w*r*Math.sin(n)]},$=(e,t)=>null!==g?g!==e:null!==b&&b!==t,C=null!==g?x[g]:void 0;/* @__PURE__ */
902
+ /* @__PURE__ */ve("tbody",{children:r.map((e,t)=>/* @__PURE__ */ve("tr",{children:e.map((e,t)=>/* @__PURE__ */ve("td",{children:e},t))},t))})]})}var Ko=3,Vo=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function Yo({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:s=!0,className:o,emptyLabel:c}){const d=K().charts,u=U(),h=i??(e=>Z(e,u)),m=c??d.nothingToCompare,p=oe(),[g,f]=ie(null),{highlighted:b}=ho(),x=t.slice(0,3);if(e.length<3||0===x.length)/* @__PURE__ */
903
+ return ve("p",{className:`text-sm text-gray-500 ${o??""}`,children:m});const y=r/2,v=r/2,w=r/2-46,k=Ks(e.length),N=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...x.map(e=>e.values[t]??0).filter(Number.isFinite))),M=(e,t)=>{const r=Math.max(0,Math.min(1,t/N[e])),n=k.center(e)-k.step/2;return[y+w*r*Math.cos(n),v+w*r*Math.sin(n)]},$=(e,t)=>null!==g?g!==e:null!==b&&b!==t,C=null!==g?x[g]:void 0;/* @__PURE__ */
896
904
  return we("div",{className:`relative ${o??""}`,children:[
897
905
  /* @__PURE__ */we("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
898
- /* @__PURE__ */ve("title",{id:p,children:d.acrossMeasures(x.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const n=w*(r+1)/l;return"circle"===a?/* @__PURE__ */ve("circle",{cx:y,cy:v,r:n,fill:"none",stroke:Bs.grid,strokeWidth:1},r):/* @__PURE__ */ve("path",{d:_o(eo(y,v,n,e.length)),fill:"none",stroke:Bs.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,n]=M(t,N[t]);/* @__PURE__ */
906
+ /* @__PURE__ */ve("title",{id:p,children:d.acrossMeasures(x.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const n=w*(r+1)/l;return"circle"===a?/* @__PURE__ */ve("circle",{cx:y,cy:v,r:n,fill:"none",stroke:Is.grid,strokeWidth:1},r):/* @__PURE__ */ve("path",{d:Vo(ao(y,v,n,e.length)),fill:"none",stroke:Is.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,n]=M(t,N[t]);/* @__PURE__ */
899
907
  return we("g",{children:[
900
- /* @__PURE__ */ve("line",{x1:y,y1:v,x2:r,y2:n,stroke:Bs.grid,strokeWidth:1}),
901
- /* @__PURE__ */ve("text",{x:y+(w+18)*Math.cos(k.center(t)-k.step/2),y:v+(w+18)*Math.sin(k.center(t)-k.step/2)+4,textAnchor:"middle",fontSize:11,fill:Bs.label,children:e.label})]},e.key)}),
902
- /* @__PURE__ */ve(Ba,{id:p,reveal:!!s&&"center-out"}),x.map((t,r)=>{const a=Ts(r,t.color,t.tone),l=e.map((e,r)=>M(r,t.values[r]??0));/* @__PURE__ */
903
- return we("g",{opacity:$(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:s?`url(#${Da(p)})`:void 0,children:["area"===n&&/* @__PURE__ */ve("path",{d:_o(l),fill:a,fillOpacity:.18,stroke:"none"}),
904
- /* @__PURE__ */ve("path",{d:_o(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */ve("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:Bs.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve(wo,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:Ts(g,C.color,C.tone),value:h(C.values[t]??0)}))})}),
908
+ /* @__PURE__ */ve("line",{x1:y,y1:v,x2:r,y2:n,stroke:Is.grid,strokeWidth:1}),
909
+ /* @__PURE__ */ve("text",{x:y+(w+18)*Math.cos(k.center(t)-k.step/2),y:v+(w+18)*Math.sin(k.center(t)-k.step/2)+4,textAnchor:"middle",fontSize:11,fill:Is.label,children:e.label})]},e.key)}),
910
+ /* @__PURE__ */ve(Ia,{id:p,reveal:!!s&&"center-out"}),x.map((t,r)=>{const a=Rs(r,t.color,t.tone),l=e.map((e,r)=>M(r,t.values[r]??0));/* @__PURE__ */
911
+ return we("g",{opacity:$(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:s?`url(#${za(p)})`:void 0,children:["area"===n&&/* @__PURE__ */ve("path",{d:Vo(l),fill:a,fillOpacity:.18,stroke:"none"}),
912
+ /* @__PURE__ */ve("path",{d:Vo(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */ve("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:Is.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve($o,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:Rs(g,C.color,C.tone),value:h(C.values[t]??0)}))})}),
905
913
  /* @__PURE__ */ve("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:x.map((e,t)=>/* @__PURE__ */we("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
906
- /* @__PURE__ */ve("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Ts(t,e.color,e.tone)}}),
914
+ /* @__PURE__ */ve("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Rs(t,e.color,e.tone)}}),
907
915
  /* @__PURE__ */ve("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
908
- /* @__PURE__ */ve(Wo,{caption:d.acrossMeasures(x.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:x.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}function Uo({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:s,centerLabel:o,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=K().charts,g=U(),f=s??(e=>Z(e,g)),b=i??p.other,x=m??p.nothingToBreakDown,y=oe(),[v,w]=ie(null),{highlighted:k}=so(),N=e.filter(e=>e.value>0);if(0===N.length)/* @__PURE__ */return ve("p",{className:`text-sm text-gray-500 ${h??""}`,children:x});const M=[...N].sort((e,t)=>t.value-e.value),$=M.slice(0,l),C=M.slice(l),L=C.length>0?[...$,{key:"__other__",label:b,value:C.reduce((e,t)=>e+t.value,0)}]:$,D=L.reduce((e,t)=>e+t.value,0),P=r/2,j=r/2,z=r/2-12,A=n??("ring"===t?.58*z:0),S=Hs(L.length,a),B=Math.max(...L.map(e=>e.value)),F=e=>A+(z-A)*Math.sqrt(Math.max(0,e)/B);let T=-Math.PI/2;const E=(()=>{if("outside"!==d)return[];let e=-Math.PI/2;const r=L.map((r,n)=>{const l="rose"===t?Hs(L.length,a).step:r.value/D*Math.PI*2,i="rose"===t?Hs(L.length,a).center(n):e+l/2;e+=l;const s="rose"===t?F(r.value):z;return{key:r.key,label:r.label,share:r.value/D,right:Math.cos(i)>=0,anchor:[P+s*Math.cos(i),j+s*Math.sin(i)],y:j+(s+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u);for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<15&&(t[e].y=t[e-1].y+15)}return r})(),I=(e,t)=>null!==v?v!==e:null!==k&&k!==t,O=null!==v?L[v]:void 0;/* @__PURE__ */
916
+ /* @__PURE__ */ve(Uo,{caption:d.acrossMeasures(x.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:x.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}function Zo({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:s,centerLabel:o,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=K().charts,g=U(),f=s??(e=>Z(e,g)),b=i??p.other,x=m??p.nothingToBreakDown,y=oe(),[v,w]=ie(null),{highlighted:k}=ho(),N=e.filter(e=>e.value>0);if(0===N.length)/* @__PURE__ */return ve("p",{className:`text-sm text-gray-500 ${h??""}`,children:x});const M=[...N].sort((e,t)=>t.value-e.value),$=M.slice(0,l),C=M.slice(l),L=C.length>0?[...$,{key:"__other__",label:b,value:C.reduce((e,t)=>e+t.value,0)}]:$,D=L.reduce((e,t)=>e+t.value,0),j=r/2,P=r/2,S=r/2-12,z=n??("ring"===t?.58*S:0),A=Ks(L.length,a),B=Math.max(...L.map(e=>e.value)),F=e=>z+(S-z)*Math.sqrt(Math.max(0,e)/B);let E=-Math.PI/2;const T=(()=>{if("outside"!==d)return[];let e=-Math.PI/2;const r=L.map((r,n)=>{const l="rose"===t?Ks(L.length,a).step:r.value/D*Math.PI*2,i="rose"===t?Ks(L.length,a).center(n):e+l/2;e+=l;const s="rose"===t?F(r.value):S;return{key:r.key,label:r.label,share:r.value/D,right:Math.cos(i)>=0,anchor:[j+s*Math.cos(i),P+s*Math.sin(i)],y:P+(s+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u);for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<15&&(t[e].y=t[e-1].y+15)}return r})(),I=(e,t)=>null!==v?v!==e:null!==k&&k!==t,O=null!==v?L[v]:void 0;/* @__PURE__ */
909
917
  return we("div",{className:`relative ${h??""}`,children:[
910
918
  /* @__PURE__ */we("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":y,onMouseLeave:()=>w(null),children:[
911
- /* @__PURE__ */ve("title",{id:y,children:p.breakdown(f(D),L.length)}),L.map((e,r)=>{const n=Ts(r,e.color,e.tone),l="rose"===t?S(r):T,i="rose"===t?S.step:e.value/D*Math.PI*2-a;"rose"!==t&&(T+=e.value/D*Math.PI*2);const s=l+Math.max(.001,i),o="rose"===t?F(e.value):z;/* @__PURE__ */
912
- return ve("path",{d:to(P,j,A,o,l,s),fill:n,fillOpacity:I(r,e.key)?.4:1,stroke:Bs.surface,strokeWidth:1,className:c?Ta.sweep:void 0,style:c?Ea(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),E.map(e=>{const t=e.right?r-6:6,n=e.right?r-58:58;/* @__PURE__ */
919
+ /* @__PURE__ */ve("title",{id:y,children:p.breakdown(f(D),L.length)}),L.map((e,r)=>{const n=Rs(r,e.color,e.tone),l="rose"===t?A(r):E,i="rose"===t?A.step:e.value/D*Math.PI*2-a;"rose"!==t&&(E+=e.value/D*Math.PI*2);const s=l+Math.max(.001,i),o="rose"===t?F(e.value):S;/* @__PURE__ */
920
+ return ve("path",{d:lo(j,P,z,o,l,s),fill:n,fillOpacity:I(r,e.key)?.4:1,stroke:Is.surface,strokeWidth:1,className:c?Ra.sweep:void 0,style:c?Wa(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),T.map(e=>{const t=e.right?r-6:6,n=e.right?r-58:58;/* @__PURE__ */
913
921
  return we("g",{children:[
914
- /* @__PURE__ */ve("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${n},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:Bs.grid,strokeWidth:1}),
915
- /* @__PURE__ */ve("text",{x:t,y:e.y-2,fontSize:10.5,fill:Bs.label,textAnchor:e.right?"end":"start",children:e.label}),
916
- /* @__PURE__ */ve("text",{x:t,y:e.y+10,fontSize:10.5,fontWeight:600,fill:Bs.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:J(100*e.share,1,g)})]},`lbl-${e.key}`)}),o&&A>0&&/* @__PURE__ */ve("text",{x:P,y:j+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:Bs.label,children:o})]}),O&&null!==v&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve(wo,{title:O.label,rows:[{key:"value",label:p.value,color:Ts(v,O.color,O.tone),value:f(O.value)},{key:"share",label:p.share,color:Bs.muted,value:J(O.value/D*100,1,g)}]})}),
922
+ /* @__PURE__ */ve("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${n},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:Is.grid,strokeWidth:1}),
923
+ /* @__PURE__ */ve("text",{x:t,y:e.y-2,fontSize:10.5,fill:Is.label,textAnchor:e.right?"end":"start",children:e.label}),
924
+ /* @__PURE__ */ve("text",{x:t,y:e.y+10,fontSize:10.5,fontWeight:600,fill:Is.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:J(100*e.share,1,g)})]},`lbl-${e.key}`)}),o&&z>0&&/* @__PURE__ */ve("text",{x:j,y:P+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:Is.label,children:o})]}),O&&null!==v&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve($o,{title:O.label,rows:[{key:"value",label:p.value,color:Rs(v,O.color,O.tone),value:f(O.value)},{key:"share",label:p.share,color:Is.muted,value:J(O.value/D*100,1,g)}]})}),
917
925
  /* @__PURE__ */ve("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:L.map((e,t)=>/* @__PURE__ */we("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
918
- /* @__PURE__ */ve("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Ts(t,e.color,e.tone)}}),
926
+ /* @__PURE__ */ve("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Rs(t,e.color,e.tone)}}),
919
927
  /* @__PURE__ */ve("span",{className:"flex-1 truncate",children:e.label}),
920
- /* @__PURE__ */ve("span",{className:"tabular-nums text-gray-800",children:J(e.value/D*100,1,g)})]},e.key))})]})}var Ko=300*Math.PI/180;function Vo({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:s,trackGap:o=6}){const c=K().charts,d=U(),u=a??(e=>Z(e,d)),h=s??c.nothingToPlot,m=oe(),[p,g]=ie(null),{highlighted:f}=so();if(0===e.length)/* @__PURE__ */return ve("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const b=r/2,x=r/2,y=r/2-10,v=n??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(y-.16*r)/e.length):0,k=Math.max(1,Math.floor((y-.16*r)/w||1)),N="track"===t?e.slice(0,k):e,M=Math.min(o,Math.max(1,w-2)),$=Hs(N.length,.03),C=null!==p?N[p]:void 0;/* @__PURE__ */
928
+ /* @__PURE__ */ve("span",{className:"tabular-nums text-gray-800",children:J(e.value/D*100,1,g)})]},e.key))})]})}var Go=300*Math.PI/180;function Jo({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:s,trackGap:o=6}){const c=K().charts,d=U(),u=a??(e=>Z(e,d)),h=s??c.nothingToPlot,m=oe(),[p,g]=ie(null),{highlighted:f}=ho();if(0===e.length)/* @__PURE__ */return ve("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const b=r/2,x=r/2,y=r/2-10,v=n??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(y-.16*r)/e.length):0,k=Math.max(1,Math.floor((y-.16*r)/w||1)),N="track"===t?e.slice(0,k):e,M=Math.min(o,Math.max(1,w-2)),$=Ks(N.length,.03),C=null!==p?N[p]:void 0;/* @__PURE__ */
921
929
  return we("div",{className:`relative ${i??""}`,children:[
922
930
  /* @__PURE__ */we("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
923
- /* @__PURE__ */ve("title",{id:m,children:"track"===t?c.radialTrack(N.length):c.radialCycle(N.length)}),N.map((e,n)=>{const a=Ts(n,e.color,e.tone),i=Math.max(0,Math.min(1,e.value/v)),s=((e,t)=>null!==p?p!==e:null!==f&&f!==t)(n,e.key);if("track"===t){const t=y-n*w,r=t-w+M,o=-Math.PI/2;/* @__PURE__ */
924
- return we("g",{opacity:s?.4:1,onMouseEnter:()=>g(n),className:l?Ta.sweep:void 0,style:l?Ea(n,70):void 0,children:[
925
- /* @__PURE__ */ve("path",{d:to(b,x,r,t,o,o+Ko),fill:Bs.grid}),
926
- /* @__PURE__ */ve("path",{d:to(b,x,r,t,o,o+Ko*i),fill:a})]},e.key)}const o=.14*r;/* @__PURE__ */
927
- return ve("g",{opacity:s?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */ve("path",{d:to(b,x,o,o+(y-o)*i,$(n),$(n)+$.step),fill:a})},e.key)})]}),C&&null!==p&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve(wo,{title:C.label,rows:[{key:"value",label:c.value,color:Ts(p,C.color,C.tone),value:u(C.value)}]})}),
931
+ /* @__PURE__ */ve("title",{id:m,children:"track"===t?c.radialTrack(N.length):c.radialCycle(N.length)}),N.map((e,n)=>{const a=Rs(n,e.color,e.tone),i=Math.max(0,Math.min(1,e.value/v)),s=((e,t)=>null!==p?p!==e:null!==f&&f!==t)(n,e.key);if("track"===t){const t=y-n*w,r=t-w+M,o=-Math.PI/2;/* @__PURE__ */
932
+ return we("g",{opacity:s?.4:1,onMouseEnter:()=>g(n),className:l?Ra.sweep:void 0,style:l?Wa(n,70):void 0,children:[
933
+ /* @__PURE__ */ve("path",{d:lo(b,x,r,t,o,o+Go),fill:Is.grid}),
934
+ /* @__PURE__ */ve("path",{d:lo(b,x,r,t,o,o+Go*i),fill:a})]},e.key)}const o=.14*r;/* @__PURE__ */
935
+ return ve("g",{opacity:s?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */ve("path",{d:lo(b,x,o,o+(y-o)*i,$(n),$(n)+$.step),fill:a})},e.key)})]}),C&&null!==p&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve($o,{title:C.label,rows:[{key:"value",label:c.value,color:Rs(p,C.color,C.tone),value:u(C.value)}]})}),
928
936
  /* @__PURE__ */ve("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:e.map((e,t)=>/* @__PURE__ */we("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
929
- /* @__PURE__ */ve("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Ts(t,e.color,e.tone)}}),
937
+ /* @__PURE__ */ve("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Rs(t,e.color,e.tone)}}),
930
938
  /* @__PURE__ */ve("span",{className:"flex-1 truncate",children:e.label}),
931
- /* @__PURE__ */ve("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function Yo({stages:e,shape:t="funnel",height:r,width:n=560,gap:a=4,formatValue:l,color:i,className:s,emptyLabel:o}){const c=K().charts,d=U(),u=l??(e=>Z(e,d)),h=o??c.noStages,m=oe(),[p,g]=ie(null),{highlighted:f}=so();if(0===e.length)/* @__PURE__ */return ve("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const b=i??Ts(0),x=r??54*e.length,y=Math.max(...e.map(e=>e.value),1),v=168,w=n-v,k=e=>w*Math.max(0,e/y)/2,N=v+w/2,M=t=>46+t/Math.max(1,e.length-1)*54,$=e=>`color-mix(in oklab, ${b} ${M(e).toFixed(0)}%, ${Bs.surface})`,C=e=>M(e)>=55?Bs.surface:Bs.label,L=(e,t)=>null!==p?p!==e:null!==f&&f!==t,D=null!==p?e[p]:void 0;/* @__PURE__ */
939
+ /* @__PURE__ */ve("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function Xo({stages:e,shape:t="funnel",height:r,width:n=560,gap:a=4,formatValue:l,color:i,className:s,emptyLabel:o}){const c=K().charts,d=U(),u=l??(e=>Z(e,d)),h=o??c.noStages,m=oe(),[p,g]=ie(null),{highlighted:f}=ho();if(0===e.length)/* @__PURE__ */return ve("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const b=i??Rs(0),x=r??54*e.length,y=Math.max(...e.map(e=>e.value),1),v=168,w=n-v,k=e=>w*Math.max(0,e/y)/2,N=v+w/2,M=t=>46+t/Math.max(1,e.length-1)*54,$=e=>`color-mix(in oklab, ${b} ${M(e).toFixed(0)}%, ${Is.surface})`,C=e=>M(e)>=55?Is.surface:Is.label,L=(e,t)=>null!==p?p!==e:null!==f&&f!==t,D=null!==p?e[p]:void 0;/* @__PURE__ */
932
940
  return we("div",{className:`relative ${s??""}`,children:[
933
941
  /* @__PURE__ */we("svg",{width:"100%",height:x,viewBox:`0 0 ${n} ${x}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
934
942
  /* @__PURE__ */ve("title",{id:m,children:c.funnel(e.length,u(e[0].value),u(e[e.length-1].value))}),e.map((r,n)=>{const l=n*x/e.length+a/2,i=(n+1)*x/e.length-a/2,s=k(r.value),o="cone"===t?k(e[n+1]?.value??r.value):s,c=e[n-1]?.value,h=null!=c&&c>0?100*(1-r.value/c):null;/* @__PURE__ */
935
943
  return we("g",{opacity:L(n,r.key)?.45:1,onMouseEnter:()=>g(n),children:[
936
944
  /* @__PURE__ */ve("path",{d:`M${N-s},${l} L${N+s},${l} L${N+o},${i} L${N-o},${i} Z`,fill:$(n)}),
937
- /* @__PURE__ */ve("text",{x:154,y:(l+i)/2-2,textAnchor:"end",fontSize:12,fill:Bs.label,children:r.label}),
938
- /* @__PURE__ */we("text",{x:154,y:(l+i)/2+14,textAnchor:"end",fontSize:11,fill:Bs.muted,style:{fontVariantNumeric:"tabular-nums"},children:[u(r.value),null!=h?` · −${J(h,1,d)}`:""]}),
939
- /* @__PURE__ */ve("text",{x:N,y:(l+i)/2+4,textAnchor:"middle",fontSize:11.5,fontWeight:600,fill:C(n),style:{fontVariantNumeric:"tabular-nums"},children:J(r.value/(e[0].value||1)*100,0,d)})]},r.key)})]}),D&&null!==p&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve(wo,{title:D.label,rows:[{key:"value",label:c.count,color:$(p),value:u(D.value)},{key:"share",label:c.ofFirstStage,color:Bs.muted,value:J(D.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:Ss.critical,value:`−${J(100*(1-D.value/e[p-1].value),1,d)}`}]:[]]})})]})}function Zo({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:s,emptyLabel:o}){const c=K().charts,d=U(),u=l??(e=>Z(e,d)),h=o??c.nothingToBreakDown,m=se(null),p=uo(m),g=r??p,[f,b]=ie(null),{highlighted:x}=so(),y=ao(e,g,t);if(0===y.length)/* @__PURE__ */
940
- return ve("div",{className:s,ref:m,children:/* @__PURE__ */ve("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??Ts(0),w=Math.max(...y.map(e=>e.value),1),k=e=>34+e/w*62,N=e=>`color-mix(in oklab, ${v} ${k(e).toFixed(0)}%, ${Bs.surface})`,M=e=>k(e)>=55?Bs.surface:Bs.label,$=f??x,C=f?y.find(e=>e.key===f):void 0;/* @__PURE__ */
945
+ /* @__PURE__ */ve("text",{x:154,y:(l+i)/2-2,textAnchor:"end",fontSize:12,fill:Is.label,children:r.label}),
946
+ /* @__PURE__ */we("text",{x:154,y:(l+i)/2+14,textAnchor:"end",fontSize:11,fill:Is.muted,style:{fontVariantNumeric:"tabular-nums"},children:[u(r.value),null!=h?` · −${J(h,1,d)}`:""]}),
947
+ /* @__PURE__ */ve("text",{x:N,y:(l+i)/2+4,textAnchor:"middle",fontSize:11.5,fontWeight:600,fill:C(n),style:{fontVariantNumeric:"tabular-nums"},children:J(r.value/(e[0].value||1)*100,0,d)})]},r.key)})]}),D&&null!==p&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve($o,{title:D.label,rows:[{key:"value",label:c.count,color:$(p),value:u(D.value)},{key:"share",label:c.ofFirstStage,color:Is.muted,value:J(D.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:Ts.critical,value:`−${J(100*(1-D.value/e[p-1].value),1,d)}`}]:[]]})})]})}function Qo({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:s,emptyLabel:o}){const c=K().charts,d=U(),u=l??(e=>Z(e,d)),h=o??c.nothingToBreakDown,m=se(null),p=go(m),g=r??p,[f,b]=ie(null),{highlighted:x}=ho(),y=oo(e,g,t);if(0===y.length)/* @__PURE__ */
948
+ return ve("div",{className:s,ref:m,children:/* @__PURE__ */ve("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??Rs(0),w=Math.max(...y.map(e=>e.value),1),k=e=>34+e/w*62,N=e=>`color-mix(in oklab, ${v} ${k(e).toFixed(0)}%, ${Is.surface})`,M=e=>k(e)>=55?Is.surface:Is.label,$=f??x,C=f?y.find(e=>e.key===f):void 0;/* @__PURE__ */
941
949
  return we("div",{className:`relative ${s??""}`,ref:m,children:[
942
950
  /* @__PURE__ */ve("svg",{width:"100%",height:t,viewBox:`0 0 ${g} ${t}`,role:"img","aria-label":c.treemap(e.length),onMouseLeave:()=>b(null),children:y.map(e=>{const t=Math.max(0,e.width-n),r=Math.max(0,e.height-n),l=t>6.2*e.label.length+12&&r>30,i=l&&r>44;/* @__PURE__ */
943
951
  return we("g",{opacity:$&&$!==e.key?.55:1,onMouseEnter:()=>b(e.key),children:[
944
- /* @__PURE__ */ve("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:N(e.value)}),l&&/* @__PURE__ */ve("text",{x:e.x+n/2+8,y:e.y+n/2+18,fontSize:11.5,fontWeight:600,fill:M(e.value),children:e.label}),i&&/* @__PURE__ */ve("text",{x:e.x+n/2+8,y:e.y+n/2+34,fontSize:11,fill:M(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve(wo,{title:C.label,rows:[{key:"value",label:c.value,color:N(C.value),value:u(C.value)}]})}),
945
- /* @__PURE__ */ve(Wo,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function Go(e,t,r,n,a,l,i,s){if(n>=8)return;const o=e.reduce((e,t)=>e+Jo(t,8-n),0);if(o<=0)return;let c=t;e.forEach((e,t)=>{const d=Jo(e,8-n),u=d/o*r,h=`${i}/${e.key}`,m=0===n?t:a,p=0===n?e.key:l;s.push({id:h,label:e.label,value:d,depth:n,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&Go(e.children,c,u,n+1,m,p,h,s),c+=u})}function Jo(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+Jo(r,t-1),0):Math.max(0,e.value??0)}function Xo({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:s}){const o=K().charts,c=U(),d=a??(e=>Z(e,c)),u=s??o.nothingToBreakDown,[h,m]=ie(null),{highlighted:p}=so(),g=[];if(Go(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return ve("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,b=t/2,x=t/2,y=(t/2-8-r)/f,v=g.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),w=e=>`color-mix(in oklab, ${Ts(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${Bs.surface})`,k=e=>null!==h?e.id===h:null===p||e.branchKey===p,N=h?g.find(e=>e.id===h):void 0,M=e=>J(e.value/v*100,1,c);/* @__PURE__ */
952
+ /* @__PURE__ */ve("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:N(e.value)}),l&&/* @__PURE__ */ve("text",{x:e.x+n/2+8,y:e.y+n/2+18,fontSize:11.5,fontWeight:600,fill:M(e.value),children:e.label}),i&&/* @__PURE__ */ve("text",{x:e.x+n/2+8,y:e.y+n/2+34,fontSize:11,fill:M(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve($o,{title:C.label,rows:[{key:"value",label:c.value,color:N(C.value),value:u(C.value)}]})}),
953
+ /* @__PURE__ */ve(Uo,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function ec(e,t,r,n,a,l,i,s){if(n>=8)return;const o=e.reduce((e,t)=>e+tc(t,8-n),0);if(o<=0)return;let c=t;e.forEach((e,t)=>{const d=tc(e,8-n),u=d/o*r,h=`${i}/${e.key}`,m=0===n?t:a,p=0===n?e.key:l;s.push({id:h,label:e.label,value:d,depth:n,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&ec(e.children,c,u,n+1,m,p,h,s),c+=u})}function tc(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+tc(r,t-1),0):Math.max(0,e.value??0)}function rc({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:s}){const o=K().charts,c=U(),d=a??(e=>Z(e,c)),u=s??o.nothingToBreakDown,[h,m]=ie(null),{highlighted:p}=ho(),g=[];if(ec(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return ve("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,b=t/2,x=t/2,y=(t/2-8-r)/f,v=g.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),w=e=>`color-mix(in oklab, ${Rs(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${Is.surface})`,k=e=>null!==h?e.id===h:null===p||e.branchKey===p,N=h?g.find(e=>e.id===h):void 0,M=e=>J(e.value/v*100,1,c);/* @__PURE__ */
946
954
  return we("div",{className:`relative ${i??""}`,children:[
947
- /* @__PURE__ */we("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":o.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */ve("path",{d:to(b,x,r+e.depth*y+n/2,r+(e.depth+1)*y-n/2,e.start,e.end),fill:w(e),fillOpacity:k(e)?1:.45,stroke:Bs.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */ve("text",{x:b,y:x+5,textAnchor:"middle",fontSize:15,fontWeight:600,fill:Bs.label,children:l})]}),N&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve(wo,{title:N.label,rows:[{key:"value",label:o.value,color:w(N),value:d(N.value)},{key:"share",label:o.share,color:Bs.muted,value:M(N)}]})}),
948
- /* @__PURE__ */ve(Wo,{caption:o.sunburst(d(v),f),head:[o.tableLevel,o.tableItem,o.value,o.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),M(e)])})]})}function Qo({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:s,emptyLabel:o}){const c=K().charts,d=U(),u=i??(e=>Z(e,d)),h=o??c.noFlows,m=se(null),p=uo(m),g=n??p,[f,b]=ie(null),{highlighted:x}=so();if(0===e.length||0===t.length)/* @__PURE__ */
949
- return ve("div",{className:s,ref:m,children:/* @__PURE__ */ve("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const y=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>y.length<=1?0:y.indexOf(e)/(y.length-1)*(g-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),k=/* @__PURE__ */new Map;for(const t of e)k.set(t.depth,[...k.get(t.depth)??[],t]);const N=Math.max(...[...k.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),M=r-20,$=N>0?(M-l*(Math.max(...[...k.values()].map(e=>e.length))-1))/N:0,C=/* @__PURE__ */new Map;for(const[e,t]of k){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*$)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>M&&a>0?Math.max(0,1-(n-M)/a):1;let s=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:s,h:a,index:n}),s+=a+l})}const L=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,P=/* @__PURE__ */new Map,j=(e,t)=>e.from===t||e.to===t,z="link"===f?.kind?t[f.index]:void 0,A="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
955
+ /* @__PURE__ */we("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":o.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */ve("path",{d:lo(b,x,r+e.depth*y+n/2,r+(e.depth+1)*y-n/2,e.start,e.end),fill:w(e),fillOpacity:k(e)?1:.45,stroke:Is.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */ve("text",{x:b,y:x+5,textAnchor:"middle",fontSize:15,fontWeight:600,fill:Is.label,children:l})]}),N&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve($o,{title:N.label,rows:[{key:"value",label:o.value,color:w(N),value:d(N.value)},{key:"share",label:o.share,color:Is.muted,value:M(N)}]})}),
956
+ /* @__PURE__ */ve(Uo,{caption:o.sunburst(d(v),f),head:[o.tableLevel,o.tableItem,o.value,o.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),M(e)])})]})}function nc({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:s,emptyLabel:o}){const c=K().charts,d=U(),u=i??(e=>Z(e,d)),h=o??c.noFlows,m=se(null),p=go(m),g=n??p,[f,b]=ie(null),{highlighted:x}=ho();if(0===e.length||0===t.length)/* @__PURE__ */
957
+ return ve("div",{className:s,ref:m,children:/* @__PURE__ */ve("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const y=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>y.length<=1?0:y.indexOf(e)/(y.length-1)*(g-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),k=/* @__PURE__ */new Map;for(const t of e)k.set(t.depth,[...k.get(t.depth)??[],t]);const N=Math.max(...[...k.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),M=r-20,$=N>0?(M-l*(Math.max(...[...k.values()].map(e=>e.length))-1))/N:0,C=/* @__PURE__ */new Map;for(const[e,t]of k){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*$)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>M&&a>0?Math.max(0,1-(n-M)/a):1;let s=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:s,h:a,index:n}),s+=a+l})}const L=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,j=/* @__PURE__ */new Map,P=(e,t)=>e.from===t||e.to===t,S="link"===f?.kind?t[f.index]:void 0,z="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
950
958
  return we("div",{className:`relative ${s??""}`,ref:m,children:[
951
- /* @__PURE__ */we("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>b(null),children:[t.map((e,t)=>{const r=C.get(e.from),n=C.get(e.to);if(!r||!n)return null;const l=Math.max(1,e.value*$),i=r.y+(L.get(e.from)??0)+l/2,s=n.y+(D.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),D.set(e.to,(D.get(e.to)??0)+l);const o=r.x+a,c=n.x,d=Ts(r.index,e.color),u=`${e.from}→${e.to}`,h=P.get(u)??0;P.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:j(e,f.key):null!==x?j(e,x):null)(e,t);/* @__PURE__ */
952
- return ve("path",{d:Gs([[o,i],[c,s]]),fill:"none",stroke:d,strokeWidth:l,strokeOpacity:null===m||m?.42:.12,onMouseEnter:()=>b({kind:"link",index:t})},h?`${u}#${h}`:u)}),e.map(e=>{const r=C.get(e.key);if(!r)return null;const n=r.x>g/2,l=(i=e.key,f?"node"===f.kind?f.key===i:j(t[f.index],i):null!==x?x===i:null);var i;/* @__PURE__ */
959
+ /* @__PURE__ */we("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>b(null),children:[t.map((e,t)=>{const r=C.get(e.from),n=C.get(e.to);if(!r||!n)return null;const l=Math.max(1,e.value*$),i=r.y+(L.get(e.from)??0)+l/2,s=n.y+(D.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),D.set(e.to,(D.get(e.to)??0)+l);const o=r.x+a,c=n.x,d=Rs(r.index,e.color),u=`${e.from}→${e.to}`,h=j.get(u)??0;j.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:P(e,f.key):null!==x?P(e,x):null)(e,t);/* @__PURE__ */
960
+ return ve("path",{d:eo([[o,i],[c,s]]),fill:"none",stroke:d,strokeWidth:l,strokeOpacity:null===m||m?.42:.12,onMouseEnter:()=>b({kind:"link",index:t})},h?`${u}#${h}`:u)}),e.map(e=>{const r=C.get(e.key);if(!r)return null;const n=r.x>g/2,l=(i=e.key,f?"node"===f.kind?f.key===i:P(t[f.index],i):null!==x?x===i:null);var i;/* @__PURE__ */
953
961
  return we("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>b({kind:"node",key:e.key}),children:[
954
- /* @__PURE__ */ve("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:Ts(r.index,e.color,e.tone)}),
955
- /* @__PURE__ */ve("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:Bs.label,children:e.label})]},e.key)})]}),z&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve(wo,{title:`${z.from} → ${z.to}`,rows:[{key:"value",label:c.flow,color:Ts(C.get(z.from)?.index??0,z.color),value:u(z.value)}]})}),A&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve(wo,{title:A.label,rows:[{key:"value",label:c.throughput,color:Ts(C.get(A.key)?.index??0,A.color,A.tone),value:u(w.get(A.key)??0)}]})}),
956
- /* @__PURE__ */ve(Wo,{caption:c.sankey(e.length,t.length),head:[c.tableFrom,c.tableTo,c.value],rows:t.map(e=>[e.from,e.to,u(e.value)])})]})}function ec({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:s,emptyLabel:o}){const c=K().charts,d=U(),u=i??(e=>Z(e,d)),h=o??c.noFlows,[m,p]=ie(null),{highlighted:g}=so(),f=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},b=e.map((t,r)=>e.reduce((e,t,n)=>e+f(r,n)+f(n,r),0)),x=e.map((e,t)=>t).sort((e,t)=>b[t]-b[e]).slice(0,n),y=x.reduce((e,t)=>e+b[t],0);if(y<=0)/* @__PURE__ */return ve("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const v=r/2,w=r/2,k=r/2-44,N=k-l,M=a*x.length,$=/* @__PURE__ */new Map;let C=-Math.PI/2;x.forEach((e,t)=>{const r=b[e]/y*(2*Math.PI-M);$.set(e,{start:C,end:C+r,slot:t}),C+=r+a});const L=/* @__PURE__ */new Map,D=[];for(const e of x)for(const t of x){const r=f(e,t);if(r<=0)continue;const n=$.get(e),a=r/Math.max(1,b[e])*(n.end-n.start),l=L.get(e)??0;L.set(e,l+a),D.push({from:e,to:t,value:r,a:n.start+l+a/2,b:$.get(t).start+($.get(t).end-$.get(t).start)/2})}const P=(e,t)=>[v+t*Math.cos(e),w+t*Math.sin(e)],j="arc"===m?.kind?m.index:void 0,z="ribbon"===m?.kind?D[m.index]:void 0;/* @__PURE__ */
962
+ /* @__PURE__ */ve("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:Rs(r.index,e.color,e.tone)}),
963
+ /* @__PURE__ */ve("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:Is.label,children:e.label})]},e.key)})]}),S&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve($o,{title:`${S.from} → ${S.to}`,rows:[{key:"value",label:c.flow,color:Rs(C.get(S.from)?.index??0,S.color),value:u(S.value)}]})}),z&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve($o,{title:z.label,rows:[{key:"value",label:c.throughput,color:Rs(C.get(z.key)?.index??0,z.color,z.tone),value:u(w.get(z.key)??0)}]})}),
964
+ /* @__PURE__ */ve(Uo,{caption:c.sankey(e.length,t.length),head:[c.tableFrom,c.tableTo,c.value],rows:t.map(e=>[e.from,e.to,u(e.value)])})]})}function ac({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:s,emptyLabel:o}){const c=K().charts,d=U(),u=i??(e=>Z(e,d)),h=o??c.noFlows,[m,p]=ie(null),{highlighted:g}=ho(),f=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},b=e.map((t,r)=>e.reduce((e,t,n)=>e+f(r,n)+f(n,r),0)),x=e.map((e,t)=>t).sort((e,t)=>b[t]-b[e]).slice(0,n),y=x.reduce((e,t)=>e+b[t],0);if(y<=0)/* @__PURE__ */return ve("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const v=r/2,w=r/2,k=r/2-44,N=k-l,M=a*x.length,$=/* @__PURE__ */new Map;let C=-Math.PI/2;x.forEach((e,t)=>{const r=b[e]/y*(2*Math.PI-M);$.set(e,{start:C,end:C+r,slot:t}),C+=r+a});const L=/* @__PURE__ */new Map,D=[];for(const e of x)for(const t of x){const r=f(e,t);if(r<=0)continue;const n=$.get(e),a=r/Math.max(1,b[e])*(n.end-n.start),l=L.get(e)??0;L.set(e,l+a),D.push({from:e,to:t,value:r,a:n.start+l+a/2,b:$.get(t).start+($.get(t).end-$.get(t).start)/2})}const j=(e,t)=>[v+t*Math.cos(e),w+t*Math.sin(e)],P="arc"===m?.kind?m.index:void 0,S="ribbon"===m?.kind?D[m.index]:void 0;/* @__PURE__ */
957
965
  return we("div",{className:`relative ${s??""}`,children:[
958
- /* @__PURE__ */we("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord(x.length),onMouseLeave:()=>p(null),children:[D.map((t,n)=>{const[a,l]=P(t.a,N),[i,s]=P(t.b,N),o=Ts($.get(t.from).slot),c=((t,r)=>m?"ribbon"===m.kind?m.index===r:m.index===t.from||m.index===t.to:null!==g?e[t.from]===g||e[t.to]===g:null)(t,n);/* @__PURE__ */
959
- return ve("path",{d:`M${a},${l} Q${v},${w} ${i},${s}`,fill:"none",stroke:o,strokeWidth:Math.max(1,t.value/y*r*.9),strokeOpacity:null===c||c?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:n})},`${e[t.from]}→${e[t.to]}`)}),x.map(t=>{const r=$.get(t),n=(r.start+r.end)/2,[a,l]=P(n,k+16),i=(t=>m?"arc"===m.kind?m.index===t:D[m.index].from===t||D[m.index].to===t:null!==g?e[t]===g:null)(t);/* @__PURE__ */
966
+ /* @__PURE__ */we("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord(x.length),onMouseLeave:()=>p(null),children:[D.map((t,n)=>{const[a,l]=j(t.a,N),[i,s]=j(t.b,N),o=Rs($.get(t.from).slot),c=((t,r)=>m?"ribbon"===m.kind?m.index===r:m.index===t.from||m.index===t.to:null!==g?e[t.from]===g||e[t.to]===g:null)(t,n);/* @__PURE__ */
967
+ return ve("path",{d:`M${a},${l} Q${v},${w} ${i},${s}`,fill:"none",stroke:o,strokeWidth:Math.max(1,t.value/y*r*.9),strokeOpacity:null===c||c?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:n})},`${e[t.from]}→${e[t.to]}`)}),x.map(t=>{const r=$.get(t),n=(r.start+r.end)/2,[a,l]=j(n,k+16),i=(t=>m?"arc"===m.kind?m.index===t:D[m.index].from===t||D[m.index].to===t:null!==g?e[t]===g:null)(t);/* @__PURE__ */
960
968
  return we("g",{onMouseEnter:()=>p({kind:"arc",index:t}),children:[
961
- /* @__PURE__ */ve("path",{d:to(v,w,N,k,r.start,r.end),fill:Ts(r.slot),fillOpacity:null===i||i?1:.45}),
962
- /* @__PURE__ */ve("text",{x:a,y:l+4,fontSize:11,fill:Bs.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==j&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve(wo,{title:e[j],rows:[{key:"total",label:c.totalFlow,color:Ts($.get(j).slot),value:u(b[j])}]})}),z&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve(wo,{title:`${e[z.from]} → ${e[z.to]}`,rows:[{key:"value",label:c.flow,color:Ts($.get(z.from).slot),value:u(z.value)}]})}),
963
- /* @__PURE__ */ve(Wo,{caption:c.chord(x.length),head:[c.tableFrom,c.tableTo,c.value],rows:D.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{fi as APP_UPDATE_POLL_MS,Qn as Accordion,xi as AppUpdateBanner,Gr as AttachButton,Yr as AttachmentDropZone,Zr as AttachmentList,us as AuthScreen,Rn as Avatar,Wn as AvatarGroup,Un as Banner,Ei as BarChart,Io as BoxPlotChart,dt as BrandAssetEditor,ka as BudgetBar,Bs as CHART_INK,$t as Calendar,Oo as CandlestickChart,rn as Card,$o as CartesianPlot,No as ChartBrush,Ba as ChartDefs,ko as ChartDot,vo as ChartFrame,io as ChartHighlightProvider,bo as ChartSkeleton,wo as ChartTooltip,is as ChatTemplate,We as Checkbox_default,es as CheckoutTemplate,ec as ChordChart,qr as ColorPicker,Hr as ColorPickerPanel,Ir as ColorSwatch,ia as ColoredBadge,Ao as ColumnChart,Jr as ComposerAttachments,Al as ContainerFillChart,ai as ContextMenu,Sn as CountBadge,Na as DAY_MS,Ki as DashboardTemplate,Si as DataTable,Gi as DataTablePage,Kt as DatePicker_default,Ft as DateRangePicker,Gt as DateTimePicker_default,jn as DescriptionList,kn as Divider,Oi as DonutChart,ki as Drawer,ri as DropdownMenu,ns as EmailTemplate,sa as EmptyState,Ls as EmptyValue,gs as ErrorBoundary,ms as ErrorPage,Ur as FilePicker_default,Ve as FormErrorSummary,qe as FormField,Xi as FormLayoutPage,Yo as FunnelChart,ea as GROUP_COLORS,ta as GROUP_COLORS_SOLID,cs as GalleryTemplate,vn as Grid,Ro as HeatmapChart,ql as HelpCenter,_r as HexInput,Eo as HistogramChart,De as INPUT_BASE,Le as INPUT_SIZES,Me as IconButton_default,pi as IconRail,gi as IconRailButton,fn as Inline,kr as InputNumber_default,ze as Input_default,Ni as Kanban,Ge as Label,Wi as LineChart,Bi as ListFooter,Fi as ListLoadError,lr as MAX_FRACTION_DIGITS,Ta as MOTION,Hl as Markdown,ct as MediaUploadField,bt as MediaUploadGrid,po as Meter,xa as MetricBar,Nl as MilestoneTimeline,Ee as NativeSelect,cr as NumericKeypad,Ml as POST_PRODUCTION_STATUSES,oa as PageHeader,$i as Pagination,Kr as PaperclipGlyph,un as Paragraph,Uo as PieChart,Cr as Popover,pt as PortalBrandingProvider,jl as ProductionTimeline,Ho as RADAR_SERIES_CAP,qo as RadarChart,Vo as RadialBarChart,Ke as RadioGroup,_e as Radio_default,Fo as RangeChart,ho as RankedBars,So as SCATTER_SERIES_CAP,zs as SERIES_SLOT_COUNT,As as SERIES_VARS,$l as STAGES,Ss as STATUS_VARS,Qo as SankeyChart,Bo as ScatterChart,Qr as SearchableSelect,gr as Segmented,Oe as Select_default,zn as SettingRow,Kl as SidebarActionButton,Yl as SidebarGroupLabel,Jl as SidebarNavGroup,Gl as SidebarNavItem,$n as Skeleton,Mr as Slider,ar as Snippet,Ti as Sparkline,gn as Stack,nn as StatCard,fo as StatTile,Tn as Statistic,la as StatusBadge,aa as StatusBadgeProvider,Xn as Stepper,Xo as SunburstChart,yr as Switch_default,Gn as Tabs,en as TagInput,on as Text,Ae as Textarea_default,ur as TileButton_default,Ds as TimeAgo,Ot as TimePicker_default,zo as TimeSeriesChart,wl as TimelineTrack,dn as Title,Xl as TopNav,oi as Tree,hi as TreeEmptySlot,ci as TreeGroup,di as TreeGroupLabel,ui as TreeRow,Zo as TreemapChart,To as WaterfallChart,Hs as angleScale,ir as appendKey,$s as applyThemePrefs,to as arcPath,Qs as areaBetween,Xs as areaFrom,co as autoHighlightIndex,sr as backspace,Is as bandScale,qs as binValues,va as budgetState,Gs as bumpPath,Cl as calcOverall,Ll as calcReportOverall,Tr as colorFill,Er as colorSwatchClasses,Qt as copyToClipboard,Js as curvePath,za as dashFor,ja as fillFor,Ca as fillId,Se as firstEnabledIndex,$a as fmtSliderDate,vt as fromKey,La as glowId,Pa as groundId,ra as groupColors,zr as hexToHsv,oo as highlightOpacity,Ar as hsvToHex,je as inputClasses,da as isSeverityTone,Ze as labelClasses,Os as ladderScale,Be as lastEnabledIndex,Ks as linearPath,Es as linearScale,Ws as logScale,Da as maskId,Te as matchTypeahead,Xe as mediaFileName,Ys as monotonePath,Fe as nextEnabledIndex,Rs as niceMax,Dr as parseHexColor,eo as polygonPoints,_s as radiusScale,ut as resolvePortalBrandAsset,Ts as resolveSeriesColor,ks as resolveTheme,Jt as selectionAt,Fs as seriesColor,ua as severityOf,Zs as splinePath,ao as squarify,Ea as stagger,Vs as stepPath,Kn as tabButtonId,Vn as tabPanelId,Ma as toDayMs,Pt as toISODate,yt as toKey,bi as useAppUpdate,js as useClickOutside,li as useContextMenu,Ps as useDebouncedValue,so as useHighlight,uo as usePlotWidth,gt as usePortalBranding,Dl as useProductionTimeline,Cs as useTheme};
969
+ /* @__PURE__ */ve("path",{d:lo(v,w,N,k,r.start,r.end),fill:Rs(r.slot),fillOpacity:null===i||i?1:.45}),
970
+ /* @__PURE__ */ve("text",{x:a,y:l+4,fontSize:11,fill:Is.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==P&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve($o,{title:e[P],rows:[{key:"total",label:c.totalFlow,color:Rs($.get(P).slot),value:u(b[P])}]})}),S&&/* @__PURE__ */ve("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ve($o,{title:`${e[S.from]} → ${e[S.to]}`,rows:[{key:"value",label:c.flow,color:Rs($.get(S.from).slot),value:u(S.value)}]})}),
971
+ /* @__PURE__ */ve(Uo,{caption:c.chord(x.length),head:[c.tableFrom,c.tableTo,c.value],rows:D.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{vi as APP_UPDATE_POLL_MS,na as Accordion,ki as AppUpdateBanner,en as AttachButton,Xr as AttachmentDropZone,Qr as AttachmentList,gs as AuthScreen,qn as Avatar,Un as AvatarGroup,Zn as Banner,Wi as BarChart,Ho as BoxPlotChart,ht as BrandAssetEditor,Ca as BudgetBar,Is as CHART_INK,Lt as Calendar,_o as CandlestickChart,sn as Card,jo as CartesianPlot,Lo as ChartBrush,Ia as ChartDefs,Co as ChartDot,Mo as ChartFrame,uo as ChartHighlightProvider,wo as ChartSkeleton,$o as ChartTooltip,ds as ChatTemplate,_e as Checkbox_default,as as CheckoutTemplate,ac as ChordChart,Yr as ColorPicker,Kr as ColorPickerPanel,Hr as ColorSwatch,da as ColoredBadge,Eo as ColumnChart,tn as ComposerAttachments,El as ContainerFillChart,oi as ContextMenu,Tn as CountBadge,La as DAY_MS,Gi as DashboardTemplate,Ti as DataTable,es as DataTablePage,Yt as DatePicker_default,Tt as DateRangePicker,Xt as DateTimePicker_default,Bn as DescriptionList,Cn as Divider,_i as DonutChart,Ci as Drawer,ii as DropdownMenu,ss as EmailTemplate,ua as EmptyState,Ss as EmptyValue,ys as ErrorBoundary,bs as ErrorPage,Zr as FilePicker_default,Ze as FormErrorSummary,Ke as FormField,rs as FormLayoutPage,Xo as FunnelChart,aa as GROUP_COLORS,la as GROUP_COLORS_SOLID,ms as GalleryTemplate,Mn as Grid,qo as HeatmapChart,Yl as HelpCenter,Vr as HexInput,Wo as HistogramChart,De as INPUT_BASE,Le as INPUT_SIZES,Me as IconButton_default,xi as IconRail,yi as IconRailButton,vn as Inline,Cr as InputNumber_default,Se as Input_default,Li as Kanban,Xe as Label,Ui as LineChart,Ii as ListFooter,Oi as ListLoadError,sr as MAX_FRACTION_DIGITS,Ra as MOTION,Kl as Markdown,ut as MediaUploadField,yt as MediaUploadGrid,xo as Meter,ka as MetricBar,Ll as MilestoneTimeline,Ie as NativeSelect,ur as NumericKeypad,Dl as POST_PRODUCTION_STATUSES,ha as PageHeader,ji as Pagination,Gr as PaperclipGlyph,gn as Paragraph,Zo as PieChart,Pr as Popover,ft as PortalBrandingProvider,Bl as ProductionTimeline,Ko as RADAR_SERIES_CAP,Yo as RadarChart,Jo as RadialBarChart,Ye as RadioGroup,Ue as Radio_default,Oo as RangeChart,fo as RankedBars,To as SCATTER_SERIES_CAP,Fs as SERIES_SLOT_COUNT,Es as SERIES_VARS,jl as STAGES,Ts as STATUS_VARS,nc as SankeyChart,Io as ScatterChart,nn as SearchableSelect,br as Segmented,We as Select_default,Fn as SettingRow,Gl as SidebarActionButton,Xl as SidebarGroupLabel,ti as SidebarNavGroup,ei as SidebarNavItem,jn as Skeleton,Dr as Slider,ir as Snippet,Ri as Sparkline,yn as Stack,on as StatCard,vo as StatTile,Rn as Statistic,ca as StatusBadge,oa as StatusBadgeProvider,ra as Stepper,rc as SunburstChart,wr as Switch_default,ea as Tabs,an as TagInput,hn as Text,ze as Textarea_default,mr as TileButton_default,zs as TimeAgo,Wt as TimePicker_default,Fo as TimeSeriesChart,$l as TimelineTrack,pn as Title,ri as TopNav,hi as Tree,fi as TreeEmptySlot,mi as TreeGroup,pi as TreeGroupLabel,gi as TreeRow,Qo as TreemapChart,Ro as WaterfallChart,Ks as angleScale,or as appendKey,js as applyThemePrefs,lo as arcPath,no as areaBetween,ro as areaFrom,po as autoHighlightIndex,cr as backspace,Hs as bandScale,Ys as binValues,Ma as budgetState,eo as bumpPath,Pl as calcOverall,Sl as calcReportOverall,Rr as colorFill,Wr as colorSwatchClasses,tr as copyToClipboard,to as curvePath,Fa as dashFor,Ba as fillFor,Pa as fillId,Ae as firstEnabledIndex,ja as fmtSliderDate,kt as fromKey,Sa as glowId,Aa as groundId,ia as groupColors,Fr as hexToHsv,mo as highlightOpacity,Er as hsvToHex,Pe as inputClasses,pa as isSeverityTone,Je as labelClasses,_s as ladderScale,Be as lastEnabledIndex,Gs as linearPath,Ws as linearScale,Us as logScale,za as maskId,Ee as matchTypeahead,et as mediaFileName,Xs as monotonePath,Fe as nextEnabledIndex,qs as niceMax,zr as parseHexColor,ao as polygonPoints,Vs as radiusScale,mt as resolvePortalBrandAsset,Rs as resolveSeriesColor,Cs as resolveTheme,Qt as selectionAt,Os as seriesColor,ga as severityOf,Qs as splinePath,oo as squarify,Wa as stagger,Js as stepPath,Gn as tabButtonId,Jn as tabPanelId,Da as toDayMs,St as toISODate,wt as toKey,wi as useAppUpdate,Bs as useClickOutside,ci as useContextMenu,As as useDebouncedValue,ho as useHighlight,go as usePlotWidth,bt as usePortalBranding,zl as useProductionTimeline,Ps as useTheme};