efficient-shell 4.145.0 → 4.147.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/dist/{Browser-24YNRTKT.js → Browser-52FZDK3P.js} +14 -14
- package/dist/{Calculator-LER6KUQC.js → Calculator-4S44DK45.js} +22 -22
- package/dist/{ConfirmDialog-GAYETRMG.js → ConfirmDialog-KJNNVFK7.js} +1 -1
- package/dist/{CurrencyConverter-Y35GFDFF.js → CurrencyConverter-TH6ISVZ5.js} +5 -5
- package/dist/{Documents-7FYX2CGT.js → Documents-TEV6WUCC.js} +11 -11
- package/dist/{Files-RZOML2N6.js → Files-T3VMQAO3.js} +31 -31
- package/dist/{Notepad-VVDCBDUA.js → Notepad-LYNVGUHK.js} +9 -9
- package/dist/{PomodoroTimer-VAM3AJOX.js → PomodoroTimer-IEZ3ALBW.js} +24 -24
- package/dist/{Preview-HZ37D7QJ.js → Preview-SJCMGRUS.js} +5 -5
- package/dist/{Spreadsheet-6WX3P6AB.js → Spreadsheet-GR6GJTDP.js} +12 -12
- package/dist/{Stock-AUWI3TUX.js → Stock-MYXAUZJY.js} +3 -3
- package/dist/{Weather-HU75TH7T.js → Weather-HKCFNPV6.js} +15 -15
- package/dist/{WorldClock-T64MDRMJ.js → WorldClock-6XVXM4L2.js} +7 -7
- package/dist/apps/index.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/chunk-6JXLEPRE.js +1 -0
- package/dist/{chunk-LVFMK5OQ.js → chunk-D4HWQ3ET.js} +1 -1
- package/dist/{chunk-2RHMSFZV.js → chunk-JNL7A5HC.js} +7 -7
- package/dist/{chunk-GDSGXDET.js → chunk-NUPXFPQW.js} +1 -1
- package/dist/{chunk-RJ4LACFH.js → chunk-NV35RTZK.js} +1 -1
- package/dist/{chunk-NBBOFQPL.js → chunk-ZFJH3P24.js} +63 -59
- package/dist/{chunk-7DAQ3WVP.js → chunk-ZR72F7TE.js} +24 -24
- package/dist/{index-NhR7frRu.d.ts → index-DIQYwgxx.d.ts} +38 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +46 -46
- package/dist/page-tabs/index.js +10 -10
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-TWV42Q3K.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-I55UMU3R.js";import{SidebarLayout as t}from"./chunk-SLCR26NK.js";import{BrandMark as r}from"./chunk-OCSOMMY2.js";import{toast_default as a}from"./chunk-KKOHUQPF.js";import{useIsMobile as n,useShortcutLabel as l,useShellPrefs as i}from"./chunk-V453E4KU.js";import{useFileIntake as s,humanSize as o,FileIntakeAlert as c}from"./chunk-UB22J6EF.js";import{iconButtonClasses as d,Button_default as u}from"./chunk-PH3PRIFP.js";import{PopupMenu as h,PopupMenuDivider as m,PopupMenuLabel as p,itemLook as g}from"./chunk-
|
|
1
|
+
import{Breadcrumbs as e}from"./chunk-I55UMU3R.js";import{SidebarLayout as t}from"./chunk-SLCR26NK.js";import{BrandMark as r}from"./chunk-OCSOMMY2.js";import{toast_default as a}from"./chunk-KKOHUQPF.js";import{useIsMobile as n,useShortcutLabel as l,useShellPrefs as i}from"./chunk-V453E4KU.js";import{useFileIntake as s,humanSize as o,FileIntakeAlert as c}from"./chunk-UB22J6EF.js";import{iconButtonClasses as d,Button_default as u}from"./chunk-PH3PRIFP.js";import{PopupMenu as h,PopupMenuDivider as m,PopupMenuLabel as p,itemLook as g}from"./chunk-JNL7A5HC.js";import{registerModalEscapeInterceptor as f,onOverlayOpen as x,Z_LAYERS as b,useDismissPopupsOnOpen as y,useFocusTrap as v,useScrollLock as w}from"./chunk-D4HWQ3ET.js";import{glassStyle as k,glassFill as N}from"./chunk-57MIENLJ.js";import{useShellLocale as M,useShellStrings as $,DEFAULT_SHELL_STRINGS as C,currentShellStrings as L,formatPlain as D,formatFixed as j,formatPercent as z,splitAround as P}from"./chunk-TR6PLN7W.js";import{useBrowserLayoutEffect as S,useBrowserValue as A,useBrowserValueOnce as F}from"./chunk-D65T4H6J.js";import{forwardRef as B,useCallback as T,useState as W,useRef as I,useId as E,useEffect as R,createContext as O,useMemo as Y,Children as _,isValidElement as H,cloneElement as q,useContext as U,Fragment as K,Component as V,useSyncExternalStore as G,useLayoutEffect as Z}from"react";import{jsx as J,jsxs as X,Fragment as Q}from"react/jsx-runtime";import{createPortal as ee}from"react-dom";var te=B(function({children:e,variant:t="ghost",size:r="md",type:a="button",className:n="",...l},i){/* @__PURE__ */
|
|
2
2
|
return J("button",{ref:i,type:a,className:d({variant:t,size:r,className:n}),...l,children:e})}),re="block w-full rounded-md border border-gray-300 bg-white",ae="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)]",ne={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"},le=`${re} ${ne.md} ${ae}`,ie="disabled:cursor-not-allowed disabled:opacity-60";function se(e){return[e?.size&&"md"!==e.size?`${re} ${ne[e.size]} ${ae}`:le,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",ie,e?.className??""].filter(Boolean).join(" ")}var oe=B(function({invalid:e,leftIcon:t,rightAdornment:r,size:a,className:n="",...l},i){const s=`${t?"pl-9":""} ${r?"pr-9":""}`.trim(),o=
|
|
3
3
|
/* @__PURE__ */J("input",{ref:i,"aria-invalid":e||void 0,className:se({invalid:e,size:a,className:[s,n].filter(Boolean).join(" ")}),...l});return t||r?/* @__PURE__ */X("div",{className:"relative",children:[t&&/* @__PURE__ */J("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:t}),o,r&&/* @__PURE__ */J("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):o}),ce=B(function({invalid:e,autoGrow:t,className:r="",onInput:a,rows:n=3,size:l,...i},s){const o=T(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}a?.(e)},[t,a]);/* @__PURE__ */
|
|
4
4
|
return J("textarea",{ref:s,"aria-invalid":e||void 0,rows:n,onInput:o,className:se({invalid:e,size:l,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...i})}),de=448,ue=240;function he(e){const t={left:0,right:window.innerWidth,top:0,bottom:window.innerHeight},r=e?.closest?.("[data-modal-panel]");if(!r)return t;const a=r.getBoundingClientRect();return a.width<=0||a.height<=0?t:{left:Math.max(t.left,a.left),right:Math.min(t.right,a.right),top:Math.max(t.top,a.top),bottom:Math.min(t.bottom,a.bottom)}}var me={top:"bottom",bottom:"top",left:"right",right:"left"},pe={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function ge(e,t,r){return{top:e.top-r-(t.top+8),bottom:t.bottom-8-(e.bottom+r),left:e.left-r-(t.left+8),right:t.right-8-(e.right+r)}}var fe=(e,t,r)=>Math.max(t,Math.min(e,r));function xe(e,t,r){let a=NaN,n=NaN,l=NaN,i=NaN,s=NaN;const o=()=>{const t=e()?.getBoundingClientRect();if(!t)return!1;const o=r?r():NaN,c=t.left!==a||t.top!==n||t.right!==l||t.bottom!==i||o!==s&&!(Number.isNaN(o)&&Number.isNaN(s));return a=t.left,n=t.top,l=t.right,i=t.bottom,s=o,c};o();const c=()=>{o(),t()};let d=requestAnimationFrame(function e(){o()&&t(),d=requestAnimationFrame(e)});return window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),()=>{cancelAnimationFrame(d),window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c)}}function be(e,t,r={}){const{matchTriggerWidth:a=!1,preferredMaxWidth:n=de,preferredMaxHeight:l=ue,popupRef:i}=r,[s,o]=W(null);return S(()=>{if(!t)return void o(null);const r=()=>{const t=e.current,r=t?.getBoundingClientRect();if(!r)return;const s=he(t),c=s.bottom-r.bottom-4-8,d=r.top-s.top-4-8,u=c<Math.min(l,160)&&d>c,h=Math.max(96,Math.min(l,u?d:c)),m=Math.max(0,s.right-s.left-16),p={minWidth:r.width,maxWidth:Math.min(n,m),maxHeight:h};if(a){const e=Math.min(r.width,m);p.width=e,p.maxWidth=e,p.left=Math.min(Math.max(s.left+8,r.left),s.right-8-e)}else if(i&&s.right-8-r.left<p.maxWidth&&Math.min(r.right,s.right-8)-s.left-8<p.maxWidth){const e=i.current?.offsetWidth??0,t=e>0?Math.min(e,p.maxWidth):p.maxWidth;p.left=Math.max(s.left+8,Math.min(r.left,s.right-8-t))}else if(s.right-8-r.left<p.maxWidth){const e=Math.min(r.right,s.right-8);p.right=window.innerWidth-e,p.maxWidth=Math.min(p.maxWidth,Math.max(0,e-s.left-8))}else p.left=Math.max(s.left+8,r.left);u?p.bottom=window.innerHeight-r.top+4:p.top=r.bottom+4,o(p)};return r(),xe(()=>e.current,r,i?()=>i.current?.offsetWidth??NaN:void 0)},[t,e,a,n,l,i]),s}function ye(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function ve(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function we(e,t,r){let a=t+r;for(;a>=0&&a<e.length;){if(!e[a].disabled)return a;a+=r}return t>=0&&t<e.length&&!e[t].disabled?t:r>0?ye(e):ve(e)}function ke(e,t,r){const a=t.toLowerCase(),n=e.length;if(!a||0===n)return-1;for(let t=1;t<=n;t++){const l=((r+t)%n+n)%n,i=e[l];if(!i.disabled&&i.label.toLowerCase().startsWith(a))return l}return-1}var Ne=B(function({value:e,onChange:t,options:r,placeholder:a,invalid:n,className:l="",size:i,touchSize:s,...o},c){/* @__PURE__ */
|
|
@@ -31,14 +31,14 @@ return J("svg",{className:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor
|
|
|
31
31
|
return X("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
|
|
32
32
|
/* @__PURE__ */J("path",{d:"M12 15V4"}),
|
|
33
33
|
/* @__PURE__ */J("path",{d:"M8 8l4-4 4 4"}),
|
|
34
|
-
/* @__PURE__ */J("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function Ke({value:e,onChange:t,onPick:r,onFile:a,label:n,hint:l,error:i,required:o,className:d,accept:h="image/*",maxSizeBytes:m,fit:p="cover",height:g=112,placeholder:f,cta:x,acceptHint:b,showFilename:y=!0,allowReplace:v=!0,allowRemove:w=!0,replaceLabel:k,removeLabel:N,busy:M=!1,busyLabel:C,disabled:L=!1}){const D=$().media,j=x??D.cta,z=k??D.replace,P=N??D.remove,S=C??D.uploading,A=E(),F=I(null),[B,T]=W(null);R(()=>()=>{F.current&&URL.revokeObjectURL(F.current)},[]);const O=L||M,Y=!!e&&(_e(e,h)||e===B),_=f??Ie(h,D),H=e=>{r?r(e):a?a(e):(e=>{F.current&&URL.revokeObjectURL(F.current);const r=URL.createObjectURL(e);F.current=r,T(e.type.startsWith("video/")?r:null),t(r)})(e)},q=s({accept:h,maxSizeBytes:m,acceptHint:b,multiple:!1,disabled:O,onAccept:([e])=>H(e)}),{dragOver:U}=q,K=()=>{O||(r?r():q.open())},V=e?Te(e):"",
|
|
35
|
-
/* @__PURE__ */X("div",{...q.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",U?"border-blue-500":"border-gray-200"].join(" "),style:{height:g},children:[Y?/* @__PURE__ */J("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":V||void 0,className:"h-full w-full",style:{objectFit:p}}):/* @__PURE__ */J("img",{src:e??void 0,alt:V,className:"h-full w-full",style:{objectFit:p}}),y&&e&&/* @__PURE__ */J(Ye,{children:V}),M&&/* @__PURE__ */J(Oe,{label:S,rounded:"rounded-md"})]}),!L&&(v||w)&&/* @__PURE__ */X("div",{className:"mt-2 flex gap-2",children:[v&&/* @__PURE__ */J(u,{id:A,variant:"secondary",size:"sm",onClick:()=>K(),disabled:M,children:z}),w&&/* @__PURE__ */J(u,{variant:"ghost",size:"sm",onClick:()=>{F.current&&(URL.revokeObjectURL(F.current),F.current=null),T(null),t("")},disabled:M,children:P})]})]}),
|
|
34
|
+
/* @__PURE__ */J("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function Ke({value:e,onChange:t,onPick:r,onFile:a,label:n,hint:l,error:i,required:o,className:d,accept:h="image/*",maxSizeBytes:m,fit:p="cover",height:g=112,placeholder:f,cta:x,acceptHint:b,showFilename:y=!0,allowReplace:v=!0,allowRemove:w=!0,replaceLabel:k,removeLabel:N,busy:M=!1,busyLabel:C,disabled:L=!1}){const D=$().media,j=x??D.cta,z=k??D.replace,P=N??D.remove,S=C??D.uploading,A=E(),F=I(null),[B,T]=W(null);R(()=>()=>{F.current&&URL.revokeObjectURL(F.current)},[]);const O=L||M,Y=!!e&&(_e(e,h)||e===B),_=f??Ie(h,D),H=e=>{r?r(e):a?a(e):(e=>{F.current&&URL.revokeObjectURL(F.current);const r=URL.createObjectURL(e);F.current=r,T(e.type.startsWith("video/")?r:null),t(r)})(e)},q=s({accept:h,maxSizeBytes:m,acceptHint:b,multiple:!1,disabled:O,onAccept:([e])=>H(e)}),{dragOver:U}=q,K=()=>{O||(r?r():q.open())},V=e?Te(e):"",G=/* @__PURE__ */X("div",{children:[
|
|
35
|
+
/* @__PURE__ */X("div",{...q.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",U?"border-blue-500":"border-gray-200"].join(" "),style:{height:g},children:[Y?/* @__PURE__ */J("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":V||void 0,className:"h-full w-full",style:{objectFit:p}}):/* @__PURE__ */J("img",{src:e??void 0,alt:V,className:"h-full w-full",style:{objectFit:p}}),y&&e&&/* @__PURE__ */J(Ye,{children:V}),M&&/* @__PURE__ */J(Oe,{label:S,rounded:"rounded-md"})]}),!L&&(v||w)&&/* @__PURE__ */X("div",{className:"mt-2 flex gap-2",children:[v&&/* @__PURE__ */J(u,{id:A,variant:"secondary",size:"sm",onClick:()=>K(),disabled:M,children:z}),w&&/* @__PURE__ */J(u,{variant:"ghost",size:"sm",onClick:()=>{F.current&&(URL.revokeObjectURL(F.current),F.current=null),T(null),t("")},disabled:M,children:P})]})]}),Z=/* @__PURE__ */J("button",{type:"button",id:A,onClick:()=>K(),disabled:O,"aria-label":"string"==typeof _?_:D.upload,"aria-busy":M||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${A}-error`:l?`${A}-hint`:void 0,...q.zoneProps,className:Ee(U,O,Re(O)),style:{minHeight:g},children:M?/* @__PURE__ */X("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
|
|
36
36
|
/* @__PURE__ */J(He,{}),
|
|
37
37
|
/* @__PURE__ */J("span",{className:"text-xs font-medium text-gray-500",children:S})]}):/* @__PURE__ */X(Q,{children:[
|
|
38
38
|
/* @__PURE__ */J("span",{className:"text-gray-400",children:/* @__PURE__ */J(Ue,{})}),
|
|
39
39
|
/* @__PURE__ */J("span",{className:"px-3 text-xs text-gray-500",children:_}),
|
|
40
40
|
/* @__PURE__ */J("span",{className:"text-sm font-medium text-blue-600",children:j}),b&&/* @__PURE__ */J("span",{className:"text-xs text-gray-400",children:b})]})});/* @__PURE__ */
|
|
41
|
-
return X(ze,{label:n,htmlFor:A,hint:l,error:i,required:o,className:d,children:[e?Z
|
|
41
|
+
return X(ze,{label:n,htmlFor:A,hint:l,error:i,required:o,className:d,children:[e?G:Z,!r&&/* @__PURE__ */J("input",{...q.inputProps}),
|
|
42
42
|
/* @__PURE__ */J(c,{rejections:q.rejections})]})}function Ve({committedUrl:e,committedHasAlpha:t=null,committedIsLight:a=null,fallbackUrl:n,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:s,assetName:o,onSave:c,onRemove:d,accept:h="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:m="PNG · ICO · SVG · JPG · WEBP",maxBytes:p=5242880,previews:g=[],disabled:f=!1}){const x=I(null),[b,y]=W(null),[v,w]=W(""),[k,N]=W(""),[M,C]=W(!1),[L,D]=W(!1),j=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(o),z=$().brandAsset,P=v||e||n||"",S=b?null:e?t:l,A=b?null:e?a:i;R(()=>()=>{x.current&&URL.revokeObjectURL(x.current)},[]);const F=()=>{x.current&&(URL.revokeObjectURL(x.current),x.current=null)};/* @__PURE__ */
|
|
43
43
|
return X("section",{"aria-label":z.region(o,s),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
44
44
|
/* @__PURE__ */X("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
@@ -58,8 +58,8 @@ return X("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white
|
|
|
58
58
|
/* @__PURE__ */X("div",{className:"min-w-0 leading-tight",children:[
|
|
59
59
|
/* @__PURE__ */J("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??s}),e.url&&/* @__PURE__ */J("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
|
|
60
60
|
/* @__PURE__ */J("div",{className:"mt-1.5 text-sm font-medium text-blue-700",children:e.title??s}),e.description&&/* @__PURE__ */J("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */X("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__ */J("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function
|
|
62
|
-
return J(
|
|
61
|
+
/* @__PURE__ */J("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function Ge(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 Ze=O(null);function Je(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 Xe({load:e,fallback:t,documentTitle:r,children:a}){const[n,l]=W(t),[i,s]=W(!0),[o,c]=W(null),d=I(e),u=I(t);d.current=e,u.current=t,R(()=>{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()}},[]),R(()=>(Je(n.favicon_url),()=>Je(null)),[n.favicon_url]),R(()=>{r&&(document.title=r(n))},[n,r]);const h=Y(()=>({branding:n,loading:i,error:o}),[n,i,o]);/* @__PURE__ */
|
|
62
|
+
return J(Ze.Provider,{value:h,children:a})}function Qe(){const e=U(Ze);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var et=/* @__PURE__ */J("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */J("path",{d:"M6 6l12 12M18 6L6 18"})});function tt({items:e,onPick:t,onFiles:r,onRemove:a,onReorder:n,label:l,hint:i,error:o,required:d,className:u,accept:h="image/*",maxSizeBytes:m,maxFiles:p,fit:g="cover",thumbSize:f=96,placeholder:x,cta:b,acceptHint:y,showCover:v=!1,coverLabel:w,busy:k=!1,busyLabel:N,disabled:M=!1,readOnly:C=!1}){const L=$().media,D=b??L.cta,j=w??L.cover,z=N??L.uploading,P=E(),[S,A]=W(null),F=M||k,B=!(!t&&!r||F||C),T=!!a&&!F&&!C,I=!!n&&!F&&!C,R=Re(F),O=x??Ie(h,L),Y=s({accept:h,maxSizeBytes:m,maxFiles:p,acceptHint:y,multiple:!0,disabled:!B,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),_=Y.dragOver,H=()=>{B&&(t?t():Y.open())},q={width:f,height:f},U=B&&/* @__PURE__ */X("button",{type:"button",onClick:()=>H(),"aria-label":L.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 ${R}`,style:q,children:[
|
|
63
63
|
/* @__PURE__ */J(Ue,{className:"h-5 w-5"}),
|
|
64
64
|
/* @__PURE__ */J("span",{className:"text-xs font-medium text-gray-500",children:L.add})]}),K=B?/* @__PURE__ */X("button",{type:"button",onClick:()=>H(),"aria-label":"string"==typeof O?O:L.upload,className:Ee(_,!1,R),style:{minHeight:f+32},children:[
|
|
65
65
|
/* @__PURE__ */J("span",{className:"text-gray-400",children:/* @__PURE__ */J(Ue,{})}),
|
|
@@ -80,7 +80,7 @@ return X("div",{className:h,children:[
|
|
|
80
80
|
/* @__PURE__ */X("div",{ref:z,role:"grid","aria-label":K,onKeyDown:e=>{const t=xt(H)??g??L,r={ArrowLeft:()=>vt(t,-1),ArrowRight:()=>vt(t,1),ArrowUp:()=>vt(t,-7),ArrowDown:()=>vt(t,7),Home:()=>vt(t,-(t.getDay()-v+7)%7),End:()=>vt(t,6-(t.getDay()-v+7)%7),PageUp:()=>wt(t,e.shiftKey?-12:-1),PageDown:()=>wt(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),n=r[e.key](),P.current=!0,j(ft(n)),void(bt(n)!==C&&U(n));var n;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T(H)||a(H))},hidden:"days"!==S,children:[
|
|
81
81
|
/* @__PURE__ */J("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+v)%7).map(e=>
|
|
82
82
|
/* @__PURE__ */J("div",{role:"columnheader","aria-label":b.weekdays[e],className:"py-1",children:/* @__PURE__ */J("abbr",{title:b.weekdays[e],className:"no-underline",children:b.weekdaysShort[e]})},e))}),Array.from({length:6},(n,l)=>/* @__PURE__ */J("div",{role:"row",className:"grid grid-cols-7 text-center text-sm",children:B.slice(7*l,7*l+7).map(n=>{const l=ft(n),i=n.getMonth()!==L.getMonth(),s=l===e||"range"===r&&l===t,o=(a=>!("range"!==r||!e||!t)&&a>e&&a<t)(l),c=T(l);/* @__PURE__ */
|
|
83
|
-
return J("div",{role:"gridcell","aria-selected":s,children:/* @__PURE__ */J("button",{type:"button","data-active":l===H,tabIndex:l===H?0:-1,disabled:c,"aria-label":b.longDate(n.getFullYear(),n.getMonth(),n.getDate()),"aria-current":l===p?"date":void 0,onClick:()=>{j(l),a(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-
|
|
83
|
+
return J("div",{role:"gridcell","aria-selected":s,children:/* @__PURE__ */J("button",{type:"button","data-active":l===H,tabIndex:l===H?0:-1,disabled:c,"aria-label":b.longDate(n.getFullYear(),n.getMonth(),n.getDate()),"aria-current":l===p?"date":void 0,onClick:()=>{j(l),a(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:n.getDate()})},l)})},l))]})]})}var Nt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Mt=e=>`${e.getFullYear()}-${$t(e.getMonth()+1)}`,$t=e=>String(e).padStart(2,"0");function Ct(e){return`${e.getFullYear()}-${$t(e.getMonth()+1)}-${$t(e.getDate())}`}function Lt(e,t){const r=t.getFullYear(),a=t.getMonth(),n=new Date(r,a,t.getDate()),l=new Date(r,a,0),i=e=>new Date(r,a-e,1);switch(e){case"last2Weeks":return{from:Ct(new Date(r,a,t.getDate()-14)),to:Ct(n)};case"lastMonth":return{from:Ct(i(1)),to:Ct(l)};case"last3Months":return{from:Ct(i(3)),to:Ct(l)};case"last6Months":return{from:Ct(i(6)),to:Ct(l)};case"last12Months":return{from:Ct(i(12)),to:Ct(l)}}}function Dt(e,t,r){const a=Mt(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function jt(e){const[t,r,a]=e.split("-").map(Number);return new Date(t,r-1,a)}function zt(e){const[t,r,a]=e.split("-");return t&&r&&a?`${a}/${r}/${t}`:e}var Pt=/* @__PURE__ */new Map;function St({from:e,to:t,onChange:r,formatDisplay:a,clearable:n,required:l=!1,name:i,id:s,"aria-labelledby":o,"aria-label":c,weekStartsOn:d,placeholder:u,fullWidth:h=!1,min:m,max:p}){const g=$().dateRange,f=M(),y=a??(f?function(e){let t=Pt.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Pt.set(e,t));const r=t;return e=>{const[t,a,n]=e.split("-").map(Number);return t&&a&&n?r.format(new Date(Date.UTC(t,a-1,n))):e}}(f):zt),v=u??g.placeholder,w=n??!l,[N,C]=W(!1),[L,D]=W(e),[j,z]=W(t),[P,A]=W(null),F=I(null),B=I(null),T=I(null),O=E(),Y=E(),_=E(),[H,q]=W(!1),U=be(F,N,{preferredMaxWidth:520,preferredMaxHeight:H?720:560,popupRef:T}),K=I(null),V=I(null);S(()=>{const e=T.current;if(!N||!U||!e)return;const t=getComputedStyle(e),r=U.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(H)null!==V.current&&V.current<=r&&q(!1);else{const e=K.current?.offsetWidth??0;if(0===e)return;V.current=e,e>r+.5&&q(!0)}});const[G,Z]=W(!1);S(()=>{const e=!!s&&(B.current?.labels?.length??0)>0;e!==G&&Z(e)});const te=!!c||!!o||G,re=/* @__PURE__ */new Date,[ae,ne]=W(()=>e?Mt(jt(e)):Dt(re,m,p)),le=Nt.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(Lt(e,re),m,p)),ie=e=>e?y(e):"";R(()=>{if(!N)return;const e=e=>{const t=e.target;F.current?.contains(t)||T.current?.contains(t)||C(!1)};document.addEventListener("mousedown",e);const t=x(()=>C(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[N]);const se=()=>{r("",""),C(!1)},oe=e&&t?`${ie(e)} — ${ie(t)}`:e?g.fromOnly(ie(e)):t?g.toOnly(ie(t)):"",ce=ht(f),de=e=>{const t=xt(e);return t?ce.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},ue=e&&t?g.range(de(e),de(t)):e?g.fromOnly(de(e)):t?g.toOnly(de(t)):v,he=e=>H?"rounded-md border px-2.5 py-1 text-sm transition-colors "+(P===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 "+(P===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),me=/* @__PURE__ */X(Q,{children:[le.map(e=>/* @__PURE__ */J("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=Lt(e,re);D(t.from),z(t.to),A(e),ne(t.from.slice(0,7))})(e),className:he(e),children:g[e]},e)),
|
|
84
84
|
/* @__PURE__ */J("button",{type:"button",onClick:()=>A("Custom"),className:he("Custom"),children:g.custom})]}),pe=
|
|
85
85
|
/* @__PURE__ */J(kt,{mode:"range",min:m,max:p,value:L||null,endValue:j||null,month:ae,onMonthChange:ne,onSelect:e=>{A("Custom"),!L||L&&j?(D(e),z("")):e<L?(z(L),D(e)):z(e)},weekStartsOn:d,"aria-label":g.dialog});/* @__PURE__ */
|
|
86
86
|
return X("div",{className:"relative"+(h?" w-full":""),ref:F,children:[
|
|
@@ -104,18 +104,18 @@ return X("div",{className:"relative"+(h?" w-full":""),ref:F,children:[
|
|
|
104
104
|
/* @__PURE__ */X("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[w&&/* @__PURE__ */J("button",{type:"button",onClick:se,className:"px-3 py-1.5 text-sm text-gray-500 hover:text-gray-700",children:g.clear}),
|
|
105
105
|
/* @__PURE__ */J("button",{type:"button",onClick:()=>C(!1),className:"px-3 py-1.5 text-sm text-gray-600 border border-gray-300 rounded-md hover:bg-gray-50",children:g.cancel}),
|
|
106
106
|
/* @__PURE__ */J("button",{type:"button",onClick:()=>{r(L,j),C(!1)},disabled:!L||!j,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:g.apply})]})]}),document.body)]})}var At=/^\d{2}:\d{2}(:\d{2})?$/,Ft=e=>String(e).padStart(2,"0");function Bt(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Ft(e.getHours())}:${Ft(e.getMinutes())}`;return t?`${r}:${Ft(e.getSeconds())}`:r}return At.test(e)?e:""}var Tt=B(function({value:e,onChange:t,min:r,max:a,invalid:n,size:l,className:i="",step:s,...o},c){const d=null!=s&&Number(s)<60,u=M();/* @__PURE__ */
|
|
107
|
-
return J("input",{ref:c,type:"time",lang:u,step:s,"aria-invalid":n||void 0,value:Bt(e,d),min:Bt(r,d)||void 0,max:Bt(a,d)||void 0,onChange:e=>t?.(At.test(e.target.value)?e.target.value:null),className:se({invalid:n,size:l,className:i}),...o})}),Wt=/^\d{4}-\d{2}-\d{2}$/,It=/^(aria|data)-/,Et=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function Rt(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Ct(e);if(Wt.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Ct(t)}function Ot(e){if(!Wt.test(e))return null;const[t,r,a]=e.split("-").map(Number),n=new Date(t,r-1,a);return n.getMonth()===r-1&&n.getDate()===a?n:null}function Yt(e,t){const r=Ot(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var _t=B(function({value:e,onChange:t,min:r,max:a,invalid:n,size:l,native:i,weekStartsOn:s,className:o="","aria-label":c,"aria-describedby":d,"aria-labelledby":u,id:h,name:m,disabled:p,placeholder:g,required:y,clearable:v,form:w,title:k,tabIndex:N,autoFocus:C,onFocus:L,onBlur:D,...j},z){const P=v??!y,A=Rt(e),F=Rt(r),B=Rt(a),T=$().datePicker,O=M(),Y=ht(O),[_,H]=W(!1),q=I(null),U=I(null),K=I(null),V=E(),
|
|
108
|
-
return J("input",{ref:z,type:"date",lang:O,id:h,name:m,disabled:p,"aria-label":c,"aria-describedby":d,"aria-invalid":n||void 0,value:A,min:F||void 0,max:B||void 0,onChange:e=>t?.(Ot(e.target.value)),className:se({invalid:n,size:l,className:o}),"aria-labelledby":u,required:y,form:w,title:k,tabIndex:N,autoFocus:C,onFocus:L,onBlur:D,...j});const ne=Object.fromEntries(Object.entries(j).filter(([e])=>It.test(e)&&!Et.has(e))),le=j["aria-required"],ie=!!y||!0===le||"true"===le,oe=[ae?
|
|
107
|
+
return J("input",{ref:c,type:"time",lang:u,step:s,"aria-invalid":n||void 0,value:Bt(e,d),min:Bt(r,d)||void 0,max:Bt(a,d)||void 0,onChange:e=>t?.(At.test(e.target.value)?e.target.value:null),className:se({invalid:n,size:l,className:i}),...o})}),Wt=/^\d{4}-\d{2}-\d{2}$/,It=/^(aria|data)-/,Et=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function Rt(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Ct(e);if(Wt.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Ct(t)}function Ot(e){if(!Wt.test(e))return null;const[t,r,a]=e.split("-").map(Number),n=new Date(t,r-1,a);return n.getMonth()===r-1&&n.getDate()===a?n:null}function Yt(e,t){const r=Ot(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var _t=B(function({value:e,onChange:t,min:r,max:a,invalid:n,size:l,native:i,weekStartsOn:s,className:o="","aria-label":c,"aria-describedby":d,"aria-labelledby":u,id:h,name:m,disabled:p,placeholder:g,required:y,clearable:v,form:w,title:k,tabIndex:N,autoFocus:C,onFocus:L,onBlur:D,...j},z){const P=v??!y,A=Rt(e),F=Rt(r),B=Rt(a),T=$().datePicker,O=M(),Y=ht(O),[_,H]=W(!1),q=I(null),U=I(null),K=I(null),V=E(),G=E(),Z=E(),Q=be(U,_,{popupRef:K}),[te,re]=W(!1);S(()=>{const e=!!h&&(U.current?.labels?.length??0)>0;e!==te&&re(e)});const ae=!c&&(!!u||te);if(R(()=>{if(!_)return;const e=e=>{const t=e.target;q.current?.contains(t)||K.current?.contains(t)||H(!1)};document.addEventListener("pointerdown",e,!0);const t=x(()=>H(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[_]),R(()=>{if(_)return f(e=>"Escape"===e.key&&(H(!1),U.current?.focus(),!0))},[_]),i)/* @__PURE__ */
|
|
108
|
+
return J("input",{ref:z,type:"date",lang:O,id:h,name:m,disabled:p,"aria-label":c,"aria-describedby":d,"aria-invalid":n||void 0,value:A,min:F||void 0,max:B||void 0,onChange:e=>t?.(Ot(e.target.value)),className:se({invalid:n,size:l,className:o}),"aria-labelledby":u,required:y,form:w,title:k,tabIndex:N,autoFocus:C,onFocus:L,onBlur:D,...j});const ne=Object.fromEntries(Object.entries(j).filter(([e])=>It.test(e)&&!Et.has(e))),le=j["aria-required"],ie=!!y||!0===le||"true"===le,oe=[ae?G:void 0,ie?Z:void 0,d].filter(Boolean).join(" ")||void 0,ce=Ct(/* @__PURE__ */new Date),de=(!F||ce>=F)&&(!B||ce<=B),ue=g??T.placeholder;/* @__PURE__ */
|
|
109
109
|
return X("div",{ref:q,className:"relative",children:[
|
|
110
110
|
/* @__PURE__ */J("input",{ref:z,type:"hidden",name:m,form:w,value:A}),
|
|
111
111
|
/* @__PURE__ */X("button",{ref:U,type:"button",...ne,id:h,disabled:p,title:k,tabIndex:N,autoFocus:C,onFocus:L,onBlur:D,"aria-haspopup":"dialog","aria-expanded":_,"aria-controls":_?V:void 0,"aria-labelledby":u,"aria-describedby":oe,"aria-label":c?`${c}${A?`, ${Yt(A,Y)}`:""}`:void 0,onClick:()=>H(e=>!e),className:`${se({invalid:n,size:l,className:o})} flex items-center justify-between text-left`,children:[
|
|
112
112
|
/* @__PURE__ */J("span",{className:A?"text-gray-900":"text-gray-400",children:A?Yt(A,Y):ue}),
|
|
113
|
-
/* @__PURE__ */J("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__ */J("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"})})]}),ae&&/* @__PURE__ */J("span",{id:
|
|
113
|
+
/* @__PURE__ */J("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__ */J("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"})})]}),ae&&/* @__PURE__ */J("span",{id:G,className:"sr-only",children:A?Yt(A,Y):ue}),ie&&/* @__PURE__ */J("span",{id:Z,className:"sr-only",children:T.required}),_&&ee(
|
|
114
114
|
/* @__PURE__ */X("div",{ref:K,id:V,role:"dialog","aria-label":c??T.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:b.popup,left:Q?.left,right:Q?.right,top:Q?.top,bottom:Q?.bottom,maxWidth:Q?.maxWidth,visibility:Q?void 0:"hidden"},children:[
|
|
115
115
|
/* @__PURE__ */J(kt,{value:A||null,min:F||null,max:B||null,weekStartsOn:s,onSelect:e=>{H(!1),U.current?.focus(),t?.(Ot(e))}}),(P||de)&&/* @__PURE__ */X("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[P&&/* @__PURE__ */J("button",{type:"button",onClick:()=>{H(!1),U.current?.focus(),t?.(null)},className:"rounded-md px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:T.clear}),de&&/* @__PURE__ */J("button",{type:"button",onClick:()=>{H(!1),U.current?.focus(),t?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-md px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:T.today})]})]}),document.body)]})}),Ht=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,qt=e=>String(e).padStart(2,"0");function Ut(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${qt(t.getMonth()+1)}-${qt(t.getDate())}T${qt(t.getHours())}:${qt(t.getMinutes())}`:Ht.test(e)?e:"";var t}var Kt=B(function({value:e,onChange:t,min:r,max:a,invalid:n,size:l,className:i="",...s},o){const c=M();/* @__PURE__ */
|
|
116
|
-
return J("input",{ref:o,type:"datetime-local",lang:c,"aria-invalid":n||void 0,value:Ut(e),min:Ut(r)||void 0,max:Ut(a)||void 0,onChange:e=>t?.(function(e){if(!Ht.test(e))return null;const[t,r]=e.split("T"),[a,n,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(a,n-1,l,i,s,o);return c.getMonth()===n-1&&c.getDate()===l?c:null}(e.target.value)),className:se({invalid:n,size:l,className:i}),...s})});function Vt(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 a=0;a<t.rangeCount&&!e;a++)e=t.getRangeAt(a).intersectsNode(r);if(!e)return null}const a=t.toString();if(!a.trim())return null;const n=document.createElement("div");for(let e=0;e<t.rangeCount;e++)n.appendChild(t.getRangeAt(e).cloneContents());return{text:a,html:n.innerHTML}}async function
|
|
116
|
+
return J("input",{ref:o,type:"datetime-local",lang:c,"aria-invalid":n||void 0,value:Ut(e),min:Ut(r)||void 0,max:Ut(a)||void 0,onChange:e=>t?.(function(e){if(!Ht.test(e))return null;const[t,r]=e.split("T"),[a,n,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(a,n-1,l,i,s,o);return c.getMonth()===n-1&&c.getDate()===l?c:null}(e.target.value)),className:se({invalid:n,size:l,className:i}),...s})});function Vt(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 a=0;a<t.rangeCount&&!e;a++)e=t.getRangeAt(a).intersectsNode(r);if(!e)return null}const a=t.toString();if(!a.trim())return null;const n=document.createElement("div");for(let e=0;e<t.rangeCount;e++)n.appendChild(t.getRangeAt(e).cloneContents());return{text:a,html:n.innerHTML}}async function Gt(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()},a=document.createElement("textarea");a.value=e,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.addEventListener("copy",r);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",r),a.remove()}}async function Zt(e,t,r){const n=await Gt(t,r),l=L().copy;return n?a.success(l.copiedLabel(e)):a.error(l.failed),n}var Jt={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},Xt={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 Qt(){/* @__PURE__ */
|
|
117
117
|
return J("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */J("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 er(){/* @__PURE__ */
|
|
118
|
-
return J("svg",{className:"h-4 w-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function tr({value:e,children:t,symbol:r,label:n,size:l="md",variant:i="bordered",hideCopyButton:s=!1,onCopy:o,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=W(!1),g=I(null),f=$().copy;R(()=>()=>{g.current&&clearTimeout(g.current)},[]);const x=T(async()=>{await
|
|
118
|
+
return J("svg",{className:"h-4 w-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function tr({value:e,children:t,symbol:r,label:n,size:l="md",variant:i="bordered",hideCopyButton:s=!1,onCopy:o,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=W(!1),g=I(null),f=$().copy;R(()=>()=>{g.current&&clearTimeout(g.current)},[]);const x=T(async()=>{await Gt(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),o?.(e)):a.error(f.failed)},[e,o,f]),{box:b,button:y}=Xt[l],v=!s;/* @__PURE__ */
|
|
119
119
|
return X("div",{id:v?void 0:d,"aria-describedby":v?void 0:u,className:["inline-flex max-w-full items-center rounded-md",Jt[i],b,h].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
|
|
120
120
|
/* @__PURE__ */J("span",{className:"min-w-0 font-mono text-gray-800 "+(c?"whitespace-pre-wrap break-all":"truncate"),title:c?void 0:e,children:t??e}),!s&&/* @__PURE__ */X(Q,{children:[
|
|
121
121
|
/* @__PURE__ */J(te,{id:d,"aria-label":n?f.copyLabel(n):f.copy,"aria-describedby":u,onClick:x,className:`${y} text-gray-400`,children:/* @__PURE__ */J(m?er:Qt,{})}),
|
|
@@ -123,12 +123,12 @@ return X("div",{id:v?void 0:d,"aria-describedby":v?void 0:u,className:["inline-f
|
|
|
123
123
|
return X("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[lr.map(t=>/* @__PURE__ */J(u,{size:"touch-xl",variant:"secondary",onClick:()=>s(ar(e,t)),children:t},t)),
|
|
124
124
|
/* @__PURE__ */J(u,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>s(nr(e)),children:"⌫"}),r&&/* @__PURE__ */J(u,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:n,onClick:r,children:a??i.enter})]})}var sr={md:"h-24 p-3",lg:"h-32 p-4"},or=B(function({title:e,subtitle:t,size:r="lg",selected:a=!1,disabled:n,type:l="button",className:i="",...s},o){/* @__PURE__ */
|
|
125
125
|
return X("button",{ref:o,type:l,disabled:n,"aria-pressed":a||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",a?"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)]",sr[r],i].filter(Boolean).join(" "),...s,children:[
|
|
126
|
-
/* @__PURE__ */J("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */J("span",{className:"text-sm text-gray-500",children:t})]})}),cr={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},dr="bg-white text-gray-900 shadow-sm rosh-segmented-on",ur="text-gray-600 hover:text-gray-900";function hr({value:e,onChange:t,options:r,name:a,size:n="md",block:l=!1,label:i,className:s=""}){const o=E(),
|
|
127
|
-
return J("div",a?{role:"radiogroup",
|
|
126
|
+
/* @__PURE__ */J("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */J("span",{className:"text-sm text-gray-500",children:t})]})}),cr={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},dr="bg-white text-gray-900 shadow-sm rosh-segmented-on",ur="text-gray-600 hover:text-gray-900";function hr({value:e,onChange:t,options:r,name:a,size:n="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=E(),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 J("div",a?{role:"radiogroup",...d,className:h,children:r.map(r=>{const l=`${u}-${r.value}`,i=r.value===e;
|
|
128
128
|
/* @__PURE__ */
|
|
129
|
-
return X("label",{htmlFor:l,className:[
|
|
130
|
-
/* @__PURE__ */J("input",{id:l,type:"radio",name:a,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",
|
|
131
|
-
return X("button",{type:"button","aria-pressed":a,disabled:r.disabled,onClick:()=>t(r.value),className:[
|
|
129
|
+
return X("label",{htmlFor:l,title:r.title,className:[m,"relative",cr[n],i?dr:ur,r.disabled?"cursor-not-allowed opacity-40":"cursor-pointer"].join(" "),children:[
|
|
130
|
+
/* @__PURE__ */J("input",{id:l,type:"radio",name:a,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 a=r.value===e;/* @__PURE__ */
|
|
131
|
+
return X("button",{type:"button",title:r.title,"aria-pressed":a,disabled:r.disabled,onClick:()=>t(r.value),className:[m,cr[n],a?dr:ur,"disabled:cursor-not-allowed disabled:opacity-40"].join(" "),children:[r.icon,r.label]},r.value)})})}var mr={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},pr={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},gr={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},fr=B(function({checked:e,onChange:t,disabled:r=!1,size:a="md",label:n,hint:l,id:i,className:s="",disabledReason:o,disabledReasonId:c,...d},u){const h=E(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=o&&""!==o,x=f?`${m}-reason`:void 0,b=[p,g??x].filter(Boolean).join(" ")||void 0,y=/* @__PURE__ */J("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":b,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",mr[a],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */J("span",{className:["inline-block rounded-full bg-white shadow transition-transform",pr[a],e?gr[a]:"translate-x-0"].join(" ")})});return n||l||f?/* @__PURE__ */X("span",{className:`flex items-start gap-3 ${s}`.trim(),children:[y,
|
|
132
132
|
/* @__PURE__ */X("span",{className:"min-w-0",children:[n&&/* @__PURE__ */J("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:n}),l&&/* @__PURE__ */J("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */J("span",{id:x,className:"mt-0.5 block text-xs text-red-600",children:o})]})]}):/* @__PURE__ */J("span",{className:s,children:y})}),xr=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function br(e){const t=e.trim();if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}var yr=B(function({value:e,onChange:t,min:r,max:a,precision:n,step:l,disabled:i,invalid:s,placeholder:o,size:c,prefix:d,suffix:u,id:h,name:m,className:p="",onBlur:g},f){const[x,b]=W(()=>xr(e,n)),y=I(x);y.current=x,R(()=>{br(y.current)!==e&&b(xr(e,n))},[e,n]);const v=/* @__PURE__ */J("input",{ref:f,id:h,name:m,type:"text",inputMode:0===n?"numeric":"decimal",value:x,disabled:i,placeholder:o,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":a,"aria-valuetext":null==e?void 0:xr(e,n),"aria-invalid":s||void 0,onChange:e=>{var r;(""===(r=e.target.value)||/^-?\d*\.?\d*$/.test(r))&&(b(r),t(br(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=(br(y.current)??0)+e;null!=r&&i<r&&(i=r),null!=a&&i>a&&(i=a);const s=n??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(s)),b(xr(i,n)),t(i)})(o))},onBlur:()=>{const e=br(x);if(null==e)b(""),t(null);else{let l=e;null!=r&&l<r&&(l=r),null!=a&&l>a&&(l=a),null!=n&&(l=Number(l.toFixed(n))),b(xr(l,n)),l!==e&&t(l)}g?.()},className:se({invalid:s,size:c,className:[d?"pl-7":"",u?"pr-9":"","text-right tabular-nums",p].filter(Boolean).join(" ")})});return d||u?/* @__PURE__ */X("div",{className:"relative",children:[d&&/* @__PURE__ */J("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:d}),v,u&&/* @__PURE__ */J("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:u})]}):v}),vr=B(function({files:e,onChange:t,accept:r,acceptHint:a,multiple:n=!0,maxSizeBytes:l,maxFiles:i,disabled:d=!1,label:u,hint:h,error:m,required:p,className:g=""},f){const x=E(),b=$().files,y=s({accept:r,acceptHint:a,maxSizeBytes:l,maxFiles:i,multiple:n,disabled:d,currentCount:e.length,onAccept:r=>t(n?[...e,...r]:r.slice(0,1))}),v=m?`${x}-error`:h?`${x}-hint`:void 0;/* @__PURE__ */
|
|
133
133
|
return X(ze,{label:u,htmlFor:x,hint:h,error:m,required:p,className:g,children:[
|
|
134
134
|
/* @__PURE__ */X("button",{ref:f,type:"button",id:x,disabled:d,onClick:y.open,"aria-invalid":!!m||void 0,"aria-required":p||void 0,"aria-describedby":v,...y.zoneProps,className:Ee(y.dragOver,d,`px-4 py-6 ${Re(d)}`),children:[
|
|
@@ -178,11 +178,11 @@ return J(`h${t}`,{className:[Wr[t],Ar[r],a].filter(Boolean).join(" "),children:e
|
|
|
178
178
|
return J("p",{className:[Ar[t],Fr[r],"mb-2 last:mb-0",a].filter(Boolean).join(" "),children:e})}var Rr={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},Or={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Yr={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function _r({children:e,gap:t=4,align:r,justify:a,className:n=""}){/* @__PURE__ */
|
|
179
179
|
return J("div",{className:["flex flex-col",Rr[t],r?Or[r]:"",a?Yr[a]:"",n].filter(Boolean).join(" "),children:e})}function Hr({children:e,gap:t=2,align:r="center",justify:a,wrap:n=!0,className:l=""}){/* @__PURE__ */
|
|
180
180
|
return J("div",{className:["flex",n?"flex-wrap":"",Rr[t],Or[r],a?Yr[a]:"",l].filter(Boolean).join(" "),children:e})}var qr={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Ur={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"},Kr={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 Vr({children:e,cols:t=1,smCols:r,lgCols:a,gap:n=4,className:l=""}){/* @__PURE__ */
|
|
181
|
-
return J("div",{className:["grid",qr[t],r?Ur[r]:"",a?Kr[a]:"",Rr[n],l].filter(Boolean).join(" "),children:e})}var
|
|
181
|
+
return J("div",{className:["grid",qr[t],r?Ur[r]:"",a?Kr[a]:"",Rr[n],l].filter(Boolean).join(" "),children:e})}var Gr={sm:"my-2",md:"my-4",lg:"my-6"};function Zr({orientation:e="horizontal",children:t,align:r="center",spacing:a="md",className:n=""}){const l=E();if("vertical"===e)/* @__PURE__ */
|
|
182
182
|
return J("span",{role:"presentation",className:`inline-block h-full min-h-[1em] w-px shrink-0 self-stretch bg-gray-200 ${n}`.trim()});if(!t)/* @__PURE__ */
|
|
183
|
-
return J("hr",{className:`border-0 border-t border-gray-200 ${
|
|
183
|
+
return J("hr",{className:`border-0 border-t border-gray-200 ${Gr[a]} ${n}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",s="right"===r?"w-4 shrink-0":"flex-1";
|
|
184
184
|
/* @__PURE__ */
|
|
185
|
-
return X("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${
|
|
185
|
+
return X("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${Gr[a]} ${n}`.trim(),children:[
|
|
186
186
|
/* @__PURE__ */J("span",{"aria-hidden":"true",className:`${i} border-t border-gray-200`}),
|
|
187
187
|
/* @__PURE__ */J("span",{id:l,className:"shrink-0 text-xs font-medium text-gray-500",children:t}),
|
|
188
188
|
/* @__PURE__ */J("span",{"aria-hidden":"true",className:`${s} border-t border-gray-200`})]})}var Jr={text:"rounded",rect:"rounded-md",circle:"rounded-full"},Xr=e=>"number"==typeof e?`${e}px`:e;function Qr({variant:e="text",width:t,height:r,lines:a=1,className:n=""}){const l=`animate-pulse bg-gray-200 ${Jr[e]} ${n}`.trim();if("circle"===e){const e=Xr(r??t)??"2.5rem";/* @__PURE__ */
|
|
@@ -204,10 +204,12 @@ return X("div",{className:`flex items-center ${a}`.trim(),children:[l.map((e,t)=
|
|
|
204
204
|
return J("svg",{...t,children:/* @__PURE__ */J("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__ */
|
|
205
205
|
return J("svg",{...t,children:/* @__PURE__ */J("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__ */
|
|
206
206
|
return J("svg",{...t,children:/* @__PURE__ */J("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__ */
|
|
207
|
-
return J("svg",{...t,children:/* @__PURE__ */J("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 ya({tone:e="info",emphasis:t="subtle",title:r,children:a,icon:n,action:l,onDismiss:i,sticky:s=!1,className:o=""}){const c=fa[e],d="solid"===t,u=$().banner,h=d?xa[e]:c.box;/* @__PURE__ */
|
|
208
|
-
return X("div",{role:"danger"===e?"alert":"status",className:`${
|
|
209
|
-
/* @__PURE__ */J("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:n??/* @__PURE__ */J(ba,{tone:e})}),
|
|
210
|
-
/* @__PURE__ */X("div",{className:"
|
|
207
|
+
return J("svg",{...t,children:/* @__PURE__ */J("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 ya({tone:e="info",emphasis:t="subtle",title:r,children:a,icon:n,action:l,onDismiss:i,sticky:s=!1,className:o=""}){const c=fa[e],d="solid"===t,u=$().banner,h=d?xa[e]:c.box,m=s?"sticky top-0 z-30":"",p=/* @__PURE__ */X(Q,{children:[r&&/* @__PURE__ */J("div",{className:("font-semibold "+(d?"":"text-gray-900")).trim(),children:r}),a&&/* @__PURE__ */J("div",{className:`${d?"":"text-gray-700"} ${r?"mt-0.5":""}`.trim(),children:a})]});/* @__PURE__ */
|
|
208
|
+
return X("div",{role:"danger"===e?"alert":"status",className:`${m} flex items-start gap-3 rounded-lg border px-4 py-3 ${h} ${o}`.trim(),children:[
|
|
209
|
+
/* @__PURE__ */J("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:n??/* @__PURE__ */J(ba,{tone:e})}),null==l?/* @__PURE__ */J("div",{className:"min-w-0 flex-1 text-sm",children:p}):
|
|
210
|
+
/* @__PURE__ */X("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
|
|
211
|
+
/* @__PURE__ */J("div",{className:"min-w-0 grow basis-48 text-sm",children:p}),
|
|
212
|
+
/* @__PURE__ */J("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */J("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__ */J("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */J("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})}var va=(e,t)=>`${e}-tab-${t}`,wa=(e,t)=>`${e}-panel-${t}`,ka={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 Na(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 Ma({items:e,value:t,onChange:r,variant:a="underline",idPrefix:n,className:l="","aria-label":i,"aria-labelledby":s}){const o=I([]),c=(t,r)=>{for(let a=1;a<=e.length;a+=1){const n=((t+r*a)%e.length+e.length)%e.length;if(!e[n]?.disabled)return n}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__ */
|
|
211
213
|
return J("div",{role:"tablist","aria-label":i,"aria-labelledby":s,onKeyDown:a=>{const n=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===a.key||"ArrowDown"===a.key)l=c(n,1);else if("ArrowLeft"===a.key||"ArrowUp"===a.key)l=c(n,-1);else if("Home"===a.key)l=d(1);else{if("End"!==a.key)return;l=d(-1)}a.preventDefault(),null!==l&&l!==n&&(r(e[l].id),o.current[l]?.focus())},className:`${ka[a]} ${l}`.trim(),children:e.map((e,l)=>{const i=e.id===t;/* @__PURE__ */
|
|
212
214
|
return X("button",{ref:e=>{o.current[l]=e},type:"button",role:"tab",id:n?va(n,e.id):void 0,"aria-controls":n?wa(n,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:Na(a,i),children:[e.icon&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e.icon}),e.label]},e.id)})})}var $a=()=>/* @__PURE__ */J("svg",{viewBox:"0 0 12 12",fill:"none",className:"h-3.5 w-3.5","aria-hidden":"true",children:/* @__PURE__ */J("path",{d:"M2.5 6.5L5 9l4.5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})});function Ca({items:e,value:t,onChange:r,"aria-label":a,className:n=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
|
|
213
215
|
return J("ol",{"aria-label":a,className:`grid items-start ${n}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,a)=>{const n=a<l?"complete":a===l?"current":"upcoming",i="complete"===n&&!!r,s=/* @__PURE__ */J("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"===n?"bg-blue-600 text-white":"","current"===n?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===n?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===n?/* @__PURE__ */J($a,{}):a+1}),o=/* @__PURE__ */X("span",{className:"min-w-0 text-center",children:[
|
|
@@ -237,7 +239,7 @@ return X("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */J("div",{
|
|
|
237
239
|
/* @__PURE__ */J("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:null!=g?i:p})]}),A]}:{className:u,children:[
|
|
238
240
|
/* @__PURE__ */X("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */J("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
239
241
|
/* @__PURE__ */J("span",{className:`text-sm font-semibold tabular-nums ${F}`,children:L}),
|
|
240
|
-
/* @__PURE__ */J("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:null!=g?i:p})]}),A]})}function
|
|
242
|
+
/* @__PURE__ */J("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:null!=g?i:p})]}),A]})}function Ga(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function Za(e,t){const r=Ga(e);if(null==r)return"no-reading";const a=Ga(t);return null==a||0===a?"no-budget":r>a?"over":"within"}var Ja=e=>Math.min(100,Math.max(0,e));function Xa({label:e,elapsed:t,budget:r,grace:a,detail:n,formatDuration:l,emptyLabel:i,noBudgetLabel:s,size:o="sm",ariaLabel:c,className:d=""}){const u=$().meter,h=M(),m=l??(e=>function(e,t=C.meter){const r=Math.round(e),a=Math.floor(r/3600),n=Math.floor(r%3600/60),l=r%60;return a>0?t.hoursMinutes(a,n):n>0?t.minutesSeconds(n,l):t.seconds(l)}(e,u)),p=i??u.noReading,g=s??u.noBudget,f=Ga(t),x=Ga(r),b=null!=x&&x>0?x:null,y=Ga(a)??0,v="over"===Za(t,r),w=null!=b?b+y:null,k=null!=b&&null!=w?Ja(b/w*100):null,N=v&&y>0,L=null==w||null==f?0:v?N?k??0:0:Ja(f/w*100),D=N?k??0:0,j=v?N&&null!=w&&null!=f?Ja(f/w*100):100:0,P=Math.max(0,j-D),S=null!=f&&null!=b?f/b*100:null,A=null!=S?z(Math.round(S),0,h):null!=f?m(f):"—",F=n??(null==f?p:null==b?g:`${m(f)} / ${m(b)}`),B="md"===o?"h-2":"h-1.5",T=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",W=null!=f&&null!=b&&null!=w?/* @__PURE__ */X("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(A),className:`relative mt-2 ${B} overflow-hidden rounded-full bg-gray-200`,children:[(!v||N)&&/* @__PURE__ */J("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${L}%`}}),P>0&&/* @__PURE__ */J("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${D}%`,width:`${P}%`}}),y>0&&null!=k&&/* @__PURE__ */J("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${k}%`}})]}):null;/* @__PURE__ */
|
|
241
243
|
return X("div","md"===o?{className:d,children:[null!=e&&/* @__PURE__ */J("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
242
244
|
/* @__PURE__ */X("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
243
245
|
/* @__PURE__ */J("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${T}`,children:A}),
|
|
@@ -279,7 +281,7 @@ return J("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:gn[e]})}functi
|
|
|
279
281
|
return X("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
|
|
280
282
|
/* @__PURE__ */J("path",{d:"M4.2 2.2v11.6"}),
|
|
281
283
|
/* @__PURE__ */J("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function bn(){/* @__PURE__ */
|
|
282
|
-
return J("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */J("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var yn=1e-6;function vn(e,t,r={}){const a=Number.isFinite(t)&&t>0?t:0,n=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(a<=0||n.length<2){const e=n[0]??0;return{anchorsMs:n,xs:n.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=n[n.length-1]-n[0],i=r.maxTimeShare??.3,s=Math.min(r.breakPx??48,a),o=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<n.length;e++){const t=n[e+1]-n[e];c.push(t),d.push(l>0?t/l*a:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,a-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),x=function(e,t,r){const a=e.slice();let n=0;for(let e=0;e<a.length;e++)t[e]||a[e]>=r-yn||(n+=r-a[e],a[e]=r);if(n<=yn)return a;let l=0;for(let e=0;e<a.length;e++)!t[e]&&a[e]>r+yn&&(l+=a[e]-r);if(l<=yn)return a;const i=Math.min(n,l);for(let e=0;e<a.length;e++)t[e]||a[e]<=r+yn||(a[e]-=i*(a[e]-r)/l);return a}(f,u,o),b=x.reduce((e,t,r)=>u[r]?e:e+t,0),y=x.map((e,t)=>u[t]?e:b>0?e*m/b:e),v=[0];for(let e=0;e<y.length;e++)v.push(v[e]+y[e]);v[v.length-1]=a;const w=v.slice(0,-1).map((e,t)=>({fromMs:n[t],toMs:n[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:n,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=n[0])return 0;if(e>=n[n.length-1])return a;for(let t=0;t+1<n.length;t++){if(e>n[t+1])continue;const r=n[t+1]-n[t],a=r>0?(e-n[t])/r:0;return v[t]+a*(v[t+1]-v[t])}return a},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),a);for(let e=0;e+1<n.length;e++){if(t>v[e+1]&&e+2<n.length)continue;const r=v[e+1]-v[e],a=r>0?(t-v[e])/r:0;return n[e]+a*(n[e+1]-n[e])}return n[n.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function wn(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var kn="mixed";function Nn(e,t){return 5.6*Math.max(e.length,t.length)+8}var Mn=(e,t,r)=>Math.min(Math.max(e,t),r),$n=e=>-(Math.cos(Math.PI*e)-1)/2;function Cn(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)*$n(t);return{px:r,ms:e.msByPx(r)}}var Ln={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 Dn(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var jn=e=>5.6*e.length,zn={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:{}},Pn={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function Sn(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:zn[t].glyph??(r?"flag":void 0)}function An(e,t,r=!1){const a=zn[e],n=["rosh-tl-node","rosh-tl-mark",`is-${t}`];a.diamond&&n.push("is-diamond"),r&&n.push("is-provisional");const l="current"===t?"var(--tl-accent)":a.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:n.join(" "),style:i}}function Fn(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var Bn="undefined"==typeof document?R:
|
|
284
|
+
return J("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */J("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var yn=1e-6;function vn(e,t,r={}){const a=Number.isFinite(t)&&t>0?t:0,n=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(a<=0||n.length<2){const e=n[0]??0;return{anchorsMs:n,xs:n.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=n[n.length-1]-n[0],i=r.maxTimeShare??.3,s=Math.min(r.breakPx??48,a),o=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<n.length;e++){const t=n[e+1]-n[e];c.push(t),d.push(l>0?t/l*a:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,a-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),x=function(e,t,r){const a=e.slice();let n=0;for(let e=0;e<a.length;e++)t[e]||a[e]>=r-yn||(n+=r-a[e],a[e]=r);if(n<=yn)return a;let l=0;for(let e=0;e<a.length;e++)!t[e]&&a[e]>r+yn&&(l+=a[e]-r);if(l<=yn)return a;const i=Math.min(n,l);for(let e=0;e<a.length;e++)t[e]||a[e]<=r+yn||(a[e]-=i*(a[e]-r)/l);return a}(f,u,o),b=x.reduce((e,t,r)=>u[r]?e:e+t,0),y=x.map((e,t)=>u[t]?e:b>0?e*m/b:e),v=[0];for(let e=0;e<y.length;e++)v.push(v[e]+y[e]);v[v.length-1]=a;const w=v.slice(0,-1).map((e,t)=>({fromMs:n[t],toMs:n[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:n,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=n[0])return 0;if(e>=n[n.length-1])return a;for(let t=0;t+1<n.length;t++){if(e>n[t+1])continue;const r=n[t+1]-n[t],a=r>0?(e-n[t])/r:0;return v[t]+a*(v[t+1]-v[t])}return a},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),a);for(let e=0;e+1<n.length;e++){if(t>v[e+1]&&e+2<n.length)continue;const r=v[e+1]-v[e],a=r>0?(t-v[e])/r:0;return n[e]+a*(n[e+1]-n[e])}return n[n.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function wn(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var kn="mixed";function Nn(e,t){return 5.6*Math.max(e.length,t.length)+8}var Mn=(e,t,r)=>Math.min(Math.max(e,t),r),$n=e=>-(Math.cos(Math.PI*e)-1)/2;function Cn(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)*$n(t);return{px:r,ms:e.msByPx(r)}}var Ln={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 Dn(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var jn=e=>5.6*e.length,zn={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:{}},Pn={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function Sn(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:zn[t].glyph??(r?"flag":void 0)}function An(e,t,r=!1){const a=zn[e],n=["rosh-tl-node","rosh-tl-mark",`is-${t}`];a.diamond&&n.push("is-diamond"),r&&n.push("is-provisional");const l="current"===t?"var(--tl-accent)":a.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:n.join(" "),style:i}}function Fn(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var Bn="undefined"==typeof document?R:Z;function Tn(e,t){const[r,a]=W(0);return Bn(()=>{const r=t?e.current:null;if(!r)return;const n=()=>{const e=r.getBoundingClientRect().width;e>0&&a(e)};if(n(),"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(n);return l.observe(r),()=>{l.disconnect()}},[e,t]),r}function Wn(e,t,r){const a=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&a.set(e.x,Math.max(a.get(e.x)??0,e.widthPx));const n=[...a.keys()].sort((e,t)=>e-t);if(r<=0||n.length<2)return e;const l=Math.max(0,n[0]),i=Math.min(r,n[n.length-1]),s=i-l,o=[];for(let e=0;e+1<n.length;e++){const t=(a.get(n[e])??0)/2+(a.get(n[e+1])??0)/2+8;o.push(Math.max(28,t,n[e+1]-n[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,x=g+d,b=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?x+(e-i)*(r-x)/h:x;let t=f;for(let r=0;r+1<n.length;r++){if(e>n[r+1]){t+=b[r];continue}const a=n[r+1]-n[r];return t+(a>0?(e-n[r])/a*b[r]:0)}return x};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>=x)return r-x>0?i+(e-x)*h/(r-x):i;let t=f;for(let r=0;r+1<n.length;r++){if(!(e>t+b[r]))return n[r]+(b[r]>0?(e-t)/b[r]*(n[r+1]-n[r]):0);t+=b[r]}return i})(t)),inCut:e.inCut}}function In(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 En({marks:e,innerRef:t}){/* @__PURE__ */
|
|
283
285
|
return J("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */X("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
|
|
284
286
|
/* @__PURE__ */J("span",{className:"rosh-tl-name",children:e.label}),
|
|
285
287
|
/* @__PURE__ */J("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function Rn({startMs:e,endMs:t,axis:r,geo:a,reveal:n}){const l=$().timeline,i=ht(M()),s=a.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*Qa){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*Qa)-t<14||o.push(
|
|
@@ -321,7 +323,7 @@ return X("div",{"aria-hidden":"true","data-timeline-part":"phase",children:[
|
|
|
321
323
|
/* @__PURE__ */J("div",{className:"rosh-tl-phase border-gray-300",style:{left:`${a}px`,width:`${n}px`,top:t.laneB+t.laneH-4+"px"}}),
|
|
322
324
|
/* @__PURE__ */X("span",{className:"rosh-tl-phase-label text-gray-500",style:{left:`${a+n/2}px`,top:`${t.laneB+t.laneH+5}px`},children:[e.label," · parallel"]})]})}function Vn({nodes:e,trackPx:t,geo:r,activeKey:a,hoveredKey:n,currentKey:l}){const i=$().timeline,s=(e,t)=>null!==t&&(e.key===t||e.members.some(e=>e.key===t)),o=e.find(e=>e.key===n)??e.find(e=>s(e,a))??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:Nn(d,u),m=c?.onOpen;/* @__PURE__ */
|
|
323
325
|
return X("div",{"data-timeline-part":"label",className:`rosh-tl-label${o.key===n?" is-hot":""}${s(o,l)?" is-current":""}`,style:{left:`${wn(o.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */J("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */J("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
|
|
324
|
-
/* @__PURE__ */J("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function
|
|
326
|
+
/* @__PURE__ */J("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function Gn({groups:e,trackPx:t,geo:r,startMs:a,endMs:n,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:x}){const b=[];e.forEach((e,t)=>{if("cluster"===e.type){const a=`cluster-${e.members[0].key}`,n=(r=e.members,`${(r[0]?.label??"").replace(/\s*v?\d+$/i,"").trim()||(r[0]?.label??"")} ×${r.length}`);if(b.push({key:a,group:e,text:n,x:e.members.reduce((e,t)=>e+t.baseX,0)/e.members.length,index:t,lane:-1,left:0,widthPx:Math.ceil(jn(n))+28}),a===c)for(const r of e.members)b.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;b.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})}),b.sort((e,t)=>e.x-t.x);const y=function(e,t,r,a,n={}){const l=t>0?t:0,i=a>0?a:1,s=n.gapPx??6,o=Math.max(1,n.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 a=e.xPx??(e.ms-r)/i*l,n=Math.min(Math.max(a-t/2,0),l-t),c=n+t;let h=-1;for(let e=0;e<o;e++)if(d[e].every(e=>n>e.right+s||c+s<e.left)){d[e].push({left:n,right:c}),h=e;break}u.set(e.key,h)}return e.map(e=>({key:e.key,lane:u.get(e.key)??-1}))}([...x>0?[{key:"__rosh-tl-start__",ms:a,xPx:0,widthPx:x,priority:-2}]:[],...b.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,a,Math.max(n-a,Qa),{laneCount:2}),v=new Map(y.map(e=>[e.key,e.lane]));for(const e of b)e.lane=v.get(e.key)??-1,e.left=wn(e.x,e.widthPx,t);const w=b.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__ */
|
|
325
327
|
return X(Q,{children:[b.map(e=>{const t=Math.max(0,e.lane),a=Math.round(e.index*o+60);if("cluster"===e.group.type){const n=h===e.key,l=e.group.members.map(e=>e.x),i=()=>{g(null),n||f(null)};/* @__PURE__ */
|
|
326
328
|
return X("div",{children:[
|
|
327
329
|
/* @__PURE__ */X("button",{type:"button","data-timeline-part":"cluster",className:`rosh-tl-pill${zn[e.group.kind]?.token?"":" text-blue-600"}${s?" rosh-tl-fade":""}`,"aria-expanded":n,"aria-controls":d,style:{left:`${e.left}px`,top:`${0===t?r.laneA+r.laneH-19:r.laneB}px`,color:zn[e.group.kind]?.token,...s?{animationDelay:`${a}ms`}:{}},onMouseEnter:()=>{g(e.key),f(e.key)},onMouseLeave:i,onFocus:()=>{g(e.key),f(e.key)},onBlur:i,onClick:()=>{m(n?null:e.key),f(n?null:e.key)},children:[
|
|
@@ -336,11 +338,11 @@ return X("div",{children:[
|
|
|
336
338
|
/* @__PURE__ */J("p",{className:"rosh-tl-popover-head",children:w.text}),
|
|
337
339
|
/* @__PURE__ */J("ol",{children:w.group.members.map(e=>/* @__PURE__ */X("li",{children:[
|
|
338
340
|
/* @__PURE__ */J("span",{children:e.label}),
|
|
339
|
-
/* @__PURE__ */J("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function
|
|
341
|
+
/* @__PURE__ */J("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function Zn({thumb:e,value:t,snap:r,axis:a,geo:n,startMs:l,endMs:i,trackPx:s,layerRef:o,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=$().timeline,p=M(),g=I(!1),f=c?c.px:a.xByMs(t),x=c?c.ms:t,b=In(e.stops),y=b?b.indexOf(t):-1,v=e=>{const r=o.current?.getBoundingClientRect();return r?a.msByPx(e-r.left):t},w=a=>{const n=r(a);n!==t&&e.onChange(n)},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?.())},C=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 a=r[e],n=r[e+1];if(t<a.ms||t>n.ms)continue;const l=n.ms-a.ms;return{fromKey:a.key,toKey:n.key,t:l>0?Mn((t-a.ms)/l,0,1):1,ms:t}}return null}(u,t))},L=e.valueText?e.valueText(x):tn(x,p),D=Math.max(1,Math.round((i-l)/Qa));/* @__PURE__ */
|
|
340
342
|
return X(Q,{children:[
|
|
341
343
|
/* @__PURE__ */J("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:n.rail-9+"px",height:"24px"},onPointerDown:e=>{k(e),w(v(e.clientX))},onPointerMove:C,onPointerUp:N,onPointerCancel:N}),
|
|
342
344
|
/* @__PURE__ */J("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${wn(f,88,s)+44}px`,top:`${n.tag}px`},children:e.chip?e.chip(x):tn(x,p)}),
|
|
343
|
-
/* @__PURE__ */J("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":b&&b.length>0?b.length-1:D,"aria-valuenow":b&&b.length>0?Math.max(0,y):Math.round((t-l)/Qa),"aria-valuetext":L,style:{left:`${f}px`,top:`${n.rail+3}px`},onPointerDown:k,onPointerMove:C,onPointerUp:N,onPointerCancel:N,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(b&&b.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?b[Math.min(e+1,b.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?b[Math.max(e-1,0)]:"Home"===r?b[0]:"End"===r?b[b.length-1]:null}const a=(e.shiftKey?7:1)*Qa;return"ArrowRight"===r||"ArrowUp"===r?t+a:"ArrowLeft"===r||"ArrowDown"===r?t-a:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function Jn(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Xn({startMs:e,endMs:t,axis:r="linear",items:a,markers:n=[],pending:l=[],fillToMs:i,todayMs:s,labels:o="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:x=null,motion:b=!0,ariaLabel:y,highlightKeys:v=null,onHoverChange:w,endMark:k=null}){const N="none"===o,C=F(Date.now,null),L=F(Dn,!1),D=s??C,j=I(null),z=$().timeline,P=M(),S=e=>tn(e,P),A=I(null),B=I(null),O=I(null),Y=I(/* @__PURE__ */new Map),_=I(void 0),H=I(void 0),q=I(null),[U,K]=W({}),[V,Z]=W(null),[G,ee]=W(null),[te,re]=W(null),[ae,ne]=W(null),[le,ie]=W(null),[se,oe]=W(null),ce=E(),de=E(),ue=Tn(j,!0),me=ue>0?ue-(l.length>0&&!N?176:0):0,pe=me>0&&me-20<320,ge=Tn(A,!pe),fe=ge>0?ge:600,xe=Ln[o],be=N&&l.length>0,ye=be?Math.max(0,fe-36):fe,ve=r=>r>=e-Qa&&r<=t+Qa,we=a.filter(e=>Number.isFinite(e.ms)&&ve(e.ms)).slice().sort((e,t)=>e.ms-t.ms),ke="spread"===r?n.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],Ne=vn([e,...[...we.map(e=>e.ms),...ke].filter(r=>r>e&&r<t),t],ye,"compressed"===(Me=r)?{}:"spread"===Me?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var Me;const $e=Ne.xByMs,Ce=we.filter(e=>!e.provisional),Le=g??(Ce.length>0?Ce[Ce.length-1].key:null),De=we.map((e,t)=>{const r=e.date??S(e.ms),a=(e.priority??0)>0||"report"===e.kind,n=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?Pn[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:$e(e.ms),baseX:$e(e.ms),kind:n,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Sn(e,n,0===t&&"default"===n),role:e.key===Le?"current":a?"dot":"key",widthPx:N?Math.max(16,jn(e.caption??"")+6):U[e.key]||Nn(e.label,r),collapsible:a,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),je=n.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&ve(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,a=S(t);return{key:r,ms:t,x:$e(t),baseX:$e(t),kind:e.kind,label:e.label,dateText:a,detail:e.detail,preview:e.preview,glyph:e.glyph??zn[e.kind].glyph,role:"key",widthPx:U[r]||Nn(e.label,a),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),ze=be?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Qa,x:fe,baseX:fe,kind:e.kind??"default",label:e.label,dateText:z.notReached,detail:r.length>0?z.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],Pe=N&&k&&!be?[{key:k.key,ms:t,x:ye,baseX:ye,kind:"default",label:k.label,dateText:k.dateText??S(t),detail:k.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Se=[...De,...je,...ze,...Pe].sort((e,t)=>e.x-t.x||e.ms-t.ms),Ae=m?.start??z.start(S(e)),Fe=null==Ae||!1===Ae?0:"string"==typeof Ae?Math.ceil(jn(Ae)):96,Be="lanes"===o?function(e,t={}){const r=t.minPitchPx??40,a=[];let n=0;for(;n<e.length;){const t=e[n];if(!t.collapsible){a.push({type:"item",mark:t}),n+=1;continue}let l=n+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(n,l),s=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const a=i[t-1],n=Math.max(r,Math.max(e.widthPx,a.widthPx)+8);return e.x-a.x<n});if(i.length>=3||s)a.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)a.push({type:"item",mark:e});n=l}return a}(Se):[],Te=function(e,t=16){const r=[];let a=0;for(;a<e.length;){let n=a+1;for(;n<e.length&&e[n].x-e[n-1].x<t;)n+=1;if(n-a===1)r.push({type:"item",mark:e[a]});else{const t=e.slice(a,n),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:kn,members:t})}a=n}return r}(Se),We=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,We(e));const Ee=te??ae??le,Re=Be.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Ee)??Te.find(e=>"cluster"===e.type&&We(e)===Ee),Oe=e=>({x:e.baseX,widthPx:e.widthPx}),Ye=Re&&"cluster"===Re.type?Re.members.map(Oe):x?Se.filter(e=>e.ms>=x[0]&&e.ms<=x[1]).map(Oe):[],_e=Ye.length>1?Wn(Ne,Ye,ye):Ne,He=_e!==Ne;if(He)for(const e of Se)e.isCap||(e.x=_e.xByMs(e.ms));const qe=Se.some(e=>e.x<14),Ue=He&&Re?Ee:null,Ke=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ve=pe?Se.map(Ke):Te.flatMap(e=>{if("item"===e.type)return[Ke(e.mark)];const t=We(e);if(t===Ue&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ke);var r;const a=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:a.reduce((e,t)=>e+t,0)/a.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ze=/* @__PURE__ */new Map;for(const e of Ve)for(const t of e.members)Ze.set(t.key,e.key);const Ge=Te.find(e=>"cluster"===e.type&&We(e)===Ue),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=I(Ue),[Qe,et]=W(!1);R(()=>{if(Xe.current===Ue)return;Xe.current=Ue,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[Ue]);const tt=Se.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Bn(()=>{const e=B.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,a=r.getBoundingClientRect().width;e&&a>0&&(t[e]=a)}K(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=`${o}|${r}|${Se.map(e=>`${e.key}@${e.ms}`).join("|")}`,[at,nt]=W(rt),lt=b&&at===rt;R(()=>{at!==rt&&nt(rt)},[at,rt]);const it=Math.min(28,340/Math.max(1,Se.length-1)),st=In(u?.stops),ot=r=>{const a=Math.min(Math.max(r,e),t);if(!st)return a;let n=st[0];for(const e of st)Math.abs(e-a)<Math.abs(n-a)&&(n=e);return n},ct=u?ot(u.valueMs):null,dt=h&&u?De.filter(e=>!st||st.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const a=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,n=Math.max(0,r.dwellMs??700)/a,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:Mn(350*u/100,450,1400)/a;i.push({fromKey:s.key,toKey:o.key,fromMs:s.ms,toMs:o.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:n,msByPx:e.msByPx})}return i}(_e,dt,{speed:h?.speed,reducedMotion:L}),[ht,mt]=W(null),pt=I(null),gt=I({segments:ut,value:ct,playback:h});R(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=I(null),xt=T(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),bt=T(()=>{pt.current=null,mt(null),xt(null),gt.current.playback?.onStop?.()},[xt]),yt=!!h?.playing&&!!u;R(()=>{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 bt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,a=0;const n=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},n(Cn(t,0))):bt()},s=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const a=e[t.index];if(!a)return{cursor:null,at:null,arrived:null,progress:null};const n=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-n;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:Cn(a,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:Cn(a,0),arrived:null,progress:null}}const l=a.durationMs>0?Math.min(1,t.t+n/a.durationMs):1,i=Cn(a,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:a.fromKey,toKey:a.toKey,t:$n(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:a.toKey,ms:a.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&n(i.at),xt(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(),a=requestAnimationFrame(s)):bt()};return l(),a=requestAnimationFrame(s),()=>{cancelAnimationFrame(a),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,xt(null))}},[yt,bt,xt]);const vt=De.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===D?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,D):null,kt=new Set(v??[]),Nt=Se.filter(e=>kt.has(e.key)).map(e=>e.x),Mt=Nt.length>0?{from:Math.min(...Nt),to:Math.max(...Nt)}:null,$t=T(()=>{clearTimeout(_.current),clearTimeout(H.current),Z(null),ee(null),re(null),ne(null),ie(null)},[]);R(()=>()=>{clearTimeout(_.current),clearTimeout(H.current)},[]),R(()=>{const e=q.current;e&&(q.current=null,Y.current.get(e)?.focus())});const Ct=null!==G||null!==te||null!==ae||null!==le;R(()=>{if(Ct)return f(e=>"Escape"===e.key&&($t(),!0))},[Ct,$t]);const Lt=T((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let a=r>0?Math.max(r,Math.min(t,fe-r)):t;const n=e.parentElement;if(r>0&&n){const t=he(e),l=n.getBoundingClientRect().left,i=t.left+8+r-l,s=t.right-8-r-l;i<=s&&(a=Math.max(i,Math.min(a,s)))}e.style.left=`${a}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-a)}px`)},[fe]),Dt=Ve.find(e=>e.key===G)??null,jt=Dt?Dt.x:0;Bn(()=>{Lt(O.current,jt)},[Lt,G,jt]);const zt=ct??void 0,Pt=I(null);R(()=>{if(void 0===zt)return;const e=_e.xByMs(zt),t=Pt.current;if(Pt.current=e,null===t||e<=t)return;const r=[];for(const a of Se){if(a.x<=t||a.x>e)continue;const n=Y.current.get(Ze.get(a.key)??a.key);n&&(n.classList.add("is-hit"),r.push(setTimeout(()=>n.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[zt]);const St=Ve.map(e=>e.key),At=Le?Ze.get(Le)??null:null,Ft=se&&St.includes(se)?se:At&&St.includes(At)?At:St[0],Bt=e=>{const t=St.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?St.length-1:-1;r<0||r>St.length-1||(e.preventDefault(),oe(St[r]),Y.current.get(St[r])?.focus())},Tt=()=>clearTimeout(H.current),Wt=e=>{Tt(),ie(e)},It=()=>{clearTimeout(H.current),H.current=setTimeout(()=>ie(null),260)},Et=e=>{Ue&&Ie.get(e)===Ue?Tt():(Tt(),ie(null))},Rt=e=>{clearTimeout(_.current),Z(e),ee(e),w?.((e=>{const t=Ve.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Ot=e=>{Z(t=>t===e?null:t),clearTimeout(_.current),_.current=setTimeout(()=>ee(t=>t===e?null:t),160),w?.(null)},Yt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Fn(e),"aria-describedby":G===e.key?ce:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?Y.current.set(e.key,t):Y.current.delete(e.key)},onMouseEnter:()=>{Et(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Ot(e.key)},onFocus:()=>{Et(e.key),Rt(e.key),oe(e.key)},onBlur:()=>{It(),Ot(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(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=z,r.events(t.length,t.map(Fn))),"aria-describedby":G===e.key?ce:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?Y.current.set(e.key,t):Y.current.delete(e.key)},onMouseEnter:()=>{e.openable?Wt(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Ot(e.key)},onFocus:()=>{Tt(),Rt(e.key),oe(e.key)},onBlur:()=>{It(),Ot(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Wt(e.key);const r=e.members[0];oe(r.key),q.current=r.key}};var t,r},Ht="lanes"!==o||Se.length>1;if(pe)/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */J("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":b&&b.length>0?b.length-1:D,"aria-valuenow":b&&b.length>0?Math.max(0,y):Math.round((t-l)/Qa),"aria-valuetext":L,style:{left:`${f}px`,top:`${n.rail+3}px`},onPointerDown:k,onPointerMove:C,onPointerUp:N,onPointerCancel:N,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(b&&b.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?b[Math.min(e+1,b.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?b[Math.max(e-1,0)]:"Home"===r?b[0]:"End"===r?b[b.length-1]:null}const a=(e.shiftKey?7:1)*Qa;return"ArrowRight"===r||"ArrowUp"===r?t+a:"ArrowLeft"===r||"ArrowDown"===r?t-a:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function Jn(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Xn({startMs:e,endMs:t,axis:r="linear",items:a,markers:n=[],pending:l=[],fillToMs:i,todayMs:s,labels:o="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:x=null,motion:b=!0,ariaLabel:y,highlightKeys:v=null,onHoverChange:w,endMark:k=null}){const N="none"===o,C=F(Date.now,null),L=F(Dn,!1),D=s??C,j=I(null),z=$().timeline,P=M(),S=e=>tn(e,P),A=I(null),B=I(null),O=I(null),Y=I(/* @__PURE__ */new Map),_=I(void 0),H=I(void 0),q=I(null),[U,K]=W({}),[V,G]=W(null),[Z,ee]=W(null),[te,re]=W(null),[ae,ne]=W(null),[le,ie]=W(null),[se,oe]=W(null),ce=E(),de=E(),ue=Tn(j,!0),me=ue>0?ue-(l.length>0&&!N?176:0):0,pe=me>0&&me-20<320,ge=Tn(A,!pe),fe=ge>0?ge:600,xe=Ln[o],be=N&&l.length>0,ye=be?Math.max(0,fe-36):fe,ve=r=>r>=e-Qa&&r<=t+Qa,we=a.filter(e=>Number.isFinite(e.ms)&&ve(e.ms)).slice().sort((e,t)=>e.ms-t.ms),ke="spread"===r?n.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],Ne=vn([e,...[...we.map(e=>e.ms),...ke].filter(r=>r>e&&r<t),t],ye,"compressed"===(Me=r)?{}:"spread"===Me?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var Me;const $e=Ne.xByMs,Ce=we.filter(e=>!e.provisional),Le=g??(Ce.length>0?Ce[Ce.length-1].key:null),De=we.map((e,t)=>{const r=e.date??S(e.ms),a=(e.priority??0)>0||"report"===e.kind,n=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?Pn[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:$e(e.ms),baseX:$e(e.ms),kind:n,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Sn(e,n,0===t&&"default"===n),role:e.key===Le?"current":a?"dot":"key",widthPx:N?Math.max(16,jn(e.caption??"")+6):U[e.key]||Nn(e.label,r),collapsible:a,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),je=n.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&ve(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,a=S(t);return{key:r,ms:t,x:$e(t),baseX:$e(t),kind:e.kind,label:e.label,dateText:a,detail:e.detail,preview:e.preview,glyph:e.glyph??zn[e.kind].glyph,role:"key",widthPx:U[r]||Nn(e.label,a),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),ze=be?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Qa,x:fe,baseX:fe,kind:e.kind??"default",label:e.label,dateText:z.notReached,detail:r.length>0?z.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],Pe=N&&k&&!be?[{key:k.key,ms:t,x:ye,baseX:ye,kind:"default",label:k.label,dateText:k.dateText??S(t),detail:k.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Se=[...De,...je,...ze,...Pe].sort((e,t)=>e.x-t.x||e.ms-t.ms),Ae=m?.start??z.start(S(e)),Fe=null==Ae||!1===Ae?0:"string"==typeof Ae?Math.ceil(jn(Ae)):96,Be="lanes"===o?function(e,t={}){const r=t.minPitchPx??40,a=[];let n=0;for(;n<e.length;){const t=e[n];if(!t.collapsible){a.push({type:"item",mark:t}),n+=1;continue}let l=n+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(n,l),s=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const a=i[t-1],n=Math.max(r,Math.max(e.widthPx,a.widthPx)+8);return e.x-a.x<n});if(i.length>=3||s)a.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)a.push({type:"item",mark:e});n=l}return a}(Se):[],Te=function(e,t=16){const r=[];let a=0;for(;a<e.length;){let n=a+1;for(;n<e.length&&e[n].x-e[n-1].x<t;)n+=1;if(n-a===1)r.push({type:"item",mark:e[a]});else{const t=e.slice(a,n),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:kn,members:t})}a=n}return r}(Se),We=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,We(e));const Ee=te??ae??le,Re=Be.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Ee)??Te.find(e=>"cluster"===e.type&&We(e)===Ee),Oe=e=>({x:e.baseX,widthPx:e.widthPx}),Ye=Re&&"cluster"===Re.type?Re.members.map(Oe):x?Se.filter(e=>e.ms>=x[0]&&e.ms<=x[1]).map(Oe):[],_e=Ye.length>1?Wn(Ne,Ye,ye):Ne,He=_e!==Ne;if(He)for(const e of Se)e.isCap||(e.x=_e.xByMs(e.ms));const qe=Se.some(e=>e.x<14),Ue=He&&Re?Ee:null,Ke=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ve=pe?Se.map(Ke):Te.flatMap(e=>{if("item"===e.type)return[Ke(e.mark)];const t=We(e);if(t===Ue&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ke);var r;const a=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:a.reduce((e,t)=>e+t,0)/a.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ge=/* @__PURE__ */new Map;for(const e of Ve)for(const t of e.members)Ge.set(t.key,e.key);const Ze=Te.find(e=>"cluster"===e.type&&We(e)===Ue),Je=Ze&&"cluster"===Ze.type?{from:Math.min(...Ze.members.map(e=>e.x))-16,to:Math.max(...Ze.members.map(e=>e.x))+16}:null,Xe=I(Ue),[Qe,et]=W(!1);R(()=>{if(Xe.current===Ue)return;Xe.current=Ue,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[Ue]);const tt=Se.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Bn(()=>{const e=B.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,a=r.getBoundingClientRect().width;e&&a>0&&(t[e]=a)}K(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=`${o}|${r}|${Se.map(e=>`${e.key}@${e.ms}`).join("|")}`,[at,nt]=W(rt),lt=b&&at===rt;R(()=>{at!==rt&&nt(rt)},[at,rt]);const it=Math.min(28,340/Math.max(1,Se.length-1)),st=In(u?.stops),ot=r=>{const a=Math.min(Math.max(r,e),t);if(!st)return a;let n=st[0];for(const e of st)Math.abs(e-a)<Math.abs(n-a)&&(n=e);return n},ct=u?ot(u.valueMs):null,dt=h&&u?De.filter(e=>!st||st.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const a=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,n=Math.max(0,r.dwellMs??700)/a,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:Mn(350*u/100,450,1400)/a;i.push({fromKey:s.key,toKey:o.key,fromMs:s.ms,toMs:o.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:n,msByPx:e.msByPx})}return i}(_e,dt,{speed:h?.speed,reducedMotion:L}),[ht,mt]=W(null),pt=I(null),gt=I({segments:ut,value:ct,playback:h});R(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=I(null),xt=T(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),bt=T(()=>{pt.current=null,mt(null),xt(null),gt.current.playback?.onStop?.()},[xt]),yt=!!h?.playing&&!!u;R(()=>{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 bt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,a=0;const n=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},n(Cn(t,0))):bt()},s=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const a=e[t.index];if(!a)return{cursor:null,at:null,arrived:null,progress:null};const n=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-n;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:Cn(a,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:Cn(a,0),arrived:null,progress:null}}const l=a.durationMs>0?Math.min(1,t.t+n/a.durationMs):1,i=Cn(a,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:a.fromKey,toKey:a.toKey,t:$n(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:a.toKey,ms:a.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&n(i.at),xt(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(),a=requestAnimationFrame(s)):bt()};return l(),a=requestAnimationFrame(s),()=>{cancelAnimationFrame(a),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,xt(null))}},[yt,bt,xt]);const vt=De.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===D?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,D):null,kt=new Set(v??[]),Nt=Se.filter(e=>kt.has(e.key)).map(e=>e.x),Mt=Nt.length>0?{from:Math.min(...Nt),to:Math.max(...Nt)}:null,$t=T(()=>{clearTimeout(_.current),clearTimeout(H.current),G(null),ee(null),re(null),ne(null),ie(null)},[]);R(()=>()=>{clearTimeout(_.current),clearTimeout(H.current)},[]),R(()=>{const e=q.current;e&&(q.current=null,Y.current.get(e)?.focus())});const Ct=null!==Z||null!==te||null!==ae||null!==le;R(()=>{if(Ct)return f(e=>"Escape"===e.key&&($t(),!0))},[Ct,$t]);const Lt=T((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let a=r>0?Math.max(r,Math.min(t,fe-r)):t;const n=e.parentElement;if(r>0&&n){const t=he(e),l=n.getBoundingClientRect().left,i=t.left+8+r-l,s=t.right-8-r-l;i<=s&&(a=Math.max(i,Math.min(a,s)))}e.style.left=`${a}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-a)}px`)},[fe]),Dt=Ve.find(e=>e.key===Z)??null,jt=Dt?Dt.x:0;Bn(()=>{Lt(O.current,jt)},[Lt,Z,jt]);const zt=ct??void 0,Pt=I(null);R(()=>{if(void 0===zt)return;const e=_e.xByMs(zt),t=Pt.current;if(Pt.current=e,null===t||e<=t)return;const r=[];for(const a of Se){if(a.x<=t||a.x>e)continue;const n=Y.current.get(Ge.get(a.key)??a.key);n&&(n.classList.add("is-hit"),r.push(setTimeout(()=>n.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[zt]);const St=Ve.map(e=>e.key),At=Le?Ge.get(Le)??null:null,Ft=se&&St.includes(se)?se:At&&St.includes(At)?At:St[0],Bt=e=>{const t=St.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?St.length-1:-1;r<0||r>St.length-1||(e.preventDefault(),oe(St[r]),Y.current.get(St[r])?.focus())},Tt=()=>clearTimeout(H.current),Wt=e=>{Tt(),ie(e)},It=()=>{clearTimeout(H.current),H.current=setTimeout(()=>ie(null),260)},Et=e=>{Ue&&Ie.get(e)===Ue?Tt():(Tt(),ie(null))},Rt=e=>{clearTimeout(_.current),G(e),ee(e),w?.((e=>{const t=Ve.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Ot=e=>{G(t=>t===e?null:t),clearTimeout(_.current),_.current=setTimeout(()=>ee(t=>t===e?null:t),160),w?.(null)},Yt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Fn(e),"aria-describedby":Z===e.key?ce:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?Y.current.set(e.key,t):Y.current.delete(e.key)},onMouseEnter:()=>{Et(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Ot(e.key)},onFocus:()=>{Et(e.key),Rt(e.key),oe(e.key)},onBlur:()=>{It(),Ot(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(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=z,r.events(t.length,t.map(Fn))),"aria-describedby":Z===e.key?ce:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?Y.current.set(e.key,t):Y.current.delete(e.key)},onMouseEnter:()=>{e.openable?Wt(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Ot(e.key)},onFocus:()=>{Tt(),Rt(e.key),oe(e.key)},onBlur:()=>{It(),Ot(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Wt(e.key);const r=e.members[0];oe(r.key),q.current=r.key}};var t,r},Ht="lanes"!==o||Se.length>1;if(pe)/* @__PURE__ */
|
|
344
346
|
return J("div",{ref:j,children:/* @__PURE__ */J(Yn,{marks:Se.filter(e=>!e.isCap),pending:l,currentKey:Le,todayMs:D,reveal:lt,ariaLabel:y,step:it,nodeProps:Yt,onKeyDown:Bt})});const qt=(e,t)=>null==e||!1===e?null:/* @__PURE__ */J("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:xe.rail-3+"px"},children:e});/* @__PURE__ */
|
|
345
347
|
return X("div",{ref:j,className:"rosh-tl-body"+(l.length>0&&!N?"":" is-solo"),children:[
|
|
346
348
|
/* @__PURE__ */X("div",{className:"flex items-stretch gap-3",children:[N&&qt(Ae,!1),
|
|
@@ -353,7 +355,7 @@ return X("div",{ref:j,className:"rosh-tl-body"+(l.length>0&&!N?"":" is-solo"),ch
|
|
|
353
355
|
return J("li",{children:/* @__PURE__ */J("button",{...Yt(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:a,...n}})},e.key);if(!e.mark){const t=e.kind===kn,i=An(t?"default":e.kind,"key"),s=t?void 0:zn[e.kind]?.glyph;/* @__PURE__ */
|
|
354
356
|
return X("li",{...r(Le)?{"aria-current":"step"}:{},children:[
|
|
355
357
|
/* @__PURE__ */X("button",{..._t(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(c)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:a,...n},children:[s&&/* @__PURE__ */J(fn,{name:s}),t&&/* @__PURE__ */X("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */X("i",{"aria-hidden":"true",className:"rosh-tl-count"+(lt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:a},children:["×",e.members.length]})]},e.key)}const i=e.mark,s=An(i.kind,i.role,i.provisional),{glyph:o}=i;/* @__PURE__ */
|
|
356
|
-
return J("li",{...i.key===Le?{"aria-current":"step"}:{},children:/* @__PURE__ */X("button",{...Yt(i),className:`${s.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...s.style,left:`${i.x}px`,top:a,...n},children:[o&&/* @__PURE__ */J(fn,{name:o}),"current"===i.role&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===o?/* @__PURE__ */J(
|
|
358
|
+
return J("li",{...i.key===Le?{"aria-current":"step"}:{},children:/* @__PURE__ */X("button",{...Yt(i),className:`${s.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...s.style,left:`${i.x}px`,top:a,...n},children:[o&&/* @__PURE__ */J(fn,{name:o}),"current"===i.role&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===o?/* @__PURE__ */J(Gn,{groups:Be,trackPx:fe,geo:xe,startMs:e,endMs:t,currentKey:Le,hoveredKey:V,reveal:lt,step:it,zoomedKey:Ue,popId:de,aimBubble:Lt,startCaptionPx:Fe,openCluster:te,setOpenCluster:re,previewCluster:ae,setPreviewCluster:ne,setZoomKey:ie}):"active"===o?/* @__PURE__ */J(Vn,{nodes:Ve,trackPx:fe,geo:xe,activeKey:c,hoveredKey:V,currentKey:Le}):null,Dt&&/* @__PURE__ */J("div",{ref:O,id:ce,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${xe.rail+6+6}px`},onMouseEnter:()=>{Tt(),Rt(Dt.key)},onMouseLeave:()=>{It(),Ot(Dt.key)},onFocus:()=>{Tt(),Rt(Dt.key)},onBlur:()=>{It(),Ot(Dt.key)},children:Dt.mark?/* @__PURE__ */X(Q,{children:[
|
|
357
359
|
/* @__PURE__ */J("span",{className:"rosh-tl-name",children:Dt.mark.label}),
|
|
358
360
|
/* @__PURE__ */J("span",{className:"rosh-tl-date",children:Dt.mark.dateText}),Dt.mark.preview?/* @__PURE__ */J("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:Dt.mark.preview}):Dt.mark.detail&&/* @__PURE__ */J("span",{className:"rosh-tl-detail",children:Dt.mark.detail}),(Dt.mark.onOpen??Dt.mark.onClick)&&/* @__PURE__ */J("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(Dt.mark?.onOpen??Dt.mark?.onClick)?.(),children:z.openButton})]}):
|
|
359
361
|
/* @__PURE__ */X("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
|
|
@@ -362,7 +364,7 @@ return J("li",{...i.key===Le?{"aria-current":"step"}:{},children:/* @__PURE__ */
|
|
|
362
364
|
/* @__PURE__ */X("p",{className:"rosh-tl-foldrow",children:[
|
|
363
365
|
/* @__PURE__ */J("span",{children:e.label}),
|
|
364
366
|
/* @__PURE__ */J("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */J("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */J("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),u&&null!==ct&&
|
|
365
|
-
/* @__PURE__ */J(
|
|
367
|
+
/* @__PURE__ */J(Zn,{thumb:u,value:ct,snap:ot,axis:_e,geo:xe,startMs:e,endMs:t,trackPx:fe,layerRef:A,glide:ht,onScrub:h?bt:void 0,nodes:dt,onProgress:xt})]})}),N&&qt(m?.end,!0)]}),l.length>0&&!N&&/* @__PURE__ */J(On,{pending:l,reveal:lt})]})}function Qn({icon:e,heading:t,subject:r,meta:a=[],actions:n,footer:l,children:i}){const s=[...r?[/* @__PURE__ */J("b",{children:r},"subject")]:[],...a.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
|
|
366
368
|
return X("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
|
|
367
369
|
/* @__PURE__ */X("div",{className:"rosh-tl-head",children:[
|
|
368
370
|
/* @__PURE__ */X("div",{className:"rosh-tl-head-main",children:[e&&/* @__PURE__ */J("span",{className:"rosh-tl-ico text-gray-500","aria-hidden":"true",children:e}),
|
|
@@ -448,15 +450,17 @@ return X("button",{type:"button",onClick:a,className:"flex w-full items-center j
|
|
|
448
450
|
return X("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[a&&/* @__PURE__ */J("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:a}),
|
|
449
451
|
/* @__PURE__ */J("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const a=e.key===t;/* @__PURE__ */
|
|
450
452
|
return X("button",{type:"button",disabled:e.disabled,"aria-current":a?"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 "+(a?"text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.icon&&/* @__PURE__ */J("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
451
|
-
/* @__PURE__ */J("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */J("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}),a&&/* @__PURE__ */J("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),n&&/* @__PURE__ */J("div",{className:"ml-auto flex items-center gap-2",children:n})]})}var Ll=/(^|[\s:])!?z-/,Dl=/* @__PURE__ */J("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),jl=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function zl({trigger:e,items:t,align:r="end",side:a="bottom","aria-label":n,className:l="",triggerClassName:i,menuClassName:s="",minWidth:o=180,linkAs:c,disabled:d}){const[
|
|
453
|
+
/* @__PURE__ */J("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */J("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}),a&&/* @__PURE__ */J("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),n&&/* @__PURE__ */J("div",{className:"ml-auto flex items-center gap-2",children:n})]})}var Ll=/(^|[\s:])!?z-/,Dl=/* @__PURE__ */J("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),jl=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function zl({trigger:e,items:t,align:r="end",side:a="bottom","aria-label":n,className:l="",triggerClassName:i,menuClassName:s="",minWidth:o=180,linkAs:c,disabled:d,id:u,"aria-describedby":y}){const[v,w]=W(!1),[k,N]=W(-1),M=I(null),$=I(null),C=I(null),L=I({text:"",at:0}),D=E(),j=E(),z=u??j,P=T(e=>{w(!1),e&&$.current?.focus()},[]),A=(e,r)=>{const a=t.length;for(let n=0;n<a;n+=1){const l=((e+r*n)%a+a)%a;if(jl(t[l]))return l}return-1},F=()=>C.current?.closest("[data-popup-menu-tree]")??null;R(()=>{if(!v)return;const e=e=>{const t=e.target;M.current?.contains(t)||F()?.contains(t)||P(!1)};document.addEventListener("pointerdown",e,!0);const t=x(()=>P(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[v,P]);const B=T(()=>{const e=F(),t=$.current;if(!e||!t)return;const n=e.style;n.left="0px",n.top="0px",n.maxWidth="none",n.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=function({trigger:e,menu:t,bounds:r,align:a,side:n}){const l=ge(e,r,4),i="bottom"===n?"top":"bottom",s=t.height>l[n]&&(t.height<=l[i]||l[i]>l[n])?i:n,o=Math.max(Math.min(t.height,96),l[s]),c=Math.min(t.height,o),d=fe("bottom"===s?e.bottom+4:e.top-4-c,r.top+8,r.bottom-8-c),u=Math.max(0,r.right-r.left-16),h=Math.min(t.width,u);return{left:fe("start"===a?e.left:e.right-h,r.left+8,r.right-8-h),top:d,side:s,maxHeight:o,maxWidth:u}}({trigger:t.getBoundingClientRect(),menu:l,bounds:he(t),align:r,side:a});n.left=`${i.left}px`,n.top=`${i.top}px`,n.maxWidth=`${i.maxWidth}px`,n.maxHeight=`${i.maxHeight}px`,n.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,a]);S(()=>{v&&B()}),R(()=>{if(v)return xe(()=>$.current,B)},[v,B]),R(()=>{if(!v)return;const e=C.current,r=jl(t[k])?e?.querySelector(`[data-dropdown-index="${k}"]`):null;(r??e)?.focus({preventScroll:!0})},[v,k]),R(()=>{if(v)return f(e=>"Escape"===e.key&&(P(!0),!0))},[v,P]);const O=e=>{N(e),w(!0)},Y=e=>{e.disabled||(P(!0),e.onSelect())},_=c??"a",H=(e,t)=>({"data-dropdown-index":e,tabIndex:e===k?0:-1,onMouseEnter:()=>{t.disabled||N(e)}}),q=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
|
|
452
454
|
return J("div",{role:"separator",children:/* @__PURE__ */J(m,{})},e.key);if("label"===e.type)/* @__PURE__ */
|
|
453
|
-
return J("div",{id:`${
|
|
454
|
-
return X("button",{type:"button",role:"
|
|
455
|
-
/* @__PURE__ */J("span",{"aria-hidden":!0,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center
|
|
456
|
-
return X("button",{type:"button",role:"
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
455
|
+
return J("div",{id:`${D}-label-${t}`,children:/* @__PURE__ */J(p,{children:e.label})},e.key);if("checkbox"===e.type){const r=g(!1,e.disabled,"");/* @__PURE__ */
|
|
456
|
+
return X("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),...H(t,e),children:[
|
|
457
|
+
/* @__PURE__ */J("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&&Dl}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=g(!1,e.disabled,"");/* @__PURE__ */
|
|
458
|
+
return X("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>Y(e),...H(t,e),children:[
|
|
459
|
+
/* @__PURE__ */J("span",{"aria-hidden":!0,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e.checked&&Dl}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=g(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */X("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...H(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */X(_,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>P(!0),...H(t,e),children:[e.icon,e.label]},e.key)}const r=g(e.danger,e.disabled,"");/* @__PURE__ */
|
|
460
|
+
return X("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>Y(e),...H(t,e),children:[e.icon,e.label]},e.key)},U={...Ll.test(s)?{}:{zIndex:b.popup},minWidth:o};/* @__PURE__ */
|
|
461
|
+
return X("div",{ref:M,className:`relative inline-flex ${l}`.trim(),children:[
|
|
462
|
+
/* @__PURE__ */J("button",{ref:$,id:z,type:"button","aria-haspopup":"menu","aria-expanded":v,"aria-controls":v?D:void 0,"aria-label":n,"aria-describedby":y,disabled:d,onClick:()=>v?P(!1):O(A(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),O(A(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),O(A(t.length-1,-1)))},className:i??"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}),v&&
|
|
463
|
+
/* @__PURE__ */J(h,{portal:!0,className:s,style:U,children:/* @__PURE__ */J("div",{ref:C,id:D,role:"menu","aria-orientation":"vertical","aria-label":n,"aria-labelledby":n?void 0:z,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),N(A(k+1,1));else if("ArrowUp"===e.key)e.preventDefault(),N(A(k-1,-1));else if("Home"===e.key)e.preventDefault(),N(A(0,1));else if("End"===e.key)e.preventDefault(),N(A(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),P(!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(),a=e.key.toLowerCase(),n=r-L.current.at<500?L.current.text+a:a;L.current={text:n,at:r};const l=[...n].every(e=>e===n[0]),i=l?n[0]:n,s=l?k+1:Math.max(k,0),o=C.current,c=t.length;for(let r=0;r<c;r+=1){const a=((s+r)%c+c)%c;if(jl(t[a])&&(o?.querySelector(`[data-dropdown-index="${a}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void N(a)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const a=t[r];if("radio"!==a.type&&"checkbox"!==a.type){e.push(q(a,r)),r+=1;continue}const n=a.type,l=r,i=[];for(;r<t.length&&t[r].type===n;)i.push(q(t[r],r)),r+=1;const s="label"===t[l-1]?.type?`${D}-label-${l-1}`:void 0;e.push(/* @__PURE__ */J("div",{role:"group","aria-labelledby":s,children:i},`group:${a.key}`))}return e})()})})]})}var Pl=6e4;function Sl({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[a,n]=W(null);return R(()=>{if(!e||null!==a)return;let l=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const r=t.includes("?")?"&":"?",a=await fetch(`${t}${r}t=${Date.now()}`,{cache:"no-store"});if(!a.ok)return;const i=await a.json(),s=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&s&&s!==e&&n(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,a]),a}function Al({currentVersion:e,versionUrl:t,pollMs:r,message:a,onRefresh:n,className:l=""}){const i=Sl({currentVersion:e,versionUrl:t,pollMs:r}),s=$();if(null===i)return null;const o=n??(()=>window.location.reload());/* @__PURE__ */
|
|
460
464
|
return J("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__ */X(ya,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */J(u,{type:"button",variant:"primary",size:"md",onClick:o,children:s.update.refreshNow}),children:[
|
|
461
465
|
/* @__PURE__ */J("span",{className:"font-medium",children:a??s.update.available}),
|
|
462
466
|
/* @__PURE__ */X("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var Fl={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Bl={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function Tl({onClose:e}){const t=$().dialog;/* @__PURE__ */
|
|
@@ -502,7 +506,7 @@ return X("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.tr
|
|
|
502
506
|
/* @__PURE__ */J("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${Ol} text-gray-600 hover:bg-gray-100`,children:"›"}),n&&/* @__PURE__ */J("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${Ol} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function _l(e){const t={};if(!e)return t;for(const[r,a]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof a&&"number"!=typeof a&&"boolean"!=typeof a||(t[r]=a);return t}var Hl=e=>Array.isArray(e.columns),ql={sm:"px-2 py-1.5",md:"px-3 py-2"},Ul={left:"text-left",right:"text-right",center:"text-center"};function Kl({direction:e}){/* @__PURE__ */
|
|
503
507
|
return X("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
504
508
|
/* @__PURE__ */J("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */J("path",{d:"M4 0L8 5H0z"})}),
|
|
505
|
-
/* @__PURE__ */J("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */J("path",{d:"M4 5L0 0h8z"})})]})}function Vl({columns:e,data:t,rowKey:r,sort:a=null,onSortChange:n,pagination:l,caption:i,loading:s=!1,bordered:o=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,emptyText:m,selection:p,footer:g,virtualized:f,stackOnNarrow:x=!1,className:b=""}){const y=$(),v=m??y.table.empty,w=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),k=x&&!f,N=e=>k?{role:e}:{},M=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[C,L]=W(0),D=f?.overscan??6,j=f?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/f.rowHeight)-D);L(e=>e===t?e:t)}:void 0,z=f?Math.ceil(f.height/f.rowHeight)+2*D:t.length,P=f?Math.min(C,Math.max(0,t.length-z)):0,A=Math.min(t.length,P+z),F=f?P*f.rowHeight:0,B=f?(t.length-A)*f.rowHeight:0,T=I(null),[E,R]=W(0);S(()=>{if(!f)return;const e=T.current?.offsetHeight??0;R(t=>t===e?t:e)});const O=e=>e.sortField??e.key,Y=e=>a&&a.field===O(e)?a.direction:null,_=e.flatMap(e=>Hl(e)?e.columns:[e]),H=e.some(Hl),q=/* @__PURE__ */new Map;if(k)for(const t of e)if(Hl(t))for(const e of t.columns)q.set(e,M(t.title,t.label));const U=e=>{const t=M(e.title,e.label),r=q.get(e);return t&&r?`${r} · ${t}`:t},K=new Set(p?.selected??[]),V=p?t.map((e,t)=>w(e,t)):[],
|
|
509
|
+
/* @__PURE__ */J("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */J("path",{d:"M4 5L0 0h8z"})})]})}function Vl({columns:e,data:t,rowKey:r,sort:a=null,onSortChange:n,pagination:l,caption:i,loading:s=!1,bordered:o=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,emptyText:m,selection:p,footer:g,virtualized:f,stackOnNarrow:x=!1,className:b=""}){const y=$(),v=m??y.table.empty,w=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),k=x&&!f,N=e=>k?{role:e}:{},M=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[C,L]=W(0),D=f?.overscan??6,j=f?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/f.rowHeight)-D);L(e=>e===t?e:t)}:void 0,z=f?Math.ceil(f.height/f.rowHeight)+2*D:t.length,P=f?Math.min(C,Math.max(0,t.length-z)):0,A=Math.min(t.length,P+z),F=f?P*f.rowHeight:0,B=f?(t.length-A)*f.rowHeight:0,T=I(null),[E,R]=W(0);S(()=>{if(!f)return;const e=T.current?.offsetHeight??0;R(t=>t===e?t:e)});const O=e=>e.sortField??e.key,Y=e=>a&&a.field===O(e)?a.direction:null,_=e.flatMap(e=>Hl(e)?e.columns:[e]),H=e.some(Hl),q=/* @__PURE__ */new Map;if(k)for(const t of e)if(Hl(t))for(const e of t.columns)q.set(e,M(t.title,t.label));const U=e=>{const t=M(e.title,e.label),r=q.get(e);return t&&r?`${r} · ${t}`:t},K=new Set(p?.selected??[]),V=p?t.map((e,t)=>w(e,t)):[],G=V.length>0&&V.every(e=>K.has(e)),Z=V.some(e=>K.has(e)),ee=p?36:0,te=_.length+(p?1:0),re=_.some(e=>"left"===e.fixed),ae=`${ql[c]} ${"sm"===c?"text-xs":"text-sm"}`,ne=(e,t,r,a=0)=>{const l=Y(e),i=Ul[e.align??(e.numeric?"right":"left")],s="left"===e.fixed,o=!(!e.sortable||!n);/* @__PURE__ */
|
|
506
510
|
return J("th",{scope:"col",...N("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:(ie[t]??0)+ee}:{},...f?{top:a}:{}},className:[ae,i,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs",s?f?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":f?"sticky z-10 bg-gray-50":"",k&&o?"rosh-dt-sort":"",e.headerClassName??""].filter(Boolean).join(" "),children:o?/* @__PURE__ */X("button",{type:"button",onClick:()=>(e=>{if(!n)return;const t=O(e),r=Y(e),a=e.sortFirst??"asc";n(null===r?{field:t,direction:a}:r===a?{field:t,direction:"asc"===a?"desc":"asc"}:null)})(e),"data-group":k?q.get(e):void 0,className:`inline-flex items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[e.title,
|
|
507
511
|
/* @__PURE__ */J(Kl,{direction:l})]}):e.title},e.key)};let le=0;const ie=_.map(e=>{if("left"!==e.fixed)return null;const t=le;return le+=e.width??0,t});/* @__PURE__ */
|
|
508
512
|
return X("div",{className:k?`rosh-dt-stack ${b}`.trim():b,children:[
|
|
@@ -512,13 +516,13 @@ return X("div",{className:k?`rosh-dt-stack ${b}`.trim():b,children:[
|
|
|
512
516
|
/* @__PURE__ */J("span",{className:"sr-only",children:y.table.loading})]}),
|
|
513
517
|
/* @__PURE__ */X("table",{...N("table"),className:(k?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */J("caption",{className:"sr-only",children:i}),
|
|
514
518
|
/* @__PURE__ */X("thead",{...N("rowgroup"),className:k?"rosh-dt-head":void 0,children:[
|
|
515
|
-
/* @__PURE__ */X("tr",{ref:T,...N("row"),className:"border-b border-gray-200 bg-gray-50",children:[p&&/* @__PURE__ */J("th",{scope:"col",...N("columnheader"),rowSpan:H?2:void 0,style:{width:36,...f?{top:0}:{}},className:[ae,re||f?"sticky z-20 bg-gray-50":"",re?"left-0":"",k?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */J(Le,{"aria-label":y.table.selectAll,checked:
|
|
519
|
+
/* @__PURE__ */X("tr",{ref:T,...N("row"),className:"border-b border-gray-200 bg-gray-50",children:[p&&/* @__PURE__ */J("th",{scope:"col",...N("columnheader"),rowSpan:H?2:void 0,style:{width:36,...f?{top:0}:{}},className:[ae,re||f?"sticky z-20 bg-gray-50":"",re?"left-0":"",k?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */J(Le,{"aria-label":y.table.selectAll,checked:G,indeterminate:Z&&!G,onChange:()=>{if(!p)return;const e=new Set(V);p.onChange(G?p.selected.filter(t=>!e.has(t)):[...p.selected,...V.filter(e=>!K.has(e))])}})}),e.map((e,t)=>Hl(e)?/* @__PURE__ */J("th",{scope:"colgroup",...N("columnheader"),colSpan:e.columns.length,style:f?{top:0}:void 0,className:[ae,"text-center","font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs","border-b border-gray-200",f?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:e.title},e.key??`group-${t}`):ne(e,_.indexOf(e),H?2:1))]}),H&&/* @__PURE__ */J("tr",{...N("row"),className:"border-b border-gray-200 bg-gray-50",children:e.flatMap(e=>Hl(e)?e.columns:[]).map(e=>ne(e,_.indexOf(e),1,E))})]}),
|
|
516
520
|
/* @__PURE__ */J("tbody",{...N("rowgroup"),className:k?"rosh-dt-body":void 0,children:0!==t.length||s?/* @__PURE__ */X(Q,{children:[F>0&&/* @__PURE__ */J("tr",{"aria-hidden":"true",children:/* @__PURE__ */J("td",{colSpan:te,style:{height:F,padding:0,border:0}})}),t.slice(P,A).map((e,t)=>{const r=P+t,a=h?.(e,r);/* @__PURE__ */
|
|
517
521
|
return X("tr",{..._l(a),...N("row"),style:f?{height:f.rowHeight}:void 0,onClick:a?.onClick,...a?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a.onClick?.()))}}:{},className:[k?p?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"","border-b border-gray-100 last:border-b-0",a?.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)]":"",u?.(e,r)??"",a?.className??""].filter(Boolean).join(" "),children:[p&&(()=>{const t=w(e,r);/* @__PURE__ */
|
|
518
522
|
return J("td",{...N("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[ae,re?"sticky left-0 z-10 bg-white":"",k?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */J(Le,{"aria-label":y.table.selectRow,checked:K.has(t),onChange:()=>(e=>{p&&p.onChange(K.has(e)?p.selected.filter(t=>t!==e):[...p.selected,e])})(t)})})})(),_.map((t,a)=>{const n="left"===t.fixed,l=t.render?t.render(e,r):t.dataIndex?e[t.dataIndex]:null;/* @__PURE__ */
|
|
519
523
|
return J("td",{...N("cell"),"data-label":k?U(t):void 0,style:n?{left:(ie[a]??0)+ee}:void 0,className:[k?t.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",ae,Ul[t.align??(t.numeric?"right":"left")],t.numeric&&!k?"font-mono":"","text-gray-900",t.ellipsis?"max-w-0 truncate":"",n?"sticky z-10 bg-white":""].filter(Boolean).join(" "),children:k?
|
|
520
|
-
/* @__PURE__ */J("span",{className:t.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:l}):l},t.key)})]},w(e,r))}),B>0&&/* @__PURE__ */J("tr",{"aria-hidden":"true",children:/* @__PURE__ */J("td",{colSpan:te,style:{height:B,padding:0,border:0}})})]}):/* @__PURE__ */J("tr",{...N("row"),className:k?"rosh-dt-empty":void 0,children:/* @__PURE__ */J("td",{...N("cell"),colSpan:te,className:`${ae} py-10 text-center text-gray-500`,children:v})})})]}),g]}),l&&l.pageCount>1&&/* @__PURE__ */J("div",{className:k?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */J(Yl,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]})}function
|
|
521
|
-
return X(Q,{children:[l,e>0?`${i.selected(e)} — `:"",o?null!=r?i.allLoaded(s,a):i.count(s,a):i.loadedOf(t,s,a),n?` · ${i.loadingMore}`:""]})}function
|
|
524
|
+
/* @__PURE__ */J("span",{className:t.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:l}):l},t.key)})]},w(e,r))}),B>0&&/* @__PURE__ */J("tr",{"aria-hidden":"true",children:/* @__PURE__ */J("td",{colSpan:te,style:{height:B,padding:0,border:0}})})]}):/* @__PURE__ */J("tr",{...N("row"),className:k?"rosh-dt-empty":void 0,children:/* @__PURE__ */J("td",{...N("cell"),colSpan:te,className:`${ae} py-10 text-center text-gray-500`,children:v})})})]}),g]}),l&&l.pageCount>1&&/* @__PURE__ */J("div",{className:k?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */J(Yl,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]})}function Gl({selectedCount:e,loadedCount:t,totalCount:r,label:a,isFetchingMore:n,extra:l}){const i=$().list,s=r??t,o=t>=s;/* @__PURE__ */
|
|
525
|
+
return X(Q,{children:[l,e>0?`${i.selected(e)} — `:"",o?null!=r?i.allLoaded(s,a):i.count(s,a):i.loadedOf(t,s,a),n?` · ${i.loadingMore}`:""]})}function Zl({title:e,message:t,onRetry:r,variant:a="dashed"}){const n=$().list;/* @__PURE__ */
|
|
522
526
|
return X("div",{className:`flex flex-col items-center justify-center text-center ${"card"===a?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===a?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
|
|
523
527
|
/* @__PURE__ */J("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__ */J("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"})}),
|
|
524
528
|
/* @__PURE__ */J("h3",{className:"text-sm font-medium text-gray-900",children:e??n.loadError}),
|
|
@@ -740,7 +744,7 @@ return J(Q,{children:e($().errors)})}var zi=class extends V{state={error:null};s
|
|
|
740
744
|
/* @__PURE__ */J("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */J(Di,{code:500,actions:/* @__PURE__ */X(Q,{children:[
|
|
741
745
|
/* @__PURE__ */J(u,{onClick:this.reset,children:/* @__PURE__ */J(ji,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */X("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
|
|
742
746
|
/* @__PURE__ */J("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */J(ji,{pick:e=>e.details})}),
|
|
743
|
-
/* @__PURE__ */J("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 Pi(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Si(e){const t=Pi();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function Ai(){return Pi()?.matches??!1}function Fi(){return!1}function Bi(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,a=parseInt(e.slice(5,7),16)/255,n=Math.max(t,r,a),l=Math.min(t,r,a);let i=0,s=0;const o=(n+l)/2;if(n!==l){const e=n-l;s=o>.5?e/(2-n-l):e/(n+l),i=n===t?((r-a)/e+(r<a?6:0))/6:n===r?((a-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*s,100*o]}function Ti(e,t,r){r/=100;const a=(t/=100)*Math.min(r,1-r),n=t=>{const n=(t+e/30)%12;return r-a*Math.max(Math.min(n-3,9-n,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(n(0))}${l(n(8))}${l(n(4))}`}function Wi(e){const t=e||"system";return"system"===t?Ai()?"dark":"light":t}function Ii(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,a,n]=Bi(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Ti(r,a,Math.max(n-10,5))),t.style.setProperty("--accent-500",Ti(r,a,Math.min(n+10,95))),t.style.setProperty("--accent-400",Ti(r,a,Math.min(n+20,95))),t.style.setProperty("--accent-300",Ti(r,Math.min(a+10,100),Math.min(n+30,92))),t.style.setProperty("--accent-200",Ti(r,Math.min(a+15,100),Math.min(n+38,94))),t.style.setProperty("--accent-100",Ti(r,Math.min(a+20,100),Math.min(n+42,96))),t.style.setProperty("--accent-50",Ti(r,Math.min(a+20,100),Math.min(n+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 Ei(e,t,r,a,n){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))),a&&l.style.setProperty("--window-content-rgb",e(a)),n){l.style.setProperty("--custom-button-color",n);const[e,t,r]=Bi(n);l.style.setProperty("--custom-button-hover",Ti(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}function Ri(e){document.documentElement.setAttribute("data-theme",Wi(e.theme)),Ii(e.accent_color??null),Ei(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 Oi(){const{prefs:e}=i(),t=Z(Si,Ai,Fi),r=e.theme||"system",a=e.accent_color||null,n=e.custom_bg_color||null,l=e.custom_title_color||null,s=e.custom_window_color||null,o=e.custom_button_color||null,c="system"===r?t?"dark":"light":r;return R(()=>(document.documentElement.setAttribute("data-theme",c),()=>document.documentElement.removeAttribute("data-theme")),[c]),R(()=>{Ii(a)},[a]),R(()=>{Ei(a,n,l,s,o)},[a,n,l,s,o]),{theme:r,resolved:c}}function Yi(e,t){R(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var _i=8,Hi=["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)"],qi={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},Ui={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function Ki(e){return Hi[e]??Ui.muted}function Vi(e,t,r){return t||(r?qi[r]:Ki(e))}function Zi(e,t){const[r,a]=e,n=a-r,l=e=>0===n?t.from:t.from+(e-r)/n*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,a)=>r+n*a/(e-1)),l}function Gi(e,t,r=0){const a=e>0?(t.to-t.from)/e:0,n=a*r,l=e=>t.from+e*a+n/2;return l.bandwidth=Math.max(0,a-n),l.center=e=>t.from+e*a+a/2,l.end=e=>t.from+(e+1)*a-n/2,l.count=e,l}function Ji(e,t){const r=[...e].sort((e,t)=>e-t),a=Math.max(0,r.length-1),n=e=>0===a?t.from:t.from+e/a*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return n(t);const l=r.findIndex(t=>t>=e);return n(-1===l?a:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function Xi(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 Qi(e,t){const r=Math.max(e[0],e[1]),a=Math.min(e[0],e[1]),n=r>0?r:0,l=a>0?a:n>0?10**(Math.ceil(Math.log10(n))-3):0,i=Math.log10(l),s=n>0&&l>0?Math.log10(n)-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,n],o.range=t,o.ticks=e=>{if(e<2||s<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(n)),a=[];for(let e=t;e<=r;e+=1)a.push(10**e);return 0===a.length?[l,n]:(Math.log10(a[0])-i>.15&&a.unshift(l),Math.log10(n)-Math.log10(a[a.length-1])>.15&&a.push(n),a)},o}function es(e,t=0){const r=e>0?2*Math.PI/e:0,a=e=>-Math.PI/2+e*r+t/2;return a.step=Math.max(0,r-t),a.center=e=>-Math.PI/2+e*r+r/2,a.count=e,a}function ts(e,t){const[r,a]=e,n=Math.sqrt(Math.max(0,a))-Math.sqrt(Math.max(0,r));return e=>{if(0===n)return t.to;const a=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/n;return t.from+Math.min(1,Math.max(0,a))*(t.to-t.from)}}function rs(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 a=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),n=e[e.length-1];for(const t of r){if(t<e[0]||t>n)continue;const r=t===n?a.length-1:a.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(a[r].count+=1)}return a}const a=t;if(0===r.length||a<1)return[];const n=Math.min(...r),l=(Math.max(...r)-n)/a||1,i=Array.from({length:a},(e,t)=>({from:n+t*l,to:n+(t+1)*l,count:0}));for(const e of r){i[Math.min(a-1,Math.floor((e-n)/l))].count+=1}return i}var as=e=>e.toFixed(2);function ns(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${as(e)},${as(t)}`).join(" ")}function ls(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${as(e.start)},${as(e.y)}`,t+=` L${as(e.end)},${as(e.y)}`}),t}function is(e){if(e.length<3)return ns(e);const t=e.length,r=[],a=[];for(let n=0;n<t-1;n+=1){const t=e[n+1][0]-e[n][0];r.push(t),a.push(0===t?0:(e[n+1][1]-e[n][1])/t)}const n=[a[0]];for(let e=1;e<t-1;e+=1)n.push(a[e-1]*a[e]<=0?0:(a[e-1]+a[e])/2);n.push(a[t-2]);for(let e=0;e<t-1;e+=1){if(0===a[e]){n[e]=0,n[e+1]=0;continue}const t=n[e]/a[e],r=n[e+1]/a[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);n[e]=i*t*a[e],n[e+1]=i*r*a[e]}}let l=`M${as(e[0][0])},${as(e[0][1])}`;for(let a=0;a<t-1;a+=1){const t=r[a]/3;l+=` C${as(e[a][0]+t)},${as(e[a][1]+n[a]*t)} ${as(e[a+1][0]-t)},${as(e[a+1][1]-n[a+1]*t)} ${as(e[a+1][0])},${as(e[a+1][1])}`}return l}function ss(e,t=0){if(e.length<3)return ns(e);const r=e.map(e=>e[1]),a=Math.min(...r),n=Math.max(...r),l=e=>Math.min(n,Math.max(a,e)),i=(1-t)/6;let s=`M${as(e[0][0])},${as(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],a=e[t],n=e[t+1],o=e[t+2]??n,c=a[0]+(n[0]-r[0])*i,d=l(a[1]+(n[1]-r[1])*i),u=n[0]-(o[0]-a[0])*i,h=l(n[1]-(o[1]-a[1])*i);s+=` C${as(c)},${as(d)} ${as(u)},${as(h)} ${as(n[0])},${as(n[1])}`}return s}function os(e){if(e.length<2)return ns(e);let t=`M${as(e[0][0])},${as(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[a,n]=e[r-1],[l,i]=e[r],s=(a+l)/2;t+=` C${as(s)},${as(n)} ${as(s)},${as(i)} ${as(l)},${as(i)}`}return t}function cs(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${as(e[0][0])},${as(e[0][1])}`:"monotone"===t?is(e):"spline"===t?ss(e,r):"bump"===t?os(e):ns(e)}function ds(e,t,r){if(0===t.length)return"";const a=t[0],n=t[t.length-1];return`${e} L${as(n[0])},${as(r)} L${as(a[0])},${as(r)} Z`}function us(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${as(e)},${as(t)}`).join(" L")} Z`}function hs(e,t,r,a,n=-Math.PI/2){return Array.from({length:a},(l,i)=>{const s=n+2*i*Math.PI/a;return[e+r*Math.cos(s),t+r*Math.sin(s)]})}function ms(e,t,r,a,n,l){const i=l-n;if(Math.abs(i)>=2*Math.PI){const l=n+Math.PI;return`${ms(e,t,r,a,n,l)} ${ms(e,t,r,a,l,n+2*Math.PI)}`}const s=Math.abs(i)>Math.PI?1:0,o=(r,a)=>[e+r*Math.cos(a),t+r*Math.sin(a)],[c,d]=o(a,n),[u,h]=o(a,l);if(r<=0)return`M${as(e)},${as(t)} L${as(c)},${as(d)} A${as(a)},${as(a)} 0 ${s} 1 ${as(u)},${as(h)} Z`;const[m,p]=o(r,l),[g,f]=o(r,n);return`M${as(c)},${as(d)} A${as(a)},${as(a)} 0 ${s} 1 ${as(u)},${as(h)} L${as(m)},${as(p)} A${as(r)},${as(r)} 0 ${s} 0 ${as(g)},${as(f)} Z`}function ps(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const a=Math.max(...e),n=Math.min(...e),l=t*t,i=r*r;return Math.max(i*a/l,l/(i*n))}function gs(e,t,r,a){const n=a?r.height:r.width,l=n>0?t/n:0;let i=0;return{tiles:e.map(e=>{const s=t>0?e.value/t*n:0,o=a?{...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:a?{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 fs(e,t,r){const a=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===a.length||t<=0||r<=0)return[];const n=a.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=[...a.map(e=>({...e,value:e.value/n*l}))];for(;d.length>0;){const e=d[0],t=Math.min(s.width,s.height),r=s.width>=s.height,a=ps(o.map(e=>e.value),c,t),n=ps([...o.map(e=>e.value),e.value],c+e.value,t);if(0===o.length||n<=a)o.push(e),c+=e.value,d=d.slice(1);else{const e=gs(o,c,s,r);i.push(...e.tiles),s=e.rest,o=[],c=0}}o.length>0&&i.push(...gs(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 xs=O({highlighted:null,setHighlighted:()=>{}});function bs({children:e}){const[t,r]=W(null),a=Y(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
|
|
747
|
+
/* @__PURE__ */J("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 Pi(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Si(e){const t=Pi();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function Ai(){return Pi()?.matches??!1}function Fi(){return!1}function Bi(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,a=parseInt(e.slice(5,7),16)/255,n=Math.max(t,r,a),l=Math.min(t,r,a);let i=0,s=0;const o=(n+l)/2;if(n!==l){const e=n-l;s=o>.5?e/(2-n-l):e/(n+l),i=n===t?((r-a)/e+(r<a?6:0))/6:n===r?((a-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*s,100*o]}function Ti(e,t,r){r/=100;const a=(t/=100)*Math.min(r,1-r),n=t=>{const n=(t+e/30)%12;return r-a*Math.max(Math.min(n-3,9-n,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(n(0))}${l(n(8))}${l(n(4))}`}function Wi(e){const t=e||"system";return"system"===t?Ai()?"dark":"light":t}function Ii(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,a,n]=Bi(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Ti(r,a,Math.max(n-10,5))),t.style.setProperty("--accent-500",Ti(r,a,Math.min(n+10,95))),t.style.setProperty("--accent-400",Ti(r,a,Math.min(n+20,95))),t.style.setProperty("--accent-300",Ti(r,Math.min(a+10,100),Math.min(n+30,92))),t.style.setProperty("--accent-200",Ti(r,Math.min(a+15,100),Math.min(n+38,94))),t.style.setProperty("--accent-100",Ti(r,Math.min(a+20,100),Math.min(n+42,96))),t.style.setProperty("--accent-50",Ti(r,Math.min(a+20,100),Math.min(n+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 Ei(e,t,r,a,n){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))),a&&l.style.setProperty("--window-content-rgb",e(a)),n){l.style.setProperty("--custom-button-color",n);const[e,t,r]=Bi(n);l.style.setProperty("--custom-button-hover",Ti(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}function Ri(e){document.documentElement.setAttribute("data-theme",Wi(e.theme)),Ii(e.accent_color??null),Ei(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 Oi(){const{prefs:e}=i(),t=G(Si,Ai,Fi),r=e.theme||"system",a=e.accent_color||null,n=e.custom_bg_color||null,l=e.custom_title_color||null,s=e.custom_window_color||null,o=e.custom_button_color||null,c="system"===r?t?"dark":"light":r;return R(()=>(document.documentElement.setAttribute("data-theme",c),()=>document.documentElement.removeAttribute("data-theme")),[c]),R(()=>{Ii(a)},[a]),R(()=>{Ei(a,n,l,s,o)},[a,n,l,s,o]),{theme:r,resolved:c}}function Yi(e,t){R(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var _i=8,Hi=["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)"],qi={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},Ui={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function Ki(e){return Hi[e]??Ui.muted}function Vi(e,t,r){return t||(r?qi[r]:Ki(e))}function Gi(e,t){const[r,a]=e,n=a-r,l=e=>0===n?t.from:t.from+(e-r)/n*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,a)=>r+n*a/(e-1)),l}function Zi(e,t,r=0){const a=e>0?(t.to-t.from)/e:0,n=a*r,l=e=>t.from+e*a+n/2;return l.bandwidth=Math.max(0,a-n),l.center=e=>t.from+e*a+a/2,l.end=e=>t.from+(e+1)*a-n/2,l.count=e,l}function Ji(e,t){const r=[...e].sort((e,t)=>e-t),a=Math.max(0,r.length-1),n=e=>0===a?t.from:t.from+e/a*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return n(t);const l=r.findIndex(t=>t>=e);return n(-1===l?a:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function Xi(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 Qi(e,t){const r=Math.max(e[0],e[1]),a=Math.min(e[0],e[1]),n=r>0?r:0,l=a>0?a:n>0?10**(Math.ceil(Math.log10(n))-3):0,i=Math.log10(l),s=n>0&&l>0?Math.log10(n)-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,n],o.range=t,o.ticks=e=>{if(e<2||s<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(n)),a=[];for(let e=t;e<=r;e+=1)a.push(10**e);return 0===a.length?[l,n]:(Math.log10(a[0])-i>.15&&a.unshift(l),Math.log10(n)-Math.log10(a[a.length-1])>.15&&a.push(n),a)},o}function es(e,t=0){const r=e>0?2*Math.PI/e:0,a=e=>-Math.PI/2+e*r+t/2;return a.step=Math.max(0,r-t),a.center=e=>-Math.PI/2+e*r+r/2,a.count=e,a}function ts(e,t){const[r,a]=e,n=Math.sqrt(Math.max(0,a))-Math.sqrt(Math.max(0,r));return e=>{if(0===n)return t.to;const a=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/n;return t.from+Math.min(1,Math.max(0,a))*(t.to-t.from)}}function rs(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 a=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),n=e[e.length-1];for(const t of r){if(t<e[0]||t>n)continue;const r=t===n?a.length-1:a.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(a[r].count+=1)}return a}const a=t;if(0===r.length||a<1)return[];const n=Math.min(...r),l=(Math.max(...r)-n)/a||1,i=Array.from({length:a},(e,t)=>({from:n+t*l,to:n+(t+1)*l,count:0}));for(const e of r){i[Math.min(a-1,Math.floor((e-n)/l))].count+=1}return i}var as=e=>e.toFixed(2);function ns(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${as(e)},${as(t)}`).join(" ")}function ls(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${as(e.start)},${as(e.y)}`,t+=` L${as(e.end)},${as(e.y)}`}),t}function is(e){if(e.length<3)return ns(e);const t=e.length,r=[],a=[];for(let n=0;n<t-1;n+=1){const t=e[n+1][0]-e[n][0];r.push(t),a.push(0===t?0:(e[n+1][1]-e[n][1])/t)}const n=[a[0]];for(let e=1;e<t-1;e+=1)n.push(a[e-1]*a[e]<=0?0:(a[e-1]+a[e])/2);n.push(a[t-2]);for(let e=0;e<t-1;e+=1){if(0===a[e]){n[e]=0,n[e+1]=0;continue}const t=n[e]/a[e],r=n[e+1]/a[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);n[e]=i*t*a[e],n[e+1]=i*r*a[e]}}let l=`M${as(e[0][0])},${as(e[0][1])}`;for(let a=0;a<t-1;a+=1){const t=r[a]/3;l+=` C${as(e[a][0]+t)},${as(e[a][1]+n[a]*t)} ${as(e[a+1][0]-t)},${as(e[a+1][1]-n[a+1]*t)} ${as(e[a+1][0])},${as(e[a+1][1])}`}return l}function ss(e,t=0){if(e.length<3)return ns(e);const r=e.map(e=>e[1]),a=Math.min(...r),n=Math.max(...r),l=e=>Math.min(n,Math.max(a,e)),i=(1-t)/6;let s=`M${as(e[0][0])},${as(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],a=e[t],n=e[t+1],o=e[t+2]??n,c=a[0]+(n[0]-r[0])*i,d=l(a[1]+(n[1]-r[1])*i),u=n[0]-(o[0]-a[0])*i,h=l(n[1]-(o[1]-a[1])*i);s+=` C${as(c)},${as(d)} ${as(u)},${as(h)} ${as(n[0])},${as(n[1])}`}return s}function os(e){if(e.length<2)return ns(e);let t=`M${as(e[0][0])},${as(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[a,n]=e[r-1],[l,i]=e[r],s=(a+l)/2;t+=` C${as(s)},${as(n)} ${as(s)},${as(i)} ${as(l)},${as(i)}`}return t}function cs(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${as(e[0][0])},${as(e[0][1])}`:"monotone"===t?is(e):"spline"===t?ss(e,r):"bump"===t?os(e):ns(e)}function ds(e,t,r){if(0===t.length)return"";const a=t[0],n=t[t.length-1];return`${e} L${as(n[0])},${as(r)} L${as(a[0])},${as(r)} Z`}function us(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${as(e)},${as(t)}`).join(" L")} Z`}function hs(e,t,r,a,n=-Math.PI/2){return Array.from({length:a},(l,i)=>{const s=n+2*i*Math.PI/a;return[e+r*Math.cos(s),t+r*Math.sin(s)]})}function ms(e,t,r,a,n,l){const i=l-n;if(Math.abs(i)>=2*Math.PI){const l=n+Math.PI;return`${ms(e,t,r,a,n,l)} ${ms(e,t,r,a,l,n+2*Math.PI)}`}const s=Math.abs(i)>Math.PI?1:0,o=(r,a)=>[e+r*Math.cos(a),t+r*Math.sin(a)],[c,d]=o(a,n),[u,h]=o(a,l);if(r<=0)return`M${as(e)},${as(t)} L${as(c)},${as(d)} A${as(a)},${as(a)} 0 ${s} 1 ${as(u)},${as(h)} Z`;const[m,p]=o(r,l),[g,f]=o(r,n);return`M${as(c)},${as(d)} A${as(a)},${as(a)} 0 ${s} 1 ${as(u)},${as(h)} L${as(m)},${as(p)} A${as(r)},${as(r)} 0 ${s} 0 ${as(g)},${as(f)} Z`}function ps(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const a=Math.max(...e),n=Math.min(...e),l=t*t,i=r*r;return Math.max(i*a/l,l/(i*n))}function gs(e,t,r,a){const n=a?r.height:r.width,l=n>0?t/n:0;let i=0;return{tiles:e.map(e=>{const s=t>0?e.value/t*n:0,o=a?{...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:a?{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 fs(e,t,r){const a=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===a.length||t<=0||r<=0)return[];const n=a.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=[...a.map(e=>({...e,value:e.value/n*l}))];for(;d.length>0;){const e=d[0],t=Math.min(s.width,s.height),r=s.width>=s.height,a=ps(o.map(e=>e.value),c,t),n=ps([...o.map(e=>e.value),e.value],c+e.value,t);if(0===o.length||n<=a)o.push(e),c+=e.value,d=d.slice(1);else{const e=gs(o,c,s,r);i.push(...e.tiles),s=e.rest,o=[],c=0}}o.length>0&&i.push(...gs(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 xs=O({highlighted:null,setHighlighted:()=>{}});function bs({children:e}){const[t,r]=W(null),a=Y(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
|
|
744
748
|
return J(xs.Provider,{value:a,children:e})}function ys(){return U(xs)}function vs(e,t,r=.22){return null===t?null:t===e?1:r}function ws(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((a,n)=>{if("number"!=typeof a||!Number.isFinite(a))return;if(null===r)return void(r=n);const l=e[r];("max"===t?a>l:a<l)&&(r=n)}),r}function ks(e,t=720){const[r,a]=W(t);return R(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&a(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function Ns({rows:e,max:t,formatValue:r,emphasisKey:a,highlight:n="none",emphasisTone:l,barHeight:i=12,rowGap:s=30,animate:o=!0,className:c,emptyLabel:d}){const u=$().charts,h=M(),m=r??(e=>D(e,h)),p=d??u.nothingToRank;if(0===e.length)/* @__PURE__ */
|
|
745
749
|
return J("p",{className:`text-sm text-gray-500 ${c??""}`,children:p});const g=ws(e.map(e=>e.value),n),f=a??(null===g?void 0:e[g]?.key),x=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),b=Ki(0);/* @__PURE__ */
|
|
746
750
|
return J("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,a=r?l?qi[l]:Ki(1):f?Ui.muted:b,n=Number.isFinite(e.value)?e.value:null,s=null!==n&&x>0?Math.max(0,Math.min(1,n/x)):0;/* @__PURE__ */
|
|
@@ -801,42 +805,42 @@ return J("div",{className:s,children:/* @__PURE__ */X("svg",{ref:c,width:"100%",
|
|
|
801
805
|
/* @__PURE__ */J("rect",{x:0,y:0,width:p(u),height:n,fill:Ui.surface,fillOpacity:.72}),
|
|
802
806
|
/* @__PURE__ */J("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:n,fill:Ui.surface,fillOpacity:.72}),
|
|
803
807
|
/* @__PURE__ */J("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:n,fill:"none",stroke:m,strokeWidth:1}),D("from"),D("to")]})})}function Bs({labels:e,values:t,height:r=220,width:a,bandPadding:n=.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 x=$().charts,b=M(),y=o??(e=>D(e,b)),v=g??x.noData,w=I(null),k=ks(w),N=a??k,[C,L]=W(null),j=E();if(R(()=>{if(null!==C)return f(e=>"Escape"===e.key&&(L(null),!0))},[C]),0===e.length)/* @__PURE__ */
|
|
804
|
-
return J("div",{className:p,ref:w,children:/* @__PURE__ */J("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:v})});const z={top:12,right:16,bottom:26,left:c?58:48},P=z.left,S=Math.max(P+1,N-z.right),A=z.top,F=r-z.bottom,B=t.filter(Number.isFinite),T=l??Math.min(0,...B),O=
|
|
808
|
+
return J("div",{className:p,ref:w,children:/* @__PURE__ */J("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:v})});const z={top:12,right:16,bottom:26,left:c?58:48},P=z.left,S=Math.max(P+1,N-z.right),A=z.top,F=r-z.bottom,B=t.filter(Number.isFinite),T=l??Math.min(0,...B),O=Gi([T,i??Xi(Math.max(...B,0))],{from:F,to:A}),Y=Zi(e.length,{from:P,to:S},n),_=O.ticks(s+1),H=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor(N/84))));/* @__PURE__ */
|
|
805
809
|
return X("div",{className:`relative ${p??""}`,ref:w,children:[
|
|
806
810
|
/* @__PURE__ */X("svg",{width:"100%",height:r,viewBox:`0 0 ${N} ${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:()=>L(null),onBlur:()=>L(null),onKeyDown:t=>{if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;L(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
|
|
807
811
|
/* @__PURE__ */J("defs",{children:/* @__PURE__ */J("clipPath",{id:j,children:/* @__PURE__ */J("rect",{x:P,y:A,width:S-P,height:F-A})})}),_.map(e=>/* @__PURE__ */J("line",{x1:P,y1:O(e),x2:S,y2:O(e),stroke:Ui.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
808
812
|
/* @__PURE__ */J("line",{x1:P,y1:O(Math.max(T,0)),x2:S,y2:O(Math.max(T,0)),stroke:Ui.axis,strokeWidth:1,shapeRendering:"crispEdges"}),_.map(e=>/* @__PURE__ */J("text",{x:P-8,y:O(e)+4,textAnchor:"end",fontSize:11,fill:Ui.label,style:{fontVariantNumeric:"tabular-nums"},children:y(e)},`t${e}`)),c&&/* @__PURE__ */J("text",{x:14,y:(A+F)/2,transform:`rotate(-90 14 ${(A+F)/2})`,textAnchor:"middle",fontSize:11,fill:Ui.label,children:c}),
|
|
809
813
|
/* @__PURE__ */J("g",{clipPath:`url(#${j})`,children:u({x:Y,y:O,left:P,right:S,top:A,bottom:F,width:N,height:r,clipId:j,active:C})}),e.map((e,t)=>t%H===0?/* @__PURE__ */J("text",{x:"start"===d?Y(t):Y.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Ui.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */J("rect",{x:Y.center(r)-(S-P)/e.length/2,y:A,width:(S-P)/e.length,height:F-A,fill:"transparent",onMouseEnter:()=>L(r)},`h${r}`))]}),h&&null!==C&&
|
|
810
|
-
/* @__PURE__ */J("div",{className:"absolute top-2 z-10",style:{left:`clamp(0px, calc(${(Y.center(C)/N*100).toFixed(2)}% - 88px), calc(100% - 184px))`},children:h(C)})]})}var Ts=12,Ws=16,Is=26,Es=52,Rs=e=>"number"==typeof e&&Number.isFinite(e);function Os({series:e,labels:t,height:r=200,stacked:a=!1,stackMode:n="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:x=!1,brush:b=!1,range:y,onRangeChange:v,loading:w=!1,animate:k=!0,reveal:N="left-to-right",fillVariant:C="gradient",gridStyle:L="solid",width:j,className:P,emptyLabel:S}){const A=$().charts,F=M(),B=d??(e=>D(e,F)),T=S??A.noData,O=I(null),Y=ks(O),_=j??Y,[H,q]=W(null),[U,K]=W(null),{highlighted:V}=ys(),
|
|
811
|
-
return J("div",{className:P,ref:O,children:/* @__PURE__ */J(Ds,{height:r,width:j??Y})});const
|
|
812
|
-
return J("div",{className:P,ref:O,children:/* @__PURE__ */J("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:T})});const ne={left:Es,right:Math.max(Es+1,_-Ws),top:Ts,bottom:r-Is},le=
|
|
814
|
+
/* @__PURE__ */J("div",{className:"absolute top-2 z-10",style:{left:`clamp(0px, calc(${(Y.center(C)/N*100).toFixed(2)}% - 88px), calc(100% - 184px))`},children:h(C)})]})}var Ts=12,Ws=16,Is=26,Es=52,Rs=e=>"number"==typeof e&&Number.isFinite(e);function Os({series:e,labels:t,height:r=200,stacked:a=!1,stackMode:n="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:x=!1,brush:b=!1,range:y,onRangeChange:v,loading:w=!1,animate:k=!0,reveal:N="left-to-right",fillVariant:C="gradient",gridStyle:L="solid",width:j,className:P,emptyLabel:S}){const A=$().charts,F=M(),B=d??(e=>D(e,F)),T=S??A.noData,O=I(null),Y=ks(O),_=j??Y,[H,q]=W(null),[U,K]=W(null),{highlighted:V}=ys(),G=E();if(R(()=>{if(null!==H)return f(e=>"Escape"===e.key&&(q(null),!0))},[H]),w)/* @__PURE__ */
|
|
815
|
+
return J("div",{className:P,ref:O,children:/* @__PURE__ */J(Ds,{height:r,width:j??Y})});const Z=t,Q=y??U??[0,Math.max(0,Z.length-1)],[ee,te]=Q,re=e=>b?e.slice(ee,te+1):e,ae=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(Rs)).map(e=>({...e,data:re(e.data)}));if(t=re(Z),0===ae.length||0===t.length)/* @__PURE__ */
|
|
816
|
+
return J("div",{className:P,ref:O,children:/* @__PURE__ */J("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:T})});const ne={left:Es,right:Math.max(Es+1,_-Ws),top:Ts,bottom:r-Is},le=Zi(t.length,{from:ne.left,to:ne.right}),ie=t.map((e,t)=>ae.reduce((e,r)=>e+(Rs(r.data[t])?r.data[t]:0),0)),se=(e,t)=>ie[t]>0?e/ie[t]:null,oe=[];if(a){let e=t.map(()=>0);for(const t of ae)e=e.map((e,r)=>e+(Rs(t.data[r])?t.data[r]:0)),oe.push("percent"===n?e.map((e,t)=>se(e,t)):[...e])}const ce=l&&l.length>0?Ji(l,{from:ne.bottom,to:ne.top}):null,de=a?(oe.at(-1)??[]).filter(Rs):ae.flatMap(e=>e.data.filter(Rs)),ue=Gi([0,a&&"percent"===n?1:o??Xi(Math.max(...de,0))],{from:ne.bottom,to:ne.top}),he=e=>ce?ce(e):ue(e),me=a&&"percent"===n?e=>z(Math.round(100*e),0,F):B,pe=ce?ce.levels.map(e=>({value:e,y:ce(e)})):ue.ticks(c+1).map(e=>({value:e,y:ue(e)})),ge=e=>r=>{r.preventDefault(),q(r=>{const a=(r??0)+e;return Math.min(t.length-1,Math.max(0,a))})},fe=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(_/96))));/* @__PURE__ */
|
|
813
817
|
return X("div",{className:`relative ${P??""}`,ref:O,children:[
|
|
814
818
|
/* @__PURE__ */X("svg",{width:"100%",height:r,viewBox:`0 0 ${_} ${r}`,role:"img","aria-label":A.overIntervals(ae.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:()=>q(null),onBlur:()=>q(null),onKeyDown:e=>{"ArrowRight"===e.key&&ge(1)(e),"ArrowLeft"===e.key&&ge(-1)(e)},children:[
|
|
815
|
-
/* @__PURE__ */J("defs",{children:/* @__PURE__ */J("clipPath",{id:
|
|
816
|
-
/* @__PURE__ */J(un,{id:
|
|
819
|
+
/* @__PURE__ */J("defs",{children:/* @__PURE__ */J("clipPath",{id:G,children:/* @__PURE__ */J("rect",{x:ne.left,y:ne.top,width:ne.right-ne.left,height:ne.bottom-ne.top})})}),
|
|
820
|
+
/* @__PURE__ */J(un,{id:G,fills:ae.map((e,t)=>({color:Vi(e.slot,e.color,e.tone),variant:e.fillVariant??C})),fadeFrom:a?.42:.3,reveal:!!k&&N}),pe.map(e=>/* @__PURE__ */J("line",{x1:ne.left,y1:e.y,x2:ne.right,y2:e.y,stroke:Ui.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===L?"3 3":void 0},`grid-${e.value}`)),
|
|
817
821
|
/* @__PURE__ */J("line",{x1:ne.left,y1:ne.bottom,x2:ne.right,y2:ne.bottom,stroke:Ui.axis,strokeWidth:1,shapeRendering:"crispEdges"}),pe.map(e=>/* @__PURE__ */J("text",{x:ne.left-8,y:e.y+4,textAnchor:"end",fontSize:11,fill:Ui.label,style:{fontVariantNumeric:"tabular-nums"},children:me(e.value)},`ytick-${e.value}`)),u&&/* @__PURE__ */J("text",{x:12,y:(ne.top+ne.bottom)/2,transform:`rotate(-90 12 ${(ne.top+ne.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:Ui.label,children:u}),
|
|
818
|
-
/* @__PURE__ */J("g",{clipPath:`url(#${
|
|
822
|
+
/* @__PURE__ */J("g",{clipPath:`url(#${G})`,mask:k&&N?`url(#${nn(G)})`:void 0,children:ae.map((e,r)=>{const n=Vi(e.slot,e.color,e.tone),l=e.mode??(a?"area":"line"),o=vs(e.key,V);if("step"===l){const r=t.map((t,r)=>({start:le(r),end:le.end(r),value:e.data[r]})).filter(e=>Rs(e.value)).map(e=>({start:e.start,end:e.end,y:he(e.value)}));/* @__PURE__ */
|
|
819
823
|
return J("path",{d:ls(r),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:o??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,n)=>{const l=a?oe[r]?.[n]:e.data[n];return Rs(l)?[le.center(n),he(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*le.bandwidth);/* @__PURE__ */
|
|
820
824
|
return J("g",{opacity:o??void 0,className:"rosh-viz-mark",children:t.map((t,i)=>{const s=a?oe[r]?.[i]:e.data[i];if(!Rs(s))return null;const o=he(s);/* @__PURE__ */
|
|
821
825
|
return J("rect",{x:le.center(i)-l/2,y:o,width:l,height:Math.max(0,ne.bottom-o),rx:2,fill:n,fillOpacity:.35,className:k?mn.rise:void 0,style:k?pn(i,26):void 0},i)})},e.key)}const d=cs(c,i,s),u=a&&r>0?t.map((e,t)=>[le.center(t),he(oe[r-1]?.[t]??0)-2]):null,h=u?us(d,u):ds(d,c,ne.bottom);/* @__PURE__ */
|
|
822
826
|
return X("g",{opacity:o??void 0,className:"rosh-viz-mark",children:[("area"===l||a)&&
|
|
823
|
-
/* @__PURE__ */J("path",{d:h,fill:sn(
|
|
827
|
+
/* @__PURE__ */J("path",{d:h,fill:sn(G,r,e.fillVariant??C,n),stroke:"none"}),
|
|
824
828
|
/* @__PURE__ */J("path",{d:d,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:on(e.stroke??(e.forecast?"animated-dashed":"solid")),className:k&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?mn.march:void 0})]},e.key)})}),h?.map((e,t)=>{const r=e.color??qi[e.tone??"critical"],a=he(e.value);/* @__PURE__ */
|
|
825
829
|
return X("g",{children:[
|
|
826
830
|
/* @__PURE__ */J("line",{x1:ne.left,y1:a,x2:ne.right,y2:a,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */J("text",{x:ne.right-4,y:a-5,textAnchor:"end",fontSize:10.5,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(p??(m?"last":"none"))&&ae.map((e,r)=>{const n=p??(m?"last":"none"),l=Vi(e.slot,e.color,e.tone),i=[...e.data].map(Rs).lastIndexOf(!0),s="all"===n?t.map((e,t)=>t).filter(t=>Rs(a?oe[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
|
|
827
|
-
return X("g",{children:[s.map(n=>{const s=a?oe[r]?.[n]:e.data[n];return Rs(s)?/* @__PURE__ */J(As,{cx:le.center(n),cy:he(s),color:l,variant:g,pulse:x&&n===i,title:`${t[n]}: ${e.label} ${B(s)}`},n):null}),m&&i>=0&&Rs(a?oe[r]?.[i]:e.data[i])&&/* @__PURE__ */J("text",{x:le.center(i)-10,y:he(a?oe[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:Ui.label,style:{fontVariantNumeric:"tabular-nums"},children:B(a?oe[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%fe===0?/* @__PURE__ */J("text",{x:le.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Ui.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==H&&/* @__PURE__ */J("line",{x1:le.center(H),y1:ne.top,x2:le.center(H),y2:ne.bottom,stroke:Ui.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */J("rect",{x:le(t),y:ne.top,width:Math.max(1,le.bandwidth),height:ne.bottom-ne.top,fill:"transparent",onMouseEnter:()=>q(t)},`hit-${t}`))]}),b&&
|
|
831
|
+
return X("g",{children:[s.map(n=>{const s=a?oe[r]?.[n]:e.data[n];return Rs(s)?/* @__PURE__ */J(As,{cx:le.center(n),cy:he(s),color:l,variant:g,pulse:x&&n===i,title:`${t[n]}: ${e.label} ${B(s)}`},n):null}),m&&i>=0&&Rs(a?oe[r]?.[i]:e.data[i])&&/* @__PURE__ */J("text",{x:le.center(i)-10,y:he(a?oe[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:Ui.label,style:{fontVariantNumeric:"tabular-nums"},children:B(a?oe[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%fe===0?/* @__PURE__ */J("text",{x:le.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Ui.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==H&&/* @__PURE__ */J("line",{x1:le.center(H),y1:ne.top,x2:le.center(H),y2:ne.bottom,stroke:Ui.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */J("rect",{x:le(t),y:ne.top,width:Math.max(1,le.bandwidth),height:ne.bottom-ne.top,fill:"transparent",onMouseEnter:()=>q(t)},`hit-${t}`))]}),b&&Z.length>2&&/* @__PURE__ */J(Fs,{className:"mt-1",labels:Z,width:_,data:e[0]?.data??[],range:Q,onRangeChange:e=>{v?v(e):K(e)}}),null!==H&&
|
|
828
832
|
/* @__PURE__ */J("div",{className:"absolute top-2 z-10",style:{left:`clamp(0px, calc(${(le.center(H)/_*100).toFixed(2)}% - 88px), calc(100% - 184px))`},children:/* @__PURE__ */J(Ss,{title:t[H],rows:ae.map((e,t)=>({key:e.key,label:e.label,color:Vi(e.slot,e.color,e.tone),value:Rs(e.data[H])?a&&"percent"===n?`${z(100*(se(e.data[H],H)??0),1,F)} · ${B(e.data[H])}`:B(e.data[H]):void 0})),footnote:a&&"percent"===n?A.inBucket(B(ie[H])):void 0})})]})}function Ys({series:e,labels:t,stacked:r=!1,stackMode:a="value",height:n=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:x="none"}){const b=E(),{highlighted:y}=ys(),v=$().charts,w=M(),k=s??(e=>D(e,w));if(h)/* @__PURE__ */return J(Ds,{height:n,width:l,variant:"bars",className:c});const N=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),C=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},L=t.map((e,t)=>N.reduce((e,r)=>e+C(r,t),0)),j=t.map((e,t)=>N.reduce((e,r)=>e+Math.max(0,C(r,t)),0)),P=t.map((e,t)=>N.reduce((e,r)=>e+Math.min(0,C(r,t)),0)),S=r&&"percent"===a,A=(e,t)=>L[t]>0?e/L[t]:null,F=S?[1]:r?[...j,...P]:N.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
|
|
829
833
|
return J(Bs,{labels:t,values:F,height:n,width:l,max:S?1:i,formatValue:S?e=>z(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__ */J(Ss,{title:t[e],rows:N.map(t=>({key:t.key,label:t.label,color:Vi(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?S?`${z(100*(A(t.data[e],e)??0),1,w)} · ${k(t.data[e])}`:k(t.data[e]):void 0})),footnote:S?v.inCategory(k(L[e])):void 0}),children:({x:e,y:a,bottom:n,active:l})=>{const i=f?t.indexOf(f):-1,s=ws(r?L:N[0]?.data??[],x),o=l??(i>=0?i:s);/* @__PURE__ */
|
|
830
834
|
return X("g",{children:[
|
|
831
835
|
/* @__PURE__ */J(un,{id:b,glow:p}),t.map((t,n)=>{const l=e.bandwidth/(r?1:Math.max(1,N.length));let i=0,s=0;const c=a(Math.min(a.domain[1],Math.max(a.domain[0],0)));return N.map((t,d)=>{const h=t.data[n];if(!Number.isFinite(h))return null;const f=S?A(h,n):h;if(null===f)return null;const x=Vi(t.slot,t.color,t.tone),v=r?e(n):e(n)+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=a(Math.max(e,t)),k=a(Math.min(e,t)),M=0===e}else w=Math.min(a(f),c),k=Math.max(a(f),c);const $=Math.max(0,k-w-(r&&!M?2:0)),C=null===o||o===n,L=C?x:g?Ui.muted:x,D=vs(t.key,y);/* @__PURE__ */
|
|
832
836
|
return J("rect",{x:v,y:w,width:Math.max(1,l),height:$,rx:u,fill:L,fillOpacity:D??(C?1:g?.32:.45),filter:p&&o===n?`url(#${an(b)})`:void 0,className:"rosh-viz-mark"+(m?` ${mn.rise}`:""),style:m?pn(n*(r?1:N.length)+d,26):void 0},`${t.key}-${n}`)})}),null!==l&&!g&&/* @__PURE__ */J("line",{x1:e.center(l),y1:a(a.domain[1]),x2:e.center(l),y2:n,stroke:Ui.axis,strokeWidth:1})]})}})}var _s=3;function Hs({series:e,height:t=260,width:r,xLabel:a,yLabel:n,formatX:l,formatY:i,xDomain:s,yDomain:o,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=$().charts,g=M(),x=l??(e=>D(e,g)),b=i??(e=>D(e,g)),y=m??p.noObservations,v=I(null),w=ks(v),k=r??w,N=E(),[C,L]=W(null);R(()=>{if(null!==C)return f(e=>"Escape"===e.key&&(L(null),!0))},[C]);const j=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),z=e.filter(e=>e.points.length>0).slice(0,3),P=s||o?z.map(e=>({...e,points:e.points.filter(e=>j(e.x,s)&&j(e.y,o))})).filter(e=>e.points.length>0):z,S=z.reduce((e,t)=>e+t.points.length,0)-P.reduce((e,t)=>e+t.points.length,0);if(0===P.length)/* @__PURE__ */
|
|
833
|
-
return J("div",{className:h,ref:v,children:/* @__PURE__ */J("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:y})});const A=P.flatMap(e=>e.points),F=A.some(e=>null!=e.size),B=14,T=20,O=34,Y=52,_=Math.max(Y+1,k-T),H=(e,t,r,a)=>{const n=e.filter(e=>e>0),l="log"===r?n.length>0?Math.min(...n):0:Math.min(0,...e),i=t??[l,Xi(Math.max(...e))];return"log"===r?Qi(i,a):
|
|
837
|
+
return J("div",{className:h,ref:v,children:/* @__PURE__ */J("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:y})});const A=P.flatMap(e=>e.points),F=A.some(e=>null!=e.size),B=14,T=20,O=34,Y=52,_=Math.max(Y+1,k-T),H=(e,t,r,a)=>{const n=e.filter(e=>e>0),l="log"===r?n.length>0?Math.min(...n):0:Math.min(0,...e),i=t??[l,Xi(Math.max(...e))];return"log"===r?Qi(i,a):Gi(i,a)},q=H(A.map(e=>e.x),s,c,{from:Y,to:_}),U=H(A.map(e=>e.y),o,d,{from:t-O,to:B}),K=ts([0,Math.max(...A.map(e=>e.size??1))],{from:u[0],to:u[1]}),V=C?P[C.s]:void 0,G=C&&V?V.points[C.i]:void 0,Z=P.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
|
|
834
838
|
return X("div",{className:`relative ${h??""}`,ref:v,children:[
|
|
835
|
-
/* @__PURE__ */X("svg",{width:"100%",height:t,viewBox:`0 0 ${k} ${t}`,role:"img","aria-label":p.scatter(P.map(e=>e.label),n??p.yAxis,a??p.xAxis)+(S>0?`. ${p.outsideRange(S)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>L(null),onBlur:()=>L(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=C?
|
|
839
|
+
/* @__PURE__ */X("svg",{width:"100%",height:t,viewBox:`0 0 ${k} ${t}`,role:"img","aria-label":p.scatter(P.map(e=>e.label),n??p.yAxis,a??p.xAxis)+(S>0?`. ${p.outsideRange(S)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>L(null),onBlur:()=>L(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=C?Z.findIndex(e=>e.s===C.s&&e.i===C.i):0;L(Z[Math.min(Z.length-1,Math.max(0,r+t))])},children:[
|
|
836
840
|
/* @__PURE__ */J("defs",{children:/* @__PURE__ */J("clipPath",{id:N,children:/* @__PURE__ */J("rect",{x:Y-u[1],y:B-u[1],width:_-Y+2*u[1],height:t-O-B+2*u[1]})})}),U.ticks(5).map(e=>/* @__PURE__ */X("g",{children:[
|
|
837
841
|
/* @__PURE__ */J("line",{x1:Y,y1:U(e),x2:_,y2:U(e),stroke:Ui.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
838
842
|
/* @__PURE__ */J("text",{x:Y-8,y:U(e)+4,textAnchor:"end",fontSize:11,fill:Ui.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),q.ticks(5).map(e=>/* @__PURE__ */J("text",{x:q(e),y:t-12,textAnchor:"middle",fontSize:11,fill:Ui.label,style:{fontVariantNumeric:"tabular-nums"},children:x(e)},`x${e}`)),a&&/* @__PURE__ */J("text",{x:(Y+_)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:Ui.label,children:a}),n&&/* @__PURE__ */J("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:Ui.label,children:n}),
|
|
839
|
-
/* @__PURE__ */J("g",{clipPath:`url(#${N})`,children:P.map((e,t)=>{const r=Vi(t,e.color,e.tone);return e.points.map((a,n)=>/* @__PURE__ */J("circle",{cx:q(a.x),cy:U(a.y),r:F?K(a.size??0):u[0]+1,fill:r,fillOpacity:C&&C.s!==t?.25:.62,stroke:Ui.surface,strokeWidth:2,onMouseEnter:()=>L({s:t,i:n})},`${e.key}-${n}`))})})]}),C&&V&&
|
|
843
|
+
/* @__PURE__ */J("g",{clipPath:`url(#${N})`,children:P.map((e,t)=>{const r=Vi(t,e.color,e.tone);return e.points.map((a,n)=>/* @__PURE__ */J("circle",{cx:q(a.x),cy:U(a.y),r:F?K(a.size??0):u[0]+1,fill:r,fillOpacity:C&&C.s!==t?.25:.62,stroke:Ui.surface,strokeWidth:2,onMouseEnter:()=>L({s:t,i:n})},`${e.key}-${n}`))})})]}),C&&V&&G&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ss,{title:G.label??V.label,rows:[{key:"x",label:a??p.xAxis,color:Vi(C.s,V.color,V.tone),value:x(G.x)},{key:"y",label:n??p.yAxis,color:Vi(C.s,V.color,V.tone),value:b(G.y)},...null!=G.size?[{key:"size",label:p.size,color:Ui.muted,value:D(G.size,g)}]:[]],footnote:G.label?V.label:void 0})})]})}function qs({rows:e,labels:t,variant:r="area",curve:a="linear",height:n=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=$().charts,x=M(),b=o??(e=>D(e,x)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=Vi(0,d,u);/* @__PURE__ */
|
|
840
844
|
return J(Bs,{labels:t,values:v,height:n,width:l,max:i,min:s,formatValue:b,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(y,t.length),tooltip:r=>/* @__PURE__ */J(Ss,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:b(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:b(e[r].low)}]}),children:({x:t,y:n,active:l})=>"bar"===r?/* @__PURE__ */J("g",{children:e.map((e,r)=>/* @__PURE__ */J("rect",{x:t(r),y:n(e.high),width:Math.max(1,t.bandwidth),height:Math.max(1,n(e.low)-n(e.high)),rx:g,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */X("g",{children:[(()=>{const r=e.map((e,r)=>[t.center(r),n(e.high)]),l=e.map((e,r)=>[t.center(r),n(e.low)]);/* @__PURE__ */
|
|
841
845
|
return X(Q,{children:[
|
|
842
846
|
/* @__PURE__ */J("path",{d:us(cs(r,a),l),fill:w,fillOpacity:.2,stroke:"none"}),
|
|
@@ -855,13 +859,13 @@ return X("g",{opacity:null!==a&&a!==n?.45:1,children:[
|
|
|
855
859
|
/* @__PURE__ */J("line",{x1:l-i/4,y1:r(e.max),x2:l+i/4,y2:r(e.max),stroke:p,strokeWidth:1.5}),
|
|
856
860
|
/* @__PURE__ */J("line",{x1:l-i/4,y1:r(e.min),x2:l+i/4,y2:r(e.min),stroke:p,strokeWidth:1.5}),
|
|
857
861
|
/* @__PURE__ */J("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}),
|
|
858
|
-
/* @__PURE__ */J("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__ */J("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:Ui.surface,strokeWidth:1.5},t))]},n)})})})}function
|
|
862
|
+
/* @__PURE__ */J("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__ */J("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:Ui.surface,strokeWidth:1.5},t))]},n)})})})}function Gs({candles:e,variant:t="candle",height:r=260,width:a,formatValue:n,yAxisLabel:l,label:i,className:s,emptyLabel:o}){const c=$().charts,d=M(),u=n??(e=>Number.isInteger(e)?D(e,d):j(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__ */
|
|
859
863
|
return J(Bs,{labels:e.map(e=>e.label),values:m,height:r,width:a,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],a=r.close>=r.open,n=a?qi.good:qi.critical;/* @__PURE__ */
|
|
860
864
|
return J(Ss,{title:r.label,rows:[{key:"open",label:c.open,color:n,value:u(r.open)},{key:"high",label:c.high,color:n,value:u(r.high)},{key:"low",label:c.low,color:n,value:u(r.low)},{key:"close",label:c.close,color:n,value:u(r.close)}],emphasisKey:"close",footnote:a?c.closedAbove:c.closedBelow})},children:({x:r,y:a,active:n})=>/* @__PURE__ */J("g",{children:e.map((e,l)=>{const i=e.close>=e.open,s=i?qi.good:qi.critical,o=r.center(l),c=Math.max(3,r.bandwidth),d=null!==n&&n!==l,u=a(Math.max(e.open,e.close)),h=Math.max(1,Math.abs(a(e.close)-a(e.open)));/* @__PURE__ */
|
|
861
865
|
return X("g",{opacity:d?.45:1,children:[
|
|
862
866
|
/* @__PURE__ */J("line",{x1:o,y1:a(e.high),x2:o,y2:a(e.low),stroke:s,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */J("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__ */X(Q,{children:[
|
|
863
867
|
/* @__PURE__ */J("line",{x1:o-c/2,y1:a(e.open),x2:o,y2:a(e.open),stroke:s,strokeWidth:2}),
|
|
864
|
-
/* @__PURE__ */J("line",{x1:o,y1:a(e.close),x2:o+c/2,y2:a(e.close),stroke:s,strokeWidth:2})]})]},l)})})})}function
|
|
868
|
+
/* @__PURE__ */J("line",{x1:o,y1:a(e.close),x2:o+c/2,y2:a(e.close),stroke:s,strokeWidth:2})]})]},l)})})})}function Zs({rows:e,columns:t,cells:r,height:a,width:n,color:l,max:i,formatValue:s,label:o,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=$().charts,p=M(),g=s??(e=>D(e,p)),x=o??m.intensity,b=d??m.noActivity,y=I(null),v=ks(y),w=n??v,k=E(),[N,C]=W(null);if(R(()=>{if(null!==N)return f(e=>"Escape"===e.key&&(C(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
|
|
865
869
|
return J("div",{className:c,ref:y,children:/* @__PURE__ */J("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const L=l??Vi(0),j=i??Math.max(1,...r.flat().filter(Number.isFinite)),z=96,P=26*e.length,S=a??P+26+26,A=Math.max(2,(Math.max(97,w)-z)/t.length),F=e=>{const t=j>0?Math.max(0,Math.min(1,e/j)):0;return`color-mix(in oklab, ${L} ${(8+92*t).toFixed(1)}%, ${Ui.surface})`};/* @__PURE__ */
|
|
866
870
|
return X("div",{className:`relative ${c??""}`,ref:y,children:[
|
|
867
871
|
/* @__PURE__ */X("svg",{width:"100%",height:S,viewBox:`0 0 ${w} ${S}`,role:"img","aria-label":m.heatmap(x,e.length,t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>C(null),onBlur:()=>C(null),onKeyDown:r=>{const a="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,n="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===a&&0===n||(r.preventDefault(),C(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+a)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+n))})))},children:[
|
|
@@ -944,4 +948,4 @@ return J("path",{d:`M${n},${l} Q${v},${w} ${i},${s}`,fill:"none",stroke:o,stroke
|
|
|
944
948
|
return X("g",{onMouseEnter:()=>p({kind:"arc",index:t}),children:[
|
|
945
949
|
/* @__PURE__ */J("path",{d:ms(v,w,N,k,r.start,r.end),fill:Vi(r.slot),fillOpacity:null===i||i?1:.45}),
|
|
946
950
|
/* @__PURE__ */J("text",{x:n,y:l+4,fontSize:11,fill:Ui.label,textAnchor:Math.cos(a)>.15?"start":Math.cos(a)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==A&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ss,{title:e[A],rows:[{key:"total",label:c.totalFlow,color:Vi(L.get(A).slot),value:u(x[A])}]})}),F&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ss,{title:`${e[F.from]} → ${e[F.to]}`,rows:[{key:"value",label:c.flow,color:Vi(L.get(F.from).slot),value:u(F.value)}]})}),
|
|
947
|
-
/* @__PURE__ */J(Js,{caption:c.chord(b.length),head:[c.tableFrom,c.tableTo,c.value],rows:P.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{Pl as APP_UPDATE_POLL_MS,La as Accordion,Al as AppUpdateBanner,$r as AttachButton,Nr as AttachmentDropZone,Mr as AttachmentList,Ci as AuthScreen,pa as Avatar,ga as AvatarGroup,ya as Banner,Xl as BarChart,Vs as BoxPlotChart,Ve as BrandAssetEditor,Xa as BudgetBar,Ui as CHART_INK,kt as Calendar,
|
|
951
|
+
/* @__PURE__ */J(Js,{caption:c.chord(b.length),head:[c.tableFrom,c.tableTo,c.value],rows:P.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{Pl as APP_UPDATE_POLL_MS,La as Accordion,Al as AppUpdateBanner,$r as AttachButton,Nr as AttachmentDropZone,Mr as AttachmentList,Ci as AuthScreen,pa as Avatar,ga as AvatarGroup,ya as Banner,Xl as BarChart,Vs as BoxPlotChart,Ve as BrandAssetEditor,Xa as BudgetBar,Ui as CHART_INK,kt as Calendar,Gs as CandlestickChart,Pr as Card,Bs as CartesianPlot,Fs as ChartBrush,un as ChartDefs,As as ChartDot,Ps as ChartFrame,bs as ChartHighlightProvider,Ds as ChartSkeleton,Ss as ChartTooltip,wi as ChatTemplate,Le as Checkbox_default,gi as CheckoutTemplate,uo as ChordChart,Ta as ColoredBadge,Ys as ColumnChart,Cr as ComposerAttachments,cl as ContainerFillChart,sa as CountBadge,Qa as DAY_MS,si as DashboardTemplate,Vl as DataTable,ui as DataTablePage,_t as DatePicker_default,St as DateRangePicker,Kt as DateTimePicker_default,na as DescriptionList,Zr as Divider,ei as DonutChart,Wl as Drawer,zl as DropdownMenu,bi as EmailTemplate,Wa as EmptyState,zi as ErrorBoundary,Di as ErrorPage,vr as FilePicker_default,Ae as FormErrorSummary,ze as FormField,mi as FormLayoutPage,no as FunnelChart,za as GROUP_COLORS,Pa as GROUP_COLORS_SOLID,Mi as GalleryTemplate,El as GlobalSearch,Vr as Grid,Zs as HeatmapChart,wl as HelpCenter,Ks as HistogramChart,le as INPUT_BASE,ne as INPUT_SIZES,te as IconButton_default,Hr as Inline,yr as InputNumber_default,oe as Input_default,Rl as Kanban,Fe as Label,ri as LineChart,Gl as ListFooter,Zl as ListLoadError,rr as MAX_FRACTION_DIGITS,ue as MENU_MAX_HEIGHT,mn as MOTION,yl as Markdown,Ke as MediaUploadField,tt as MediaUploadGrid,$s as Meter,Va as MetricBar,el as MilestoneTimeline,Ne as NativeSelect,ir as NumericKeypad,de as POPUP_MAX_WIDTH,tl as POST_PRODUCTION_STATUSES,Ia as PageHeader,Yl as Pagination,wr as PaperclipGlyph,Er as Paragraph,to as PieChart,Xe as PortalBrandingProvider,sl as ProductionTimeline,Xs as RADAR_SERIES_CAP,eo as RadarChart,ao as RadialBarChart,Se as RadioGroup,je as Radio_default,qs as RangeChart,Ns as RankedBars,_s as SCATTER_SERIES_CAP,_i as SERIES_SLOT_COUNT,Hi as SERIES_VARS,rl as STAGES,qi as STATUS_VARS,co as SankeyChart,Hs as ScatterChart,Dr as SearchableSelect,hr as Segmented,$e as Select_default,la as SettingRow,Nl as SidebarActionButton,Ml as SidebarGroupLabel,$l as SidebarNavItem,Qr as Skeleton,tr as Snippet,Jl as Sparkline,_r as Stack,Sr as StatCard,Ls as StatTile,da as Statistic,Ba as StatusBadge,Fa as StatusBadgeProvider,Ca as Stepper,oo as SunburstChart,fr as Switch_default,Ma as Tabs,jr as TagInput,Tr as Text,ce as Textarea_default,or as TileButton_default,Tt as TimePicker_default,Os as TimeSeriesChart,Xn as TimelineTrack,Ir as Title,ja as Tooltip,Cl as TopNav,lo as TreemapChart,Us as WaterfallChart,es as angleScale,ar as appendKey,Ri as applyThemePrefs,ms as arcPath,us as areaBetween,ds as areaFrom,ws as autoHighlightIndex,nr as backspace,Zi as bandScale,rs as binValues,Za as budgetState,os as bumpPath,al as calcOverall,nl as calcReportOverall,Zt as copyToClipboard,cs as curvePath,on as dashFor,sn as fillFor,rn as fillId,pt as firstDayOfWeek,ye as firstEnabledIndex,tn as fmtSliderDate,ct as formatDate,xt as fromKey,an as glowId,ln as groundId,Sa as groupColors,vs as highlightOpacity,se as inputClasses,Ra as isSeverityTone,Ji as ladderScale,ve as lastEnabledIndex,ns as linearPath,Gi as linearScale,Qi as logScale,nn as maskId,ke as matchTypeahead,Te as mediaFileName,is as monotonePath,we as nextEnabledIndex,Xi as niceMax,hs as polygonPoints,he as popupBounds,ts as radiusScale,Ge as resolvePortalBrandAsset,Vi as resolveSeriesColor,Wi as resolveTheme,Vt as selectionAt,Ki as seriesColor,Oa as severityOf,ss as splinePath,fs as squarify,pn as stagger,ls as stepPath,va as tabButtonId,wa as tabPanelId,en as toDayMs,Ct as toISODate,ft as toKey,Sl as useAppUpdate,Yi as useClickOutside,be as useDropdownPosition,ys as useHighlight,ks as usePlotWidth,Qe as usePortalBranding,ll as useProductionTimeline,Oi as useTheme};
|