efficient-shell 7.7.0 → 7.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{Browser-56LX7FTE.js → Browser-VCRHLL3W.js} +15 -15
- package/dist/Calculator-HFF54RNH.js +29 -0
- package/dist/ConfirmDialog-6LAVAGDE.js +1 -0
- package/dist/{CurrencyConverter-ZXY7XNG6.js → CurrencyConverter-SAIDT4WN.js} +10 -10
- package/dist/{Documents-SVKR757H.js → Documents-OWPQE6D6.js} +11 -11
- package/dist/{Files-KSHU7ROB.js → Files-UCNAQWGM.js} +81 -81
- package/dist/{Notepad-5GT2GUCJ.js → Notepad-NNYMEU7M.js} +9 -9
- package/dist/PdfViewer-PHABUM7K.js +1 -0
- package/dist/{PomodoroTimer-GAGDQ4NF.js → PomodoroTimer-AV3YE2WJ.js} +50 -50
- package/dist/{Preview-YDCDW5NE.js → Preview-PWFREL75.js} +15 -15
- package/dist/Sidebar-3IB3YIWC.js +44 -0
- package/dist/{Spreadsheet-SYR23K4I.js → Spreadsheet-F5BXANOO.js} +11 -11
- package/dist/{Stock-LH5CR667.js → Stock-EP2SB76N.js} +7 -7
- package/dist/{Weather-MZGIPR2R.js → Weather-62FA6T6O.js} +13 -13
- package/dist/{WorldClock-DLB2RRLI.js → WorldClock-C3A6PZYM.js} +5 -5
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-R2TPTM4O.js → chunk-7BX3JQBP.js} +6 -6
- package/dist/{chunk-2R5RTN5T.js → chunk-7HLTPMQV.js} +1 -1
- package/dist/chunk-B4XGJA3N.js +1 -0
- package/dist/{chunk-QUVE5JZZ.js → chunk-BQ7GR7H6.js} +1 -1
- package/dist/{chunk-OXTM3XZI.js → chunk-BXW5WAEX.js} +1 -1
- package/dist/{chunk-JKHXDQEI.js → chunk-FTJ2G343.js} +6 -6
- package/dist/{chunk-5TOLXFQ6.js → chunk-GGSG7HSD.js} +1 -1
- package/dist/{chunk-4JGNJYVL.js → chunk-ICN533ML.js} +8 -8
- package/dist/{chunk-HIRMYFOF.js → chunk-ITCBLL72.js} +2 -2
- package/dist/{chunk-WOEFPBQF.js → chunk-KBOYLXAT.js} +1 -1
- package/dist/{chunk-MSGBGLGI.js → chunk-KSLOSQKN.js} +20 -20
- package/dist/{chunk-N7JTY3LU.js → chunk-MFDZYZZX.js} +8 -8
- package/dist/{chunk-2ALIPI3D.js → chunk-NGUH7T5V.js} +1 -1
- package/dist/{chunk-CQ2DLPPS.js → chunk-SCJT2XXU.js} +1 -1
- package/dist/{chunk-6SCHK75C.js → chunk-THM35LAN.js} +60 -60
- package/dist/{chunk-43XFZY4K.js → chunk-UJL5J7GX.js} +4 -4
- package/dist/{chunk-CLFUF3BH.js → chunk-UZJ6RYMF.js} +4 -4
- package/dist/{chunk-TCYS67ND.js → chunk-W6BQVATM.js} +173 -173
- package/dist/{chunk-NODT4F2C.js → chunk-XN7CAWSZ.js} +2 -2
- package/dist/{chunk-KONXUO5I.js → chunk-Y56GRZ2Q.js} +1 -1
- package/dist/{chunk-PT4Z3KIA.js → chunk-YMWCZKUN.js} +8 -8
- package/dist/{chunk-M4MCXII7.js → chunk-Z2TTHY7G.js} +2 -2
- package/dist/{chunk-CJHT4VTF.js → chunk-ZGUQLVY4.js} +4 -2
- package/dist/{chunk-G4CTTSAR.js → chunk-ZRU5F2XT.js} +4 -4
- package/dist/icons/efficient-looks.js +16 -6
- package/dist/icons/efficient.d.ts +5 -3
- package/dist/icons/efficient.js +49 -46
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/{index-BkBsXpfV.d.ts → index-Cevszdp8.d.ts} +14 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.js +103 -106
- package/dist/map/index.js +9 -9
- package/dist/markdown/index.js +4 -4
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +3 -1
- package/package.json +1 -1
- package/dist/Calculator-GBKLJHM6.js +0 -29
- package/dist/ConfirmDialog-PS5BXNAT.js +0 -1
- package/dist/PdfViewer-YVAWFZVH.js +0 -1
- package/dist/Sidebar-IH6WUPKT.js +0 -44
- package/dist/chunk-BUGGBB5J.js +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-
|
|
2
|
-
/* @__PURE__ */Te("input",{ref:o,"aria-invalid":e||void 0,readOnly:l,className:
|
|
3
|
-
return Te("textarea",{ref:s,"aria-invalid":e||void 0,rows:a,onInput:c,readOnly:i,className:
|
|
1
|
+
import{Breadcrumbs as e}from"./chunk-Z2TTHY7G.js";import{SidebarLayout as t}from"./chunk-UJL5J7GX.js";import{BrandMark as r}from"./chunk-BQ7GR7H6.js";import{isSafeLinkHref as n}from"./chunk-PJPK2ADX.js";import{useShellLanguage as a}from"./chunk-RBKIYZ7H.js";import{toast_default as l}from"./chunk-RUHUTZN4.js";import{useIsMobile as i,useShortcutLabel as o,useShellPrefs as s}from"./chunk-ZRU5F2XT.js";import{isAriaDisabled as c,swallowPress as d,describedByWith as u,OffWithReason as h,useDropdownPosition as m,MENU_MAX_HEIGHT as p,Button_default as g,Tooltip as f,popupBounds as b,VIEWPORT_MARGIN as y,placeMenu as x,followAnchor as v,POPUP_MAX_WIDTH as w,placeAtPoint as N}from"./chunk-YMWCZKUN.js";import{useTabLayer as k,focusableIn as $,useFocusTrap as M,useScrollLock as C,stopAfter as L}from"./chunk-KSLOSQKN.js";import{PopupMenu as D,MenuSemanticsContext as S,leavesContextMenuAlone as P,PopupMenuDivider as A,PopupMenuLabel as j,itemLook as z,MenuCheckMark as F}from"./chunk-ICN533ML.js";import{useDismissPopupsOnOpen as T}from"./chunk-UVBK6YSR.js";import{iconButtonClasses as E,buttonClasses as B}from"./chunk-NGUH7T5V.js";import{glassStyle as O,GLASS_DIVIDER as I}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as R,onOverlayOpen as W,Z_LAYERS as K}from"./chunk-FIEA5CGB.js";import{useBrowserLayoutEffect as _,useBrowserValue as q,useHydrated as U,useBrowserValueOnce as H,useBrowserState as V}from"./chunk-D65T4H6J.js";import{reportBoundaryError as Y}from"./chunk-KNUR2UEG.js";import{useFileIntake as G,humanSize as X,FileIntakeAlert as Z}from"./chunk-M4TRVJTO.js";import{useShellLocale as J,useShellStrings as Q,DEFAULT_SHELL_STRINGS as ee,currentShellStrings as te,splitAround as re}from"./chunk-QRCDQPJA.js";import{formatPlain as ne,formatFixed as ae,formatPercent as le}from"./chunk-C3QOHMR6.js";import{parseFocal as ie,formatFocal as oe,nudgeFocal as se,focalFromRect as ce}from"./chunk-AP2QEJXQ.js";import{calendarNames as de,firstDayOfWeek as ue,formatDate as he,EMPTY_VALUE as me,toInstant as pe,timeAgo as ge,formatDateTime as fe}from"./chunk-W32SKK3D.js";import{Icon as be,setIconSet as ye}from"./chunk-ZGUQLVY4.js";import{forwardRef as xe,useId as ve,useCallback as we,useState as Ne,useRef as ke,useMemo as $e,useEffect as Me,createContext as Ce,Children as Le,isValidElement as De,cloneElement as Se,useContext as Pe,Fragment as Ae,Component as je,useSyncExternalStore as ze,useLayoutEffect as Fe}from"react";import{jsx as Te,jsxs as Ee,Fragment as Be}from"react/jsx-runtime";import{createPortal as Oe}from"react-dom";var Ie=xe(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",pressed:l,disabledReason:i,disabled:o,onClick:s,"aria-disabled":m,"aria-describedby":p,...g},f){const b=ve(),y=(Boolean(o)||c(m))&&null!=i&&""!==i,x=y||c(m),v=/* @__PURE__ */Te("button",{ref:f,type:n,className:E({variant:t,size:r,pressed:l??(!0===g["aria-pressed"]||"true"===g["aria-pressed"]),className:a}),...g,disabled:y?void 0:o,"aria-disabled":!!x||m,"aria-describedby":u(p,y?b:void 0),onClick:x?d:s,children:e});return y?/* @__PURE__ */Te(h,{reason:i,id:b,children:v}):v}),Re="block w-full rounded-(--radius-control) border border-gray-300 bg-white",We="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)]",Ke={sm:"h-6 px-2 text-xs",md:"h-8 px-3 text-sm",lg:"h-10 px-4 text-base",touch:"h-14 px-4 text-base"},_e=`${Re} ${Ke.md} ${We}`,qe=`block w-full rounded-(--radius-control) border border-blue-400 bg-blue-50 rosh-field-on ${Ke.md} ${We}`,Ue="disabled:cursor-not-allowed disabled:opacity-60";function He(e){const t=e?.multiline?Ve:Ke;return[e?.readOnly?`block w-full rounded-(--radius-control) border border-gray-300 bg-gray-50 ${t[e.size??"md"]} ${We}`:e?.multiline||e?.size&&"md"!==e.size?`${Re} ${t[e?.size??"md"]} ${We}`:_e,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",Ue,e?.className??""].filter(Boolean).join(" ")}var Ve={sm:"px-2 py-1 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-2 text-base",touch:Ke.touch},Ye=xe(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",readOnly:l,...i},o){const s=`${t?"pl-9":""} ${r?"pr-9":""}`.trim(),c=
|
|
2
|
+
/* @__PURE__ */Te("input",{ref:o,"aria-invalid":e||void 0,readOnly:l,className:He({invalid:e,size:n,readOnly:l,className:[s,a].filter(Boolean).join(" ")}),...i});return t||r?/* @__PURE__ */Ee("div",{className:"relative",children:[t&&/* @__PURE__ */Te("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:t}),c,r&&/* @__PURE__ */Te("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):c}),Ge=xe(function({invalid:e,autoGrow:t,className:r="",onInput:n,rows:a=3,size:l,readOnly:i,...o},s){const c=we(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}n?.(e)},[t,n]);/* @__PURE__ */
|
|
3
|
+
return Te("textarea",{ref:s,"aria-invalid":e||void 0,rows:a,onInput:c,readOnly:i,className:He({invalid:e,size:l,readOnly:i,multiline:!0,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...o})});function Xe(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Ze(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Je(e,t,r){let n=t+r;for(;n>=0&&n<e.length;){if(!e[n].disabled)return n;n+=r}return t>=0&&t<e.length&&!e[t].disabled?t:r>0?Xe(e):Ze(e)}function Qe(e,t,r){const n=t.toLowerCase(),a=e.length;if(!n||0===a)return-1;for(let t=1;t<=a;t++){const l=((r+t)%a+a)%a,i=e[l];if(!i.disabled&&i.label.toLowerCase().startsWith(n))return l}return-1}var et=e=>Array.isArray(e.options);function tt(e){const t=[];for(const r of e)et(r)?t.push(...r.options):t.push(r);return t}function rt(e,t){const r=[];for(const n of e){if(!et(n)){t(n)&&r.push(n);continue}const e=n.options.filter(t);e.length&&r.push({...n,options:e})}return r}function nt(e,t,r,n=""){const a=[];let l=0;return e.forEach((e,i)=>{if(!et(e))return a.push(t(e,l)),void(l+=1);const o=`${r}-group-${i}`,s=l;l+=e.options.length,a.push(
|
|
4
4
|
/* @__PURE__ */Ee("div",{role:"group","aria-labelledby":o,children:[
|
|
5
5
|
/* @__PURE__ */Te("div",{id:o,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${n}`.trim(),children:e.label}),e.options.map((e,r)=>t(e,s+r))]},o))}),a}function at({selected:e}){/* @__PURE__ */
|
|
6
6
|
return Te(be,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(e?"":"invisible"),strokeWidth:2.5})}var lt=xe(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:i,touchSize:o,renderOption:s,renderValue:c,valueText:d,readOnly:u,multiple:h,...m},p){const g=t;/* @__PURE__ */
|
|
7
|
-
return Ee("select",{ref:p,value:e,multiple:h||void 0,onChange:e=>g(h?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":a||void 0,className:
|
|
7
|
+
return Ee("select",{ref:p,value:e,multiple:h||void 0,onChange:e=>g(h?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":a||void 0,className:He({invalid:a,size:i,className:`pr-8 ${l}`.trim()}),...m,children:[void 0!==n&&!h&&/* @__PURE__ */Te("option",{value:"",disabled:!0,children:n}),
|
|
8
8
|
/* @__PURE__ */Te(it,{items:r})]})});function it({items:e}){const t=e=>/* @__PURE__ */Te("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
9
|
-
return Te(Be,{children:e.map((e,r)=>(e=>et(e))(e)?/* @__PURE__ */Te("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var ot=xe(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:i,disabled:o,size:s,touchSize:c,title:d,multiple:u,renderOption:h,renderValue:g,valueText:f,readOnly:b=!1,"aria-describedby":y,"aria-label":x,"aria-labelledby":v,...w},N){const[k,$]=Ne(!1),[M,C]=Ne(-1),L=ke(null),D=ke(null),S=ke(null),P=ke(k);P.current=k;const A=ke({buffer:"",timer:null}),j=ve(),z=`${j}-listbox`,F=i??`${j}-trigger`,T=e=>`${j}-opt-${e}`,E=$e(()=>tt(r),[r]),B=u?e:[],
|
|
9
|
+
return Te(Be,{children:e.map((e,r)=>(e=>et(e))(e)?/* @__PURE__ */Te("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var ot=xe(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:i,disabled:o,size:s,touchSize:c,title:d,multiple:u,renderOption:h,renderValue:g,valueText:f,readOnly:b=!1,"aria-describedby":y,"aria-label":x,"aria-labelledby":v,...w},N){const[k,$]=Ne(!1),[M,C]=Ne(-1),L=ke(null),D=ke(null),S=ke(null),P=ke(k);P.current=k;const A=ke({buffer:"",timer:null}),j=ve(),z=`${j}-listbox`,F=i??`${j}-trigger`,T=e=>`${j}-opt-${e}`,E=$e(()=>tt(r),[r]),B=u?e:[],I=t,_=m(D,k,{matchTriggerWidth:!0}),q=u?E.findIndex(e=>B.includes(e.value)):E.findIndex(t=>t.value===e),U=u?E.filter(e=>B.includes(e.value)).map(e=>e.label).join(", ")||void 0:q>=0?E[q].label:void 0,H=!u&&q>=0?E[q].lang:void 0,V=u?E.filter(e=>B.includes(e.value)):q>=0?[E[q]]:[],Y=g&&V.length?g(V):void 0,G=void 0!==Y&&f?f(V):void 0,X=we((e=!0)=>{$(!1),C(-1),e&&D.current?.focus()},[]),Z=we(()=>{o||b||(C(q>=0?q:Xe(E)),$(!0))},[o,b,E,q]),J=we(t=>{const r=E[t];if(r&&!r.disabled){if(u){const n=e;return I(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void C(t)}I(r.value),X()}},[E,u,e,I,X]);Me(()=>{if(!k)return;return R(e=>!("Escape"!==e.key||!P.current)&&(X(),!0),()=>S.current)},[k,X]),Me(()=>{if(!k)return;const e=e=>{const t=e.target;L.current?.contains(t)||S.current?.contains(t)||X(!1)};document.addEventListener("pointerdown",e);const t=W(()=>X(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[k,X]),Me(()=>{!k||M<0||S.current?.querySelector(`#${CSS.escape(T(M))}`)?.scrollIntoView({block:"nearest"})});const Q=we(e=>{const t=A.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=k?M:q,n=Qe(E,t.buffer,r);n<0||(k?C(n):u?(C(n),$(!0)):J(n))},[k,M,q,E,J,u]),ee=k?nt(r,(t,r)=>{const n=(a=t.value,u?B.includes(a):e===a);var a;const l=r===M;/* @__PURE__ */
|
|
10
10
|
return Ee("div",{id:T(r),role:"option",lang:t.description||h?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||C(r)},onClick:()=>J(r),className:`mx-1 cursor-pointer truncate rounded-lg min-h-(--row-height-menu) px-3 py-2 text-sm leading-5${u?" flex items-center gap-2":""}\n ${t.disabled?"cursor-not-allowed text-gray-400":l?"bg-blue-50 text-blue-700":n?"font-medium text-blue-600":"text-gray-700"}`,children:[u&&/* @__PURE__ */Te(at,{selected:n}),h?/* @__PURE__ */Te("span",{className:"block min-w-0 flex-1 truncate",children:h(t,{selected:n,active:l})}):u?/* @__PURE__ */Ee("span",{className:"block min-w-0 flex-1",children:[
|
|
11
11
|
/* @__PURE__ */Te("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */Te("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.description?
|
|
12
12
|
/* @__PURE__ */Ee(Be,{children:[
|
|
13
13
|
/* @__PURE__ */Te("span",{lang:t.lang,className:"block truncate",children:t.label}),
|
|
14
14
|
/* @__PURE__ */Te("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},j,"mx-1"):null;/* @__PURE__ */
|
|
15
15
|
return Ee("div",{ref:L,className:"relative",children:[
|
|
16
|
-
/* @__PURE__ */Te("button",{ref:D,id:F,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":k?z:void 0,"aria-activedescendant":k&&M>=0?T(M):void 0,"aria-invalid":a||void 0,"aria-describedby":y,"aria-label":x,"aria-labelledby":v,title:d,disabled:o,"aria-readonly":b||void 0,onClick:()=>k?X():Z(),onKeyDown:e=>{if(!o&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(k?C(e=>Je(E,e,1)):Z());case"ArrowUp":return e.preventDefault(),void(k?C(e=>Je(E,e,-1)):Z());case"Home":return void(k&&(e.preventDefault(),C(Xe(E))));case"End":return void(k&&(e.preventDefault(),C(Ze(E))));case"Enter":return void(k&&(e.preventDefault(),J(M)));case" ":return e.preventDefault(),void(k?J(M):Z());case"Escape":return void(k&&(e.preventDefault(),e.stopPropagation(),X()));case"Tab":return void(k&&X(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),Q(e.key))}},className:
|
|
16
|
+
/* @__PURE__ */Te("button",{ref:D,id:F,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":k?z:void 0,"aria-activedescendant":k&&M>=0?T(M):void 0,"aria-invalid":a||void 0,"aria-describedby":y,"aria-label":x,"aria-labelledby":v,title:d,disabled:o,"aria-readonly":b||void 0,onClick:()=>k?X():Z(),onKeyDown:e=>{if(!o&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(k?C(e=>Je(E,e,1)):Z());case"ArrowUp":return e.preventDefault(),void(k?C(e=>Je(E,e,-1)):Z());case"Home":return void(k&&(e.preventDefault(),C(Xe(E))));case"End":return void(k&&(e.preventDefault(),C(Ze(E))));case"Enter":return void(k&&(e.preventDefault(),J(M)));case" ":return e.preventDefault(),void(k?J(M):Z());case"Escape":return void(k&&(e.preventDefault(),e.stopPropagation(),X()));case"Tab":return void(k&&X(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),Q(e.key))}},className:He({invalid:a,size:s,readOnly:b,className:`${b?"":"pr-8 "}text-left ${l}`.trim()}),children:void 0!==Y?
|
|
17
17
|
/* @__PURE__ */Ee("span",{className:"relative block min-w-0 truncate",children:[
|
|
18
|
-
/* @__PURE__ */Te("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-
|
|
19
|
-
/* @__PURE__ */Te("span",{lang:void 0===G?
|
|
20
|
-
/* @__PURE__ */Ee("select",{ref:N,value:e,multiple:u||void 0,onChange:e=>
|
|
21
|
-
/* @__PURE__ */Te(it,{items:r})]}),k&&
|
|
22
|
-
/* @__PURE__ */Te("div",{ref:S,id:z,role:"listbox","aria-labelledby":v??(x?void 0:F),"aria-label":v?void 0:x,"aria-multiselectable":u||void 0,className:"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:{zIndex:K.popup,left:_?.left,top:_?.top,bottom:_?.bottom,width:_?.width,maxHeight:_?.maxHeight??p,visibility:_?void 0:"hidden",...
|
|
18
|
+
/* @__PURE__ */Te("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Y}),
|
|
19
|
+
/* @__PURE__ */Te("span",{lang:void 0===G?H:void 0,className:"sr-only",children:G??U})]}):/* @__PURE__ */Te("span",{lang:H,className:"block truncate "+(void 0===U?"text-gray-400":""),children:U??n??" "})}),!b&&/* @__PURE__ */Te(be,{name:"chevron-up-down","aria-hidden":"true",className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400",strokeWidth:2}),
|
|
20
|
+
/* @__PURE__ */Ee("select",{ref:N,value:e,multiple:u||void 0,onChange:e=>I(u?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:o,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...w,children:[void 0!==n&&!u&&/* @__PURE__ */Te("option",{value:"",disabled:!0,children:n}),
|
|
21
|
+
/* @__PURE__ */Te(it,{items:r})]}),k&&Oe(
|
|
22
|
+
/* @__PURE__ */Te("div",{ref:S,id:z,role:"listbox","aria-labelledby":v??(x?void 0:F),"aria-label":v?void 0:x,"aria-multiselectable":u||void 0,className:"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:{zIndex:K.popup,left:_?.left,top:_?.top,bottom:_?.bottom,width:_?.width,maxHeight:_?.maxHeight??p,visibility:_?void 0:"hidden",...O()},children:ee}),document.body)]})}),st=xe(function({touchSize:e="touch",...t},r){return i()&&!t.readOnly?/* @__PURE__ */Te(lt,{ref:r,...t,size:e}):/* @__PURE__ */Te(ot,{ref:r,...t})});function ct(e,t,r,n){const a=ve(),l=!!e&&!!t,i=l?`${a}-label`:void 0,o=l?`${a}-description`:void 0;return{labelId:i,descriptionId:o,labelledBy:r??i,describedBy:[n,o].filter(Boolean).join(" ")||void 0}}var dt=xe(function({checked:e,onChange:t,indeterminate:r=!1,label:n,description:a,disabled:l,className:i="","aria-labelledby":o,"aria-describedby":s,...c},d){const u=ke(null),h=ct(n,a,o,s);Me(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=we(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */Te("input",{ref:m,type:"checkbox",checked:e,disabled:l,onChange:e=>t(e.target.checked),className:`h-4 w-4 shrink-0 rounded border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 ${r}`.trim(),"aria-labelledby":h.labelledBy,"aria-describedby":h.describedBy,...c});return n||a?/* @__PURE__ */Ee("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
|
|
23
23
|
/* @__PURE__ */Ee("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */Te("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */Te("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),ut="h-4 w-4 shrink-0 border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60",ht=xe(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":o,...s},c){const d=ct(r,n,i,o);return r||n?/* @__PURE__ */Ee("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
|
|
24
24
|
/* @__PURE__ */Te("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${ut} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s}),
|
|
25
25
|
/* @__PURE__ */Ee("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */Te("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */Te("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */Te("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${ut} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s})});function mt({label:e,htmlFor:t,labelId:r,hint:n,error:a,required:l,className:i="",children:o}){const s=t?a?`${t}-error`:n?`${t}-hint`:void 0:void 0,c=1===Le.count(o)?Le.only(o):null,d=De(c)?c:null,u={};if(d){if(s){const e=(d.props["aria-describedby"]??"").split(/\s+/);u["aria-describedby"]=Array.from(new Set([...e,s].filter(Boolean))).join(" ")}a&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0)}const h=d&&Object.keys(u).length>0?Se(d,u):o;/* @__PURE__ */
|
|
@@ -28,26 +28,26 @@ return Ee("div",{className:i,children:[e&&/* @__PURE__ */Ee("label",{id:r,htmlFo
|
|
|
28
28
|
return Te(mt,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */Te("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:pt[s],children:o.map(e=>/* @__PURE__ */Te(ht,{name:a,value:e.value,checked:l===e.value,onChange:t=>{t&&i(e.value)},label:e.label,description:e.description,disabled:c||e.disabled},e.value))})})}function ft({errors:e,title:t,autoFocus:r=!0,className:n=""}){const a=Q(),l=ke(null),i=ke(!1);if(Me(()=>{const t=e.length>0;t&&!i.current&&r&&l.current?.focus(),i.current=t},[e.length>0,r]),0===e.length)return null;/* @__PURE__ */
|
|
29
29
|
return Ee("div",{ref:l,role:"alert",tabIndex:-1,className:`rounded-md border border-red-300 bg-red-50 px-4 py-3 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-invalid-solid)] ${n}`.trim(),children:[
|
|
30
30
|
/* @__PURE__ */Te("h2",{className:"text-sm font-semibold text-red-800",children:t??a.form.errorSummaryTitle}),
|
|
31
|
-
/* @__PURE__ */Te("ul",{className:"mt-
|
|
31
|
+
/* @__PURE__ */Te("ul",{className:"mt-2 space-y-1",children:e.map(({fieldId:e,message:t},r)=>/* @__PURE__ */Te("li",{children:e?/* @__PURE__ */Te("a",{href:`#${e}`,onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&(t.scrollIntoView({block:"center"}),t.focus())})(e)},className:"text-sm text-red-700 underline hover:text-red-900",children:t}):
|
|
32
32
|
/* @__PURE__ */Te("span",{className:"text-sm text-red-700",children:t})},`${e??""}-${r}`))})]})}var bt="text-xs font-medium text-gray-600";function yt({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",bt,t].filter(Boolean).join(" ")}function xt({required:e,children:t,className:r="",...n}){/* @__PURE__ */
|
|
33
|
-
return Ee("label",{className:yt({className:r}),...n,children:[t,e&&/* @__PURE__ */Te("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var vt=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function wt(e){if(/^data:/i.test(e||""))return function(e){const t=vt.exec(e);if(!t)return"media";const[,r,n]=t,a=n.split("+")[0].split(".").pop().replace(/^x-/i,"");return a?`${r.toLowerCase()}.${a.toLowerCase()}`:"media"}(e);const t=(e||"").split("?")[0].split("#")[0],r=t.substring(t.lastIndexOf("/")+1);try{return decodeURIComponent(r.replace(/^[0-9a-f]{32}_/i,""))||r||"media"}catch{return r||"media"}}var Nt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function kt(e,t=ee.media){const r=function(e){const t=e.includes("video"),r=e.includes("image")||"*"===e||""===e;return t&&!r?"video":r&&!t?"image":"file"}(e);return"image"===r?t.uploadImage:"video"===r?t.uploadVideo:t.uploadFile}function $t(e,t,r=""){return["flex w-full flex-col items-center justify-center gap-
|
|
33
|
+
return Ee("label",{className:yt({className:r}),...n,children:[t,e&&/* @__PURE__ */Te("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var vt=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function wt(e){if(/^data:/i.test(e||""))return function(e){const t=vt.exec(e);if(!t)return"media";const[,r,n]=t,a=n.split("+")[0].split(".").pop().replace(/^x-/i,"");return a?`${r.toLowerCase()}.${a.toLowerCase()}`:"media"}(e);const t=(e||"").split("?")[0].split("#")[0],r=t.substring(t.lastIndexOf("/")+1);try{return decodeURIComponent(r.replace(/^[0-9a-f]{32}_/i,""))||r||"media"}catch{return r||"media"}}var Nt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function kt(e,t=ee.media){const r=function(e){const t=e.includes("video"),r=e.includes("image")||"*"===e||""===e;return t&&!r?"video":r&&!t?"image":"file"}(e);return"image"===r?t.uploadImage:"video"===r?t.uploadVideo:t.uploadFile}function $t(e,t,r=""){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",t?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",r].filter(Boolean).join(" ")}function Mt(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function Ct({label:e,rounded:t="rounded-lg"}){/* @__PURE__ */
|
|
34
34
|
return Ee("div",{role:"status",className:`absolute inset-0 flex items-center justify-center gap-2 bg-white/60 ${t}`,children:[
|
|
35
35
|
/* @__PURE__ */Te(St,{}),
|
|
36
36
|
/* @__PURE__ */Te("span",{className:"text-xs font-medium text-gray-600",children:e})]})}function Lt({children:e}){/* @__PURE__ */
|
|
37
|
-
return Te("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-
|
|
37
|
+
return Te("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function Dt(e,t=""){if(!e)return!1;const r=vt.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return Nt.test(e)||n&&!a}function St({className:e="h-5 w-5"}){/* @__PURE__ */
|
|
38
38
|
return Ee("svg",{className:`${e} animate-spin text-gray-400`,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
|
|
39
39
|
/* @__PURE__ */Te("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
|
|
40
40
|
/* @__PURE__ */Te("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function Pt({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
41
41
|
return Te(be,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function At({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
42
|
-
return Te(be,{name:"upload",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function jt({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:s,accept:c="image/*",maxSizeBytes:d,fit:u="cover",height:h=112,placeholder:m,cta:p,acceptHint:f,showFilename:b=!0,allowReplace:y=!0,allowRemove:x=!0,replaceLabel:v,removeLabel:w,busy:N=!1,busyLabel:k,disabled:$=!1}){const M=Q().media,C=p??M.cta,L=v??M.replace,D=w??M.remove,S=k??M.uploading,P=ve(),A=ke(null),[j,z]=Ne(null);Me(()=>()=>{A.current&&URL.revokeObjectURL(A.current)},[]);const F=$||N,T=!!e&&(Dt(e,c)||e===j),E=m??kt(c,M),B=e=>{r?r(e):n?n(e):(e=>{A.current&&URL.revokeObjectURL(A.current);const r=URL.createObjectURL(e);A.current=r,z(e.type.startsWith("video/")?r:null),t(r)})(e)},
|
|
43
|
-
/* @__PURE__ */Ee("div",{...
|
|
42
|
+
return Te(be,{name:"upload",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function jt({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:s,accept:c="image/*",maxSizeBytes:d,fit:u="cover",height:h=112,placeholder:m,cta:p,acceptHint:f,showFilename:b=!0,allowReplace:y=!0,allowRemove:x=!0,replaceLabel:v,removeLabel:w,busy:N=!1,busyLabel:k,disabled:$=!1}){const M=Q().media,C=p??M.cta,L=v??M.replace,D=w??M.remove,S=k??M.uploading,P=ve(),A=ke(null),[j,z]=Ne(null);Me(()=>()=>{A.current&&URL.revokeObjectURL(A.current)},[]);const F=$||N,T=!!e&&(Dt(e,c)||e===j),E=m??kt(c,M),B=e=>{r?r(e):n?n(e):(e=>{A.current&&URL.revokeObjectURL(A.current);const r=URL.createObjectURL(e);A.current=r,z(e.type.startsWith("video/")?r:null),t(r)})(e)},O=G({accept:c,maxSizeBytes:d,acceptHint:f,multiple:!1,disabled:F,onAccept:([e])=>B(e)}),{dragOver:I}=O,R=()=>{F||(r?r():O.open())},W=e?wt(e):"",K=/* @__PURE__ */Ee("div",{children:[
|
|
43
|
+
/* @__PURE__ */Ee("div",{...O.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",I?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[T?/* @__PURE__ */Te("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":W||void 0,className:"h-full w-full",style:{objectFit:u}}):/* @__PURE__ */Te("img",{src:e??void 0,alt:W,className:"h-full w-full",style:{objectFit:u}}),b&&e&&/* @__PURE__ */Te(Lt,{children:W}),N&&/* @__PURE__ */Te(Ct,{label:S,rounded:"rounded-md"})]}),!$&&(y||x)&&/* @__PURE__ */Ee("div",{className:"mt-2 flex gap-2",children:[y&&/* @__PURE__ */Te(g,{id:P,variant:"secondary",size:"sm",onClick:()=>R(),disabled:N,children:L}),x&&/* @__PURE__ */Te(g,{variant:"ghost",size:"sm",onClick:()=>{A.current&&(URL.revokeObjectURL(A.current),A.current=null),z(null),t("")},disabled:N,children:D})]})]}),_=/* @__PURE__ */Te("button",{type:"button",id:P,onClick:()=>R(),disabled:F,"aria-label":"string"==typeof E?E:M.upload,"aria-busy":N||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${P}-error`:l?`${P}-hint`:void 0,...O.zoneProps,className:$t(I,F,Mt(F)),style:{minHeight:h},children:N?/* @__PURE__ */Ee("span",{role:"status",className:"flex flex-col items-center gap-2",children:[
|
|
44
44
|
/* @__PURE__ */Te(St,{}),
|
|
45
45
|
/* @__PURE__ */Te("span",{className:"text-xs font-medium text-gray-500",children:S})]}):/* @__PURE__ */Ee(Be,{children:[
|
|
46
46
|
/* @__PURE__ */Te("span",{className:"text-gray-400",children:/* @__PURE__ */Te(At,{})}),
|
|
47
47
|
/* @__PURE__ */Te("span",{className:"px-3 text-xs text-gray-500",children:E}),
|
|
48
48
|
/* @__PURE__ */Te("span",{className:"text-sm font-medium text-blue-600",children:C}),f&&/* @__PURE__ */Te("span",{className:"text-xs text-gray-400",children:f})]})});/* @__PURE__ */
|
|
49
|
-
return Ee(mt,{label:a,htmlFor:P,hint:l,error:i,required:o,className:s,children:[e?K:_,!r&&/* @__PURE__ */Te("input",{...
|
|
50
|
-
/* @__PURE__ */Te(Z,{rejections:
|
|
49
|
+
return Ee(mt,{label:a,htmlFor:P,hint:l,error:i,required:o,className:s,children:[e?K:_,!r&&/* @__PURE__ */Te("input",{...O.inputProps}),
|
|
50
|
+
/* @__PURE__ */Te(Z,{rejections:O.rejections})]})}function zt({committedUrl:e,committedHasAlpha:t=null,committedIsLight:n=null,fallbackUrl:a,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:o,assetName:s,onSave:c,onRemove:d,accept:u="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:h="PNG · ICO · SVG · JPG · WEBP",maxBytes:m=5242880,previews:p=[],disabled:f=!1}){const b=ke(null),[y,x]=Ne(null),[v,w]=Ne(""),[N,k]=Ne(""),[$,M]=Ne(!1),[C,L]=Ne(!1),D=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(s),S=Q().brandAsset,P=v||e||a||"",A=y?null:e?t:l,j=y?null:e?n:i;Me(()=>()=>{b.current&&URL.revokeObjectURL(b.current)},[]);const z=()=>{b.current&&(URL.revokeObjectURL(b.current),b.current=null)};/* @__PURE__ */
|
|
51
51
|
return Ee("section",{"aria-label":S.region(s,o),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
52
52
|
/* @__PURE__ */Ee("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
53
53
|
/* @__PURE__ */Te(jt,{value:P,onChange:()=>{},onFile:e=>{if(f)return;z();const t=URL.createObjectURL(e);b.current=t,x(e),w(t),k("")},label:s,hint:N||S.usedFor(o),error:N||void 0,accept:u,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:$||C,disabled:f}),
|
|
@@ -65,41 +65,41 @@ return Ee("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-whit
|
|
|
65
65
|
/* @__PURE__ */Te("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-full border border-gray-200 bg-gray-50",children:t}),
|
|
66
66
|
/* @__PURE__ */Ee("div",{className:"min-w-0 leading-tight",children:[
|
|
67
67
|
/* @__PURE__ */Te("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??o}),e.url&&/* @__PURE__ */Te("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
|
|
68
|
-
/* @__PURE__ */Te("div",{className:"mt-
|
|
68
|
+
/* @__PURE__ */Te("div",{className:"mt-2 text-sm font-medium text-blue-700",children:e.title??o}),e.description&&/* @__PURE__ */Te("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */Ee("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,
|
|
69
69
|
/* @__PURE__ */Te("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function Ft(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 Tt=Ce(null);function Et(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 Bt({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=Ne(t),[i,o]=Ne(!0),[s,c]=Ne(null),d=ke(e),u=ke(t);d.current=e,u.current=t,Me(()=>{const e=new AbortController;let t=!0;return l(u.current),o(!0),c(null),d.current(e.signal).then(e=>{t&&(l(e),o(!1))},e=>{t&&(c(e instanceof Error?e:new Error("Could not load portal branding.")),o(!1))}),()=>{t=!1,e.abort()}},[]),Me(()=>(Et(a.favicon_url),()=>Et(null)),[a.favicon_url]),Me(()=>{r&&(document.title=r(a))},[a,r]);const h=$e(()=>({branding:a,loading:i,error:s}),[a,i,s]);/* @__PURE__ */
|
|
70
|
-
return Te(Tt.Provider,{value:h,children:n})}function
|
|
70
|
+
return Te(Tt.Provider,{value:h,children:n})}function Ot(){const e=Pe(Tt);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var It=/* @__PURE__ */Te(be,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function Rt({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,label:l,hint:i,error:o,required:s,className:c,accept:d="image/*",maxSizeBytes:u,maxFiles:h,fit:m="cover",thumbSize:p=96,placeholder:g,cta:f,acceptHint:b,showCover:y=!1,coverLabel:x,busy:v=!1,busyLabel:w,disabled:N=!1,readOnly:k=!1}){const $=Q().media,M=f??$.cta,C=x??$.cover,L=w??$.uploading,D=ve(),[S,P]=Ne(null),A=N||v,j=!(!t&&!r||A||k),z=!!n&&!A&&!k,F=!!a&&!A&&!k,T=Mt(A),E=g??kt(d,$),B=G({accept:d,maxSizeBytes:u,maxFiles:h,acceptHint:b,multiple:!0,disabled:!j,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),O=B.dragOver,I=()=>{j&&(t?t():B.open())},R={width:p,height:p},W=j&&/* @__PURE__ */Ee("button",{type:"button",onClick:()=>I(),"aria-label":$.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${T}`,style:R,children:[
|
|
71
71
|
/* @__PURE__ */Te(At,{className:"h-5 w-5"}),
|
|
72
|
-
/* @__PURE__ */Te("span",{className:"text-xs font-medium text-gray-500",children:$.add})]}),K=j?/* @__PURE__ */Ee("button",{type:"button",onClick:()=>
|
|
72
|
+
/* @__PURE__ */Te("span",{className:"text-xs font-medium text-gray-500",children:$.add})]}),K=j?/* @__PURE__ */Ee("button",{type:"button",onClick:()=>I(),"aria-label":"string"==typeof E?E:$.upload,className:$t(O,!1,T),style:{minHeight:p+32},children:[
|
|
73
73
|
/* @__PURE__ */Te("span",{className:"text-gray-400",children:/* @__PURE__ */Te(At,{})}),
|
|
74
74
|
/* @__PURE__ */Te("span",{className:"px-3 text-xs text-gray-500",children:E}),
|
|
75
75
|
/* @__PURE__ */Te("span",{className:"text-sm font-medium text-blue-600",children:M}),b&&/* @__PURE__ */Te("span",{className:"text-xs text-gray-400",children:b})]}):/* @__PURE__ */Te("div",{className:"flex w-full items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-3 text-xs text-gray-400",style:{minHeight:p+32},children:$.empty});/* @__PURE__ */
|
|
76
76
|
return Ee(mt,{label:l,labelId:l?`${D}-label`:void 0,htmlFor:D,hint:i,error:o,required:s,className:c,children:[
|
|
77
|
-
/* @__PURE__ */Ee("div",{id:D,role:"group","aria-labelledby":l?`${D}-label`:void 0,"aria-describedby":o?`${D}-error`:i?`${D}-hint`:void 0,"aria-busy":v||void 0,...B.zoneProps,className:"relative rounded-lg transition-colors",style:{...A?{opacity:.6}:{},...
|
|
78
|
-
return Ee("div",{draggable:F||void 0,onDragStart:F?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),P(r)}:void 0,onDragEnd:F?()=>P(null):void 0,onDragOver:F?e=>{null!=S&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:F?e=>{null!=S&&(e.preventDefault(),e.stopPropagation(),S!==r&&a(S,r),P(null))}:void 0,tabIndex:F?0:void 0,"aria-label":F?$.reorder(i,r+1,e.length):void 0,onKeyDown:F?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",T,S===r?"opacity-50":""].join(" "),style:{...R,cursor:F?"move":void 0},children:[l?/* @__PURE__ */Te("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */Te("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),o&&/* @__PURE__ */Te("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-
|
|
79
|
-
/* @__PURE__ */Te(Z,{rejections:B.rejections})]})}var Wt=e=>String(e).padStart(2,"0"),Kt="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";function _t(e){return`${e.getFullYear()}-${Wt(e.getMonth()+1)}-${Wt(e.getDate())}`}function qt(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var
|
|
77
|
+
/* @__PURE__ */Ee("div",{id:D,role:"group","aria-labelledby":l?`${D}-label`:void 0,"aria-describedby":o?`${D}-error`:i?`${D}-hint`:void 0,"aria-busy":v||void 0,...B.zoneProps,className:"relative rounded-lg transition-colors",style:{...A?{opacity:.6}:{},...O?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?K:/* @__PURE__ */Ee("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:Dt(t.url,d),i=wt(t.url),o=y&&(t.cover??0===r);/* @__PURE__ */
|
|
78
|
+
return Ee("div",{draggable:F||void 0,onDragStart:F?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),P(r)}:void 0,onDragEnd:F?()=>P(null):void 0,onDragOver:F?e=>{null!=S&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:F?e=>{null!=S&&(e.preventDefault(),e.stopPropagation(),S!==r&&a(S,r),P(null))}:void 0,tabIndex:F?0:void 0,"aria-label":F?$.reorder(i,r+1,e.length):void 0,onKeyDown:F?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",T,S===r?"opacity-50":""].join(" "),style:{...R,cursor:F?"move":void 0},children:[l?/* @__PURE__ */Te("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */Te("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),o&&/* @__PURE__ */Te("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-2 py-0.5 text-xs font-medium text-white",children:C}),null!=t.caption&&/* @__PURE__ */Te(Lt,{children:t.caption}),z&&/* @__PURE__ */Te("button",{type:"button",onClick:()=>n(t.id),"aria-label":$.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${T}`,style:{background:"var(--rosh-media-scrim-button)"},children:It})]},t.id)}),W]}),v&&/* @__PURE__ */Te(Ct,{label:L})]}),!t&&r&&/* @__PURE__ */Te("input",{...B.inputProps}),
|
|
79
|
+
/* @__PURE__ */Te(Z,{rejections:B.rejections})]})}var Wt=e=>String(e).padStart(2,"0"),Kt="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";function _t(e){return`${e.getFullYear()}-${Wt(e.getMonth()+1)}-${Wt(e.getDate())}`}function qt(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var Ut=e=>`${e.getFullYear()}-${Wt(e.getMonth()+1)}`;var Ht=()=>_t(/* @__PURE__ */new Date);var Vt=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Yt=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),n=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),n))};function Gt({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:o,onMonthChange:s,weekStartsOn:c,quickJump:d=!0,markedDates:u,readOnly:h=!1,"aria-label":m,className:p=""}){const g=$e(()=>new Set(u??[]),[u]),f=qt(e),b=q(Ht,null),y=qt(b),x=Q().calendar,v=J(),w=de(v),N=q(()=>ue(v),0),k=c??N,$=()=>{if(!y)return null;const e=Ut(y);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[M,C]=Ne(()=>o||(f?Ut(f):$())),L=i??M??$(),D=null===L?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(L,y),[S,P]=Ne(()=>e??b),A=ke(null),j=ke(!1),[z,F]=Ne("days"),T=$e(()=>D?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),n=(r.getDay()-t+7)%7,a=new Date(r.getFullYear(),r.getMonth(),1-n);return Array.from({length:42},(e,t)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+t))}(D,k):[],[L,k]),E=e=>!!a&&e<a||!!l&&e>l,B=S??b,O=T.some(e=>_t(e)===B),I=D?T.find(e=>e.getMonth()===D.getMonth())??T[0]:null,R=O&&B?B:I?_t(I):"";if(Me(()=>{j.current&&(j.current=!1,A.current?.querySelector('[data-active="true"]')?.focus())},[R,L]),!D)/* @__PURE__ */
|
|
80
80
|
return Ee("div",{className:p,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
81
81
|
/* @__PURE__ */Te("div",{className:"mb-2 h-6"}),
|
|
82
|
-
/* @__PURE__ */Te("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */Te("div",0===t?{className:"py-1 text-xs",children:" "}:{className:Kt,children:/* @__PURE__ */Te("span",{className:"aspect-square"})},t))})]});const W=e=>"years"===z?new Date(D.getFullYear()+12*e,D.getMonth(),1):"months"===z?new Date(D.getFullYear()+e,D.getMonth(),1):Yt(D,e),K=e=>{const t=
|
|
82
|
+
/* @__PURE__ */Te("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */Te("div",0===t?{className:"py-1 text-xs",children:" "}:{className:Kt,children:/* @__PURE__ */Te("span",{className:"aspect-square"})},t))})]});const W=e=>"years"===z?new Date(D.getFullYear()+12*e,D.getMonth(),1):"months"===z?new Date(D.getFullYear()+e,D.getMonth(),1):Yt(D,e),K=e=>{const t=Ut(e);void 0===i&&C(t),s?.(t)},_=m??w.monthYear(D.getFullYear(),D.getMonth());/* @__PURE__ */
|
|
83
83
|
return Ee("div",{className:p,children:[
|
|
84
84
|
/* @__PURE__ */Ee("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
85
85
|
/* @__PURE__ */Te("button",{type:"button","aria-label":"years"===z?x.previousYears:"months"===z?x.previousYear:x.previousMonth,onClick:()=>K(W(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */Te(be,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
|
|
86
86
|
/* @__PURE__ */Te("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */Ee(Be,{children:["years"!==z&&/* @__PURE__ */Te("button",{type:"button","aria-label":x.chooseMonth(w.months[D.getMonth()]),onClick:()=>F(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:w.months[D.getMonth()]}),
|
|
87
87
|
/* @__PURE__ */Te("button",{type:"button","aria-label":x.chooseYear(D.getFullYear()),onClick:()=>F(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:D.getFullYear()})]}):/* @__PURE__ */Te("span",{children:w.monthYear(D.getFullYear(),D.getMonth())})}),
|
|
88
88
|
/* @__PURE__ */Te("button",{type:"button","aria-label":"years"===z?x.nextYears:"months"===z?x.nextYear:x.nextMonth,onClick:()=>K(W(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */Te(be,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===z&&/* @__PURE__ */Te("div",{role:"group","aria-label":x.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:w.monthsShort.map((e,t)=>/* @__PURE__ */Te("button",{type:"button","aria-pressed":t===D.getMonth(),onClick:()=>{K(new Date(D.getFullYear(),t,1)),F("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===D.getMonth()?"bg-blue-600 font-semibold text-white":y&&t===y.getMonth()&&D.getFullYear()===y.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===z&&/* @__PURE__ */Te("div",{role:"group","aria-label":x.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=D.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */Te("button",{type:"button","aria-pressed":e===D.getFullYear(),onClick:()=>{K(new Date(e,D.getMonth(),1)),F("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===D.getFullYear()?"bg-blue-600 font-semibold text-white":e===y?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
89
|
-
/* @__PURE__ */Ee("div",{ref:A,role:"grid","aria-label":_,className:"space-y-1","aria-readonly":h||void 0,onKeyDown:e=>{const t=qt(R)??y??D,r={ArrowLeft:()=>Vt(t,-1),ArrowRight:()=>Vt(t,1),ArrowUp:()=>Vt(t,-7),ArrowDown:()=>Vt(t,7),Home:()=>Vt(t,-(t.getDay()-k+7)%7),End:()=>Vt(t,6-(t.getDay()-k+7)%7),PageUp:()=>Yt(t,e.shiftKey?-12:-1),PageDown:()=>Yt(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),j.current=!0,P(_t(a)),void(
|
|
89
|
+
/* @__PURE__ */Ee("div",{ref:A,role:"grid","aria-label":_,className:"space-y-1","aria-readonly":h||void 0,onKeyDown:e=>{const t=qt(R)??y??D,r={ArrowLeft:()=>Vt(t,-1),ArrowRight:()=>Vt(t,1),ArrowUp:()=>Vt(t,-7),ArrowDown:()=>Vt(t,7),Home:()=>Vt(t,-(t.getDay()-k+7)%7),End:()=>Vt(t,6-(t.getDay()-k+7)%7),PageUp:()=>Yt(t,e.shiftKey?-12:-1),PageDown:()=>Yt(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),j.current=!0,P(_t(a)),void(Ut(a)!==L&&K(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h||E(R)||n(R))},hidden:"days"!==z,children:[
|
|
90
90
|
/* @__PURE__ */Te("div",{role:"row",className:`${Kt} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+k)%7).map(e=>
|
|
91
91
|
/* @__PURE__ */Te("div",{role:"columnheader","aria-label":w.weekdays[e],className:"py-1",children:/* @__PURE__ */Te("abbr",{title:w.weekdays[e],className:"no-underline",children:w.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */Te("div",{role:"row",className:`${Kt} text-center text-sm`,children:T.slice(7*l,7*l+7).map(a=>{const l=_t(a),i=a.getMonth()!==D.getMonth(),o=l===e||"range"===r&&l===t,s=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=E(l),d=w.longDate(a.getFullYear(),a.getMonth(),a.getDate()),u=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",c?"cursor-not-allowed text-gray-300":o?"bg-blue-600 font-semibold text-white":s?"bg-blue-100 text-blue-800":i?"text-gray-500"+(e?" hover:bg-gray-100":""):"text-gray-700"+(e?" hover:bg-gray-100":""),l!==b||o?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),m=g.has(l)&&/* @__PURE__ */Te("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(o?"bg-white":i?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
|
|
92
|
-
return Te("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */Ee("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */Ee("button",{type:"button","data-active":l===R,tabIndex:l===R?0:-1,disabled:c,"aria-label":d,"aria-current":l===b?"date":void 0,onClick:()=>{P(l),n(l)},className:u(!0),children:[a.getDate(),m]})},l)})},l))]})]})}var Xt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Zt=e=>`${e.getFullYear()}-${Jt(e.getMonth()+1)}`,Jt=e=>String(e).padStart(2,"0");function Qt(e){return`${e.getFullYear()}-${Jt(e.getMonth()+1)}-${Jt(e.getDate())}`}function er(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),l=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:Qt(new Date(r,n,t.getDate()-14)),to:Qt(a)};case"lastMonth":return{from:Qt(i(1)),to:Qt(l)};case"last3Months":return{from:Qt(i(3)),to:Qt(l)};case"last6Months":return{from:Qt(i(6)),to:Qt(l)};case"last12Months":return{from:Qt(i(12)),to:Qt(l)}}}function tr(e,t,r){const n=Zt(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function rr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function nr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var ar=/* @__PURE__ */new Map;function lr({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:o,"aria-labelledby":s,"aria-label":c,weekStartsOn:d,placeholder:u,fullWidth:h=!1,min:p,max:g,disabled:f=!1,allowOpenEnd:b=!1}){const y=Q().dateRange,x=J(),v=n??(x?function(e){let t=ar.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),ar.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(x):nr),w=u??y.placeholder,N=a??!l,[k,$]=Ne(!1),[M,C]=Ne(e),[L,D]=Ne(t),[S,P]=Ne(null),[A,j]=Ne("from"),z=ke(null),F=ke(null),T=ke(null),E=ve(),
|
|
92
|
+
return Te("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */Ee("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */Ee("button",{type:"button","data-active":l===R,tabIndex:l===R?0:-1,disabled:c,"aria-label":d,"aria-current":l===b?"date":void 0,onClick:()=>{P(l),n(l)},className:u(!0),children:[a.getDate(),m]})},l)})},l))]})]})}var Xt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Zt=e=>`${e.getFullYear()}-${Jt(e.getMonth()+1)}`,Jt=e=>String(e).padStart(2,"0");function Qt(e){return`${e.getFullYear()}-${Jt(e.getMonth()+1)}-${Jt(e.getDate())}`}function er(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),l=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:Qt(new Date(r,n,t.getDate()-14)),to:Qt(a)};case"lastMonth":return{from:Qt(i(1)),to:Qt(l)};case"last3Months":return{from:Qt(i(3)),to:Qt(l)};case"last6Months":return{from:Qt(i(6)),to:Qt(l)};case"last12Months":return{from:Qt(i(12)),to:Qt(l)}}}function tr(e,t,r){const n=Zt(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function rr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function nr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var ar=/* @__PURE__ */new Map;function lr({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:o,"aria-labelledby":s,"aria-label":c,weekStartsOn:d,placeholder:u,fullWidth:h=!1,min:p,max:g,disabled:f=!1,allowOpenEnd:b=!1}){const y=Q().dateRange,x=J(),v=n??(x?function(e){let t=ar.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),ar.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(x):nr),w=u??y.placeholder,N=a??!l,[k,$]=Ne(!1),[M,C]=Ne(e),[L,D]=Ne(t),[S,P]=Ne(null),[A,j]=Ne("from"),z=ke(null),F=ke(null),T=ke(null),E=ve(),I=ve(),R=ve(),[q,U]=Ne(!1),H=m(z,k,{preferredMaxWidth:520,preferredMaxHeight:q?720:560,popupRef:T}),V=ke(null),Y=ke(null),[G,X]=Ne(!0);_(()=>{const e=Y.current;if(!k||!q||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==G&&X(a)});const Z=ke(null);_(()=>{const e=T.current;if(!k||!H||!e)return;const t=getComputedStyle(e),r=H.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(q)null!==Z.current&&Z.current<=r&&U(!1);else{const e=V.current?.offsetWidth??0;if(0===e)return;Z.current=e,e>r+.5&&U(!0)}});const[ee,te]=Ne(!1);_(()=>{const e=!!o&&(F.current?.labels?.length??0)>0;e!==ee&&te(e)});const re=!!c||!!s||ee,ne=/* @__PURE__ */new Date,[ae,le]=Ne(()=>e?Zt(rr(e)):tr(ne,p,g)),ie=Xt.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(er(e,ne),p,g)),oe=e=>e?v(e):"";Me(()=>{if(!k)return;const e=e=>{const t=e.target;z.current?.contains(t)||T.current?.contains(t)||$(!1)};document.addEventListener("mousedown",e);const t=W(()=>$(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[k]),Me(()=>{f&&$(!1)},[f]);const se=()=>{r("",""),$(!1)},ce=e&&t?`${oe(e)} — ${oe(t)}`:e?y.fromOnly(oe(e)):t?y.toOnly(oe(t)):"",ue=de(x),he=e=>{const t=qt(e);return t?ue.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},me=e&&t?y.range(he(e),he(t)):e?y.fromOnly(he(e)):t?y.toOnly(he(t)):w,pe=e=>q?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(S===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(S===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),ge=/* @__PURE__ */Ee(Be,{children:[ie.map(e=>/* @__PURE__ */Te("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=er(e,ne);C(t.from),D(t.to),P(e),le(t.from.slice(0,7))})(e),className:pe(e),"aria-label":q?y[e]:void 0,children:q?G?y[e]:y[`${e}Short`]:y[e]},e)),
|
|
93
93
|
/* @__PURE__ */Te("button",{type:"button",onClick:()=>P("Custom"),className:pe("Custom"),children:y.custom})]}),fe=(e,t)=>b?/* @__PURE__ */Te("button",{type:"button","data-range-end":e,"aria-pressed":A===e,onClick:()=>j(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */Te("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),ye=e=>b&&A===e?" ring-1 ring-blue-400":"",xe=
|
|
94
94
|
/* @__PURE__ */Te(Gt,{mode:"range",min:p,max:g,value:M||null,endValue:L||null,month:ae,onMonthChange:le,onSelect:e=>{P("Custom"),b?"from"===A?(L&&e>L?(C(L),D(e)):C(e),j("to")):M&&e<M?(D(M),C(e)):D(e):!M||M&&L?(C(e),D("")):e<M?(D(M),C(e)):D(e)},weekStartsOn:d,"aria-label":y.dialog});/* @__PURE__ */
|
|
95
95
|
return Ee("div",{className:"relative"+(h?" w-full":""),ref:z,children:[
|
|
96
96
|
/* @__PURE__ */Ee("div",{className:`${h?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${e||t?"border-blue-400 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500"}${f?" cursor-not-allowed opacity-60":""}`,children:[
|
|
97
|
-
/* @__PURE__ */Ee("button",{ref:F,type:"button",onClick:()=>{f||(C(e),D(t),P(null),j(e&&!t?"to":"from"),le(e?Zt(rr(e)):tr(ne,p,g)),$(!0))},"aria-haspopup":"dialog","aria-expanded":k,id:o,disabled:f||void 0,"aria-label":c,"aria-labelledby":s,"aria-describedby":[re?
|
|
97
|
+
/* @__PURE__ */Ee("button",{ref:F,type:"button",onClick:()=>{f||(C(e),D(t),P(null),j(e&&!t?"to":"from"),le(e?Zt(rr(e)):tr(ne,p,g)),$(!0))},"aria-haspopup":"dialog","aria-expanded":k,id:o,disabled:f||void 0,"aria-label":c,"aria-labelledby":s,"aria-describedby":[re?I:void 0,l?R:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":k?E:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(h?" min-w-0 flex-1 justify-start":""),children:[
|
|
98
98
|
/* @__PURE__ */Te(be,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
99
|
-
/* @__PURE__ */Te("span",{className:"truncate",children:ce||w})]}),N&&!f&&(e||t)&&/* @__PURE__ */Te("button",{type:"button",onClick:se,"aria-label":y.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),re&&/* @__PURE__ */Te("span",{id:
|
|
99
|
+
/* @__PURE__ */Te("span",{className:"truncate",children:ce||w})]}),N&&!f&&(e||t)&&/* @__PURE__ */Te("button",{type:"button",onClick:se,"aria-label":y.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),re&&/* @__PURE__ */Te("span",{id:I,className:"sr-only",children:me}),l&&/* @__PURE__ */Te("span",{id:R,className:"sr-only",children:y.required}),i&&/* @__PURE__ */Ee(Be,{children:[
|
|
100
100
|
/* @__PURE__ */Te("input",{type:"hidden",name:i.from,value:e,disabled:f||void 0}),
|
|
101
|
-
/* @__PURE__ */Te("input",{type:"hidden",name:i.to,value:t,disabled:f||void 0})]}),k&&
|
|
102
|
-
/* @__PURE__ */Ee("div",{ref:T,id:E,role:"dialog","aria-label":y.dialog,"data-layout":q?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:K.popup,left:
|
|
101
|
+
/* @__PURE__ */Te("input",{type:"hidden",name:i.to,value:t,disabled:f||void 0})]}),k&&Oe(
|
|
102
|
+
/* @__PURE__ */Ee("div",{ref:T,id:E,role:"dialog","aria-label":y.dialog,"data-layout":q?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:K.popup,left:H?.left,right:H?.right,top:H?.top,bottom:H?.bottom,width:q&&H?H.maxWidth:"max-content",maxWidth:H?.maxWidth,maxHeight:H?.maxHeight,overflowY:"auto",visibility:H?void 0:"hidden",...O()},children:[
|
|
103
103
|
/* @__PURE__ */Ee("div",{className:q?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[fe("from",/* @__PURE__ */Ee(Be,{children:[
|
|
104
104
|
/* @__PURE__ */Te("span",{className:"text-xs font-medium text-gray-500",children:y.from}),
|
|
105
105
|
/* @__PURE__ */Te("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${M?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${ye("from")}`,children:M?oe(M):y.start})]})),!q&&/* @__PURE__ */Te("span",{className:"text-gray-300",children:"—"}),fe("to",/* @__PURE__ */Ee(Be,{children:[
|
|
@@ -112,31 +112,31 @@ return Ee("div",{className:"relative"+(h?" w-full":""),ref:z,children:[
|
|
|
112
112
|
/* @__PURE__ */Ee("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[N&&/* @__PURE__ */Te("button",{type:"button",onClick:se,className:B({variant:"ghost"}),children:y.clear}),
|
|
113
113
|
/* @__PURE__ */Te("button",{type:"button",onClick:()=>$(!1),className:B({variant:"secondary"}),children:y.cancel}),
|
|
114
114
|
/* @__PURE__ */Te("button",{type:"button",onClick:()=>{r(M,L),$(!1)},disabled:b?!M&&!L:!M||!L,className:B({variant:"primary"}),children:y.apply})]})]}),document.body)]})}var ir=/^\d{2}:\d{2}(:\d{2})?$/,or=e=>String(e).padStart(2,"0");function sr(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${or(e.getHours())}:${or(e.getMinutes())}`;return t?`${r}:${or(e.getSeconds())}`:r}return ir.test(e)?e:""}var cr=xe(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",step:o,...s},c){const d=null!=o&&Number(o)<60,u=J();/* @__PURE__ */
|
|
115
|
-
return Te("input",{ref:c,type:"time",lang:u,step:o,"aria-invalid":a||void 0,value:sr(e,d),min:sr(r,d)||void 0,max:sr(n,d)||void 0,onChange:e=>t?.(ir.test(e.target.value)?e.target.value:null),className:
|
|
116
|
-
return Te("input",{ref:C,type:"date",lang:j,id:h,name:p,disabled:g,"aria-label":c,"aria-describedby":d,"aria-invalid":a||void 0,value:D,min:S||void 0,max:P||void 0,onChange:e=>t?.(pr(e.target.value)),className:
|
|
115
|
+
return Te("input",{ref:c,type:"time",lang:u,step:o,"aria-invalid":a||void 0,value:sr(e,d),min:sr(r,d)||void 0,max:sr(n,d)||void 0,onChange:e=>t?.(ir.test(e.target.value)?e.target.value:null),className:He({invalid:a,size:l,className:i}),...s})}),dr=/^\d{4}-\d{2}-\d{2}$/,ur=/^(aria|data)-/,hr=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function mr(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Qt(e);if(dr.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Qt(t)}function pr(e){if(!dr.test(e))return null;const[t,r,n]=e.split("-").map(Number),a=new Date(t,r-1,n);return a.getMonth()===r-1&&a.getDate()===n?a:null}function gr(e,t){const r=pr(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var fr=xe(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,native:i,weekStartsOn:o,className:s="","aria-label":c,"aria-describedby":d,"aria-labelledby":u,id:h,name:p,disabled:g,placeholder:f,required:b,clearable:y,form:x,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:$,...M},C){const L=y??!b,D=mr(e),S=mr(r),P=mr(n),A=Q().datePicker,j=J(),z=de(j),[F,T]=Ne(!1),E=ke(null),B=ke(null),O=ke(null),I=ve(),q=ve(),U=ve(),H=m(B,F,{popupRef:O}),[V,Y]=Ne(!1);_(()=>{const e=!!h&&(B.current?.labels?.length??0)>0;e!==V&&Y(e)});const G=!c&&(!!u||V);if(Me(()=>{if(!F)return;const e=e=>{const t=e.target;E.current?.contains(t)||O.current?.contains(t)||T(!1)};document.addEventListener("pointerdown",e,!0);const t=W(()=>T(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[F]),Me(()=>{if(F)return R(e=>"Escape"===e.key&&(T(!1),B.current?.focus(),!0),()=>O.current)},[F]),i)/* @__PURE__ */
|
|
116
|
+
return Te("input",{ref:C,type:"date",lang:j,id:h,name:p,disabled:g,"aria-label":c,"aria-describedby":d,"aria-invalid":a||void 0,value:D,min:S||void 0,max:P||void 0,onChange:e=>t?.(pr(e.target.value)),className:He({invalid:a,size:l,className:s}),"aria-labelledby":u,required:b,form:x,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:$,...M});const X=Object.fromEntries(Object.entries(M).filter(([e])=>ur.test(e)&&!hr.has(e))),Z=M["aria-required"],ee=!!b||!0===Z||"true"===Z,te=[G?q:void 0,ee?U:void 0,d].filter(Boolean).join(" ")||void 0,re=Qt(/* @__PURE__ */new Date),ne=(!S||re>=S)&&(!P||re<=P),ae=f??A.placeholder;/* @__PURE__ */
|
|
117
117
|
return Ee("div",{ref:E,className:"relative",children:[
|
|
118
118
|
/* @__PURE__ */Te("input",{ref:C,type:"hidden",name:p,form:x,value:D}),
|
|
119
|
-
/* @__PURE__ */Ee("button",{ref:B,type:"button",...X,id:h,disabled:g,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:$,"aria-haspopup":"dialog","aria-expanded":F,"aria-controls":F?
|
|
119
|
+
/* @__PURE__ */Ee("button",{ref:B,type:"button",...X,id:h,disabled:g,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:$,"aria-haspopup":"dialog","aria-expanded":F,"aria-controls":F?I:void 0,"aria-labelledby":u,"aria-describedby":te,"aria-label":c?`${c}${D?`, ${gr(D,z)}`:""}`:void 0,onClick:()=>T(e=>!e),className:`${He({invalid:a,size:l,className:s})} flex items-center justify-between text-left`,children:[
|
|
120
120
|
/* @__PURE__ */Te("span",{className:D?"text-gray-900":"text-gray-400",children:D?gr(D,z):ae}),
|
|
121
|
-
/* @__PURE__ */Te(be,{name:"date",className:"h-4 w-4 shrink-0 text-gray-400",strokeWidth:"1.75","aria-hidden":"true"})]}),G&&/* @__PURE__ */Te("span",{id:q,className:"sr-only",children:D?gr(D,z):ae}),ee&&/* @__PURE__ */Te("span",{id:
|
|
122
|
-
/* @__PURE__ */Ee("div",{ref:
|
|
121
|
+
/* @__PURE__ */Te(be,{name:"date",className:"h-4 w-4 shrink-0 text-gray-400",strokeWidth:"1.75","aria-hidden":"true"})]}),G&&/* @__PURE__ */Te("span",{id:q,className:"sr-only",children:D?gr(D,z):ae}),ee&&/* @__PURE__ */Te("span",{id:U,className:"sr-only",children:A.required}),F&&Oe(
|
|
122
|
+
/* @__PURE__ */Ee("div",{ref:O,id:I,role:"dialog","aria-label":c??A.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:K.popup,left:H?.left,right:H?.right,top:H?.top,bottom:H?.bottom,maxWidth:H?.maxWidth,visibility:H?void 0:"hidden"},children:[
|
|
123
123
|
/* @__PURE__ */Te(Gt,{value:D||null,min:S||null,max:P||null,weekStartsOn:o,onSelect:e=>{T(!1),B.current?.focus(),t?.(pr(e))}}),(L||ne)&&/* @__PURE__ */Ee("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[L&&/* @__PURE__ */Te("button",{type:"button",onClick:()=>{T(!1),B.current?.focus(),t?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:A.clear}),ne&&/* @__PURE__ */Te("button",{type:"button",onClick:()=>{T(!1),B.current?.focus(),t?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:A.today})]})]}),document.body)]})}),br=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,yr=e=>String(e).padStart(2,"0");function xr(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${yr(t.getMonth()+1)}-${yr(t.getDate())}T${yr(t.getHours())}:${yr(t.getMinutes())}`:br.test(e)?e:"";var t}var vr=xe(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",...o},s){const c=J();/* @__PURE__ */
|
|
124
|
-
return Te("input",{ref:s,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:xr(e),min:xr(r)||void 0,max:xr(n)||void 0,onChange:e=>t?.(function(e){if(!br.test(e))return null;const[t,r]=e.split("T"),[n,a,l]=t.split("-").map(Number),[i,o,s=0]=r.split(":").map(Number);if(i>23||o>59||s>59)return null;const c=new Date(n,a-1,l,i,o,s);return c.getMonth()===a-1&&c.getDate()===l?c:null}(e.target.value)),className:
|
|
124
|
+
return Te("input",{ref:s,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:xr(e),min:xr(r)||void 0,max:xr(n)||void 0,onChange:e=>t?.(function(e){if(!br.test(e))return null;const[t,r]=e.split("T"),[n,a,l]=t.split("-").map(Number),[i,o,s=0]=r.split(":").map(Number);if(i>23||o>59||s>59)return null;const c=new Date(n,a-1,l,i,o,s);return c.getMonth()===a-1&&c.getDate()===l?c:null}(e.target.value)),className:He({invalid:a,size:l,className:i}),...o})});function wr(e){let t=null;try{t=window.getSelection()}catch{return null}if(!t||0===t.rangeCount||t.isCollapsed)return null;const r=e;if(r&&"number"==typeof r.nodeType){let e=!1;for(let n=0;n<t.rangeCount&&!e;n++)e=t.getRangeAt(n).intersectsNode(r);if(!e)return null}const n=t.toString();if(!n.trim())return null;const a=document.createElement("div");for(let e=0;e<t.rangeCount;e++)a.appendChild(t.getRangeAt(e).cloneContents());return{text:n,html:a.innerHTML}}async function Nr(e,t){try{if(t&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}const r=r=>{r.clipboardData?.setData("text/plain",e),t&&r.clipboardData?.setData("text/html",t),r.preventDefault()},n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.addEventListener("copy",r);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",r),n.remove()}}async function kr(e,t,r){const n=await Nr(t,r),a=te().copy;return n?l.success(a.copiedLabel(e)):l.error(a.failed),n}var $r={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},Mr={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function Cr(){/* @__PURE__ */
|
|
125
125
|
return Te(be,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function Lr(){/* @__PURE__ */
|
|
126
126
|
return Te(be,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function Dr({value:e,children:t,symbol:r,label:n,size:a="md",variant:i="bordered",hideCopyButton:o=!1,onCopy:s,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=Ne(!1),g=ke(null),f=Q().copy;Me(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=we(async()=>{await Nr(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),s?.(e)):l.error(f.failed)},[e,s,f]),{box:y,button:x}=Mr[a],v=!o;/* @__PURE__ */
|
|
127
127
|
return Ee("div",{id:v?void 0:d,"aria-describedby":v?void 0:u,className:["inline-flex max-w-full items-center rounded-md",$r[i],y,h].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
|
|
128
128
|
/* @__PURE__ */Te("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}),!o&&/* @__PURE__ */Ee(Be,{children:[
|
|
129
|
-
/* @__PURE__ */Te(
|
|
129
|
+
/* @__PURE__ */Te(Ie,{id:d,"aria-label":n?f.copyLabel(n):f.copy,"aria-describedby":u,onClick:b,className:`${x} text-gray-400`,children:/* @__PURE__ */Te(m?Lr:Cr,{})}),
|
|
130
130
|
/* @__PURE__ */Te("span",{"aria-live":"polite",className:"sr-only",children:m?f.copied:""})]})]})}var Sr=2;function Pr(e,t){if("."===t)return e.includes(".")?e:""===e?"0.":`${e}.`;if(t<"0"||t>"9")return e;const r=e.indexOf(".");return-1!==r&&e.length-r-1>=2?e:"0"===e?t:e+t}function Ar(e){return e.slice(0,-1)}var jr=["1","2","3","4","5","6","7","8","9",".","0"];function zr({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=Q().keypad,o=r=>{r!==e&&t(r)};/* @__PURE__ */
|
|
131
131
|
return Ee("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[jr.map(t=>/* @__PURE__ */Te(g,{size:"touch-xl",variant:"secondary",onClick:()=>o(Pr(e,t)),children:t},t)),
|
|
132
132
|
/* @__PURE__ */Te(g,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>o(Ar(e)),children:"⌫"}),r&&/* @__PURE__ */Te(g,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var Fr={md:"h-24 p-3",lg:"h-32 p-4"},Tr=xe(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...o},s){/* @__PURE__ */
|
|
133
133
|
return Ee("button",{ref:s,type:l,disabled:a,"aria-pressed":n||void 0,className:["flex w-full flex-col justify-between rounded-xl border text-left transition-colors rosh-focus-ring","disabled:cursor-not-allowed disabled:opacity-50",n?"border-blue-600 bg-blue-50 ring-2 ring-blue-400/40":"border-gray-200 bg-white hover:bg-gray-50 focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",Fr[r],i].filter(Boolean).join(" "),...o,children:[
|
|
134
|
-
/* @__PURE__ */Te("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */Te("span",{className:"text-sm text-gray-500",children:t})]})}),Er={sm:"h-(--control-height-sm) px-(--space-control-x-sm) gap-(--space-icon-gap-sm) text-xs",md:"h-(--control-height-md) px-(--space-control-x) gap-(--space-icon-gap) text-sm",lg:"h-(--control-height-lg) px-(--space-control-x-lg) gap-(--space-icon-gap) text-sm",touch:"h-14 px-(--space-20) gap-(--space-icon-gap) text-base"};function Br(e=!1,t=""){return["rosh-choice-track inline-flex max-w-full items-center gap-(--space-4) overflow-x-auto rounded-(--radius-card) bg-gray-100 p-(--space-4)","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",e?"w-full":"",t].filter(Boolean).join(" ")}function
|
|
135
|
-
return Ee(Be,{children:[e?/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e}):null,t]})}function Wr({value:e,onChange:t,options:r,name:n,size:a="md",block:l=!1,label:i,className:o="","aria-labelledby":s,"aria-describedby":c}){const d={"aria-label":s?void 0:i,"aria-labelledby":s,"aria-describedby":c},u=ve(),h=Br(l,o),m=
|
|
136
|
-
return Te("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const i=`${u}-${r.value}`,o=r.value===e,s=/* @__PURE__ */Ee("label",{htmlFor:i,className:
|
|
134
|
+
/* @__PURE__ */Te("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */Te("span",{className:"text-sm text-gray-500",children:t})]})}),Er={sm:"h-(--control-height-sm) px-(--space-control-x-sm) gap-(--space-icon-gap-sm) text-xs",md:"h-(--control-height-md) px-(--space-control-x) gap-(--space-icon-gap) text-sm",lg:"h-(--control-height-lg) px-(--space-control-x-lg) gap-(--space-icon-gap) text-sm",touch:"h-14 px-(--space-20) gap-(--space-icon-gap) text-base"};function Br(e=!1,t=""){return["rosh-choice-track inline-flex max-w-full items-center gap-(--space-4) overflow-x-auto rounded-(--radius-card) bg-gray-100 p-(--space-4)","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",e?"w-full":"",t].filter(Boolean).join(" ")}function Or({size:e="md",selected:t,disabled:r=!1,block:n=!1}){return["relative inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-(--radius-control) font-medium transition-colors",Er[e],t?"bg-blue-600 text-white shadow-sm rosh-segmented-on":"text-gray-600 hover:text-gray-900",r?"cursor-not-allowed opacity-40":"cursor-pointer",n?"flex-1":""].filter(Boolean).join(" ")}function Ir(e=!1){return e?"relative inline-flex shrink-0 flex-1":"relative inline-flex shrink-0"}function Rr({icon:e,label:t}){/* @__PURE__ */
|
|
135
|
+
return Ee(Be,{children:[e?/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e}):null,t]})}function Wr({value:e,onChange:t,options:r,name:n,size:a="md",block:l=!1,label:i,className:o="","aria-labelledby":s,"aria-describedby":c}){const d={"aria-label":s?void 0:i,"aria-labelledby":s,"aria-describedby":c},u=ve(),h=Br(l,o),m=Ir(l);/* @__PURE__ */
|
|
136
|
+
return Te("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const i=`${u}-${r.value}`,o=r.value===e,s=/* @__PURE__ */Ee("label",{htmlFor:i,className:Or({size:a,selected:o,disabled:r.disabled,block:l}),children:[
|
|
137
137
|
/* @__PURE__ */Te("input",{id:i,type:"radio",name:n,value:r.value,checked:o,disabled:r.disabled,"aria-describedby":r.title?`${i}-note`:void 0,onChange:()=>t(r.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),
|
|
138
|
-
/* @__PURE__ */Te(Rr,{icon:r.icon,label:r.label}),r.title&&/* @__PURE__ */Te("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */Te(f,{content:r.title,className:m,children:s},r.value):s})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e,i=/* @__PURE__ */Te("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:
|
|
139
|
-
/* @__PURE__ */Ee("span",{className:"min-w-0",children:[a&&/* @__PURE__ */Te("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */Te("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */Te("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */Te("span",{className:o,children:x})});function
|
|
138
|
+
/* @__PURE__ */Te(Rr,{icon:r.icon,label:r.label}),r.title&&/* @__PURE__ */Te("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */Te(f,{content:r.title,className:m,children:s},r.value):s})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e,i=/* @__PURE__ */Te("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:Or({size:a,selected:n,disabled:r.disabled,block:l}),children:/* @__PURE__ */Te(Rr,{icon:r.icon,label:r.label})},r.value);return r.title?/* @__PURE__ */Te(f,{content:r.title,className:m,children:i},r.value):i})})}var Kr={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},_r={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},qr={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},Ur=xe(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:o="",disabledReason:s,disabledReasonId:c,...d},u){const h=ve(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=s&&""!==s,b=f?`${m}-reason`:void 0,y=[p,g??b].filter(Boolean).join(" ")||void 0,x=/* @__PURE__ */Te("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":y,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",Kr[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */Te("span",{className:["inline-block rounded-full bg-white shadow transition-transform",_r[n],e?qr[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */Ee("span",{className:`flex items-start gap-3 ${o}`.trim(),children:[x,
|
|
139
|
+
/* @__PURE__ */Ee("span",{className:"min-w-0",children:[a&&/* @__PURE__ */Te("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */Te("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */Te("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */Te("span",{className:o,children:x})});function Hr(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var Vr=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function Yr(e){const t=e.trim().replace(",",".");if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}function Gr({dir:e,compact:t,label:r,disabled:n,onStep:a}){const l=ke(a);l.current=a;const i=ke({}),o=we(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);Me(()=>o,[o]),Me(()=>{n&&o()},[n,o]);const s=/* @__PURE__ */Te(be,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),c={tabIndex:-1,"aria-label":r,disabled:n,onPointerDown:e=>{if(0!==e.button||n)return;e.preventDefault(),o();const t=e.shiftKey;l.current(t);const r=e.currentTarget.ownerDocument.defaultView??window;r.addEventListener("pointerup",o),i.current={off:()=>r.removeEventListener("pointerup",o),wait:setTimeout(()=>{i.current.every=setInterval(()=>l.current(t),60)},400)}},onPointerLeave:o,onPointerCancel:o,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__PURE__ */Te("button",{type:"button",...c,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:s}):/* @__PURE__ */Te(Ie,{size:"sm",...c,children:s})}var Xr=xe(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,shiftStep:i,disabled:o,readOnly:s,invalid:c,placeholder:d,size:u,prefix:h,suffix:m,id:p,name:g,className:f="",onBlur:b,steppers:y=!1,stepFrom:x,snap:v=!1,allowEmpty:w=!0,"aria-label":N,"aria-labelledby":k},$){const M=Q(),[C,L]=Ne(()=>Vr(e,a)),D=ke(C);D.current=C;const S=ke(null),P=we(e=>{S.current=e,"function"==typeof $?$(e):$&&($.current=e)},[$]),A=ke(e),j=ke(e);j.current=e;const z=Boolean(o||s),F="compact"===y;Me(()=>{Yr(D.current)!==e&&L(Vr(e,a))},[e,a]);const T=e=>{if(z)return;let i=(Yr(D.current)??x??(d?Yr(d):null)??0)+e;null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n);const o=a??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(o));const s=Vr(i,a);D.current=s,L(s),t(i)},E=ke(T);E.current=T;const[B,O]=Ne(!1);Me(()=>{if(B&&!z)return R(e=>{if("Escape"!==e.key||document.activeElement!==S.current)return!1;const r=A.current;if(Yr(D.current)===r)return!1;const n=Vr(r,a);return D.current=n,L(n),j.current!==r&&t(r),!0})},[B,z,a,t]);const I=()=>{const e=Yr(D.current);if(null==e){if(!w){const e=Vr(j.current,a);return D.current=e,L(e),j.current}return D.current="",L(""),null!==j.current&&t(null),null}let i=e;const o=a??(v?Math.max(Hr(l??1),Hr(r??0)):void 0);v&&(i=function(e,t,r){const n=(e-r)/t;return r+Math.round(n+1e-9*Math.sign(e))*t}(i,l??1,r??0)),null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n),null!=o&&(i=Number(i.toFixed(o)));const s=Vr(i,a);return D.current=s,L(s),i===e&&i===j.current||t(i),i},W=/* @__PURE__ */Te("input",{ref:P,id:p,name:g,type:"text",inputMode:0===a?"numeric":"decimal",value:C,disabled:o,readOnly:s,placeholder:d,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?d||void 0:Vr(e,a),"aria-invalid":c||void 0,"aria-label":N,"aria-labelledby":k,onChange:e=>(e=>{if(s)return;if(""!==e&&!/^-?\d*[.,]?\d*$/.test(e))return;L(e);const r=Yr(e);(null!==r||w)&&t(r)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!z)return void(A.current=I());const t=l??1,r=i??10*t,n="ArrowUp"===e.key?e.shiftKey?r:t:"ArrowDown"===e.key?-(e.shiftKey?r:t):"PageUp"===e.key?10*t:"PageDown"===e.key?10*-t:null;null===n||z||(e.preventDefault(),T(n))},onFocus:()=>{A.current=j.current,O(!0)},onBlur:()=>{O(!1),I(),b?.()},className:He({invalid:c,size:u,readOnly:s,className:[h?"pl-7":"",F?m?"pr-12":"pr-6":y?m?"pr-24":"pr-16":m?"pr-9":"","text-right tabular-nums",f].filter(Boolean).join(" ")})});if(!h&&!m&&!y)return W;const K=Yr(C);/* @__PURE__ */
|
|
140
140
|
return Ee("div",{className:"relative",children:[h&&/* @__PURE__ */Te("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:h}),W,m&&/* @__PURE__ */Te("span",{className:`pointer-events-none absolute ${F?"right-6":y?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-sm text-gray-500`,children:m}),y&&(()=>{const e=/* @__PURE__ */Te(Gr,{dir:-1,compact:F,label:M.number.decrease,disabled:z||null!=r&&null!=K&&K<=r,onStep:e=>E.current(-(e?i??10*(l??1):l??1))}),t=/* @__PURE__ */Te(Gr,{dir:1,compact:F,label:M.number.increase,disabled:z||null!=n&&null!=K&&K>=n,onStep:e=>E.current(e?i??10*(l??1):l??1)});/* @__PURE__ */
|
|
141
141
|
return Ee("span",F?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-md",children:[t,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,t]})})()]})}),Zr=(e,t,r)=>Math.min(r,Math.max(t,e));function Jr(e,t,r,n){return Number(Zr(e,t,r).toFixed(n))}function Qr({value:e,onChange:t,min:r,max:n,step:a=1,shiftStep:l,precision:i,inputMin:o,inputMax:s,suffix:c,showInput:d=!0,emptyLabel:u,placeholderValue:h,stepFrom:m,label:p,"aria-labelledby":g,valueText:f,id:b,disabled:y,size:x="md",className:v=""}){const w=Q(),N=ve(),k=b??N,$=i??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(a),M=o??r,C=s??n,L=void 0!==u||void 0!==h,D=m??h,S=Zr(e??h??r,r,n),P=e=>f?f(e):"string"==typeof c?`${e.toFixed($)} ${c}`:void 0,A=null==e?u??(null!=h?P(h)??String(h):void 0):P(e);/* @__PURE__ */
|
|
142
142
|
return Ee("div",{className:`flex items-center gap-3 ${v}`.trim(),children:[
|
|
@@ -145,28 +145,28 @@ return Te("div",{role:"group","aria-label":a?void 0:r,"aria-labelledby":a,"aria-
|
|
|
145
145
|
/* @__PURE__ */Te(be,{name:e.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),e.label]}),c=/* @__PURE__ */Te("span",{id:n,className:"sr-only",children:e.shown?i.shown:i.hidden});/* @__PURE__ */
|
|
146
146
|
return Ee(Ae,{children:[l?/* @__PURE__ */Te(h,{reason:e.disabledReason,id:a,children:s}):/* @__PURE__ */Te(f,{content:e.shown?i.shownHint:i.hiddenHint,describe:!1,className:"relative inline-flex",children:s}),c]},e.id)})})}var tn=4,rn=10,nn={1:["100%"],2:["50%","50%"],3:["33.34%","33.33%","33.33%"],4:["25%","25%","25%","25%"]},an={1:[],2:[50],3:[34,33],4:[25,25,25]},ln=e=>"number"==typeof e&&Number.isFinite(e);function on(e,t){if(!Number.isInteger(t)||t<2||t>4)return;if(!Array.isArray(e)||e.length!==t-1)return;if(!e.every(ln))return;const r=[];let n=0;return e.forEach((e,a)=>{const l=((e,t,r)=>Math.min(r,Math.max(t,Math.round(e))))(e,rn,100-n-(t-1-a)*rn);r.push(l),n+=l}),r}function sn(e,t){const r=on(e,t);if(!r)return(e=>[...nn[e]??nn[1]])(t);const n=r.reduce((e,t)=>e+t,0);return[...r.map(e=>`${e}%`),100-n+"%"]}function cn(e,t){return sn(t,e)}var dn=10,un=(e,t,r)=>Math.min(r,Math.max(t,e)),hn=e=>e.reduce((e,t)=>e+t,0),mn=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);function pn(e){const t=e.trim().replace(/%$/,"").trim();if(""===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}var gn,fn="w-0.5",bn=`${fn} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var yn=["text-blue-700","text-gray-600"];function xn({column:e,share:t,start:r,max:n,label:a,name:l,hintId:i,readOnly:o,disabled:s,stored:c,onType:d,onRestore:u,onFocusChange:h,covered:m,seam:p}){const g=ke(null),f=o||s,[b,y]=Ne(null),x=ke(!1),v=ke(void 0),w=ke({share:t,stored:c,onType:d,onRestore:u,locked:f});w.current={share:t,stored:c,onType:d,onRestore:u,locked:f};const N=ke(!1),[k,$]=Ne(0),M=e=>{x.current=!1,y(e),$(e=>e+1)};Me(()=>{k>0&&document.activeElement===g.current&&g.current?.select()},[k]),Me(()=>{null===b||x.current||M(String(t))},[t]);const C=()=>{if(!x.current||null===b)return null;const t=pn(b),r=null===t||w.current.locked?null:w.current.onType(e,t);return x.current=!1,r},L=null!==b;Me(()=>{if(L&&!f)return R(e=>{if("Escape"!==e.key||document.activeElement!==g.current)return!1;const t=v.current,r=(n=w.current.stored,a=t,!(void 0===n||void 0===a?n===a:mn(n,a)));var n,a;return!(!x.current&&!r)&&(r&&w.current.onRestore(t),M(String(w.current.share)),!0)})},[L,f]);const D=L?`max(${t}%, 40px)`:`${t}%`;/* @__PURE__ */
|
|
147
147
|
return Ee(Be,{children:[
|
|
148
|
-
/* @__PURE__ */Te("input",{ref:g,type:"text",inputMode:"numeric",autoComplete:"off",spellCheck:!1,role:"spinbutton","data-widths-label":"","aria-label":l,"aria-valuenow":t,"aria-valuemin":rn,"aria-valuemax":n,"aria-valuetext":`${t}%`,"aria-describedby":i,value:b??a,readOnly:o,disabled:s,onFocus:()=>{v.current=w.current.stored,N.current=!0,M(String(t)),h(e,!0)},onBlur:()=>{C(),N.current=!1,x.current=!1,y(null),h(e,!1)},onMouseUp:e=>{N.current&&(N.current=!1,e.preventDefault())},onChange:e=>{f||(x.current=!0,y(e.target.value))},onKeyDown:r=>{if(f||r.altKey||r.ctrlKey||r.metaKey)return;if("Enter"===r.key){if(!x.current)return;const t=C();return t&&(v.current=t.slice(0,-1)),void M(String(t?t[e]:w.current.share))}const n=r.shiftKey?dn:1,a="ArrowUp"===r.key?n:"ArrowDown"===r.key?-n:"PageUp"===r.key?dn:"PageDown"===r.key?-10:null;if(null===a)return;r.preventDefault();const l=(x.current&&null!==b?pn(b):null)??t,i=d(e,l+a);M(String(i?i[e]:t))},style:{left:`clamp(0px, calc(${r+t/2}% - ${D} / 2), calc(100% - ${D}))`,width:D},className:`absolute inset-y-0 m-0 min-w-0 rounded-(--radius-control) border-0 p-0 text-center text-xs font-medium tabular-nums rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${yn[e%2]} ${L?"z-20 bg-white":"bg-transparent"} ${m&&!L?"opacity-0":""} ${f?"cursor-default":"cursor-text"}`}),p]})}function vn({count:e,value:t,onChange:r,label:n,"aria-labelledby":a,readOnly:l=!1,disabled:i=!1,footer:o=!0,className:s=""}){const c=Q().widths,d=ve(),u=un(Math.round(e)||1,1,4),h=on(t,u),m=h??[...an[u]??[]],p=[...m,100-hn(m)],b=l||i,y=ke(null),x=ke({onChange:r,shown:m,locked:b,n:u});x.current={onChange:r,shown:m,locked:b,n:u};const v=e=>{const{onChange:t,shown:r,locked:n,n:a}=x.current;if(n)return!1;const l=on(e,a);return!(!l||mn(l,r))&&(t(l),!0)},w=(e,t,r)=>{const n=e[t]+e[t+1],a=[...e];a[t]=un(Math.round(r),rn,n-rn),a[t+1]=n-a[t],v(a.slice(0,-1))},N=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const r=t.shiftKey?dn:1,n=p[e]+p[e+1],a="ArrowRight"===t.key?p[e]+r:"ArrowLeft"===t.key?p[e]-r:"PageUp"===t.key?p[e]+dn:"PageDown"===t.key?p[e]-dn:"Home"===t.key?rn:"End"===t.key?n-rn:null;null!==a&&(t.preventDefault(),w(p,e,a))},k=ke(null),[$,M]=Ne(null),C=()=>{k.current=null,M(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};Me(()=>C,[]);const L=e=>t=>{if(0!==t.button||b)return;t.preventDefault();const r=y.current?.getBoundingClientRect().width??0;r<=0||(k.current={i:e,x:t.clientX,width:r,from:p,moved:!1,pointer:t.pointerId},M(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},D=e=>{const t=k.current;if(!t)return;if(0===e.buttons)return void C();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}w(t.from,t.i,t.from[t.i]+r/t.width*100)},S=e=>{const t=k.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),C())},P=(e,t)=>{const{shown:r}=x.current,n=function(e,t,r){const n=e.length,a=[...e];if(n<2)return a;const l=un(Math.round(r),rn,100-(n-1)*rn);let i=l-a[t];a[t]=l;const o=[...Array.from({length:n-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(i<0)return a[o[0]]-=i,a;for(const e of o){if(i<=0)break;const t=Math.min(i,a[e]-rn);a[e]-=t,i-=t}return a}([...r,100-hn(r)],e,t);return v(n.slice(0,-1))?n:null},[A,j]=Ne(0);Me(()=>{const e=y.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>j(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const z=e=>A>0&&A*e/100<36?String(e):`${e}%`,F=ke(null),[T,E]=Ne(null),[B,
|
|
148
|
+
/* @__PURE__ */Te("input",{ref:g,type:"text",inputMode:"numeric",autoComplete:"off",spellCheck:!1,role:"spinbutton","data-widths-label":"","aria-label":l,"aria-valuenow":t,"aria-valuemin":rn,"aria-valuemax":n,"aria-valuetext":`${t}%`,"aria-describedby":i,value:b??a,readOnly:o,disabled:s,onFocus:()=>{v.current=w.current.stored,N.current=!0,M(String(t)),h(e,!0)},onBlur:()=>{C(),N.current=!1,x.current=!1,y(null),h(e,!1)},onMouseUp:e=>{N.current&&(N.current=!1,e.preventDefault())},onChange:e=>{f||(x.current=!0,y(e.target.value))},onKeyDown:r=>{if(f||r.altKey||r.ctrlKey||r.metaKey)return;if("Enter"===r.key){if(!x.current)return;const t=C();return t&&(v.current=t.slice(0,-1)),void M(String(t?t[e]:w.current.share))}const n=r.shiftKey?dn:1,a="ArrowUp"===r.key?n:"ArrowDown"===r.key?-n:"PageUp"===r.key?dn:"PageDown"===r.key?-10:null;if(null===a)return;r.preventDefault();const l=(x.current&&null!==b?pn(b):null)??t,i=d(e,l+a);M(String(i?i[e]:t))},style:{left:`clamp(0px, calc(${r+t/2}% - ${D} / 2), calc(100% - ${D}))`,width:D},className:`absolute inset-y-0 m-0 min-w-0 rounded-(--radius-control) border-0 p-0 text-center text-xs font-medium tabular-nums rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${yn[e%2]} ${L?"z-20 bg-white":"bg-transparent"} ${m&&!L?"opacity-0":""} ${f?"cursor-default":"cursor-text"}`}),p]})}function vn({count:e,value:t,onChange:r,label:n,"aria-labelledby":a,readOnly:l=!1,disabled:i=!1,footer:o=!0,className:s=""}){const c=Q().widths,d=ve(),u=un(Math.round(e)||1,1,4),h=on(t,u),m=h??[...an[u]??[]],p=[...m,100-hn(m)],b=l||i,y=ke(null),x=ke({onChange:r,shown:m,locked:b,n:u});x.current={onChange:r,shown:m,locked:b,n:u};const v=e=>{const{onChange:t,shown:r,locked:n,n:a}=x.current;if(n)return!1;const l=on(e,a);return!(!l||mn(l,r))&&(t(l),!0)},w=(e,t,r)=>{const n=e[t]+e[t+1],a=[...e];a[t]=un(Math.round(r),rn,n-rn),a[t+1]=n-a[t],v(a.slice(0,-1))},N=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const r=t.shiftKey?dn:1,n=p[e]+p[e+1],a="ArrowRight"===t.key?p[e]+r:"ArrowLeft"===t.key?p[e]-r:"PageUp"===t.key?p[e]+dn:"PageDown"===t.key?p[e]-dn:"Home"===t.key?rn:"End"===t.key?n-rn:null;null!==a&&(t.preventDefault(),w(p,e,a))},k=ke(null),[$,M]=Ne(null),C=()=>{k.current=null,M(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};Me(()=>C,[]);const L=e=>t=>{if(0!==t.button||b)return;t.preventDefault();const r=y.current?.getBoundingClientRect().width??0;r<=0||(k.current={i:e,x:t.clientX,width:r,from:p,moved:!1,pointer:t.pointerId},M(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},D=e=>{const t=k.current;if(!t)return;if(0===e.buttons)return void C();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}w(t.from,t.i,t.from[t.i]+r/t.width*100)},S=e=>{const t=k.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),C())},P=(e,t)=>{const{shown:r}=x.current,n=function(e,t,r){const n=e.length,a=[...e];if(n<2)return a;const l=un(Math.round(r),rn,100-(n-1)*rn);let i=l-a[t];a[t]=l;const o=[...Array.from({length:n-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(i<0)return a[o[0]]-=i,a;for(const e of o){if(i<=0)break;const t=Math.min(i,a[e]-rn);a[e]-=t,i-=t}return a}([...r,100-hn(r)],e,t);return v(n.slice(0,-1))?n:null},[A,j]=Ne(0);Me(()=>{const e=y.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>j(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const z=e=>A>0&&A*e/100<36?String(e):`${e}%`,F=ke(null),[T,E]=Ne(null),[B,O]=Ne([]),I=(e,t)=>E(r=>t?e:r===e?null:r),R=p.join(",");Me(()=>{const e=null===T?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===gn&&(gn=document.createElement("canvas").getContext("2d")),!gn)return[];const a=gn;return r.flatMap((e,r)=>{if(r===t)return[];const l=e.getBoundingClientRect(),i=getComputedStyle(e);a.font=`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;const o=a.measureText(e.value).width/2,s=(l.left+l.right)/2;return s+o>n.left&&s-o<n.right?[r]:[]})}(F.current,T);O(t=>mn(t,e)?t:e)},[T,R,A]);const W=p.slice(0,-1).map((e,t)=>hn(p.slice(0,t+1)));/* @__PURE__ */
|
|
149
149
|
return Ee("div",{role:"group","aria-label":a?void 0:n,"aria-labelledby":a,"aria-describedby":u>1?d:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${i?"opacity-60":""} ${s}`.trim(),children:[
|
|
150
150
|
/* @__PURE__ */Ee("div",{ref:F,"data-widths-bar":"",className:"relative h-8",children:[
|
|
151
151
|
/* @__PURE__ */Te("div",{ref:y,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-white",children:p.map((e,t)=>/* @__PURE__ */Te("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${yn[t%2]} ${t%2==0?"bg-blue-50":""}`,children:1===u&&/* @__PURE__ */Te("span",{"data-widths-label":"",children:`${e}%`})},t))}),
|
|
152
|
-
/* @__PURE__ */Te("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-gray-300"}),u>1&&p.map((e,t)=>/* @__PURE__ */Te(xn,{column:t,share:e,start:hn(p.slice(0,t)),max:100-(u-1)*rn,label:z(e),name:c.column(t+1),hintId:d,readOnly:l,disabled:i,stored:h,onType:P,onFocusChange:
|
|
152
|
+
/* @__PURE__ */Te("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-gray-300"}),u>1&&p.map((e,t)=>/* @__PURE__ */Te(xn,{column:t,share:e,start:hn(p.slice(0,t)),max:100-(u-1)*rn,label:z(e),name:c.column(t+1),hintId:d,readOnly:l,disabled:i,stored:h,onType:P,onFocusChange:I,covered:B.includes(t),onRestore:e=>{const{onChange:t,locked:r}=x.current;r||t(e)},seam:t<u-1?/* @__PURE__ */Te("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${W[t]}%`},children:/* @__PURE__ */Te(f,{content:c.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */Te("div",{role:"separator",tabIndex:i?-1:0,"aria-orientation":"vertical","aria-label":c.divider(t+1,t+2),"aria-valuenow":p[t],"aria-valuemin":rn,"aria-valuemax":p[t]+p[t+1]-rn,"aria-valuetext":c.dividerValue(t+1,p[t],t+2,p[t+1]),"aria-disabled":b||void 0,onKeyDown:b?void 0:N(t),onPointerDown:L(t),onPointerMove:D,onPointerUp:S,onPointerCancel:S,onLostPointerCapture:()=>{k.current&&C()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(b?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */Te("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(b?`${fn} bg-gray-300`:`bg-blue-600 transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${$===t?"w-1":bn}`)})})})}):null},t))]}),u>1&&!o&&/* @__PURE__ */Te("span",{id:d,className:"sr-only",children:c.hint(u,rn)}),u>1&&o&&/* @__PURE__ */Te("div",{"data-widths-footer":"",className:"@container",children:/* @__PURE__ */Ee("div",{className:"flex items-center justify-between gap-2 @max-[264px]:flex-col @max-[264px]:items-end",children:[
|
|
153
153
|
/* @__PURE__ */Te("span",{id:d,"data-widths-hint":"",className:"text-2xs leading-tight text-gray-500 @max-[264px]:self-stretch",children:c.hint(u,rn)}),
|
|
154
|
-
/* @__PURE__ */Te(g,{variant:"secondary",size:"sm",disabled:b,onClick:()=>{b||void 0===t||r(void 0)},className:"shrink-0",children:c.reset})]})})]})}var wn=/(^|[\s:])!?z-/;function Nn({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:o,defaultOpen:s=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:w="",triggerClassName:N,panelClassName:M=""}){const[C,D]=Ne(s),S=(o??C)&&!f,P=
|
|
154
|
+
/* @__PURE__ */Te(g,{variant:"secondary",size:"sm",disabled:b,onClick:()=>{b||void 0===t||r(void 0)},className:"shrink-0",children:c.reset})]})})]})}var wn=/(^|[\s:])!?z-/;function Nn({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:o,defaultOpen:s=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:w="",triggerClassName:N,panelClassName:M=""}){const[C,D]=Ne(s),S=(o??C)&&!f,P=U(),A=ke(null),j=ke(null),z=ke(null),F=ke(null),T=ve(),E=m??T,O=ve(),I=ve(),q=ve(),H=ke(null),V=ke(!1),Y=ke({openProp:o,onOpenChange:c});Y.current={openProp:o,onOpenChange:c};const G=we(e=>{void 0===Y.current.openProp&&D(e),Y.current.onOpenChange?.(e)},[]),X=we((e=!1)=>{V.current=e,G(!1)},[G]),Z=e=>{H.current=e.nativeEvent},J=we(()=>{const e=z.current,t=j.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=b(t),a=Math.max(0,n.right-n.left-2*y),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${a}px`,o.maxHeight="none",o.width=d?`${Math.min(r.width,a)}px`:"";const s={width:e.offsetWidth,height:e.offsetHeight},c=u??1/0,h=x({trigger:r,menu:{width:s.width,height:Math.min(s.height,c)},bounds:n,align:l,side:i}),m=Math.min(h.maxHeight,c);o.left=`${h.left}px`,o.top=`${h.top}px`,o.maxHeight=`${m}px`,o.overflowY=s.height>m?"auto":"",e.dataset.side=h.side,e.dataset.align=l},[l,i,d,u]);_(()=>{S&&P&&J()}),Me(()=>{if(!S||!P)return;const e=v(()=>j.current,J),t=F.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>J());return r.observe(t),()=>{e(),r.disconnect()}},[S,P,J]),Me(()=>{if(!S)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(H.current===e)return!1;const t=e.target;return!(t&&(A.current?.contains(t)||z.current?.contains(t)))})(e)&&X(!0))},a=e=>{t=e,r=window.setTimeout(()=>n(e),0)},l=e=>n(e);return document.addEventListener(e,a,!0),window.addEventListener(e,l),()=>{window.clearTimeout(r),document.removeEventListener(e,a,!0),window.removeEventListener(e,l)}},t=e("pointerdown"),r=e("focusin"),n=W(()=>X()),a=R(e=>"Escape"===e.key&&(X(),j.current?.focus(),!0),()=>z.current);return()=>{t(),r(),n(),a()}},[S,X]),k(z,S&&P),_(()=>{if(!S||!P)return;const e=z.current;return()=>{if(V.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||j.current?.focus({preventScroll:!0})}},[S,P]),Me(()=>{if(!S||!P)return;const e=z.current;e&&(V.current=!1,(h?.current??$(e)[0]??e).focus({preventScroll:!0}))},[S,P]);const Q="function"==typeof t?t({close:()=>X()}):t,ee=r?{"aria-labelledby":I}:a?{"aria-label":a}:{"aria-labelledby":E};/* @__PURE__ */
|
|
155
155
|
return Ee("div",{ref:A,className:`relative inline-flex ${w}`.trim(),children:[
|
|
156
|
-
/* @__PURE__ */Te("button",{ref:j,id:E,type:"button","aria-haspopup":"dialog","aria-expanded":S,"aria-controls":S&&P?
|
|
157
|
-
/* @__PURE__ */Te("div",{ref:z,id:
|
|
158
|
-
return Te("button",{ref:i,type:a,"aria-pressed":r,className:zn({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"absolute inset-0",style:jn(e)})})}),Tn=(e,t,r)=>Math.min(r,Math.max(t,e)),En=e=>"string"==typeof e?{value:e}:e;var Bn={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function
|
|
159
|
-
return Ee("div",{id:c,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${d}`.trim(),onKeyDown:e=>{"Escape"===e.key&&s&&(e.preventDefault(),e.stopPropagation(),s())},children:[(D.length>0||a)&&/* @__PURE__ */Ee("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-
|
|
156
|
+
/* @__PURE__ */Te("button",{ref:j,id:E,type:"button","aria-haspopup":"dialog","aria-expanded":S,"aria-controls":S&&P?O:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>S?X():G(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!S)return;const t=(()=>{const e=z.current;return e?$(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:N??B({variant:"secondary"}),children:e}),S&&P&&Oe(
|
|
157
|
+
/* @__PURE__ */Te("div",{ref:z,id:O,role:"dialog",...ee,"aria-describedby":n?q:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:Z,onFocusCapture:Z,onKeyDown:e=>{const t=z.current,r=j.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=$(t),a=document.activeElement;if(e.shiftKey){if(n.length>0&&a!==n[0]&&a!==t)return;return e.preventDefault(),void r.focus({preventScroll:!0})}if(n.length>0&&a!==n[n.length-1])return;e.preventDefault();const l=L(r,t);X(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${M}`.trim(),style:wn.test(M)?void 0:{zIndex:K.popup},children:/* @__PURE__ */Ee("div",{ref:F,children:[r&&/* @__PURE__ */Te("h2",{id:I,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */Te("p",{id:q,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */Te("div",{className:"mt-3",children:Q}):Q]})}),document.body)]})}var kn=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function $n(e){const t=e.trim().replace(/^#/,"");if(!kn.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var Mn=e=>e.toUpperCase(),Cn=(e,t,r)=>Math.min(r,Math.max(t,e));function Ln(e){const t=$n(e);if(!t)return{h:0,s:0,v:0};const r=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255,l=Math.max(r,n,a),i=l-Math.min(r,n,a);let o=0;return 0!==i&&(o=l===r?(n-a)/i%6*60:l===n?60*((a-r)/i+2):60*((r-n)/i+4)),{h:(o+360)%360,s:0===l?0:i/l,v:l}}function Dn({h:e,s:t,v:r}){const n=(e%360+360)%360,a=Cn(t,0,1),l=Cn(r,0,1),i=l*a,o=i*(1-Math.abs(n/60%2-1)),s=l-i,[c,d,u]=n<60?[i,o,0]:n<120?[o,i,0]:n<180?[0,i,o]:n<240?[0,o,i]:n<300?[o,0,i]:[i,0,o],h=e=>Math.round(255*(e+s)).toString(16).padStart(2,"0");return`#${h(c)}${h(d)}${h(u)}`}var Sn=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>Dn({h:e%360,s:1,v:1})).join(", ")})`,Pn={sm:"h-5 w-5",md:"h-7 w-7",lg:"h-9 w-9"},An={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function jn(e){return e?{background:e}:An}function zn({size:e="md",selected:t=!1,className:r=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",t?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",Pn[e],r].filter(Boolean).join(" ")}var Fn=xe(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
|
|
158
|
+
return Te("button",{ref:i,type:a,"aria-pressed":r,className:zn({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"absolute inset-0",style:jn(e)})})}),Tn=(e,t,r)=>Math.min(r,Math.max(t,e)),En=e=>"string"==typeof e?{value:e}:e;var Bn={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function On({value:e,onChange:t,label:r,presets:n,clearable:a=!1,fallback:l,dragWrites:i="live",disabled:o=!1,onClose:s,id:c,className:d=""}){const u=Q().color,h=$n(l??""),[m,p]=Ne(()=>Ln(e||h||"")),g=ke(e);Me(()=>{e!==g.current&&(g.current=e,e?p(Ln(e)):h&&p(Ln(h)))},[e]);const b=r=>{o||r===e||(g.current=r,t(r))},y=e=>{const t=$n(e);t&&(p(Ln(t)),b(t))},x=e=>{p(e),b(Dn(e))},[v,w]=Ne(!1),N=ke(m);N.current=m;const k=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,N.current);"end"===i?(w(!0),p(r)):x(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,N.current);"end"===i?p(r):x(r)},onPointerUp:t=>{"end"===i&&v&&(w(!1),x(e(t,N.current)))}}),$=k((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?Cn((r-a.left)/a.width,0,1):0,v:a.height>0?1-Cn((n-a.top)/a.height,0,1):0})};var r,n,a}),M=k((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*Cn((r-n.left)/n.width,0,1)):0)};var r,n}),C=v?Dn(m):e,L=e=>`${Math.round(100*e)}%`,D=(n??[]).map(En),S=$n(e);/* @__PURE__ */
|
|
159
|
+
return Ee("div",{id:c,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${d}`.trim(),onKeyDown:e=>{"Escape"===e.key&&s&&(e.preventDefault(),e.stopPropagation(),s())},children:[(D.length>0||a)&&/* @__PURE__ */Ee("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-2",children:[a&&/* @__PURE__ */Te(f,{content:u.clear,children:/* @__PURE__ */Te(Fn,{color:"",size:"sm","aria-label":u.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(g.current="",t(""))}})}),D.map(e=>{const t=$n(e.value),r=e.label?`${e.label} · ${Mn(t??e.value)}`:Mn(t??e.value);/* @__PURE__ */
|
|
160
160
|
return Te(f,{content:r,children:/* @__PURE__ */Te(Fn,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===S,disabled:o,onClick:()=>y(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
161
161
|
/* @__PURE__ */Te("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*m.v),"aria-valuetext":u.squareValue(Math.round(100*m.s),Math.round(100*m.v)),"aria-disabled":o||void 0,"data-color-square":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?.1:.01,a={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[t];return a?{...e,s:Tn(e.s+a[0],0,1),v:Tn(e.v+a[1],0,1)}:null}(m,e.key,e.shiftKey);t&&(e.preventDefault(),x(t))},...$,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:Dn({h:m.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:L(m.s),top:L(1-m.v),...Bn}})}),
|
|
162
162
|
/* @__PURE__ */Te("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(m.h),"aria-orientation":"horizontal","aria-disabled":o||void 0,"data-color-hue":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?10:1;switch(t){case"ArrowLeft":case"ArrowDown":return Tn(e-n,0,359);case"ArrowRight":case"ArrowUp":return Tn(e+n,0,359);case"PageDown":return Tn(e-10,0,359);case"PageUp":return Tn(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}(m.h,e.key,e.shiftKey);null!==t&&(e.preventDefault(),x({...m,h:t}))},...M,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:Sn},children:/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:m.h/360*100+"%",background:Dn({h:m.h,s:1,v:1}),...Bn}})}),
|
|
163
163
|
/* @__PURE__ */Ee("div",{className:"flex items-center gap-2",children:[
|
|
164
164
|
/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"relative h-7 w-7 shrink-0 overflow-hidden rounded-md border border-gray-300",style:jn(C||(h??""))}),
|
|
165
|
-
/* @__PURE__ */Te(
|
|
166
|
-
return Te("input",{id:l,type:"text",value:o??(e?Mn(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{s(r.target.value);const n=$n(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),s(null))},onBlur:()=>s(null),className:
|
|
165
|
+
/* @__PURE__ */Te(In,{value:C,placeholder:!e&&h?Mn(h):void 0,onChange:y,label:u.hex(r),disabled:o})]})]})}function In({value:e,onChange:t,label:r,placeholder:n,disabled:a,id:l,className:i=""}){const[o,s]=Ne(null);/* @__PURE__ */
|
|
166
|
+
return Te("input",{id:l,type:"text",value:o??(e?Mn(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{s(r.target.value);const n=$n(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),s(null))},onBlur:()=>s(null),className:He({size:"sm",className:`min-w-0 flex-1 font-mono uppercase ${i}`.trim()})})}function Rn({value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o,id:s,showHexInput:c=!1,size:d="md",align:u="start",open:h,onOpenChange:m,className:p=""}){const g=Q().color,f=ve(),b=$n(l??""),y=e||b||"",x=e?Mn(e):b?Mn(b):g.none;/* @__PURE__ */
|
|
167
167
|
return Ee("div",{className:`inline-flex items-center gap-2 ${p}`.trim(),children:[
|
|
168
|
-
/* @__PURE__ */Te(Nn,{id:s,trigger:/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"absolute inset-0",style:jn(y)}),triggerLabel:g.swatch(r,x),triggerClassName:zn({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:o,children:/* @__PURE__ */Te(
|
|
169
|
-
/* @__PURE__ */Te("div",{className:"w-24 flex-none",children:/* @__PURE__ */Te(
|
|
168
|
+
/* @__PURE__ */Te(Nn,{id:s,trigger:/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"absolute inset-0",style:jn(y)}),triggerLabel:g.swatch(r,x),triggerClassName:zn({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:o,children:/* @__PURE__ */Te(On,{id:f,value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o})}),c&&
|
|
169
|
+
/* @__PURE__ */Te("div",{className:"w-24 flex-none",children:/* @__PURE__ */Te(In,{value:e,placeholder:!e&&b?Mn(b):void 0,onChange:r=>{o||r===e||t(r)},label:g.hex(r),disabled:o})})]})}var Wn={background:"color-mix(in srgb, var(--status-on-solid) 45%, transparent)"},Kn={borderColor:"var(--status-on-solid)",boxShadow:"0 0 0 1px var(--rosh-media-scrim-button), 0 1px 4px var(--rosh-media-scrim-button)"};function _n({value:e,onChange:t,label:r,image:n,hint:a,emptyText:l,actions:i,disabled:o=!1,id:s,className:c=""}){const d=Q().imageFocus,u=ve(),h=ke(null),m=ke(!1),{x:p,y:g}=ie(e),f=oe(p,g),b=r=>{r!==e&&t(r)},y=(e,t)=>{const r=h.current?.getBoundingClientRect();if(!r)return;const n=ce(r,e,t);b(oe(n.x,n.y))},x=()=>{m.current=!1};if(!n)/* @__PURE__ */
|
|
170
170
|
return Te("div",{"data-image-focus":"",className:c||void 0,children:/* @__PURE__ */Te("p",{className:"text-xs text-gray-500",children:l??d.noImage})});const v=void 0===a,w=null!==a;/* @__PURE__ */
|
|
171
171
|
return Ee("div",{"data-image-focus":"",className:`flex flex-col gap-2 ${c}`.trim(),children:[
|
|
172
172
|
/* @__PURE__ */Te("button",{id:s,type:"button","data-image-focus-picture":"",disabled:o,"aria-label":d.picture(r,f),"aria-describedby":u,onKeyDown:t=>{if(o||t.altKey||t.ctrlKey||t.metaKey)return;const r=se(e,t.key,t.shiftKey);null!==r&&(t.preventDefault(),b(r))},onPointerDown:e=>{o||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),m.current=!0,y(e.clientX,e.clientY))},onPointerMove:e=>{m.current&&!o&&y(e.clientX,e.clientY)},onPointerUp:x,onPointerCancel:x,onLostPointerCapture:x,className:["flex min-h-36 w-full touch-none items-center justify-center overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-0","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",o?"cursor-not-allowed opacity-60":"cursor-crosshair"].join(" "),children:/* @__PURE__ */Ee("span",{ref:h,"data-image-focus-pane":"",className:"relative block max-w-full",children:[
|
|
@@ -174,25 +174,25 @@ return Ee("div",{"data-image-focus":"",className:`flex flex-col gap-2 ${c}`.trim
|
|
|
174
174
|
/* @__PURE__ */Te("span",{"aria-hidden":"true","data-image-focus-cross":"h",className:"pointer-events-none absolute inset-x-0 h-px",style:{top:`${g}%`,...Wn}}),
|
|
175
175
|
/* @__PURE__ */Te("span",{"aria-hidden":"true","data-image-focus-cross":"v",className:"pointer-events-none absolute inset-y-0 w-px",style:{left:`${p}%`,...Wn}}),
|
|
176
176
|
/* @__PURE__ */Te("span",{"aria-hidden":"true","data-image-focus-dot":"",className:"pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2",style:{left:`${p}%`,top:`${g}%`,...Kn}})]})}),w||i?/* @__PURE__ */Ee("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */Te("span",w?{id:v?u:void 0,className:"min-w-0 flex-1 text-xs text-gray-500",children:v?d.hint:a}:{className:"min-w-0 flex-1"}),i]}):null,!v&&/* @__PURE__ */Te("span",{id:u,className:"sr-only",children:d.hint})]})}function qn({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
177
|
-
return Te("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function
|
|
178
|
-
return Ee("div",{ref:J,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(J.current?.contains(t)||te.current?.contains(t))||ae.current||document.activeElement!==ee.current&&le(!0)},children:[(Be=/* @__PURE__ */Te("input",{id:q,ref:ee,type:"text",autoComplete:"off",role:"combobox","aria-expanded":z,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":z?
|
|
179
|
-
/* @__PURE__ */Te("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */Te("span",{ref:be,className:"whitespace-pre"})}),pe&&/* @__PURE__ */Te(qn,{ariaLabel:G.select.clear,onClear:()=>{L([]),le(!1)}}),y&&!z&&/* @__PURE__ */Te("div",{ref:re,className:`absolute top-1/2 -translate-y-1/2 ${pe?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:y}),z&&
|
|
180
|
-
/* @__PURE__ */Ee("div",{ref:te,onMouseDownCapture:()=>{ae.current=!0,setTimeout(()=>{ae.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:K.popup,left:ce?.left,right:ce?.right,top:ce?.top,bottom:ce?.bottom,minWidth:ce?.minWidth,width:ce?.width,...P&&{maxWidth:ce?.maxWidth},visibility:ce?void 0:"hidden",...
|
|
181
|
-
/* @__PURE__ */Te("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),L([])},className:`block w-full text-left px-3 py-
|
|
177
|
+
return Te("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function Un(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,filter:o=!1,allowFreeText:s=!1,freeTextOption:c,onSearchChange:d,loading:u=!1,error:h,onRetry:b,rightAdornment:y,renderOption:x,clearable:v=!0,"aria-label":w,"aria-labelledby":N,"aria-describedby":k}=e,$=!0===e.multiple,M=e.multiple?e.value:e.value?[e.value]:[],C=e.multiple?"":e.value,L=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},D=M.length>0,S=o&&D&&!l,P=$||o,A=null!=c,j=s||A,[z,F]=Ne(!1),[T,E]=Ne(-1),B=ve(),q=i??`${B}-input`,U=`${B}-listbox`,H=e=>`${B}-opt-${e}`,[V,Y]=Ne(""),G=Q(),X=n??G.select.none,Z=e=>{Y(e),E(-1),d?.(e)},J=ke(null),ee=ke(null),te=ke(null),re=ke(null),ne=ke(z);ne.current=z;const ae=ke(!1),le=e=>{ne.current&&(ne.current=!1,e&&s&&!A&&je&&($?M.includes(je)||L([...M,je]):je!==C&&L([je])),F(!1),Z(""))},ie=(e,t)=>{if(!e.disabled){if($)return L(M.includes(e.value)?M.filter(t=>t!==e.value):[...M,e.value]),void(e===ze?Z(""):E(t));L([e.value]),le(!1)}},[oe,se]=Ne(null);_(()=>{if(!y||z)return void se(null);const e=re.current?.offsetWidth??0;se(e?e+(pe?32:8)+6:null)});const ce=m(ee,z,P?{popupRef:te}:{matchTriggerWidth:!0}),de=$e(()=>tt(t),[t]),ue=M.join("\0"),he=$e(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of de)M.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(j)for(const r of M)t.has(r)||e.push(r);return e},[de,ue,j]),me=he.join(", "),pe=v&&D&&!l,[ge,fe]=Ne(null),be=ke(null),ye=ke(""),xe=ke(()=>{});xe.current=()=>{const e=ee.current,t=be.current;if(!$||!e||!t)return;const r=getComputedStyle(e),n=e.clientWidth-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0),a=[r.fontStyle,r.fontWeight,r.fontSize,r.fontFamily,r.letterSpacing].join("|"),l=`${n}|${a}|${he.join("\0")}`;if(l===ye.current)return;ye.current=l;let i=null;n>0&&he.length>0&&(t.style.fontStyle=r.fontStyle,t.style.fontWeight=r.fontWeight,t.style.fontSize=r.fontSize,t.style.fontFamily=r.fontFamily,t.style.letterSpacing=r.letterSpacing,i=function(e,t){const r=e.length;if(0===r||t(e.join(", ")))return{shown:r,cut:!1};if(1===r)return{shown:1,cut:!0};let n=0;for(let a=1;a<r&&t(`${e.slice(0,a).join(", ")} +${r-a}`);a+=1)n=a;return{shown:n,cut:!1}}(he,e=>(t.textContent=e,t.getBoundingClientRect().width<=n)),t.textContent=""),fe(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},_(()=>{xe.current()}),Me(()=>{const e=ee.current;if(!$||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>xe.current());return t.observe(e),()=>t.disconnect()},[$]);const we=he.length,Ce=!$||!ge||ge.shown>=we?me:0===ge.shown?G.select.selectedCount(we):`${he.slice(0,ge.shown).join(", ")} +${we-ge.shown}`,Le=$&&null!==ge&&(ge.shown<we||ge.cut),De=z&&D&&P;Me(()=>{if(!z)return;const e=e=>{const t=e.target;J.current?.contains(t)||te.current?.contains(t)||le(!0)};document.addEventListener("mousedown",e);const t=W(()=>le(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[z,s,V,ue,e.onChange]),Me(()=>{if(z)return R(e=>!("Escape"!==e.key||!ne.current)&&(le(!1),ee.current?.blur(),!0),()=>te.current)},[z]);const Se=$e(()=>{const e=/* @__PURE__ */new Set;return rt(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),Pe=$e(()=>{if(d)return Se;const e=V.trim().toLowerCase();return e?rt(Se,t=>t.label.toLowerCase().includes(e)||(t.sublabel?.toLowerCase().includes(e)??!1)):Se},[Se,V,d]),Ae=$e(()=>tt(Pe),[Pe]),je=V.trim(),ze=$e(()=>A&&je?de.some(e=>e.label===je)||M.includes(je)?null:{value:je,label:je}:null,[A,je,de,ue]),Fe=$e(()=>ze?[...Ae,ze]:Ae,[Ae,ze]);/* @__PURE__ */
|
|
178
|
+
return Ee("div",{ref:J,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(J.current?.contains(t)||te.current?.contains(t))||ae.current||document.activeElement!==ee.current&&le(!0)},children:[(Be=/* @__PURE__ */Te("input",{id:q,ref:ee,type:"text",autoComplete:"off",role:"combobox","aria-expanded":z,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":z?U:void 0,"aria-activedescendant":z&&T>=0&&T<Fe.length?H(T):void 0,"aria-label":N?void 0:w,"aria-labelledby":N,"aria-describedby":k,value:z?V:Ce,onChange:e=>{Z(e.target.value),F(!0)},onFocus:()=>{l||(Z(""),F(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(l)return;if(e.preventDefault(),!z)return void F(!0);if(0===Fe.length)return;const t="ArrowDown"===e.key?1:-1;return void E(e=>Je(Fe,e,t))}"Enter"===e.key?(e.preventDefault(),z&&T>=0&&T<Fe.length?ie(Fe[T],T):1!==Ae.length||Ae[0].disabled?s&&!A&&je&&($?(M.includes(je)||L([...M,je]),Z("")):(L([je]),le(!1),ee.current?.blur())):ie(Ae[0],0)):"Escape"===e.key?(le(!1),ee.current?.blur()):"Tab"===e.key&&le(!0)},placeholder:De?Ce:r||X,className:`${S?qe:_e} ${a} ${pe?"pr-8":""} ${l?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${De?" rosh-field-shows-choice":""}`,style:oe?{paddingRight:oe}:void 0,disabled:l}),$?/* @__PURE__ */Te(f,{content:!z&&Le?me:null,className:"block",children:Be}):Be),$&&
|
|
179
|
+
/* @__PURE__ */Te("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */Te("span",{ref:be,className:"whitespace-pre"})}),pe&&/* @__PURE__ */Te(qn,{ariaLabel:G.select.clear,onClear:()=>{L([]),le(!1)}}),y&&!z&&/* @__PURE__ */Te("div",{ref:re,className:`absolute top-1/2 -translate-y-1/2 ${pe?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:y}),z&&Oe(
|
|
180
|
+
/* @__PURE__ */Ee("div",{ref:te,onMouseDownCapture:()=>{ae.current=!0,setTimeout(()=>{ae.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:K.popup,left:ce?.left,right:ce?.right,top:ce?.top,bottom:ce?.bottom,minWidth:ce?.minWidth,width:ce?.width,...P&&{maxWidth:ce?.maxWidth},visibility:ce?void 0:"hidden",...O()},children:[$&&D&&v&&!l&&
|
|
181
|
+
/* @__PURE__ */Te("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),L([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-gray-50 border-b ${I}`,children:G.select.clearAll}),u?
|
|
182
182
|
/* @__PURE__ */Te("p",{role:"status",className:"px-3 py-2 text-sm text-gray-500",children:G.search.searching}):h?/* @__PURE__ */Ee("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
183
183
|
/* @__PURE__ */Te("span",{className:"min-w-0 flex-1",children:h}),b&&/* @__PURE__ */Te(g,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:b,className:"shrink-0",children:G.list.retry})]}):null,
|
|
184
|
-
/* @__PURE__ */Ee("div",{id:
|
|
185
|
-
return Ee("button",{id:
|
|
184
|
+
/* @__PURE__ */Ee("div",{id:U,role:Fe.length?"listbox":void 0,"aria-labelledby":Fe.length?N??(w?void 0:q):void 0,"aria-label":Fe.length&&!N?w:void 0,"aria-multiselectable":!(!Fe.length||!$)||void 0,className:"overflow-y-auto",style:{maxHeight:ce?.maxHeight??p},children:[0===Fe.length?u||h?null:/* @__PURE__ */Te("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:G.select.noMatches}):0===Ae.length?null:nt(Pe,(e,t)=>{const r=M.includes(e.value);/* @__PURE__ */
|
|
185
|
+
return Ee("button",{id:H(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||$)&&r.preventDefault(),ie(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${r?"text-blue-600 font-medium":"text-gray-700"} ${t===T?"bg-gray-100":r?"bg-blue-50/50":""}`),children:[$&&/* @__PURE__ */Te(at,{selected:r}),
|
|
186
186
|
/* @__PURE__ */Te("span",{className:`min-w-0 ${P?"flex-auto":"flex-1"} truncate`,children:x?x(e,{selected:r,active:t===T}):e.label}),e.sublabel&&/* @__PURE__ */Te("span",{className:`min-w-0 ${P?"shrink":"max-w-[45%] shrink-0"} truncate text-xs text-gray-400`,children:e.sublabel})]},e.value)},B),ze&&c&&
|
|
187
|
-
/* @__PURE__ */Te("button",{id:
|
|
188
|
-
return Te(
|
|
189
|
-
return Te(st,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:n})};let X;if("text"===P.target.type)X=/* @__PURE__ */Te(Ye,{ref:p,id:`${h}-address`,size:"sm",type:"text",invalid:K,"aria-label":d.address,"aria-describedby":K?`${h}-why`:void 0,placeholder:o??d.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:
|
|
187
|
+
/* @__PURE__ */Te("button",{id:H(Ae.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{$&&e.preventDefault(),ie(ze,Ae.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${Ae.length?`border-t ${I}`:""} ${T===Ae.length?"bg-gray-100":""}`,children:/* @__PURE__ */Te("span",{className:"min-w-0 flex-1 truncate",children:c(ze.value)})},`${B}-typed`)]})]}),document.body)]});var Be}function Hn(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var Vn="address",Yn={kindOf:()=>Vn,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},Gn=e=>n(e.trim());function Xn(e){const{value:t,kinds:r,rules:n=Yn,filtersFor:a,label:l,readOnly:i,placeholder:o,className:s=""}=e,c=void 0!==e.onApply,d=Q().link,u=n.isSafe??Gn,h=ve(),m=ke(null),p=ke(null),[f,b]=Ne({url:t}),y=c?f.url:t,[x,v]=Ne(!1),[w,N]=Ne(null),[k,$]=Ne(null),M=ke(()=>{});M.current=c?e.onCancel:()=>{},Me(()=>{if(c)return R(e=>{const t=m.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(M.current(),!0)},()=>m.current)},[c]),Me(()=>{if(!c)return;const e=p.current;e?(e.focus(),e.select()):m.current?.querySelector("button, input")?.focus()},[]);const C=r??[{value:Vn,label:d.address,target:{type:"text"}}],L=w&&w.against===y?w.kind:n.kindOf(y),D=C.filter(e=>!e.hideWhenEmpty||Hn(e.target).length>0||e.value===L),S=D.find(e=>"text"===e.target.type),P=D.find(e=>e.value===L)??S??D[0];if(!P)return null;const A="text"!==P.target.type,j=A?n.targetOf(y):y,z=Hn(P.target),F=z.find(e=>e.value===j),T=e=>({value:e,label:d.unavailable(e)}),E="select"===P.target.type&&j&&a?a(j):null,B=E?n.readFilter(y):null,O=B?E?.find(e=>e.param===B.param):void 0,I=k&&k.against===y?k.text:y,W=!A&&""!==I.trim()&&!u(I),K=W&&(!c||x),_=(t,r)=>{c?b({url:t,name:r}):void 0===r?e.onChange(t):e.onChange(t,r)},q=(e,t)=>{N(t=>t?{...t,against:e}:t),_(e,t)},U=e=>{if(!e)return q("");const t=z.find(t=>t.value===e);q(e,t?.label)},H=A?y:I.trim(),V=()=>{if(!c||!H)return;if(!A&&W)return void v(!0);const t=A&&f.url===H?f.name:void 0,r=e.onApply;void 0===t?r(H):r(H,t)},Y=(e,t)=>t&&!e.some(e=>e.value===t)?[T(t),...e]:[...e],G=(e,t,r,n,a)=>{const l=[];for(const e of r){const t=l[l.length-1],r={value:e.value,label:e.label};e.group?t&&"options"in t&&t.label===e.group?t.options.push(r):l.push({label:e.group,options:[r]}):l.push(r)}if(a){const a=r.some(e=>""===e.value);/* @__PURE__ */
|
|
188
|
+
return Te(Un,{"aria-label":e,value:t,options:l,disabled:i,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
189
|
+
return Te(st,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:n})};let X;if("text"===P.target.type)X=/* @__PURE__ */Te(Ye,{ref:p,id:`${h}-address`,size:"sm",type:"text",invalid:K,"aria-label":d.address,"aria-describedby":K?`${h}-why`:void 0,placeholder:o??d.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:I,readOnly:i,onChange:e=>(e=>{v(!1);const t=e.trim();t?u(e)?($({text:e,against:t}),q(t)):$({text:e,against:y}):($({text:e,against:""}),q(""))})(e.target.value)});else{const e="groups"===P.target.type?P.target.groups.flatMap(e=>e.options.map(t=>({value:t.value,label:t.label,group:e.label}))):P.target.options.map(e=>({value:e.value,label:e.label})),t=[{value:"",label:P.target.placeholder},...Y(e,j)];X=G(P.label,j,t,U,e.length>10)}const Z=/* @__PURE__ */Ee(Be,{children:[r&&G(d.linkType,P.value,D.map(e=>({value:e.value,label:e.label})),e=>{$(null),v(!1);const t=D.find(t=>t.value===e);if(!t||"text"===t.target.type)return void N({kind:e,against:y});const r=Hn(t.target)[0];N({kind:e,against:r?r.value:""}),r?_(r.value,r.label):_("")},!1),X,E&&G(d.filter,B?.param??"",[{value:"",label:d.noFilter},...B&&!O?[T(B.param)]:[],...E.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return q(j,F?.label);const t=E?.find(t=>t.param===e),r=t?.values[0];r&&q(n.withFilter(j,{param:e,value:r.value}),r.label)},!1),E&&B&&G(d.value,B.value,Y((O?.values??[]).map(e=>({value:e.value,label:e.label})),B.value),e=>{if(!B)return;const t=O?.values.find(t=>t.value===e);q(n.withFilter(j,{param:B.param,value:e}),t?.label)},(O?.values.length??0)>10),K&&/* @__PURE__ */Te("p",{id:`${h}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:d.unsafe}),P.hint&&/* @__PURE__ */Te("p",{className:"text-2xs leading-4 text-gray-400",children:P.hint}),E&&/* @__PURE__ */Te("p",{className:"text-2xs leading-4 text-gray-400",children:d.filterHint})]});if(!c)/* @__PURE__ */
|
|
190
190
|
return Te("div",{ref:m,className:`flex min-w-0 flex-auto flex-col gap-2 ${s}`.trim(),role:l?"group":void 0,"aria-label":l,children:Z});const J=e.onRemove;/* @__PURE__ */
|
|
191
191
|
return Ee("div",{ref:m,role:"dialog","aria-label":l??d.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${s}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),V())},children:[A?/* @__PURE__ */Te("span",{className:yt({inline:!0}),children:d.title}):/* @__PURE__ */Te("label",{htmlFor:`${h}-address`,className:yt({inline:!0}),children:d.title}),Z,
|
|
192
192
|
/* @__PURE__ */Ee("div",{className:"flex items-center justify-between gap-2",children:[J?/* @__PURE__ */Te(g,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:J,children:d.remove}):null,
|
|
193
193
|
/* @__PURE__ */Ee("span",{className:"ml-auto flex gap-1",children:[
|
|
194
194
|
/* @__PURE__ */Te(g,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>M.current(),children:d.cancel}),
|
|
195
|
-
/* @__PURE__ */Te(g,{variant:"primary",size:"sm","data-window-action":"apply",onClick:V,disabled:i||""===
|
|
195
|
+
/* @__PURE__ */Te(g,{variant:"primary",size:"sm","data-window-action":"apply",onClick:V,disabled:i||""===H,children:d.apply})]})]})]})}function Zn({label:e,text:t,onTextChange:r,link:n,onLinkChange:a,kinds:l,rules:i,filtersFor:o,textPlaceholder:s,readOnly:c,className:d=""}){const u=Q().link,[h,m]=Ne(!1),p=ke(null),g=ve(),f=()=>{m(!1),p.current?.focus()};/* @__PURE__ */
|
|
196
196
|
return Ee("div",{className:`flex min-w-0 flex-auto flex-col ${d}`.trim(),children:[
|
|
197
197
|
/* @__PURE__ */Te(Ye,{size:"sm",type:"text",className:"rounded-b-none","aria-label":u.text(e),placeholder:s,value:t,readOnly:c,onChange:e=>r(e.target.value)}),
|
|
198
198
|
/* @__PURE__ */Ee("button",{ref:p,type:"button","aria-label":u.linkOf(e,n),"aria-expanded":h,"aria-controls":h?g:void 0,disabled:c,onClick:()=>m(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-gray-300 bg-gray-50 ${Ke.sm} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
@@ -200,7 +200,7 @@ return Ee("div",{className:`flex min-w-0 flex-auto flex-col ${d}`.trim(),childre
|
|
|
200
200
|
/* @__PURE__ */Te("span",{className:"min-w-0 truncate "+(n?"text-blue-600":"text-gray-400"),children:n||u.addLink})]}),h&&/* @__PURE__ */Te("div",{id:g,className:"mt-2",children:/* @__PURE__ */Te(Xn,{value:n,label:u.linkOf(e,n),kinds:l,rules:i,filtersFor:o,onApply:(e,t)=>{void 0===t?a(e):a(e,t),f()},onRemove:n?()=>{a(""),f()}:void 0,onCancel:f})})]})}var Jn={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"};function Qn({label:e,value:t,corners:r,onChange:n,radius:a=null,onRadiusChange:l,radiusLabel:i,radiusMin:o=0,radiusMax:s,radiusStep:c=1,radiusPlaceholder:d,disabled:u=!1,disabledReason:h,id:m,className:p=""}){const g=Q();/* @__PURE__ */
|
|
201
201
|
return Ee("div",{id:m,role:"group","aria-label":e,className:`flex min-w-0 items-center gap-2 ${p}`.trim(),children:[l&&
|
|
202
202
|
/* @__PURE__ */Te("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */Te(Xr,{value:a,onChange:l,min:o,max:s,step:c,precision:0,placeholder:d,prefix:/* @__PURE__ */Te("span",{"data-radius-mark":"","aria-hidden":"true",children:g.corners.radiusMark}),suffix:g.corners.unit,steppers:"compact",disabled:u,"aria-label":i??g.corners.radius})}),
|
|
203
|
-
/* @__PURE__ */Te("div",{className:"flex shrink-0 items-center gap-1",children:r.map(e=>{const r=t.includes(e.value),a=u||!0===e.disabled,l=a&&(!0===e.disabled&&e.title||(u?h:void 0))||void 0,i=/* @__PURE__ */Te(
|
|
203
|
+
/* @__PURE__ */Te("div",{className:"flex shrink-0 items-center gap-1",children:r.map(e=>{const r=t.includes(e.value),a=u||!0===e.disabled,l=a&&(!0===e.disabled&&e.title||(u?h:void 0))||void 0,i=/* @__PURE__ */Te(Ie,{"aria-pressed":r,"aria-label":e.label,"aria-disabled":a||void 0,disabledReason:l,"data-corner":e.value,onClick:()=>{a||n(r?t.filter(t=>t!==e.value):[...t,e.value])},children:/* @__PURE__ */Te(be,{name:"corner",strokeWidth:2,className:["h-4 w-4",Jn[e.value]??""].filter(Boolean).join(" ")})},e.value);return l?i:/* @__PURE__ */Te(f,{content:e.title??e.label,children:i},e.value)})})]})}var ea={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function ta({label:e,value:t,points:r,onChange:n,disabled:a=!1,disabledReason:l,id:i,className:o=""}){const s=ve(),c=ke([]),m=r.findIndex(e=>e.value===t),p=r.findIndex(e=>!a&&!0!==e.disabled),g=m>=0?m:Math.max(0,p);/* @__PURE__ */
|
|
204
204
|
return Te("div",{id:i,role:"radiogroup","aria-label":e,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-gray-200 bg-gray-200 ${o}`.trim(),children:r.map((e,i)=>{const o=t===e.value,m=a||!0===e.disabled,p=m&&(!0===e.disabled&&e.title||(a?l:void 0))||void 0,b=`${s}-${i}`,y=/* @__PURE__ */Te("button",{type:"button",role:"radio","aria-checked":o,"aria-label":e.label,"aria-disabled":m||void 0,"aria-describedby":u(void 0,p?b:void 0),ref:e=>{c.current[i]=e},tabIndex:i===g?0:-1,onKeyDown:e=>((e,l)=>{const i=ea[l.key];if(!i)return;l.preventDefault();const o=Math.floor(e/3)+i[0],s=e%3+i[1];if(o<0||s<0||s>=3)return;const d=3*o+s;if(d>=r.length)return;c.current[d]?.focus();const u=r[d];a||!0===u.disabled||u.value===t||n(u.value)})(i,e),onClick:m?d:()=>n(e.value),className:"group relative flex size-9 items-center justify-center transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring)] aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(o?"bg-blue-50 hover:bg-blue-100":"bg-white hover:bg-gray-50"),children:e.icon?/* @__PURE__ */Te("span",{"data-icon-slot":"","aria-hidden":"true",className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4 "+(o?"text-blue-700":"text-gray-500 group-hover:text-gray-700"),children:e.icon}):/* @__PURE__ */Te("span",{"data-dot":"","aria-hidden":"true",className:o?"size-3 rounded-sm bg-blue-600":"size-1 rounded-full bg-[color:var(--ink-faintest)] transition-colors group-hover:bg-[color:var(--ink-faint)]"})},e.value);return p?/* @__PURE__ */Te(h,{reason:p,id:b,block:!0,children:y},e.value):/* @__PURE__ */Te(f,{content:e.title??e.label,className:"relative flex",children:y},e.value)})})}var ra=xe(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:o=!1,label:s,hint:c,error:d,required:u,className:h=""},m){const p=ve(),g=Q().files,f=G({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:o,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),b=d?`${p}-error`:c?`${p}-hint`:void 0;/* @__PURE__ */
|
|
205
205
|
return Ee(mt,{label:s,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
|
|
206
206
|
/* @__PURE__ */Ee("button",{ref:m,type:"button",id:p,disabled:o,onClick:f.open,"aria-invalid":!!d||void 0,"aria-required":u||void 0,"aria-describedby":b,...f.zoneProps,className:$t(f.dragOver,o,`px-4 py-6 ${Mt(o)}`),children:[
|
|
@@ -215,22 +215,22 @@ return Ee(mt,{label:s,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
|
|
|
215
215
|
return Te(be,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function aa({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
216
216
|
return Te(be,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function la({intake:e,dropLabel:t,className:r="",children:n}){const a=Q().files;/* @__PURE__ */
|
|
217
217
|
return Ee("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,children:[n,
|
|
218
|
-
/* @__PURE__ */Te("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */Te("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function ia({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=Q().files,l=ke(/* @__PURE__ */new Map);Me(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),Me(()=>()=>{for(const e of l.current.values())URL.revokeObjectURL(e);l.current.clear()},[]);const i=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=l.current.get(e);return t||(t=URL.createObjectURL(e),l.current.set(e,t)),t};return 0===e.length?null:/* @__PURE__ */Te("ul",{className:`flex flex-wrap gap-
|
|
219
|
-
return Ee("li",{className:"flex max-w-full items-center gap-
|
|
218
|
+
/* @__PURE__ */Te("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */Te("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function ia({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=Q().files,l=ke(/* @__PURE__ */new Map);Me(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),Me(()=>()=>{for(const e of l.current.values())URL.revokeObjectURL(e);l.current.clear()},[]);const i=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=l.current.get(e);return t||(t=URL.createObjectURL(e),l.current.set(e,t)),t};return 0===e.length?null:/* @__PURE__ */Te("ul",{className:`flex flex-wrap gap-2 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
|
|
219
|
+
return Ee("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-gray-200 bg-gray-50 py-1 pl-2 pr-1 text-xs text-gray-700",children:[l?/* @__PURE__ */Te("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */Te("span",{className:"text-gray-400",children:/* @__PURE__ */Te(aa,{})}),
|
|
220
220
|
/* @__PURE__ */Te("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
|
|
221
221
|
/* @__PURE__ */Te("span",{className:"shrink-0 tabular-nums text-gray-400",children:X(e.size,a)}),t&&/* @__PURE__ */Te("button",{type:"button",disabled:r,onClick:()=>t(n),"aria-label":a.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */Te(Pt,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function oa({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=Q().files,i=n??l.attach,o=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */Ee("span",{className:"relative inline-flex",children:[
|
|
222
|
-
/* @__PURE__ */Te(
|
|
222
|
+
/* @__PURE__ */Te(Ie,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */Te(na,{})}),t>0&&/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-2xs font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */Te(g,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */Te(na,{}),children:o})}function sa({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i=!1,dropLabel:o,attachLabel:s,trigger:c="button",actions:d,onReject:u,className:h="",children:m}){const p=G({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),g=ke([]);return Me(()=>{u&&p.rejections.length>0&&p.rejections!==g.current&&(g.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */Ee(la,{intake:p,dropLabel:o,className:h,children:[m,
|
|
223
223
|
/* @__PURE__ */Te(ia,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
|
|
224
224
|
/* @__PURE__ */Ee("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
225
225
|
/* @__PURE__ */Te(oa,{onClick:p.open,count:e.length,variant:c,label:s,disabled:i}),d]}),
|
|
226
226
|
/* @__PURE__ */Te(Z,{rejections:p.rejections})]})}var ca={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},da={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function ua(e,t="subtle"){return"solid"===t?da[e]:ca[e]}var ha=Ce({}),ma=Ce(void 0);function pa(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function ga({groups:e,labelFor:t,children:r}){/* @__PURE__ */
|
|
227
227
|
return Te(ha.Provider,{value:e,children:/* @__PURE__ */Te(ma.Provider,{value:t,children:r})})}function fa(){const e=Pe(ma);return we(t=>e?.(t)??pa(t),[e])}function ba({status:e,label:t,emphasis:r="subtle"}){const n=ua(Pe(ha)[e]??"neutral",r),a=Pe(ma),l=t??a?.(e)??pa(e);/* @__PURE__ */
|
|
228
|
-
return Te("span",{className:`inline-flex items-center rounded-full px-
|
|
228
|
+
return Te("span",{className:`inline-flex items-center rounded-full px-3 py-0.5 text-xs font-medium ${n}`,children:l})}var ya={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${ca.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function xa(e,t){return e.label.toLowerCase().includes(t)||(e.sublabel?.toLowerCase().includes(t)??!1)}function va({value:e,onChange:t,options:r=[],placeholder:n,allowFreeText:a=!1,invalid:l,disabled:i,id:o,className:s="",tone:c,tooltip:d,split:u}){const[h,g]=Ne(!1),[b,y]=Ne(""),x=Q(),v=ke(null),N=ke(null),k=ke(null),$=m(v,h),M=e=>r.find(t=>t.value===e)?.label??e,C=$e(()=>{const t=new Set(e),n=[],a=b.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!xa(e,a)||n.push(e));return n},[r,e,b]),L=n=>{const l=[...e];for(const e of n){const t=e.trim();if(!t)continue;const n=t.toLowerCase(),i=r.find(e=>e.value===t||e.label.toLowerCase()===n)?.value,o=i??(a?t:null);o&&!l.includes(o)&&l.push(o)}l.length!==e.length&&t(l)},D=r=>{r&&!e.includes(r)?(t([...e,r]),y("")):y("")},S=r=>t(e.filter(e=>e!==r)),P=()=>{const e=b.trim();if(u&&e)return L(e.split(u)),void y("");a&&e?D(e):y("")},A=ke(()=>{});A.current=()=>{P(),g(!1)},Me(()=>{if(!h)return;const e=e=>{const t=e.target;v.current?.contains(t)||k.current?.contains(t)||(P(),g(!1))};document.addEventListener("mousedown",e);const t=W(()=>A.current());return()=>{document.removeEventListener("mousedown",e),t()}});const j=r.length>0;/* @__PURE__ */
|
|
229
229
|
return Ee("div",{ref:v,className:"relative",children:[
|
|
230
|
-
/* @__PURE__ */Ee("div",{onMouseDown:e=>{i||e.target.closest("button")||(e.preventDefault(),N.current?.focus())},className:
|
|
230
|
+
/* @__PURE__ */Ee("div",{onMouseDown:e=>{i||e.target.closest("button")||(e.preventDefault(),N.current?.focus())},className:He({invalid:l,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${i?"bg-gray-50 cursor-not-allowed":""} ${s}`}),children:[e.map(e=>{const t=c?.(e),r=ya[t??"accent"],n=/* @__PURE__ */Ee("span",{"data-tone":t,className:r.chip,children:[
|
|
231
231
|
/* @__PURE__ */Te("span",{className:"truncate",children:M(e)}),!i&&/* @__PURE__ */Te("button",{type:"button","aria-label":x.select.removeItem?.(M(e))??`${x.select.remove} ${M(e)}`,onClick:()=>S(e),className:r.remove,children:"×"})]},e),a=d?.(e);return null==a?n:/* @__PURE__ */Te(f,{content:a,className:"relative inline-flex max-w-full",children:n},e)}),
|
|
232
|
-
/* @__PURE__ */Te("input",{id:o,ref:N,type:"text",autoComplete:"off",role:"combobox","aria-expanded":h&&j,"aria-invalid":l||void 0,disabled:i,value:b,placeholder:0===e.length?n:void 0,onChange:e=>{(e=>{if(u){const t=e.split(u);if(t.length>1)return L(t.slice(0,-1)),void y(t[t.length-1])}y(e)})(e.target.value),g(!0)},onFocus:()=>{!i&&j&&g(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&a){t.preventDefault();const e=b.trim(),r=e?C.filter(t=>xa(t,e.toLowerCase())):[];1===r.length?D(r[0].value):P()}else"Backspace"===t.key&&""===b&&e.length>0?S(e[e.length-1]):"Escape"===t.key?(g(!1),y(""),N.current?.blur()):"Tab"===t.key&&(P(),g(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),h&&j&&
|
|
233
|
-
/* @__PURE__ */Te("div",{ref:k,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:K.popup,left:$?.left,right:$?.right,top:$?.top,bottom:$?.bottom,minWidth:$?.minWidth,maxWidth:$?.maxWidth??w,width:"max-content",visibility:$?void 0:"hidden",...
|
|
232
|
+
/* @__PURE__ */Te("input",{id:o,ref:N,type:"text",autoComplete:"off",role:"combobox","aria-expanded":h&&j,"aria-invalid":l||void 0,disabled:i,value:b,placeholder:0===e.length?n:void 0,onChange:e=>{(e=>{if(u){const t=e.split(u);if(t.length>1)return L(t.slice(0,-1)),void y(t[t.length-1])}y(e)})(e.target.value),g(!0)},onFocus:()=>{!i&&j&&g(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&a){t.preventDefault();const e=b.trim(),r=e?C.filter(t=>xa(t,e.toLowerCase())):[];1===r.length?D(r[0].value):P()}else"Backspace"===t.key&&""===b&&e.length>0?S(e[e.length-1]):"Escape"===t.key?(g(!1),y(""),N.current?.blur()):"Tab"===t.key&&(P(),g(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),h&&j&&Oe(
|
|
233
|
+
/* @__PURE__ */Te("div",{ref:k,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:K.popup,left:$?.left,right:$?.right,top:$?.top,bottom:$?.bottom,minWidth:$?.minWidth,maxWidth:$?.maxWidth??w,width:"max-content",visibility:$?void 0:"hidden",...O()},children:/* @__PURE__ */Te("div",{className:"overflow-y-auto",style:{maxHeight:$?.maxHeight??p},children:0===C.length?/* @__PURE__ */Te("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:r.length>0&&e.length>=r.length?x.select.allSelected:x.select.noMatches}):C.map(e=>/* @__PURE__ */Te("button",{type:"button",onMouseDown:t=>{t.preventDefault(),D(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.sublabel?/* @__PURE__ */Ee(Be,{children:[
|
|
234
234
|
/* @__PURE__ */Te("span",{className:"min-w-0 truncate",children:e.label}),
|
|
235
235
|
/* @__PURE__ */Te("span",{className:"min-w-0 max-w-[60%] shrink-0 truncate text-xs text-gray-400",children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}var wa={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},Na={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function ka({children:e,header:t,description:r,footer:n,padded:a=!0,padding:l,headingLevel:i,headerActions:o,"aria-label":s,className:c="",bodyClassName:d="",style:u,tone:h="neutral"}){const m=wa[l??(a?"md":"none")],p=ve(),g=ve(),f=null!=t&&null!=r&&""!==r,b=null!=i&&null!=t,y=`h${i}`,x=null!=s&&""!==s,v=b||x,w=v?"section":"div",N=`rounded-(--radius-card) border ${Na[h]} bg-white shadow-sm ${c}`.trim(),k=Le.toArray(e).length>0,$=k?"border-b border-gray-100 ":"",M="current"===h,C=M?"text-base font-semibold text-blue-700":"text-base font-semibold text-gray-900",L=M?"rounded-t-(--radius-card) bg-blue-50 ":"",D=`${$}${L}${m.edge} ${C}`;/* @__PURE__ */
|
|
236
236
|
return Ee(w,{className:N,style:u,...x?{"aria-label":s}:b?{"aria-labelledby":p}:{},...f&&v?{"aria-describedby":g}:{},...M?{"aria-current":!0}:{},children:[f?
|
|
@@ -247,15 +247,15 @@ return Te(l,{className:[Ma[t],Ca[r],La[n],a?"block truncate":"",i].filter(Boolea
|
|
|
247
247
|
return Te(`h${t}`,{className:[Sa[t],Ma[r],n].filter(Boolean).join(" "),children:e})}function Aa({children:e,tone:t="secondary",size:r="sm",className:n=""}){/* @__PURE__ */
|
|
248
248
|
return Te("p",{className:[Ma[t],Ca[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var ja={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},za={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Fa={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function Ta({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
|
|
249
249
|
return Te("div",{className:["flex flex-col",ja[t],r?za[r]:"",n?Fa[n]:"",a].filter(Boolean).join(" "),children:e})}function Ea({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
|
|
250
|
-
return Te("div",{className:["flex",a?"flex-wrap":"",ja[t],za[r],n?Fa[n]:"",l].filter(Boolean).join(" "),children:e})}var Ba={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},
|
|
251
|
-
return Te("div",{className:["grid",Ba[t],r?
|
|
250
|
+
return Te("div",{className:["flex",a?"flex-wrap":"",ja[t],za[r],n?Fa[n]:"",l].filter(Boolean).join(" "),children:e})}var Ba={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Oa={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"},Ia={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 Ra({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
|
|
251
|
+
return Te("div",{className:["grid",Ba[t],r?Oa[r]:"",n?Ia[n]:"",ja[a],l].filter(Boolean).join(" "),children:e})}var Wa={sm:"my-2",md:"my-4",lg:"my-6"};function Ka({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=ve();if("vertical"===e)/* @__PURE__ */
|
|
252
252
|
return Te("span",{role:"presentation",className:`inline-block h-full min-h-[1em] w-px shrink-0 self-stretch bg-gray-200 ${a}`.trim()});if(!t)/* @__PURE__ */
|
|
253
253
|
return Te("hr",{className:`border-0 border-t border-gray-200 ${Wa[n]} ${a}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",o="right"===r?"w-4 shrink-0":"flex-1";
|
|
254
254
|
/* @__PURE__ */
|
|
255
255
|
return Ee("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${Wa[n]} ${a}`.trim(),children:[
|
|
256
256
|
/* @__PURE__ */Te("span",{"aria-hidden":"true",className:`${i} border-t border-gray-200`}),
|
|
257
257
|
/* @__PURE__ */Te("span",{id:l,className:"shrink-0 text-xs font-medium text-gray-500",children:t}),
|
|
258
|
-
/* @__PURE__ */Te("span",{"aria-hidden":"true",className:`${o} border-t border-gray-200`})]})}var _a=[2,4,8,12,16,20,24,32,40,48],qa={iconGap:8,iconGapSm:4,controlXSm:8,controlX:12,controlXLg:16,cellX:12,label:4,toolbar:8,formRow:12,card:16,block:16,gutter:16,panelGroup:2,panelSub:4,panelLayer:8,panelRow:12,panelPad:16,panelPadNarrow:12,panelSetting:32},
|
|
258
|
+
/* @__PURE__ */Te("span",{"aria-hidden":"true",className:`${o} border-t border-gray-200`})]})}var _a=[2,4,8,12,16,20,24,32,40,48],qa={iconGap:8,iconGapSm:4,controlXSm:8,controlX:12,controlXLg:16,cellX:12,label:4,toolbar:8,formRow:12,card:16,block:16,gutter:16,panelGroup:2,panelSub:4,panelLayer:8,panelRow:12,panelPad:16,panelPadNarrow:12,panelSetting:32},Ua={sm:24,md:32,lg:40},Ha={menu:36,windowBar:44,compactBar:32};function Va(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&_a.includes(4*t)}var Ya=[9,11,12,14,16,18,20,24,30],Ga={body:400,control:500,heading:600,figure:700},Xa={fast:120,base:160},Za={hairline:1,strong:2,accent:4},Ja=["control","card","panel","popup","window"],Qa=["none","raised","panel","popup","dialog"],el={text:"rounded",rect:"rounded-md",circle:"rounded-full"},tl=e=>"number"==typeof e?`${e}px`:e;function rl({variant:e="text",width:t,height:r,lines:n=1,className:a=""}){const l=`animate-pulse bg-gray-200 ${el[e]} ${a}`.trim();if("circle"===e){const e=tl(r??t)??"2.5rem";/* @__PURE__ */
|
|
259
259
|
return Te("span",{className:`inline-block ${l}`,style:{width:e,height:e},"aria-hidden":"true"})}const i={width:tl(t)??"100%",height:tl(r)??("text"===e?"1rem":"4rem")};/* @__PURE__ */
|
|
260
260
|
return Te("span","text"===e&&n>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:n},(e,t)=>/* @__PURE__ */Te("span",{className:`block ${l}`,style:{...i,width:t===n-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var nl={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},al={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},ll={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},il={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function ol({items:e,columns:t=1,bordered:r=!1,size:n="md",title:a,className:l="",emptyText:i="—"}){const o="number"==typeof t?{base:t}:t,s=o.base??1,c=Math.max(s,o.sm??0,o.lg??0),d="sm"===n?"px-3 py-2":"px-4 py-3",u="sm"===n?"text-xs":"text-sm";/* @__PURE__ */
|
|
261
261
|
return Ee("div",{className:[r?"rounded-lg border border-gray-200 bg-white":"",l].filter(Boolean).join(" "),children:[a&&/* @__PURE__ */Te("div",{className:`${d} ${r?"border-b border-gray-100":""} text-sm font-semibold text-gray-900`.trim(),children:a}),
|
|
@@ -279,23 +279,23 @@ return Ee("div",{role:"danger"===e?"alert":"status",className:`${m} flex items-s
|
|
|
279
279
|
/* @__PURE__ */Te("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:a??/* @__PURE__ */Te(Nl,{tone:e})}),null==l?/* @__PURE__ */Te("div",{className:"min-w-0 flex-1 text-sm",children:p}):
|
|
280
280
|
/* @__PURE__ */Ee("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
|
|
281
281
|
/* @__PURE__ */Te("div",{className:"min-w-0 grow basis-48 text-sm",children:p}),
|
|
282
|
-
/* @__PURE__ */Te("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */Te("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__ */Te(be,{name:"close",className:"h-4 w-4",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})}var $l=(e,t)=>`${e}-tab-${t}`,Ml=(e,t)=>`${e}-panel-${t}`;function Cl(e){return
|
|
283
|
-
return Te("div",{role:"tablist","aria-label":
|
|
282
|
+
/* @__PURE__ */Te("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */Te("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__ */Te(be,{name:"close",className:"h-4 w-4",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})}var $l=(e,t)=>`${e}-tab-${t}`,Ml=(e,t)=>`${e}-panel-${t}`;function Cl(e,t){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:border-gray-300 hover:text-gray-900"}`}function Ll({items:e,value:t,onChange:r,variant:n="underline",block:a=!1,idPrefix:l,className:i="","aria-label":o,"aria-labelledby":s}){const c=ke([]),d="pill"===n,u=(t,r)=>{for(let n=1;n<=e.length;n+=1){const a=((t+r*n)%e.length+e.length)%e.length;if(!e[a]?.disabled)return a}return null},h=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__ */
|
|
283
|
+
return Te("div",{role:"tablist","aria-label":o,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=u(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=u(a,-1);else if("Home"===n.key)l=h(1);else{if("End"!==n.key)return;l=h(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),c.current[l]?.focus())},className:d?Br(a,i):`flex items-center gap-1 border-b border-gray-200 ${i}`.trim(),children:e.map((e,n)=>{const i=e.id===t,o=/* @__PURE__ */Te("button",{ref:e=>{c.current[n]=e},type:"button",role:"tab",id:l?$l(l,e.id):void 0,"aria-controls":l?Ml(l,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:d?Or({selected:i,disabled:e.disabled,block:a}):Cl(i,a),children:/* @__PURE__ */Te(Rr,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */Te(f,{content:e.tooltip,className:d||a?Ir(a):void 0,children:o},e.id):o})})}var Dl=()=>/* @__PURE__ */Te(be,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function Sl({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
|
|
284
284
|
return Te("ol",{"aria-label":n,className:`grid items-start ${a}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,n)=>{const a=n<l?"complete":n===l?"current":"upcoming",i="complete"===a&&!!r,o=/* @__PURE__ */Te("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===a?"bg-blue-600 text-white":"","current"===a?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===a?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===a?/* @__PURE__ */Te(Dl,{}):n+1}),s=/* @__PURE__ */Ee("span",{className:"min-w-0 text-center",children:[
|
|
285
285
|
/* @__PURE__ */Te("span",{className:"block text-sm font-medium "+("upcoming"===a?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */Te("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
|
|
286
|
-
return Ee("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(n<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */Ee("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-
|
|
286
|
+
return Ee("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(n<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */Ee("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[o,s]}):/* @__PURE__ */Ee("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[o,s]})]},t.id)})})}function Pl({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,className:l=""}){const[i,o]=Ne(t),s=r??i;/* @__PURE__ */
|
|
287
287
|
return Te("div",{className:`divide-y divide-gray-100 overflow-hidden rounded-lg border border-gray-200 ${l}`.trim(),children:e.map(e=>{const t=s.includes(e.id);/* @__PURE__ */
|
|
288
288
|
return Ee("div",{children:[
|
|
289
289
|
/* @__PURE__ */Ee("button",{type:"button",disabled:e.disabled,"aria-expanded":t,onClick:()=>(e=>{const t=s.includes(e)?s.filter(t=>t!==e):a?[...s,e]:[e];void 0===r&&o(t),n?.(t)})(e.id),className:"flex w-full items-center justify-between gap-3 px-4 py-3 text-left text-sm font-medium text-gray-900 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:[
|
|
290
290
|
/* @__PURE__ */Te("span",{children:e.title}),
|
|
291
|
-
/* @__PURE__ */Te(be,{name:"chevron-down",className:"h-4 w-4 shrink-0 text-gray-400 transition-transform "+(t?"rotate-180":""),strokeWidth:"2","aria-hidden":"true"})]}),t&&/* @__PURE__ */Te("div",{className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}function Al({colorClass:e,tone:t,children:r,size:n="sm",capitalize:a=!1,closable:l=!1,onClose:i,closeLabel:o,className:s=""}){const c=e??ca[t??"neutral"],d="xs"===n?"px-2 py-0.5 text-3xs":"md"===n?"px-
|
|
291
|
+
/* @__PURE__ */Te(be,{name:"chevron-down",className:"h-4 w-4 shrink-0 text-gray-400 transition-transform "+(t?"rotate-180":""),strokeWidth:"2","aria-hidden":"true"})]}),t&&/* @__PURE__ */Te("div",{className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}function Al({colorClass:e,tone:t,children:r,size:n="sm",capitalize:a=!1,closable:l=!1,onClose:i,closeLabel:o,className:s=""}){const c=e??ca[t??"neutral"],d="xs"===n?"px-2 py-0.5 text-3xs":"md"===n?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",u=a?"capitalize":"",h=Q().badge,m=o??("string"==typeof r?h.removeItem(r):h.remove),p="xs"===n?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
292
292
|
return Ee("span",{className:["inline-flex items-center rounded-full font-medium",d,u,c,s].filter(Boolean).join(" "),children:[r,l&&/* @__PURE__ */Te("button",{type:"button",onClick:i,"aria-label":m,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */Te(be,{name:"close",look:"mini",className:p,"aria-hidden":"true"})})]})}function jl({title:e,message:t,description:r,hint:n,variant:a,frameless:l,icon:i,children:o}){const s=l?"none":a??"dashed",c="boolean"!=typeof i&&null!=i?i:null,d=!c&&(i??"card"!==s),u=Q().emptyState,h=t??(e?void 0:u.message),m=r??n;/* @__PURE__ */
|
|
293
293
|
return Ee("div",{className:`flex flex-col items-center justify-center text-center ${"card"===s?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===s?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[c&&/* @__PURE__ */Te("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */Te(be,{name:"inbox",className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",strokeWidth:1}),e&&/* @__PURE__ */Te("h3",{className:"text-sm font-medium text-gray-900",children:e}),h&&/* @__PURE__ */Te("p",{className:"text-sm text-gray-500 "+(e?"mt-2":""),children:h}),m&&/* @__PURE__ */Te("p",{className:"text-xs text-gray-400 mt-1",children:m}),o&&/* @__PURE__ */Te("div",{className:"mt-4",children:o})]})}function zl({title:t,description:r,subtitle:n,actions:a,children:l,icon:i,breadcrumbs:o}){const s=r??n,c=a??l;/* @__PURE__ */
|
|
294
294
|
return Ee("div",{className:"mb-6",children:[o&&o.length>0&&/* @__PURE__ */Te(e,{items:o,className:"mb-3"}),
|
|
295
295
|
/* @__PURE__ */Ee("div",{className:"flex items-start justify-between gap-4",children:[
|
|
296
296
|
/* @__PURE__ */Ee("div",{children:[
|
|
297
|
-
/* @__PURE__ */Ee("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */Te("span",{className:"shrink-0 text-gray-400",children:i}),t]}),s&&/* @__PURE__ */Te("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),c&&/* @__PURE__ */Te("div",{className:"flex items-center gap-2",children:c})]})]})}var Fl=["success","warning","danger"];function Tl(e){return"string"==typeof e&&Fl.includes(e)}function El(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=Bl(t),a=Bl(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function Bl(e){return null!=e&&Number.isFinite(e)?e:null}var
|
|
298
|
-
return Te("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var Kl=e=>Math.min(100,Math.max(0,e));function _l({label:e,value:t,max:r=100,warn:n,crit:a,severity:l,detail:i,formatValue:o,emptyLabel:s,size:c="sm",ariaLabel:d,className:u=""}){const h=Q().meter,m=J(),p=s??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var b,y;null==f&&(b=`MetricBar:max:${String(r)}`,y=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,
|
|
297
|
+
/* @__PURE__ */Ee("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */Te("span",{className:"shrink-0 text-gray-400",children:i}),t]}),s&&/* @__PURE__ */Te("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),c&&/* @__PURE__ */Te("div",{className:"flex items-center gap-2",children:c})]})]})}var Fl=["success","warning","danger"];function Tl(e){return"string"==typeof e&&Fl.includes(e)}function El(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=Bl(t),a=Bl(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function Bl(e){return null!=e&&Number.isFinite(e)?e:null}var Ol={success:{tone:"success",fill:"bg-green-500",ink:"text-gray-900",word:"ok"},warning:{tone:"warning",fill:"bg-amber-500",ink:"text-amber-600",word:"warning"},danger:{tone:"danger",fill:"bg-red-500",ink:"text-red-600",word:"critical"}};var Il=/* @__PURE__ */new Set;function Rl(e,t){if(null==e)return null;if(Tl(e))return Ol[e];const r=function(e){const t="string"==typeof e?JSON.stringify(e):"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e?String(e):Object.prototype.toString.call(e);return t.length>32?`${t.slice(0,31)}…`:t}(e);return function(e,t){const r=`${e}:${t}`;Il.has(r)||(Il.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${Fl.join(" | ")}. Rendering an "unknown severity" marker — a health marker must never silently disappear. If this came from a backend rollup, map it to the shell's vocabulary at the fetch boundary (see isSeverityTone).`))}(t,r),{tone:null,fill:"bg-gray-300 border border-red-500",ink:"text-gray-900",word:`unrecognised severity ${r}`,token:r}}function Wl({at:e,title:t,className:r}){/* @__PURE__ */
|
|
298
|
+
return Te("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var Kl=e=>Math.min(100,Math.max(0,e));function _l({label:e,value:t,max:r=100,warn:n,crit:a,severity:l,detail:i,formatValue:o,emptyLabel:s,size:c="sm",ariaLabel:d,className:u=""}){const h=Q().meter,m=J(),p=s??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var b,y;null==f&&(b=`MetricBar:max:${String(r)}`,y=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,Il.has(b)||(Il.add(b),console.error(y)));const x=Rl(l,"MetricBar"),v=null!=g?x??(null==(w=El(g,n,a))?null:Ol[w]):null;var w;const N=Bl(n),k=Bl(a),$=null!=g&&null!=f?Kl(g/f*100):0,M=null!=g?(o??(e=>100===f?le(e,1,m):ne(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=N||null!=k),L="md"===c?"h-2":"h-1.5",D=null!=g&&null!=f,S=/* @__PURE__ */Ee("div",{...D?{role:"meter","aria-label":d??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":f,"aria-valuenow":Math.min(f,Math.max(0,g)),"aria-valuetext":M}:{"aria-hidden":!0},className:D&&v?`relative mt-2 ${L} rounded-full bg-gray-200`:`relative mt-2 ${L} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[D&&
|
|
299
299
|
/* @__PURE__ */Te("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${$}%`}}),C&&null!=f&&null!=N&&/* @__PURE__ */Te(Wl,{at:Kl(N/f*100),title:h.warningAt(N),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=k&&/* @__PURE__ */Te(Wl,{at:Kl(k/f*100),title:h.criticalAt(k),className:"bg-gray-500"})]}),P=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
|
|
300
300
|
return Ee("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */Te("div",{className:"text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
301
301
|
/* @__PURE__ */Ee("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
@@ -303,7 +303,7 @@ return Ee("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */Te("div"
|
|
|
303
303
|
/* @__PURE__ */Te("span",{className:"min-w-0 truncate text-2xs tabular-nums text-gray-400",children:null!=g?i:p})]}),S]}:{className:u,children:[
|
|
304
304
|
/* @__PURE__ */Ee("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */Te("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
305
305
|
/* @__PURE__ */Te("span",{className:`text-sm font-semibold tabular-nums ${P}`,children:M}),
|
|
306
|
-
/* @__PURE__ */Te("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:null!=g?i:p})]}),S]})}function ql(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function
|
|
306
|
+
/* @__PURE__ */Te("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:null!=g?i:p})]}),S]})}function ql(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function Ul(e,t){const r=ql(e);if(null==r)return"no-reading";const n=ql(t);return null==n||0===n?"no-budget":r>n?"over":"within"}var Hl=e=>Math.min(100,Math.max(0,e));function Vl({label:e,elapsed:t,budget:r,grace:n,detail:a,formatDuration:l,emptyLabel:i,noBudgetLabel:o,size:s="sm",ariaLabel:c,className:d=""}){const u=Q().meter,h=J(),m=l??(e=>function(e,t=ee.meter){const r=Math.round(e),n=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return n>0?t.hoursMinutes(n,a):a>0?t.minutesSeconds(a,l):t.seconds(l)}(e,u)),p=i??u.noReading,g=o??u.noBudget,f=ql(t),b=ql(r),y=null!=b&&b>0?b:null,x=ql(n)??0,v="over"===Ul(t,r),w=null!=y?y+x:null,N=null!=y&&null!=w?Hl(y/w*100):null,k=v&&x>0,$=null==w||null==f?0:v?k?N??0:0:Hl(f/w*100),M=k?N??0:0,C=v?k&&null!=w&&null!=f?Hl(f/w*100):100:0,L=Math.max(0,C-M),D=null!=f&&null!=y?f/y*100:null,S=null!=D?le(Math.round(D),0,h):null!=f?m(f):"—",P=a??(null==f?p:null==y?g:`${m(f)} / ${m(y)}`),A="md"===s?"h-2":"h-1.5",j=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",z=null!=f&&null!=y&&null!=w?/* @__PURE__ */Ee("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(S),className:`relative mt-2 ${A} overflow-hidden rounded-full bg-gray-200`,children:[(!v||k)&&/* @__PURE__ */Te("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${$}%`}}),L>0&&/* @__PURE__ */Te("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${M}%`,width:`${L}%`}}),x>0&&null!=N&&/* @__PURE__ */Te("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${N}%`}})]}):null;/* @__PURE__ */
|
|
307
307
|
return Ee("div","md"===s?{className:d,children:[null!=e&&/* @__PURE__ */Te("div",{className:"text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
308
308
|
/* @__PURE__ */Ee("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
309
309
|
/* @__PURE__ */Te("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${j}`,children:S}),
|
|
@@ -377,9 +377,9 @@ return Ee("li",{className:a?"rosh-tl-fade":void 0,style:a?si(t,i):void 0,...e.ke
|
|
|
377
377
|
return Ee("div",{"aria-hidden":"true",children:[
|
|
378
378
|
/* @__PURE__ */Te("div",{className:"rosh-tl-rail bg-gray-200",style:{top:`${t.rail}px`,height:"6px",width:`${a}px`}}),null!==r&&/* @__PURE__ */Te("div",{"data-timeline-part":"fill",className:`rosh-tl-fill bg-blue-600${l?" is-tweened":""}${n?" rosh-tl-draw":""}`,style:{top:`${t.rail}px`,height:"6px",width:`${Math.max(0,Math.min(e.xByMs(r),a))}px`}}),e.gaps.filter(e=>e.compressed).map(e=>/* @__PURE__ */Ee("div",{className:"rosh-tl-cut",style:{left:(e.fromPx+e.toPx)/2+"px",top:`${t.rail}px`,height:"6px"},children:[
|
|
379
379
|
/* @__PURE__ */Te("i",{}),
|
|
380
|
-
/* @__PURE__ */Te("i",{})]},`railcut-${e.fromMs}`))]})}function
|
|
380
|
+
/* @__PURE__ */Te("i",{})]},`railcut-${e.fromMs}`))]})}function Oi({geo:e,caption:t,endCaption:r,around:n,reveal:a,trackPx:l}){const i=e.rail-13-4,o=a?" rosh-tl-fade":"",s=a?{animationDelay:"420ms"}:{};/* @__PURE__ */
|
|
381
381
|
return Ee("div",{"aria-hidden":"true","data-timeline-part":"start",children:[
|
|
382
|
-
/* @__PURE__ */Te("i",{className:`rosh-tl-start${n?" is-around":""}${o}`,style:{left:"0px",top:`${e.rail+3}px`,...s}}),null!=t&&!1!==t&&/* @__PURE__ */Te("span",{className:`rosh-tl-edge${o}`,"data-timeline-part":"start-caption",style:{left:"0px",top:`${i}px`,...s},children:t}),null!=r&&!1!==r&&/* @__PURE__ */Te("span",{className:`rosh-tl-edge is-end${o}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...s},children:r})]})}function
|
|
382
|
+
/* @__PURE__ */Te("i",{className:`rosh-tl-start${n?" is-around":""}${o}`,style:{left:"0px",top:`${e.rail+3}px`,...s}}),null!=t&&!1!==t&&/* @__PURE__ */Te("span",{className:`rosh-tl-edge${o}`,"data-timeline-part":"start-caption",style:{left:"0px",top:`${i}px`,...s},children:t}),null!=r&&!1!==r&&/* @__PURE__ */Te("span",{className:`rosh-tl-edge is-end${o}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...s},children:r})]})}function Ii({x:e,geo:t,trackPx:r,label:n,reveal:a}){const l=Q().timeline;/* @__PURE__ */
|
|
383
383
|
return Ee("div",{"aria-hidden":"true","data-timeline-part":"today",children:[
|
|
384
384
|
/* @__PURE__ */Te("div",{className:"rosh-tl-todayline"+(a?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${t.laneA}px`,height:t.ruler+20-t.laneA+"px",...a?{animationDelay:"420ms"}:{}}}),
|
|
385
385
|
/* @__PURE__ */Te("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${gi(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function Ri({nodes:e,geo:t,reveal:r}){const n=e.map(e=>{const t=e.members.map(e=>e.caption).filter(e=>!!e);return 0===t.length?null:{x:e.x,first:t[0],last:t[t.length-1]}}).filter(e=>null!==e).sort((e,t)=>e.x-t.x),a=[];let l=null;const i=()=>{l&&(a.push({x:(l.from+l.to)/2,text:l.first===l.last?l.first:`${l.first}–${l.last}`}),l=null)};for(const e of n){const t=e.first===e.last?e.first:`${e.first}–${e.last}`,r=ki(t)/2;l&&e.x-r<l.right+6?(l.to=e.x,l.last=e.last,l.right=e.x+r):(i(),l={from:e.x,to:e.x,first:e.first,last:e.last,right:e.x+r})}return i(),/* @__PURE__ */Te("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */Te("span",{className:"rosh-tl-caption"+(r?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:`${t.laneA}px`,...r?{animationDelay:"360ms"}:{}},children:e.text},`${e.x}-${e.text}`))})}function Wi({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
|
|
@@ -406,20 +406,20 @@ return Ee("div",{children:[
|
|
|
406
406
|
return Ee(Be,{children:[
|
|
407
407
|
/* @__PURE__ */Te("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:a.rail-9+"px",height:"24px"},onPointerDown:e=>{N(e),w(v(e.clientX))},onPointerMove:$,onPointerUp:k,onPointerCancel:k}),
|
|
408
408
|
/* @__PURE__ */Te("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${gi(f,88,o)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):Xl(b,p)}),
|
|
409
|
-
/* @__PURE__ */Te("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":y&&y.length>0?y.length-1:C,"aria-valuenow":y&&y.length>0?Math.max(0,x):Math.round((t-l)/Yl),"aria-valuetext":M,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(y&&y.length>0){const e=x<0?0:x;return"ArrowRight"===r||"ArrowUp"===r?y[Math.min(e+1,y.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?y[Math.max(e-1,0)]:"Home"===r?y[0]:"End"===r?y[y.length-1]:null}const n=(e.shiftKey?7:1)*Yl;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function Hi(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Ui({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],pending:l=[],fillToMs:i,todayMs:o,labels:s="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:y=!0,ariaLabel:x,highlightKeys:v=null,onHoverChange:w,endMark:N=null}){const k="none"===s,$=U(Date.now,null),M=U(Ni,!1),C=o??$,L=ke(null),D=Q().timeline,S=J(),P=e=>Xl(e,S),A=ke(null),j=ke(null),z=ke(null),F=ke(/* @__PURE__ */new Map),T=ke(void 0),E=ke(void 0),B=ke(null),[I,O]=Ne({}),[W,K]=Ne(null),[_,q]=Ne(null),[H,V]=Ne(null),[Y,G]=Ne(null),[X,Z]=Ne(null),[ee,te]=Ne(null),re=ve(),ne=ve(),ae=Pi(L,!0),le=ae>0?ae-(l.length>0&&!k?176:0):0,ie=le>0&&le-20<320,oe=Pi(A,!ie),se=oe>0?oe:600,ce=wi[s],de=k&&l.length>0,ue=de?Math.max(0,se-36):se,he=r=>r>=e-Yl&&r<=t+Yl,me=n.filter(e=>Number.isFinite(e.ms)&&he(e.ms)).slice().sort((e,t)=>e.ms-t.ms),pe="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],ge=pi([e,...[...me.map(e=>e.ms),...pe].filter(r=>r>e&&r<t),t],ue,"compressed"===(fe=r)?{}:"spread"===fe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var fe;const be=ge.xByMs,ye=me.filter(e=>!e.provisional),xe=g??(ye.length>0?ye[ye.length-1].key:null),$e=me.map((e,t)=>{const r=e.date??P(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?Mi[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:be(e.ms),baseX:be(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Ci(e,a,0===t&&"default"===a),role:e.key===xe?"current":n?"dot":"key",widthPx:k?Math.max(16,ki(e.caption??"")+6):I[e.key]||bi(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),Ce=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&he(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=P(t);return{key:r,ms:t,x:be(t),baseX:be(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??$i[e.kind].glyph,role:"key",widthPx:I[r]||bi(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),Le=de?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Yl,x:se,baseX:se,kind:e.kind??"default",label:e.label,dateText:D.notReached,detail:r.length>0?D.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],De=k&&N&&!de?[{key:N.key,ms:t,x:ue,baseX:ue,kind:"default",label:N.label,dateText:N.dateText??P(t),detail:N.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Se=[...$e,...Ce,...Le,...De].sort((e,t)=>e.x-t.x||e.ms-t.ms),Pe=m?.start??D.start(P(e)),Ae=null==Pe||!1===Pe?0:"string"==typeof Pe?Math.ceil(ki(Pe)):96,je="lanes"===s?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),o=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||o)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}(Se):[],ze=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:fi,members:t})}n=a}return r}(Se),Fe=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ie=/* @__PURE__ */new Map;for(const e of ze)if("cluster"===e.type)for(const t of e.members)Ie.set(t.key,Fe(e));const Oe=H??Y??X,Re=je.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Oe)??ze.find(e=>"cluster"===e.type&&Fe(e)===Oe),We=e=>({x:e.baseX,widthPx:e.widthPx}),Ke=Re&&"cluster"===Re.type?Re.members.map(We):f?Se.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(We):[],_e=Ke.length>1?Ai(ge,Ke,ue):ge,qe=_e!==ge;if(qe)for(const e of Se)e.isCap||(e.x=_e.xByMs(e.ms));const He=Se.some(e=>e.x<14),Ue=qe&&Re?Oe:null,Ve=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ye=ie?Se.map(Ve):ze.flatMap(e=>{if("item"===e.type)return[Ve(e.mark)];const t=Fe(e);if(t===Ue&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ve);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ge=/* @__PURE__ */new Map;for(const e of Ye)for(const t of e.members)Ge.set(t.key,e.key);const Xe=ze.find(e=>"cluster"===e.type&&Fe(e)===Ue),Ze=Xe&&"cluster"===Xe.type?{from:Math.min(...Xe.members.map(e=>e.x))-16,to:Math.max(...Xe.members.map(e=>e.x))+16}:null,Je=ke(Ue),[Qe,et]=Ne(!1);Me(()=>{if(Je.current===Ue)return;Je.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("|");Si(()=>{const e=j.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}O(e=>function(e,t){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Math.abs((e[r]??0)-(t[r]??0))<.5)}(e,t)?e:t)},[tt]);const rt=`${s}|${r}|${Se.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=Ne(rt),lt=y&&nt===rt;Me(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,Se.length-1)),ot=ji(u?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!ot)return n;let a=ot[0];for(const e of ot)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?st(u.valueMs):null,dt=h&&u?$e.filter(e=>!ot||ot.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const o=l[t],s=l[t+1],c=e.xByMs(o.ms),d=e.xByMs(s.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:yi(350*u/100,450,1400)/n;i.push({fromKey:o.key,toKey:s.key,fromMs:o.ms,toMs:s.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(_e,dt,{speed:h?.speed,reducedMotion:M}),[ht,mt]=Ne(null),pt=ke(null),gt=ke({segments:ut,value:ct,playback:h});Me(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=ke(null),bt=we(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),yt=we(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),xt=!!h?.playing&&!!u;Me(()=>{if(!xt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void yt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(vi(t,0))):yt()},o=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:vi(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:vi(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=vi(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:xi(l),ms:i.ms}};const o=e[t.index+1];return{cursor:o?{index:t.index+1,phase:"rest",t:0,restLeftMs:o.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(o)):yt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[xt,yt,bt]);const vt=$e.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===C?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,C):null,Nt=new Set(v??[]),kt=Se.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=we(()=>{clearTimeout(T.current),clearTimeout(E.current),K(null),q(null),V(null),G(null),Z(null)},[]);Me(()=>()=>{clearTimeout(T.current),clearTimeout(E.current)},[]),Me(()=>{const e=B.current;e&&(B.current=null,F.current.get(e)?.focus())});const Ct=null!==_||null!==H||null!==Y||null!==X;Me(()=>{if(Ct)return R(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=we((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,se-r)):t;const a=e.parentElement;if(r>0&&a){const t=b(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,o=t.right-8-r-l;i<=o&&(n=Math.max(i,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[se]),Dt=Ye.find(e=>e.key===_)??null,St=Dt?Dt.x:0;Si(()=>{Lt(z.current,St)},[Lt,_,St]);const Pt=ct??void 0,At=ke(null);Me(()=>{if(void 0===Pt)return;const e=_e.xByMs(Pt),t=At.current;if(At.current=e,null===t||e<=t)return;const r=[];for(const n of Se){if(n.x<=t||n.x>e)continue;const a=F.current.get(Ge.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[Pt]);const jt=Ye.map(e=>e.key),zt=xe?Ge.get(xe)??null:null,Ft=ee&&jt.includes(ee)?ee:zt&&jt.includes(zt)?zt:jt[0],Tt=e=>{const t=jt.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?jt.length-1:-1;r<0||r>jt.length-1||(e.preventDefault(),te(jt[r]),F.current.get(jt[r])?.focus())},Et=()=>clearTimeout(E.current),Bt=e=>{Et(),Z(e)},It=()=>{clearTimeout(E.current),E.current=setTimeout(()=>Z(null),260)},Ot=e=>{Ue&&Ie.get(e)===Ue?Et():(Et(),Z(null))},Rt=e=>{clearTimeout(T.current),K(e),q(e),w?.((e=>{const t=Ye.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{K(t=>t===e?null:t),clearTimeout(T.current),T.current=setTimeout(()=>q(t=>t===e?null:t),160),w?.(null)},Kt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Di(e),"aria-describedby":_===e.key?re:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),te(e.key)},onBlur:()=>{It(),Wt(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=D,r.events(t.length,t.map(Di))),"aria-describedby":_===e.key?re:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{e.openable?Bt(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Et(),Rt(e.key),te(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Bt(e.key);const r=e.members[0];te(r.key),B.current=r.key}};var t,r},qt="lanes"!==s||Se.length>1;if(ie)/* @__PURE__ */
|
|
410
|
-
return Te("div",{ref:L,children:/* @__PURE__ */Te(Ei,{marks:Se.filter(e=>!e.isCap),pending:l,currentKey:xe,todayMs:C,reveal:lt,ariaLabel:x,step:it,nodeProps:Kt,onKeyDown:Tt})});const
|
|
409
|
+
/* @__PURE__ */Te("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":y&&y.length>0?y.length-1:C,"aria-valuenow":y&&y.length>0?Math.max(0,x):Math.round((t-l)/Yl),"aria-valuetext":M,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(y&&y.length>0){const e=x<0?0:x;return"ArrowRight"===r||"ArrowUp"===r?y[Math.min(e+1,y.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?y[Math.max(e-1,0)]:"Home"===r?y[0]:"End"===r?y[y.length-1]:null}const n=(e.shiftKey?7:1)*Yl;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function Ui(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Hi({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],pending:l=[],fillToMs:i,todayMs:o,labels:s="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:y=!0,ariaLabel:x,highlightKeys:v=null,onHoverChange:w,endMark:N=null}){const k="none"===s,$=H(Date.now,null),M=H(Ni,!1),C=o??$,L=ke(null),D=Q().timeline,S=J(),P=e=>Xl(e,S),A=ke(null),j=ke(null),z=ke(null),F=ke(/* @__PURE__ */new Map),T=ke(void 0),E=ke(void 0),B=ke(null),[O,I]=Ne({}),[W,K]=Ne(null),[_,q]=Ne(null),[U,V]=Ne(null),[Y,G]=Ne(null),[X,Z]=Ne(null),[ee,te]=Ne(null),re=ve(),ne=ve(),ae=Pi(L,!0),le=ae>0?ae-(l.length>0&&!k?176:0):0,ie=le>0&&le-20<320,oe=Pi(A,!ie),se=oe>0?oe:600,ce=wi[s],de=k&&l.length>0,ue=de?Math.max(0,se-36):se,he=r=>r>=e-Yl&&r<=t+Yl,me=n.filter(e=>Number.isFinite(e.ms)&&he(e.ms)).slice().sort((e,t)=>e.ms-t.ms),pe="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],ge=pi([e,...[...me.map(e=>e.ms),...pe].filter(r=>r>e&&r<t),t],ue,"compressed"===(fe=r)?{}:"spread"===fe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var fe;const be=ge.xByMs,ye=me.filter(e=>!e.provisional),xe=g??(ye.length>0?ye[ye.length-1].key:null),$e=me.map((e,t)=>{const r=e.date??P(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?Mi[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:be(e.ms),baseX:be(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Ci(e,a,0===t&&"default"===a),role:e.key===xe?"current":n?"dot":"key",widthPx:k?Math.max(16,ki(e.caption??"")+6):O[e.key]||bi(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),Ce=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&he(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=P(t);return{key:r,ms:t,x:be(t),baseX:be(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??$i[e.kind].glyph,role:"key",widthPx:O[r]||bi(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),Le=de?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Yl,x:se,baseX:se,kind:e.kind??"default",label:e.label,dateText:D.notReached,detail:r.length>0?D.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],De=k&&N&&!de?[{key:N.key,ms:t,x:ue,baseX:ue,kind:"default",label:N.label,dateText:N.dateText??P(t),detail:N.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Se=[...$e,...Ce,...Le,...De].sort((e,t)=>e.x-t.x||e.ms-t.ms),Pe=m?.start??D.start(P(e)),Ae=null==Pe||!1===Pe?0:"string"==typeof Pe?Math.ceil(ki(Pe)):96,je="lanes"===s?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),o=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||o)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}(Se):[],ze=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:fi,members:t})}n=a}return r}(Se),Fe=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Oe=/* @__PURE__ */new Map;for(const e of ze)if("cluster"===e.type)for(const t of e.members)Oe.set(t.key,Fe(e));const Ie=U??Y??X,Re=je.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Ie)??ze.find(e=>"cluster"===e.type&&Fe(e)===Ie),We=e=>({x:e.baseX,widthPx:e.widthPx}),Ke=Re&&"cluster"===Re.type?Re.members.map(We):f?Se.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(We):[],_e=Ke.length>1?Ai(ge,Ke,ue):ge,qe=_e!==ge;if(qe)for(const e of Se)e.isCap||(e.x=_e.xByMs(e.ms));const Ue=Se.some(e=>e.x<14),He=qe&&Re?Ie:null,Ve=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ye=ie?Se.map(Ve):ze.flatMap(e=>{if("item"===e.type)return[Ve(e.mark)];const t=Fe(e);if(t===He&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ve);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ge=/* @__PURE__ */new Map;for(const e of Ye)for(const t of e.members)Ge.set(t.key,e.key);const Xe=ze.find(e=>"cluster"===e.type&&Fe(e)===He),Ze=Xe&&"cluster"===Xe.type?{from:Math.min(...Xe.members.map(e=>e.x))-16,to:Math.max(...Xe.members.map(e=>e.x))+16}:null,Je=ke(He),[Qe,et]=Ne(!1);Me(()=>{if(Je.current===He)return;Je.current=He,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[He]);const tt=Se.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Si(()=>{const e=j.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}I(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=`${s}|${r}|${Se.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=Ne(rt),lt=y&&nt===rt;Me(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,Se.length-1)),ot=ji(u?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!ot)return n;let a=ot[0];for(const e of ot)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?st(u.valueMs):null,dt=h&&u?$e.filter(e=>!ot||ot.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const o=l[t],s=l[t+1],c=e.xByMs(o.ms),d=e.xByMs(s.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:yi(350*u/100,450,1400)/n;i.push({fromKey:o.key,toKey:s.key,fromMs:o.ms,toMs:s.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(_e,dt,{speed:h?.speed,reducedMotion:M}),[ht,mt]=Ne(null),pt=ke(null),gt=ke({segments:ut,value:ct,playback:h});Me(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=ke(null),bt=we(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),yt=we(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),xt=!!h?.playing&&!!u;Me(()=>{if(!xt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void yt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(vi(t,0))):yt()},o=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:vi(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:vi(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=vi(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:xi(l),ms:i.ms}};const o=e[t.index+1];return{cursor:o?{index:t.index+1,phase:"rest",t:0,restLeftMs:o.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(o)):yt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[xt,yt,bt]);const vt=$e.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===C?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,C):null,Nt=new Set(v??[]),kt=Se.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=we(()=>{clearTimeout(T.current),clearTimeout(E.current),K(null),q(null),V(null),G(null),Z(null)},[]);Me(()=>()=>{clearTimeout(T.current),clearTimeout(E.current)},[]),Me(()=>{const e=B.current;e&&(B.current=null,F.current.get(e)?.focus())});const Ct=null!==_||null!==U||null!==Y||null!==X;Me(()=>{if(Ct)return R(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=we((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,se-r)):t;const a=e.parentElement;if(r>0&&a){const t=b(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,o=t.right-8-r-l;i<=o&&(n=Math.max(i,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[se]),Dt=Ye.find(e=>e.key===_)??null,St=Dt?Dt.x:0;Si(()=>{Lt(z.current,St)},[Lt,_,St]);const Pt=ct??void 0,At=ke(null);Me(()=>{if(void 0===Pt)return;const e=_e.xByMs(Pt),t=At.current;if(At.current=e,null===t||e<=t)return;const r=[];for(const n of Se){if(n.x<=t||n.x>e)continue;const a=F.current.get(Ge.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[Pt]);const jt=Ye.map(e=>e.key),zt=xe?Ge.get(xe)??null:null,Ft=ee&&jt.includes(ee)?ee:zt&&jt.includes(zt)?zt:jt[0],Tt=e=>{const t=jt.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?jt.length-1:-1;r<0||r>jt.length-1||(e.preventDefault(),te(jt[r]),F.current.get(jt[r])?.focus())},Et=()=>clearTimeout(E.current),Bt=e=>{Et(),Z(e)},Ot=()=>{clearTimeout(E.current),E.current=setTimeout(()=>Z(null),260)},It=e=>{He&&Oe.get(e)===He?Et():(Et(),Z(null))},Rt=e=>{clearTimeout(T.current),K(e),q(e),w?.((e=>{const t=Ye.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{K(t=>t===e?null:t),clearTimeout(T.current),T.current=setTimeout(()=>q(t=>t===e?null:t),160),w?.(null)},Kt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Di(e),"aria-describedby":_===e.key?re:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{It(e.key),Rt(e.key)},onMouseLeave:()=>{Ot(),Wt(e.key)},onFocus:()=>{It(e.key),Rt(e.key),te(e.key)},onBlur:()=>{Ot(),Wt(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=D,r.events(t.length,t.map(Di))),"aria-describedby":_===e.key?re:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{e.openable?Bt(e.key):Rt(e.key)},onMouseLeave:()=>{Ot(),Wt(e.key)},onFocus:()=>{Et(),Rt(e.key),te(e.key)},onBlur:()=>{Ot(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Bt(e.key);const r=e.members[0];te(r.key),B.current=r.key}};var t,r},qt="lanes"!==s||Se.length>1;if(ie)/* @__PURE__ */
|
|
410
|
+
return Te("div",{ref:L,children:/* @__PURE__ */Te(Ei,{marks:Se.filter(e=>!e.isCap),pending:l,currentKey:xe,todayMs:C,reveal:lt,ariaLabel:x,step:it,nodeProps:Kt,onKeyDown:Tt})});const Ut=(e,t)=>null==e||!1===e?null:/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:ce.rail-3+"px"},children:e});/* @__PURE__ */
|
|
411
411
|
return Ee("div",{ref:L,className:"rosh-tl-body"+(l.length>0&&!k?"":" is-solo"),children:[
|
|
412
|
-
/* @__PURE__ */Ee("div",{className:"flex items-stretch gap-3",children:[k&&
|
|
413
|
-
/* @__PURE__ */Te("div",{className:"rosh-tl-stage",style:{height:`${
|
|
412
|
+
/* @__PURE__ */Ee("div",{className:"flex items-stretch gap-3",children:[k&&Ut(Pe,!1),
|
|
413
|
+
/* @__PURE__ */Te("div",{className:"rosh-tl-stage",style:{height:`${Ui(ce,qt,p.length>0&&!k)}px`},children:/* @__PURE__ */Ee("div",{ref:A,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Ze)return;const t=A.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Ze.from&&r<=Ze.to?Et():Ot()},onMouseLeave:Ot,children:[!k&&/* @__PURE__ */Te(zi,{marks:Se,innerRef:j}),
|
|
414
414
|
/* @__PURE__ */Te(Bi,{axis:_e,geo:ce,fillTo:wt,reveal:lt,trackPx:ue,tweened:!!u}),de&&
|
|
415
415
|
/* @__PURE__ */Te("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${ue}px`,width:se-ue+"px",top:ce.rail+3-1+"px"}}),$t&&/* @__PURE__ */Te("div",{"aria-hidden":"true",className:"rosh-tl-band","data-timeline-part":"highlight",style:{left:$t.from-10+"px",width:$t.to-$t.from+20+"px",top:ce.rail-7+"px",height:"20px"}}),
|
|
416
416
|
/* @__PURE__ */Te(Fi,{startMs:e,endMs:t,axis:_e,geo:ce,reveal:lt}),
|
|
417
|
-
/* @__PURE__ */Te(
|
|
417
|
+
/* @__PURE__ */Te(Oi,{geo:ce,caption:k?null:Pe,endCaption:k?null:m?.end,around:Ue,reveal:lt,trackPx:se}),k&&/* @__PURE__ */Te(Ri,{nodes:Ye,geo:ce,reveal:lt}),null!==C&&C>e&&C<=t+Yl&&/* @__PURE__ */Te(Ii,{x:_e.xByMs(Math.min(C,t)),geo:ce,trackPx:se,label:P(C),reveal:lt}),!k&&p.map(e=>/* @__PURE__ */Te(Wi,{phase:e,geo:ce,xOf:_e.xByMs},e.key)),
|
|
418
418
|
/* @__PURE__ */Te("ol",{className:"rosh-tl-nodes","aria-label":x,onKeyDown:Tt,children:Ye.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${ce.rail+3}px`,a=lt?si(t,it):{},l=(e=>!!$t&&e.x>=$t.from-.5&&e.x<=$t.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
|
|
419
419
|
return Te("li",{children:/* @__PURE__ */Te("button",{...Kt(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:n,...a}})},e.key);if(!e.mark){const t=e.kind===fi,i=Li(t?"default":e.kind,"key"),o=t?void 0:$i[e.kind]?.glyph;/* @__PURE__ */
|
|
420
420
|
return Ee("li",{...r(xe)?{"aria-current":"step"}:{},children:[
|
|
421
421
|
/* @__PURE__ */Ee("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:n,...a},children:[o&&/* @__PURE__ */Te(di,{name:o}),t&&/* @__PURE__ */Ee("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */Ee("i",{"aria-hidden":"true",className:"rosh-tl-count"+(lt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:n},children:["×",e.members.length]})]},e.key)}const i=e.mark,o=Li(i.kind,i.role,i.provisional),{glyph:s}=i;/* @__PURE__ */
|
|
422
|
-
return Te("li",{...i.key===xe?{"aria-current":"step"}:{},children:/* @__PURE__ */Ee("button",{...Kt(i),className:`${o.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */Te(di,{name:s}),"current"===i.role&&/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */Te(_i,{groups:je,trackPx:se,geo:ce,startMs:e,endMs:t,currentKey:xe,hoveredKey:W,reveal:lt,step:it,zoomedKey:
|
|
422
|
+
return Te("li",{...i.key===xe?{"aria-current":"step"}:{},children:/* @__PURE__ */Ee("button",{...Kt(i),className:`${o.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */Te(di,{name:s}),"current"===i.role&&/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */Te(_i,{groups:je,trackPx:se,geo:ce,startMs:e,endMs:t,currentKey:xe,hoveredKey:W,reveal:lt,step:it,zoomedKey:He,popId:ne,aimBubble:Lt,startCaptionPx:Ae,openCluster:U,setOpenCluster:V,previewCluster:Y,setPreviewCluster:G,setZoomKey:Z}):"active"===s?/* @__PURE__ */Te(Ki,{nodes:Ye,trackPx:se,geo:ce,activeKey:c,hoveredKey:W,currentKey:xe}):null,Dt&&/* @__PURE__ */Te("div",{ref:z,id:re,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${ce.rail+6+6}px`},onMouseEnter:()=>{Et(),Rt(Dt.key)},onMouseLeave:()=>{Ot(),Wt(Dt.key)},onFocus:()=>{Et(),Rt(Dt.key)},onBlur:()=>{Ot(),Wt(Dt.key)},children:Dt.mark?/* @__PURE__ */Ee(Be,{children:[
|
|
423
423
|
/* @__PURE__ */Te("span",{className:"rosh-tl-name",children:Dt.mark.label}),
|
|
424
424
|
/* @__PURE__ */Te("span",{className:"rosh-tl-date",children:Dt.mark.dateText}),Dt.mark.preview?/* @__PURE__ */Te("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:Dt.mark.preview}):Dt.mark.detail&&/* @__PURE__ */Te("span",{className:"rosh-tl-detail",children:Dt.mark.detail}),(Dt.mark.onOpen??Dt.mark.onClick)&&/* @__PURE__ */Te("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(Dt.mark?.onOpen??Dt.mark?.onClick)?.(),children:D.openButton})]}):
|
|
425
425
|
/* @__PURE__ */Ee("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
|
|
@@ -428,22 +428,22 @@ return Te("li",{...i.key===xe?{"aria-current":"step"}:{},children:/* @__PURE__ *
|
|
|
428
428
|
/* @__PURE__ */Ee("p",{className:"rosh-tl-foldrow",children:[
|
|
429
429
|
/* @__PURE__ */Te("span",{children:e.label}),
|
|
430
430
|
/* @__PURE__ */Te("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */Te("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */Te("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),u&&null!==ct&&
|
|
431
|
-
/* @__PURE__ */Te(qi,{thumb:u,value:ct,snap:st,axis:_e,geo:ce,startMs:e,endMs:t,trackPx:se,layerRef:A,glide:ht,onScrub:h?yt:void 0,nodes:dt,onProgress:bt})]})}),k&&
|
|
431
|
+
/* @__PURE__ */Te(qi,{thumb:u,value:ct,snap:st,axis:_e,geo:ce,startMs:e,endMs:t,trackPx:se,layerRef:A,glide:ht,onScrub:h?yt:void 0,nodes:dt,onProgress:bt})]})}),k&&Ut(m?.end,!0)]}),l.length>0&&!k&&/* @__PURE__ */Te(Ti,{pending:l,reveal:lt})]})}function Vi({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const o=[...r?[/* @__PURE__ */Te("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
|
|
432
432
|
return Ee("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
|
|
433
433
|
/* @__PURE__ */Ee("div",{className:"rosh-tl-head",children:[
|
|
434
434
|
/* @__PURE__ */Ee("div",{className:"rosh-tl-head-main",children:[e&&/* @__PURE__ */Te("span",{className:"rosh-tl-ico text-gray-500","aria-hidden":"true",children:e}),
|
|
435
435
|
/* @__PURE__ */Te("h4",{className:"rosh-tl-title text-gray-800",children:t}),o.length>0&&/* @__PURE__ */Te("p",{className:"rosh-tl-meta text-gray-500",children:o.map((e,t)=>
|
|
436
|
-
/* @__PURE__ */Ee(Ae,{children:[t>0&&/* @__PURE__ */Te("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */Te("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */Te("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Yi({title:e,heading:t,subject:r,milestones:n,summary:a,endDate:l,phaseLabels:i,variant:o="card",edgeCaptions:s,highlightKeys:c=null,onHoverChange:d}){const u=
|
|
437
|
-
return Te("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */Te(Vi,{icon:/* @__PURE__ */Te(ui,{}),heading:t??e,subject:r,meta:N,children:L})})}var Gi=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),Xi=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function Zi(e){if(e.order_qty<=0)return 0;let t=0;for(const r of Xi)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function Ji(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Zi(t),0)/t.length}function Qi(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:o,msPerDayOfPlayback:s=500,markers:c=[]}=e,[d,u]=Ne(null),h=Q().production;Me(()=>{o?u(new Date(o).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=Ne(!1),g=ke(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};Me(()=>()=>f(),[]),Me(()=>{f()},[i]);const b=t.map(e=>Gl(e.date)).filter(e=>null!=e),y=
|
|
438
|
-
return Te("div",{className:"select-none",children:/* @__PURE__ */Te(
|
|
436
|
+
/* @__PURE__ */Ee(Ae,{children:[t>0&&/* @__PURE__ */Te("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */Te("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */Te("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Yi({title:e,heading:t,subject:r,milestones:n,summary:a,endDate:l,phaseLabels:i,variant:o="card",edgeCaptions:s,highlightKeys:c=null,onHoverChange:d}){const u=H(Date.now,null),h=[],m=[],p=Q().timeline,g=J();for(const e of n){const t=Gl(e.date??null);null===t?m.push({key:e.key,label:e.label,kind:e.kind}):h.push({...e,ms:t})}h.sort((e,t)=>e.ms-t.ms);const f=Gl(l??null);let b,y,x=!0;0===h.length?(y=f??u??0,b=y-30*Yl,x=null!==f||null!==u):(b=h[0].ms,y=f??h[h.length-1].ms,y-b<Yl&&(y=b+Yl));const v=h.length>0?Math.max(0,Math.round((y-b)/Yl)):0,w=a??(v>0?p.duration(v):void 0),N=[h.length>0?p.started(Xl(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,n.length):void 0],k=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),$={};for(const e of h)e.phase&&($[e.phase]=$[e.phase]||[]).push(e.ms);const M=Object.entries($).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),C="rail"===o,L=x&&/* @__PURE__ */Te("div",{className:"select-none",children:/* @__PURE__ */Te(Hi,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:k,pending:m,phases:M,startMs:b,endMs:y,todayMs:u??void 0,edgeCaptions:s,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
|
|
437
|
+
return Te("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */Te(Vi,{icon:/* @__PURE__ */Te(ui,{}),heading:t??e,subject:r,meta:N,children:L})})}var Gi=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),Xi=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function Zi(e){if(e.order_qty<=0)return 0;let t=0;for(const r of Xi)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function Ji(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Zi(t),0)/t.length}function Qi(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:o,msPerDayOfPlayback:s=500,markers:c=[]}=e,[d,u]=Ne(null),h=Q().production;Me(()=>{o?u(new Date(o).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=Ne(!1),g=ke(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};Me(()=>()=>f(),[]),Me(()=>{f()},[i]);const b=t.map(e=>Gl(e.date)).filter(e=>null!=e),y=H(Date.now,null)??Math.max(0,...b,...c.map(e=>Gl(e.date)??0),Gl(r??null)??0,Gl(n??null)??0),x=b.length?Math.min(...b):y,v=b.length?Math.max(...b):y,w=Gl(r??null)??x,N=Gl(n??null)??0,k=Gi.has((a||"").toLowerCase()),$=c.reduce((e,t)=>{const r=Gl(t.date);return null!=r&&r>e?r:e},0),M=(()=>{const e=[N,v,$,w+Yl];return k||e.push(y),Math.max(...e)})(),C=Math.max(1,Math.round((M-w)/Yl)),L=Gl(o??null)??v??w,D=Math.min(Math.max(d??L,w),M),S=t.find(e=>{const t=Gl(e.date);return null!=t&&t<=D})??null;let P=null;for(let e=t.length-1;e>=0;e--){const r=Gl(t[e].date);if(null!=r&&r>D){P=t[e];break}}const A=(()=>{if(S||!P||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${l}`,progress_number:h.start,date:r||new Date(w).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),j=S??A,z=S?Gl(S.date):A?w:null,F=P?Gl(P.date):null,T=!!(j&&P&&null!=z&&null!=F&&D>z&&D<F);let E,B;if(T&&null!=z&&null!=F){const e=(D-z)/Math.max(F-z,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of j?.items??[])r[e.part_number]=e;const n={};for(const e of P?.items??[])n[e.part_number]=e;const a=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const l=r[e]??{},i=n[e]??{},o=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:l.description??i.description??"",order_qty:o(l.order_qty??i.order_qty??0),casting:t(o(l.casting),o(i.casting)),cnc:t(o(l.cnc),o(i.cnc)),painting:t(o(l.painting),o(i.painting)),packing:t(o(l.packing),o(i.packing)),finished_goods:t(o(l.finished_goods),o(i.finished_goods)),stock_qty:t(o(l.stock_qty),o(i.stock_qty))}}),l=Gl(j?.est_completion_date),i=Gl(P?.est_completion_date);let o;o=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):j?.est_completion_date||P?.est_completion_date||null,E={id:`interp-${D}`,progress_number:h.estimated,date:new Date(D).toISOString().slice(0,10),created_by_name:"",est_completion_date:o,items:a,notes:""},B=j}else if(E=j??t[t.length-1]??null,E){const e=t.findIndex(e=>e.id===E.id);B=e>=0&&e<t.length-1?t[e+1]:null}else B=null;const O={};for(const e of B?.items??[])O[e.part_number]=e;const I=!(!i||E?.id===i),R=i?Math.min(Gl(o??null)??M,M):M,W=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:M,totalLeadDays:C,scrubMs:D,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),o&&u(new Date(o).getTime())},scrubbedAway:I,beforeAnchor:j,nextAfter:P,displayed:E,prevReport:B,prevByPN:O,isInterpolated:T,playing:m,startPlay:()=>{if(m)return void f();if(R<=w)return void u(R);p(!0),u(w);let e=performance.now(),t=w;const r=n=>{const a=n-e;if(e=n,t+=a/s*Yl,t>=R)return u(R),g.current=null,void p(!1);u(t),g.current=requestAnimationFrame(r)};g.current=requestAnimationFrame(r)},stopPlay:f,reports:t,markers:c,poNumber:l,currentReportId:i,currentReportProgressNumber:W,estCompletionMs:Gl(n??null)}}function eo({startMs:e,endMs:t,reports:r,markers:n,valueMs:a,activeId:l,onChange:i,onPickReport:o,onOpenReport:s,onOpenMarker:c,onDragStart:d,renderReportPreview:u,reportLabel:h,playback:m,edgeCaptions:p,bare:g=!1,endMark:f=null}){const b=Q().production,y=J(),x=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),v=x.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:h(e),preview:e.preview??u?.(e),onOpen:s?()=>s(e.id):void 0})),w=new Map(x.map(({report:e,ms:t})=>[e.id,t])),N=x.map(({ms:e})=>e),k=c?n.map(e=>({...e,onOpen:c})):n;/* @__PURE__ */
|
|
438
|
+
return Te("div",{className:"select-none",children:/* @__PURE__ */Te(Hi,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:k,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),o(e)},playback:m,edgeCaptions:p,thumb:{valueMs:a,onChange:i,onDragStart:d,stops:N,ariaLabel:b.scrub,valueText:e=>{const t=(e=>x.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${Xl(e,y)}`:Xl(e,y)}},ariaLabel:b.label(Xl(e,y),Xl(t,y))})})}function to({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,onScrubProgress:l,heading:i,edgeCaptions:o,reportLabel:s=e=>e.progress_number,resetLabel:c,variant:d="card",onPlayStart:u}){const{reports:h,markers:m,poNumber:p,startMs:g,endMs:f,totalLeadDays:b,scrubMs:y,setScrubMs:x,displayed:v,scrubbedAway:w,resetToCurrent:N,currentReportId:k,currentReportProgressNumber:$,estCompletionMs:M}=e,C=function(e,t,r){const[n,a]=Ne(!1),l=ke(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),l.current||(l.current=!0,t(e[0])),a(!0))},stop:()=>{l.current=!1,a(!1)}}}(h.map(e=>Gl(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),x,u),L=Q().production,D=J(),S=i??L.heading,P=e=>Xl(e,D);if(0===h.length&&0===m.length)return null;const A=m.filter(e=>"shipment"===e.kind),j=m.filter(e=>"inspection"===e.kind),z=m.filter(e=>"invoice"===e.kind),F=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),T=v?Ji(v):0,E=h.find(e=>e.id===k),B=E?s(E):$,O=
|
|
439
439
|
/* @__PURE__ */Ee("button",{type:"button",onClick:C.toggle,"aria-pressed":C.playing,title:C.playing?L.pause:L.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[C.playing?/* @__PURE__ */Te(be,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */Te(be,{name:"play","aria-hidden":"true"}),
|
|
440
|
-
/* @__PURE__ */Te("span",{children:C.playing?L.pause:L.play})]}),
|
|
440
|
+
/* @__PURE__ */Te("span",{children:C.playing?L.pause:L.play})]}),I=w&&(c??B)?/* @__PURE__ */Te("button",{type:"button",onClick:()=>{C.stop(),N()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(B))}):null,[R,W]=re(L.showing),K=e=>/* @__PURE__ */Te("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */Ee(Be,{children:[e&&R,
|
|
441
441
|
/* @__PURE__ */Te("b",{className:"font-medium",children:s(v)}),e&&W,
|
|
442
442
|
/* @__PURE__ */Ee("span",{className:"text-gray-500",children:[" · ",P(new Date(v.date).getTime())," · ",L.overall(Math.round(T))," · ",L.inStock(F)]})]}):/* @__PURE__ */Te("span",{className:"text-gray-500",children:L.noReport})});if("rail"===d){const e=null!=M&&M>=f&&f>g,i=e?{key:"__estimate__",label:L.estimatedCompletion,dateText:P(M)}:null;/* @__PURE__ */
|
|
443
443
|
return Ee("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
444
444
|
/* @__PURE__ */Te(eo,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:y,activeId:v?.id??"",onChange:x,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:{start:o?.start??L.start,end:o?.end??(e?L.estDone:void 0)},onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>x(t),onProgress:l,onStop:C.stop}}),
|
|
445
|
-
/* @__PURE__ */Ee("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[I,
|
|
446
|
-
return Te("div",{className:"shrink-0",children:/* @__PURE__ */Te(Vi,{icon:/* @__PURE__ */Te(hi,{}),heading:S,subject:p,meta:[`${P(g)} → ${P(f)}`,L.leadTime(b)],actions:/* @__PURE__ */Ee(Be,{children:[O
|
|
445
|
+
/* @__PURE__ */Ee("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[O,I,K(!1)]})]})}/* @__PURE__ */
|
|
446
|
+
return Te("div",{className:"shrink-0",children:/* @__PURE__ */Te(Vi,{icon:/* @__PURE__ */Te(hi,{}),heading:S,subject:p,meta:[`${P(g)} → ${P(f)}`,L.leadTime(b)],actions:/* @__PURE__ */Ee(Be,{children:[I,O]}),footer:/* @__PURE__ */Ee(Be,{children:[K(!0),
|
|
447
447
|
/* @__PURE__ */Ee("div",{className:"rosh-tl-legend",children:[h.length>0&&/* @__PURE__ */Ee("span",{className:"border-gray-200 text-gray-500",children:[
|
|
448
448
|
/* @__PURE__ */Te("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),A.length>0&&/* @__PURE__ */Ee("span",{className:"border-gray-200 text-gray-500",children:[
|
|
449
449
|
/* @__PURE__ */Te("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */Te(di,{name:"truck"})}),L.shipment]}),j.length>0&&/* @__PURE__ */Ee("span",{className:"border-gray-200 text-gray-500",children:[
|
|
@@ -452,7 +452,7 @@ return Te("div",{className:"shrink-0",children:/* @__PURE__ */Te(Vi,{icon:/* @__
|
|
|
452
452
|
return Ee("div",{className:`mt-2 px-1 space-y-2 ${d??""}`.trim(),style:u,children:[
|
|
453
453
|
/* @__PURE__ */Ee("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
|
|
454
454
|
/* @__PURE__ */Ee("span",{children:[`${h.items(m.length)} · ${h.pieces(y)}`,f&&w!==N&&/* @__PURE__ */Te("span",{className:"ml-1 text-gray-400",children:h.split(w,N)})]}),l&&x>0&&/* @__PURE__ */Ee("span",{className:"flex items-center gap-1 text-green-600",children:[
|
|
455
|
-
/* @__PURE__ */Te("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(x,v)]})]}),D>0?/* @__PURE__ */Ee("div",{className:"space-y-
|
|
455
|
+
/* @__PURE__ */Te("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(x,v)]})]}),D>0?/* @__PURE__ */Ee("div",{className:"space-y-2",children:[Array.from({length:A}).map((e,t)=>{const r=F(C,t),n=F(L,t),a=f,l=Math.max(r,n),i=Math.min(r,n),o=r>=n,s=a?o?"bg-blue-500":"bg-green-500":"bg-blue-500",c=a?o?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
|
|
456
456
|
return Ee("div",{className:"flex items-center gap-2",children:[
|
|
457
457
|
/* @__PURE__ */Te("span",{className:"text-2xs text-gray-400 w-8 shrink-0",children:S}),
|
|
458
458
|
/* @__PURE__ */Ee("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
|
|
@@ -470,15 +470,15 @@ return Ee("div",{className:"flex items-center gap-2",children:[
|
|
|
470
470
|
/* @__PURE__ */Te("a",{href:lo(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},a++)):void 0!==r[5]?t.push(
|
|
471
471
|
/* @__PURE__ */Te("strong",{className:"font-semibold text-gray-900",children:r[5]},a++)):void 0!==r[6]?t.push(
|
|
472
472
|
/* @__PURE__ */Te("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},a++)):void 0!==r[7]&&t.push(/* @__PURE__ */Te("em",{children:r[7]},a++)),n=ao.lastIndex;return n<e.length&&t.push(e.slice(n)),t}function oo({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),r=Q().markdown;/* @__PURE__ */
|
|
473
|
-
return Ee("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-dashed border-gray-300 bg-gray-50 px-3 py-
|
|
473
|
+
return Ee("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-dashed border-gray-300 bg-gray-50 px-3 py-3",children:[
|
|
474
474
|
/* @__PURE__ */Te(be,{name:"camera",look:"mini",className:"mt-0.5 h-4 w-4 shrink-0 text-gray-400","aria-hidden":"true"}),
|
|
475
475
|
/* @__PURE__ */Ee("span",{className:"text-xs text-gray-500",children:[
|
|
476
476
|
/* @__PURE__ */Te("span",{className:"font-medium text-gray-600",children:`${r.screenshot} — `}),t]})]})}function so(e,t){const r=[];for(const n of e){const e=t.exec(n);e?r.push(e[1]):r.length&&(r[r.length-1]+=" "+n.trim())}return r}var co=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function uo(e,t){const r=e.split("\n"),n=r[0],a=/^(#{2,4})\s+(.*)$/.exec(n);if(a&&1===r.length){const e=a[1].length;/* @__PURE__ */
|
|
477
477
|
return Te(`h${e}`,{className:2===e?"mt-2 text-sm font-semibold uppercase tracking-wide text-gray-500":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:io(a[2])},t)}if(1===r.length&&/^---+$/.test(n))/* @__PURE__ */
|
|
478
478
|
return Te("hr",{className:"border-gray-200"},t);if(function(e){return e.length>=2&&e[0].includes("|")&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(e[1])&&e[1].includes("-")}(r))return function(e,t){const r=co(e[0]),n=e.slice(2).map(co);/* @__PURE__ */
|
|
479
479
|
return Te("div",{className:"my-1 overflow-x-auto rounded-lg border border-gray-200",children:/* @__PURE__ */Ee("table",{className:"w-full border-collapse text-sm",children:[
|
|
480
|
-
/* @__PURE__ */Te("thead",{children:/* @__PURE__ */Te("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */Te("th",{className:"border-b border-gray-200 px-3 py-
|
|
481
|
-
/* @__PURE__ */Te("tbody",{children:n.map((e,t)=>/* @__PURE__ */Te("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */Te("td",{className:"border-t border-gray-100 px-3
|
|
480
|
+
/* @__PURE__ */Te("thead",{children:/* @__PURE__ */Te("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */Te("th",{className:"border-b border-gray-200 px-3 py-2 text-left font-semibold text-gray-700",children:io(e)},t))})}),
|
|
481
|
+
/* @__PURE__ */Te("tbody",{children:n.map((e,t)=>/* @__PURE__ */Te("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */Te("td",{className:"border-t border-gray-100 px-3 h-8 align-top text-gray-700",children:io(e)},t))},t))})]})},t)}(r,t);if(/^>\s?/.test(n)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
|
|
482
482
|
return Te("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-50/60 px-3 py-2 text-gray-700",children:io(e)},t)}const l=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(n);if(l&&1===r.length)/* @__PURE__ */
|
|
483
483
|
return Te(oo,{alt:l[1]},t);if(/^[-*]\s+/.test(n)){const e=so(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
|
|
484
484
|
return Te("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */Te("li",{children:io(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(n);if(i){const e=so(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
|
|
@@ -506,7 +506,7 @@ return Ee("button",{type:"button",onClick:()=>h(e.slug),className:"w-full text-l
|
|
|
506
506
|
/* @__PURE__ */Te("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:v.title}),
|
|
507
507
|
/* @__PURE__ */Ee("p",{className:"text-xs text-gray-500 mt-0.5",children:[v.category_label,!1===v.is_published&&/* @__PURE__ */Ee("span",{className:"ml-2 text-amber-600",children:["· ",s.help.draft]})]})]}),n&&l&&/* @__PURE__ */Te("button",{type:"button",onClick:()=>l(v),className:"shrink-0 text-sm text-blue-600 hover:underline",children:s.help.edit})]}),
|
|
508
508
|
/* @__PURE__ */Te("div",{className:"flex-1 overflow-auto px-5 py-4",children:i?i(v):v.body?/* @__PURE__ */Te(po,{children:v.body}):/* @__PURE__ */Te("p",{className:"text-sm text-gray-500 italic",children:s.help.noBody})})]}):/* @__PURE__ */Te("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:/* @__PURE__ */Te("p",{className:"text-sm text-gray-500",children:t?s.help.loading:s.help.pickArticle})})})]})}var bo={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50"};function yo({children:e,onClick:t,variant:r="primary",hotkey:n,disabled:a=!1,type:l="button",title:i,className:s=""}){const c=o(n??"");/* @__PURE__ */
|
|
509
|
-
return Ee("button",{type:l,onClick:t,disabled:a,title:i,className:`w-full inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors disabled:opacity-50 ${bo[r]} ${s}`,children:[e,n&&/* @__PURE__ */Te("kbd",{className:"kbd-submit rounded border px-
|
|
509
|
+
return Ee("button",{type:l,onClick:t,disabled:a,title:i,className:`w-full inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors disabled:opacity-50 ${bo[r]} ${s}`,children:[e,n&&/* @__PURE__ */Te("kbd",{className:"kbd-submit rounded border px-2 py-0.5 text-2xs font-medium",children:c})]})}function xo(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-2 h-5 rounded-full text-2xs font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function vo({children:e,count:t}){return null==t?/* @__PURE__ */Te("p",{className:"px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */Ee("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:[
|
|
510
510
|
/* @__PURE__ */Te("span",{className:"min-w-0 truncate",children:e}),
|
|
511
511
|
/* @__PURE__ */Te("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function wo(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function No({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:o=0}){const s=Rl(i,"SidebarNavItem"),c=Q().severity,d=s?(h=c,(u=s).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */Ee(Be,{children:[null!=a&&/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4 "+(r?"text-blue-600":"text-gray-400"),children:a}),s&&
|
|
512
512
|
/* @__PURE__ */Te("span",{"aria-hidden":"true",title:d,className:`shrink-0 h-1.5 w-1.5 rounded-full ${s.fill}`}),
|
|
@@ -520,17 +520,17 @@ return Ee("div",{children:[
|
|
|
520
520
|
return Ee("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[n&&/* @__PURE__ */Te("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:n}),
|
|
521
521
|
/* @__PURE__ */Te("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const n=e.key===t;/* @__PURE__ */
|
|
522
522
|
return Ee("button",{type:"button",disabled:e.disabled,"aria-current":n?"page":void 0,onClick:()=>!e.disabled&&r?.(e.key),className:"relative inline-flex items-center gap-2 px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40 "+(n?"text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.icon&&/* @__PURE__ */Te("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
523
|
-
/* @__PURE__ */Te("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */Te("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */Te("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */Te("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var Mo=/(^|[\s:])!?z-/,Co=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function Lo({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:o="",minWidth:s=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=Ne(!1),[g,f]=Ne(-1),y=ke(null),w=ke(null),N=ke(null),k=ke({text:"",at:0}),$=ve(),M=ve(),C=u??M,L=we(e=>{p(!1),e&&w.current?.focus()},[]),S=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(Co(t[l]))return l}return-1},P=()=>N.current?.closest("[data-popup-menu-tree]")??null;Me(()=>{if(!m)return;const e=e=>{const t=e.target;y.current?.contains(t)||P()?.contains(t)||L(!1)};document.addEventListener("pointerdown",e,!0);const t=W(()=>L(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,L]);const T=we(()=>{const e=P(),t=w.current;if(!e||!t)return;const a=e.style;a.left="0px",a.top="0px",a.maxWidth="none",a.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=x({trigger:t.getBoundingClientRect(),menu:l,bounds:b(t),align:r,side:n});a.left=`${i.left}px`,a.top=`${i.top}px`,a.maxWidth=`${i.maxWidth}px`,a.maxHeight=`${i.maxHeight}px`,a.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,n]);_(()=>{m&&T()}),Me(()=>{if(m)return v(()=>w.current,T)},[m,T]),Me(()=>{if(!m)return;const e=N.current,r=Co(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),Me(()=>{if(m)return R(e=>"Escape"===e.key&&(L(!0),!0),()=>N.current)},[m,L]);const E=e=>{f(e),p(!0)},B=e=>{e.disabled||(L(!0),e.onSelect())},
|
|
523
|
+
/* @__PURE__ */Te("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */Te("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */Te("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */Te("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var Mo=/(^|[\s:])!?z-/,Co=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function Lo({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:o="",minWidth:s=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=Ne(!1),[g,f]=Ne(-1),y=ke(null),w=ke(null),N=ke(null),k=ke({text:"",at:0}),$=ve(),M=ve(),C=u??M,L=we(e=>{p(!1),e&&w.current?.focus()},[]),S=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(Co(t[l]))return l}return-1},P=()=>N.current?.closest("[data-popup-menu-tree]")??null;Me(()=>{if(!m)return;const e=e=>{const t=e.target;y.current?.contains(t)||P()?.contains(t)||L(!1)};document.addEventListener("pointerdown",e,!0);const t=W(()=>L(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,L]);const T=we(()=>{const e=P(),t=w.current;if(!e||!t)return;const a=e.style;a.left="0px",a.top="0px",a.maxWidth="none",a.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=x({trigger:t.getBoundingClientRect(),menu:l,bounds:b(t),align:r,side:n});a.left=`${i.left}px`,a.top=`${i.top}px`,a.maxWidth=`${i.maxWidth}px`,a.maxHeight=`${i.maxHeight}px`,a.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,n]);_(()=>{m&&T()}),Me(()=>{if(m)return v(()=>w.current,T)},[m,T]),Me(()=>{if(!m)return;const e=N.current,r=Co(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),Me(()=>{if(m)return R(e=>"Escape"===e.key&&(L(!0),!0),()=>N.current)},[m,L]);const E=e=>{f(e),p(!0)},B=e=>{e.disabled||(L(!0),e.onSelect())},O=c??"a",I=(e,t)=>({"data-dropdown-index":e,tabIndex:e===g?0:-1,onMouseEnter:()=>{t.disabled||f(e)}}),q=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
|
|
524
524
|
return Te("div",{role:"separator",children:/* @__PURE__ */Te(A,{})},e.key);if("label"===e.type)/* @__PURE__ */
|
|
525
525
|
return Te("div",{id:`${$}-label-${t}`,children:/* @__PURE__ */Te(j,{children:e.label})},e.key);if("checkbox"===e.type){const r=z(!1,e.disabled,"");/* @__PURE__ */
|
|
526
|
-
return Ee("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),...
|
|
526
|
+
return Ee("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),...I(t,e),children:[
|
|
527
527
|
/* @__PURE__ */Te(F,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=z(!1,e.disabled,"");/* @__PURE__ */
|
|
528
|
-
return Ee("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>B(e),...
|
|
529
|
-
/* @__PURE__ */Te(F,{kind:"radio",checked:e.checked}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=z(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */Ee("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...
|
|
530
|
-
return Ee("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>B(e),...
|
|
528
|
+
return Ee("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>B(e),...I(t,e),children:[
|
|
529
|
+
/* @__PURE__ */Te(F,{kind:"radio",checked:e.checked}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=z(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */Ee("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...I(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */Ee(O,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>L(!0),...I(t,e),children:[e.icon,e.label]},e.key)}const r=z(e.danger,e.disabled,"");/* @__PURE__ */
|
|
530
|
+
return Ee("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>B(e),...I(t,e),children:[e.icon,e.label]},e.key)},U={...Mo.test(o)?{}:{zIndex:K.popup},minWidth:s};/* @__PURE__ */
|
|
531
531
|
return Ee("div",{ref:y,className:`relative inline-flex ${l}`.trim(),children:[
|
|
532
532
|
/* @__PURE__ */Te("button",{ref:w,id:C,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?$:void 0,"aria-label":a,"aria-describedby":h,disabled:d,onClick:()=>m?L(!1):E(S(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),E(S(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),E(S(t.length-1,-1)))},className:i??"inline-flex items-center justify-center rounded-(--radius-control) 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}),m&&
|
|
533
|
-
/* @__PURE__ */Te(D,{portal:!0,className:o,style:
|
|
533
|
+
/* @__PURE__ */Te(D,{portal:!0,className:o,style:U,children:/* @__PURE__ */Te("div",{ref:N,id:$,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:C,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f(S(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f(S(g-1,-1));else if("Home"===e.key)e.preventDefault(),f(S(0,1));else if("End"===e.key)e.preventDefault(),f(S(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),L(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),n=e.key.toLowerCase(),a=r-k.current.at<500?k.current.text+n:n;k.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?g+1:Math.max(g,0),s=N.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(Co(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void f(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(q(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(q(t[r],r)),r+=1;const o="label"===t[l-1]?.type?`${$}-label-${l-1}`:void 0;e.push(/* @__PURE__ */Te("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()})})]})}function Do(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function So({at:e,onClose:t,children:r,owner:n,"aria-label":a,minWidth:l=180,className:i="",autoFocus:o=!0}){const s=ke(null),[c,d]=Ne(null),u=ke(t);u.current=t,_(()=>{const t=s.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},a=N({point:e,menu:r,bounds:b(n??null)});d(e=>e&&e.left===a.left&&e.top===a.top&&e.maxHeight===a.maxHeight?e:{left:a.left,top:a.top,maxHeight:a.maxHeight,scroll:r.height>a.maxHeight})},[e.x,e.y,n]);const h=ke(null),m=ke(!1);Me(()=>(h.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!s.current?.contains(e)||h.current?.focus?.({preventScroll:!0})}),[]),Me(()=>{c&&!m.current&&o&&(m.current=!0,Do(s.current)[0]?.focus({preventScroll:!0}))},[c,o]),Me(()=>{if(o)return;const e=e=>{if(s.current?.contains(document.activeElement))return;const t=Do(s.current),r="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;r&&(e.preventDefault(),r.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[o]),Me(()=>R(e=>"Escape"===e.key&&(u.current(),!0),()=>s.current),[]),Me(()=>{const e=()=>u.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const p=we(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void u.current();const t=Do(s.current);if(0===t.length)return;const r=t.indexOf(document.activeElement),n="ArrowDown"===e.key?(r+1)%t.length:"ArrowUp"===e.key?r<=0?t.length-1:r-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;n<0||(e.preventDefault(),t[n].focus())},[]),g=c?{left:c.left,top:c.top,maxHeight:c.maxHeight,...c.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
|
|
534
534
|
return Te(D,{portal:!0,minWidth:l,style:g,onClose:t,className:i,children:/* @__PURE__ */Te(S.Provider,{value:!0,children:/* @__PURE__ */Te("div",{ref:s,role:"menu","aria-label":a,"data-context-menu":"",onKeyDown:p,children:r})})})}function Po(){const[e,t]=Ne(null),r=we(()=>t(null),[]),n=we((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(P(n))return!1;e.preventDefault();const a=e.target instanceof Element?e.target:null;let{clientX:l,clientY:i}=e;if(0===l&&0===i&&a){const e=a.getBoundingClientRect();l=e.left,i=e.bottom}return t({x:l,y:i,data:r,owner:a}),!0},[]),a=we(e=>{n(e,void 0)},[n]);return{open:n,onContextMenu:a,close:r,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:r}}}var Ao="Alt+ArrowUp Alt+ArrowDown";function jo(e){return!e.altKey||e.ctrlKey||e.metaKey?null:"ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":null}var zo=/* @__PURE__ */Ee("svg",{"aria-hidden":"true",viewBox:"0 0 8 14",fill:"currentColor",className:"h-3.5 w-2",children:[
|
|
535
535
|
/* @__PURE__ */Te("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
536
536
|
/* @__PURE__ */Te("circle",{cx:"6",cy:"3",r:"1.1"}),
|
|
@@ -539,14 +539,14 @@ return Te(D,{portal:!0,minWidth:l,style:g,onClose:t,className:i,children:/* @__P
|
|
|
539
539
|
/* @__PURE__ */Te("circle",{cx:"2",cy:"11",r:"1.1"}),
|
|
540
540
|
/* @__PURE__ */Te("circle",{cx:"6",cy:"11",r:"1.1"})]});function Fo({hint:e,dragging:t,revealClassName:r,marker:n}){const a=Q().tree;/* @__PURE__ */
|
|
541
541
|
return Te(f,{content:e??a.dragHint,side:"left",delay:700,className:"absolute left-0 top-1/2 inline-flex -translate-y-1/2 transition-opacity "+(t?"opacity-0":`opacity-0 ${r}`),children:/* @__PURE__ */Te("span",{"aria-hidden":"true",[`data-${n}-grip`]:"",className:"flex h-4 w-2 items-center justify-center text-gray-400",children:zo})})}function To({id:e}){/* @__PURE__ */
|
|
542
|
-
return Te("span",{id:e,hidden:!0,children:Q().tree.moveHint})}var Eo='[role="treeitem"]';function Bo(e){return[...e.querySelectorAll(Eo)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function
|
|
543
|
-
return Te("div",{...a,ref:l,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${n}`.trim(),children:r})}function
|
|
542
|
+
return Te("span",{id:e,hidden:!0,children:Q().tree.moveHint})}var Eo='[role="treeitem"]';function Bo(e){return[...e.querySelectorAll(Eo)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function Oo({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=ke(null);_(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(Eo)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??Bo(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=we(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(Eo);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const n=Bo(t),i=n.indexOf(r),o=Number(r.getAttribute("aria-level")??"1"),s=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(Eo))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":s(n[i+1]);break;case"ArrowUp":s(n[i-1]);break;case"Home":s(n[0]);break;case"End":s(n[n.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=n[i+1];t&&Number(t.getAttribute("aria-level")??"1")>o?s(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(n[e].getAttribute("aria-level")??"1")<o){s(n[e]);break}}},[a]);/* @__PURE__ */
|
|
543
|
+
return Te("div",{...a,ref:l,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${n}`.trim(),children:r})}function Io({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
544
544
|
return Te("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}function Ro({children:e}){/* @__PURE__ */
|
|
545
545
|
return Te("div",{role:"presentation",className:"px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e})}var Wo={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function Ko({label:e,level:t=1,icon:r,preview:n,selected:a=!1,expanded:l,onToggle:i,onSelect:o,muted:s=!1,badge:c,actions:d,actionsPinned:u=!1,actionsOverlay:h=!0,rename:m,drop:p,dragging:g=!1,draggable:f=!1,dragHint:b,onMove:y,rowProps:x,className:v=""}){const w=void 0!==l,N=ve(),k=[x?.["aria-describedby"],y?N:void 0].filter(Boolean).join(" ")||void 0,$=a?"bg-blue-50 text-blue-700":"into"===p?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
|
|
546
|
-
return Ee("div",{...x,role:"treeitem","aria-level":t,"aria-selected":a,"aria-expanded":w?l:void 0,tabIndex:a?0:-1,"aria-keyshortcuts":x?.["aria-keyshortcuts"]??(y?Ao:void 0),"aria-describedby":k,"data-drop":p,"data-draggable":f||void 0,onKeyDown:e=>{if(x?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=jo(e);t&&y?(e.preventDefault(),y(t)):"Enter"!==e.key&&" "!==e.key||!o?("ArrowRight"===e.key&&w&&!l&&i||"ArrowLeft"===e.key&&w&&l&&i)&&(e.preventDefault(),i()):(e.preventDefault(),o())},onClick:e=>{x?.onClick?.(e),e.defaultPrevented||o?.()},className:["group/treerow relative flex min-h-8 select-none items-center gap-
|
|
546
|
+
return Ee("div",{...x,role:"treeitem","aria-level":t,"aria-selected":a,"aria-expanded":w?l:void 0,tabIndex:a?0:-1,"aria-keyshortcuts":x?.["aria-keyshortcuts"]??(y?Ao:void 0),"aria-describedby":k,"data-drop":p,"data-draggable":f||void 0,onKeyDown:e=>{if(x?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=jo(e);t&&y?(e.preventDefault(),y(t)):"Enter"!==e.key&&" "!==e.key||!o?("ArrowRight"===e.key&&w&&!l&&i||"ArrowLeft"===e.key&&w&&l&&i)&&(e.preventDefault(),i()):(e.preventDefault(),o())},onClick:e=>{x?.onClick?.(e),e.defaultPrevented||o?.()},className:["group/treerow relative flex min-h-8 select-none items-center gap-2 rounded-md px-2 py-1 text-sm",f?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",$,"into"===p?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",g?"opacity-40":"",v].filter(Boolean).join(" "),children:["before"===p&&/* @__PURE__ */Te("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===p&&/* @__PURE__ */Te("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),f&&
|
|
547
547
|
/* @__PURE__ */Te(Fo,{marker:"tree",hint:b,dragging:g,revealClassName:"group-hover/treerow:opacity-100 group-focus-visible/treerow:opacity-100"}),
|
|
548
548
|
/* @__PURE__ */Te("span",w?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),i?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:(M=!!l,/* @__PURE__ */Te(be,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(M?"rotate-90":"")}))}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=r&&/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(a?"text-blue-600":"text-gray-500"),children:r}),
|
|
549
|
-
/* @__PURE__ */Ee("span",{className:"relative flex min-w-0 flex-1 items-center gap-
|
|
549
|
+
/* @__PURE__ */Ee("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[m??/* @__PURE__ */Ee("span",{className:`min-w-0 truncate ${a?"font-semibold":"font-medium"} ${s?"text-gray-400 line-through":""}`,children:[e,null!=n&&/* @__PURE__ */Te("span",{className:"ml-2 font-normal text-gray-500",children:n})]}),null!=c&&!1!==c&&/* @__PURE__ */Te("span",{className:"shrink-0 rounded bg-gray-100 px-1 py-0.5 text-2xs font-medium tabular-nums text-gray-500",children:c}),null!=d&&!h&&/* @__PURE__ */Te("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(u||s?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:d})]}),null!=d&&h&&
|
|
550
550
|
/* @__PURE__ */Ee("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:Wo,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(u||s||a?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
|
|
551
551
|
/* @__PURE__ */Te("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
552
552
|
/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
@@ -555,14 +555,14 @@ return Te("div",{...n,role:"presentation","data-drop":r||void 0,children:e?/* @_
|
|
|
555
555
|
/* @__PURE__ */Te("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */Te("span",{className:i,children:l})})}function qo({onInsert:e,label:t,drop:r=!1,seamProps:n}){const a=Q().tree,l=t??a.insertHere,i=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
|
|
556
556
|
return Ee("div",{...n,role:"presentation","data-tree-seam":"","data-drop":r||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${n?.className??""}`.trim(),children:[
|
|
557
557
|
/* @__PURE__ */Te("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
558
|
-
/* @__PURE__ */Te("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${i}`}),e&&/* @__PURE__ */Te(f,{content:l,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */Te("button",{type:"button","aria-label":l,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */Te(be,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}var
|
|
559
|
-
return Te(
|
|
558
|
+
/* @__PURE__ */Te("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${i}`}),e&&/* @__PURE__ */Te(f,{content:l,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */Te("button",{type:"button","aria-label":l,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */Te(be,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}var Uo=Ce("compact");function Ho({"aria-label":e,"aria-labelledby":t,children:r,spacing:n="compact",className:a="",rootProps:l}){/* @__PURE__ */
|
|
559
|
+
return Te(Uo.Provider,{value:n,children:/* @__PURE__ */Te("div",{...l,role:"list","aria-label":t?void 0:e,"aria-labelledby":t,"data-sortable-list":n,className:`flex min-w-0 flex-col ${"comfortable"===n?"gap-2":"gap-1"} ${a}`.trim(),children:r})})}function Vo({children:e,actions:t,below:r,active:n=!1,flat:a=!1,draggable:l=!1,dragHint:i,dragging:o=!1,drop:s,onMove:c,rowProps:d,rowRef:u,className:h=""}){const m=Pe(Uo),p=ke(null),g=ve(),f=[d?.["aria-describedby"],c?g:void 0].filter(Boolean).join(" ")||void 0,b=d?.tabIndex;_(()=>{const e=p.current;if(!e||void 0!==b)return;const t=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(t=>t!==e);c&&!t?e.tabIndex=0:e.removeAttribute("tabindex")});/* @__PURE__ */
|
|
560
560
|
return Ee("div",{role:"listitem","data-list-item":"","data-drop":s,className:"relative flex min-w-0 flex-col",children:[s&&/* @__PURE__ */Te("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${("comfortable"===m?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"})[s]}`}),
|
|
561
561
|
/* @__PURE__ */Ee("div",{...d,ref:e=>{var t,r;p.current=e,r=e,"function"==typeof(t=u)?t(r):t&&(t.current=r)},"data-list-row":"","data-active":n||void 0,"data-draggable":l||void 0,"aria-keyshortcuts":d?.["aria-keyshortcuts"]??(c?Ao:void 0),"aria-describedby":f,onKeyDown:e=>{if(d?.onKeyDown?.(e),e.defaultPrevented||!c)return;const t=jo(e);t&&!e.target.closest?.("select")&&(e.preventDefault(),c(t))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md pl-3 text-sm",l?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=t&&!1!==t?"":"pr-2",n?"bg-gray-100":a?"":"hover:bg-gray-100",o?"opacity-40":"",h].filter(Boolean).join(" "),children:[l&&/* @__PURE__ */Te(Fo,{marker:"list",hint:i,dragging:o,revealClassName:"group-hover/listrow:opacity-100 group-focus-within/listrow:opacity-100"}),
|
|
562
|
-
/* @__PURE__ */Te("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:e}),null!=t&&!1!==t&&/* @__PURE__ */Te("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:t}),c&&/* @__PURE__ */Te(To,{id:g})]}),null!=r&&!1!==r&&/* @__PURE__ */Te("div",{"data-list-below":"",children:r})]})}var Yo=Ce({labels:"none",shown:"none"}),Go="button[data-icon-rail-button]:not([disabled])";function Xo(e,t,r){const n=getComputedStyle(e),a=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),l="horizontal"===t?(parseFloat(n.columnGap)||0)*Math.max(0,r-1):0,i=e.parentElement;let o=1/0;if(i){const e=getComputedStyle(i);o=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:a+l,room:o}}function Zo({"aria-label":e,orientation:t="vertical",children:r,className:n="",labels:a="none",labelsFit:l=!1,onLabelsShown:i}){const o=ke(null),s="none"!==a&&l,[c,d]=Ne(null),u="none"===a?"none":s?c??"none":"all",h=ke(()=>{});h.current=()=>{const e=o.current;if(!e||!s)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const r=getComputedStyle(e),n=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a=parseFloat(r.minWidth)||0,l=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(a,n+l),worded:"below"===t?Math.max(a,n+Math.max(l,i)):Math.max(a,n+l+
|
|
562
|
+
/* @__PURE__ */Te("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:e}),null!=t&&!1!==t&&/* @__PURE__ */Te("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:t}),c&&/* @__PURE__ */Te(To,{id:g})]}),null!=r&&!1!==r&&/* @__PURE__ */Te("div",{"data-list-below":"",children:r})]})}var Yo=Ce({labels:"none",shown:"none"}),Go="button[data-icon-rail-button]:not([disabled])";function Xo(e,t,r){const n=getComputedStyle(e),a=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),l="horizontal"===t?(parseFloat(n.columnGap)||0)*Math.max(0,r-1):0,i=e.parentElement;let o=1/0;if(i){const e=getComputedStyle(i);o=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:a+l,room:o}}function Zo({"aria-label":e,orientation:t="vertical",children:r,className:n="",labels:a="none",labelsFit:l=!1,onLabelsShown:i}){const o=ke(null),s="none"!==a&&l,[c,d]=Ne(null),u="none"===a?"none":s?c??"none":"all",h=ke(()=>{});h.current=()=>{const e=o.current;if(!e||!s)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const r=getComputedStyle(e),n=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a=parseFloat(r.minWidth)||0,l=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(a,n+l),worded:"below"===t?Math.max(a,n+Math.max(l,i)):Math.max(a,n+l+8+i),active:"true"===e.getAttribute("aria-pressed")}})}(e,a);d(function({buttons:e,orientation:t,chrome:r,room:n}){if(0===e.length)return"none";const a=n=>{const a=e.map(e=>n(e)?e.worded:e.bare);return r+("horizontal"===t?a.reduce((e,t)=>e+t,0):Math.max(...a))};return a(()=>!0)<=n+.5?"all":e.some(e=>e.active)&&a(e=>e.active)<=n+.5?"chosen":"none"}({buttons:r,orientation:t,...Xo(e,t,r.length)}))},_(()=>{h.current()}),Me(()=>{const e=o.current?.parentElement;if(!s||!e)return;let t=!0;const r=()=>{t&&h.current()},n="undefined"==typeof ResizeObserver?void 0:ResizeObserver,a=n?new n(r):null;return a?.observe(e),document.fonts?.ready.then(r,()=>{}),()=>{t=!1,a?.disconnect()}},[s]);const m=ke(null),p=ke(i);p.current=i,Me(()=>{s&&null!==c&&m.current!==c&&(m.current=c,p.current?.(c))},[s,c]),_(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(Go)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===r?0:-1});/* @__PURE__ */
|
|
563
563
|
return Te("div",{ref:o,role:"toolbar","aria-label":e,"aria-orientation":t,"data-orientation":t,onKeyDown:e=>{const r=o.current;if(!r)return;const n=[...r.querySelectorAll(Go)],a=n.indexOf(e.target);if(a<0)return;const l="vertical"===t?"ArrowUp":"ArrowLeft",i="vertical"===t?"ArrowDown":"ArrowRight",s=e.key===i?(a+1)%n.length:e.key===l?(a-1+n.length)%n.length:"Home"===e.key?0:"End"===e.key?n.length-1:-1;if(!(s<0)){e.preventDefault();for(const e of n)e.tabIndex=e===n[s]?0:-1;n[s].focus()}},"data-labels":"none"===a?void 0:a,"data-labels-shown":"none"===a?void 0:u,className:`flex gap-1 ${"vertical"===t?"flex-col items-center":"flex-row items-center"} ${n}`.trim(),children:/* @__PURE__ */Te(Yo.Provider,{value:{labels:a,shown:u},children:r})})}function Jo({label:e,icon:t,active:r,disabled:n,onClick:a,badge:l,tooltipSide:i="right",className:o=""}){const s=!0===r,{labels:c,shown:d}=Pe(Yo),u=void 0===l||!1===l||0===l?t:/* @__PURE__ */Te(ul,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:t}),h="none"!==c,m=h&&("all"===d||"chosen"===d&&s),p=/* @__PURE__ */Te("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof r?r:void 0,disabled:n,onClick:n?void 0:a,className:[`relative inline-flex ${h?"beside"===c?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",s?"bg-blue-50 text-blue-700":"text-gray-600 hover:bg-gray-100 hover:text-gray-900",o].filter(Boolean).join(" "),children:h?/* @__PURE__ */Ee(Be,{children:[
|
|
564
564
|
/* @__PURE__ */Te("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:u}),
|
|
565
|
-
/* @__PURE__ */Te("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",m?"beside"===c?"ml-
|
|
565
|
+
/* @__PURE__ */Te("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",m?"beside"===c?"ml-2":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):u});/* @__PURE__ */
|
|
566
566
|
return Te(f,{content:e,side:i,children:p})}var Qo=6e4;function es({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=Ne(null);return Me(()=>{if(!e||null!==n)return;let l=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const r=t.includes("?")?"&":"?",n=await fetch(`${t}${r}t=${Date.now()}`,{cache:"no-store"});if(!n.ok)return;const i=await n.json(),o=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&o&&o!==e&&a(o)}catch{}};i();const o=setInterval(()=>{i()},r),s=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",s),()=>{l=!0,clearInterval(o),document.removeEventListener("visibilitychange",s)}},[e,t,r,n]),n}function ts({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=es({currentVersion:e,versionUrl:t,pollMs:r}),o=Q();if(null===i)return null;const s=a??(()=>window.location.reload());/* @__PURE__ */
|
|
567
567
|
return Te("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */Ee(kl,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */Te(g,{type:"button",variant:"primary",size:"md",onClick:s,children:o.update.refreshNow}),children:[
|
|
568
568
|
/* @__PURE__ */Te("span",{className:"font-medium",children:n??o.update.available}),
|
|
@@ -581,28 +581,28 @@ return Ee("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray
|
|
|
581
581
|
/* @__PURE__ */Te("span",{className:"text-xs opacity-70",children:ne(t.length,f)})]}),
|
|
582
582
|
/* @__PURE__ */Ee("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>k(r=>r&&r.col===e.value&&r.index===t.length?r:{col:e.value,index:t.length}),children:[t.map((r,a)=>{const o=n(r),c=o===v;/* @__PURE__ */
|
|
583
583
|
return Ee(Ae,{children:[s===a&&/* @__PURE__ */Te("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
|
|
584
|
-
/* @__PURE__ */Te("div",{"data-kanban-card":o,draggable:!0,onDragStart:e=>{w(o);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:r=>{r.stopPropagation();const l=null!==v?t.findIndex(e=>n(e)===v):-1,i=-1!==l&&l<a?a+1:a;k(t=>t&&t.col===e.value&&t.index===i?t:{col:e.value,index:i})},onDragEnd:M,onClick:i?()=>i(r):void 0,style:null===v?void 0:{opacity:c?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(i?"cursor-pointer":""),children:l(r)})]},o)}),t.length>0&&s===t.length&&/* @__PURE__ */Te("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===t.length&&/* @__PURE__ */Te("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(r?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:y})]}),m&&/* @__PURE__ */Te("div",{className:"p-2 pt-0",children:/* @__PURE__ */Ee("button",{type:"button",onClick:()=>m(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 py-1
|
|
584
|
+
/* @__PURE__ */Te("div",{"data-kanban-card":o,draggable:!0,onDragStart:e=>{w(o);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:r=>{r.stopPropagation();const l=null!==v?t.findIndex(e=>n(e)===v):-1,i=-1!==l&&l<a?a+1:a;k(t=>t&&t.col===e.value&&t.index===i?t:{col:e.value,index:i})},onDragEnd:M,onClick:i?()=>i(r):void 0,style:null===v?void 0:{opacity:c?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(i?"cursor-pointer":""),children:l(r)})]},o)}),t.length>0&&s===t.length&&/* @__PURE__ */Te("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===t.length&&/* @__PURE__ */Te("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(r?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:y})]}),m&&/* @__PURE__ */Te("div",{className:"p-2 pt-0",children:/* @__PURE__ */Ee("button",{type:"button",onClick:()=>m(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-gray-500 opacity-0 transition hover:bg-gray-100 hover:text-gray-700 focus-visible:opacity-100 group-hover:opacity-100",children:[
|
|
585
585
|
/* @__PURE__ */Te("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),x]})})]},e.value)})})}):/* @__PURE__ */Te(Be,{children:d??/* @__PURE__ */Te("div",{className:"text-sm text-gray-500 p-4",children:g.empty})})}var os="inline-flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-40";function ss({page:e,pageCount:t,onPageChange:r,siblingCount:n=1,showEdges:a=!1,className:l=""}){const i=Q().pagination,o=J();if(t<=1)return null;const s=function(e,t,r){const n=/* @__PURE__ */new Set([1,t]);for(let a=e-r;a<=e+r;a++)a>=1&&a<=t&&n.add(a);const a=[...n].sort((e,t)=>e-t),l=[];let i=0;for(const e of a)i&&e-i>1&&l.push("…"),l.push(e),i=e;return l}(e,t,n),c=n=>{n>=1&&n<=t&&n!==e&&r(n)};/* @__PURE__ */
|
|
586
586
|
return Ee("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[a&&/* @__PURE__ */Te("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${os} text-gray-600 hover:bg-gray-100`,children:"«"}),
|
|
587
587
|
/* @__PURE__ */Te("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${os} text-gray-600 hover:bg-gray-100`,children:"‹"}),s.map((t,r)=>"…"===t?/* @__PURE__ */Te("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */Te("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${os} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:ne(t,o)},t)),
|
|
588
|
-
/* @__PURE__ */Te("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${os} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */Te("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${os} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function cs(e){const t={};if(!e)return t;for(const[r,n]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||(t[r]=n);return t}var ds=e=>Array.isArray(e.columns),us=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",hs="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",ms={sm:"px-2 py-
|
|
588
|
+
/* @__PURE__ */Te("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${os} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */Te("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${os} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function cs(e){const t={};if(!e)return t;for(const[r,n]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||(t[r]=n);return t}var ds=e=>Array.isArray(e.columns),us=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",hs="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",ms={sm:"px-2 py-2",md:"px-3 py-2"},ps={left:"text-left",right:"text-right",center:"text-center"};function gs({direction:e}){/* @__PURE__ */
|
|
589
589
|
return Ee("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
590
590
|
/* @__PURE__ */Te("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */Te("path",{d:"M4 0L8 5H0z"})}),
|
|
591
|
-
/* @__PURE__ */Te("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */Te("path",{d:"M4 5L0 0h8z"})})]})}function fs({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:o=!1,bordered:s=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:g,emptyText:f,selection:b,footer:y,virtualized:x,stackOnNarrow:v=!1,stackBelow:w,className:N=""}){const k=Q(),$=f??k.table.empty,M=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!x,L=C?e:e.flatMap(e=>{if(!ds(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),D=e=>C?{role:e}:{},S=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[P,A]=Ne(0),j=x?.overscan??6,z=x?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/x.rowHeight)-j);A(e=>e===t?e:t)}:void 0,F=x?Math.ceil(x.height/x.rowHeight)+2*j:t.length,T=x?Math.min(P,Math.max(0,t.length-F)):0,E=Math.min(t.length,T+F),B=x?T*x.rowHeight:0,
|
|
591
|
+
/* @__PURE__ */Te("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */Te("path",{d:"M4 5L0 0h8z"})})]})}function fs({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:o=!1,bordered:s=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:g,emptyText:f,selection:b,footer:y,virtualized:x,stackOnNarrow:v=!1,stackBelow:w,className:N=""}){const k=Q(),$=f??k.table.empty,M=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!x,L=C?e:e.flatMap(e=>{if(!ds(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),D=e=>C?{role:e}:{},S=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[P,A]=Ne(0),j=x?.overscan??6,z=x?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/x.rowHeight)-j);A(e=>e===t?e:t)}:void 0,F=x?Math.ceil(x.height/x.rowHeight)+2*j:t.length,T=x?Math.min(P,Math.max(0,t.length-F)):0,E=Math.min(t.length,T+F),B=x?T*x.rowHeight:0,O=x?(t.length-E)*x.rowHeight:0,I=ke(null),[R,W]=Ne(0);_(()=>{if(!x)return;const e=I.current?.offsetHeight??0;W(t=>t===e?t:e)});const K=e=>e.sortField??e.key,q=e=>n&&n.field===K(e)?n.direction:null,U=L.flatMap(e=>ds(e)?e.columns:[e]),H=L.some(ds),V=/* @__PURE__ */new Map;if(C)for(const e of L)if(ds(e))for(const t of e.columns)V.set(t,S(e.title,e.label));const Y=e=>{const t=S(e.title,e.label),r=V.get(e);return t&&r?`${r} · ${t}`:t},G=new Set(b?.selected??[]),X=b?t.map((e,t)=>M(e,t)):[],Z=X.length>0&&X.every(e=>G.has(e)),J=X.some(e=>G.has(e)),ee=b?36:0,te=U.length+(b?1:0),re=U.some(e=>"left"===e.fixed),ne=C&&!b&&U.some(e=>e.cardCorner),ae=g??"a",le=`${ms[c]} ${"sm"===c?"text-xs":"text-sm"}`,ie=(e,t,r,n=0)=>{const l=q(e),i=ps[e.align??(e.numeric?"right":"left")],o="left"===e.fixed,s=!(!e.sortable||!a);/* @__PURE__ */
|
|
592
592
|
return Te("th",{scope:"col",...D("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===l?"ascending":"desc"===l?"descending":s?"none":void 0,style:{width:e.width,...o?{left:(se[t]??0)+ee}:{},...x?{top:n}:{}},className:[le,i,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-2xs":"text-xs",o?x?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":x?"sticky z-10 bg-gray-50":"",C&&s?"rosh-dt-sort":"",C?us(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:s?/* @__PURE__ */Ee("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=K(e),r=q(e),n=e.sortFirst??"asc";a(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":C?V.get(e):void 0,className:`inline-flex items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[e.title,
|
|
593
|
-
/* @__PURE__ */Te(gs,{direction:l})]}):e.title},e.key)};let oe=0;const se=
|
|
593
|
+
/* @__PURE__ */Te(gs,{direction:l})]}):e.title},e.key)};let oe=0;const se=U.map(e=>{if("left"!==e.fixed)return null;const t=oe;return oe+=e.width??0,t}),ce=/* @__PURE__ */Ee(Be,{children:[
|
|
594
594
|
/* @__PURE__ */Ee("div",{onScroll:z,style:x?{maxHeight:x.height}:void 0,className:`relative overflow-x-auto ${x?"overflow-y-auto":""} ${s?"rounded-lg border border-gray-200":""}${C?" rosh-dt-scroll":""}`.trim(),children:[o&&
|
|
595
595
|
/* @__PURE__ */Ee("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
596
596
|
/* @__PURE__ */Te("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-gray-200 border-t-blue-600"}),
|
|
597
597
|
/* @__PURE__ */Te("span",{className:"sr-only",children:k.table.loading})]}),
|
|
598
598
|
/* @__PURE__ */Ee("table",{...D("table"),className:(C?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */Te("caption",{className:"sr-only",children:i}),
|
|
599
599
|
/* @__PURE__ */Ee("thead",{...D("rowgroup"),className:C?"rosh-dt-head":void 0,children:[
|
|
600
|
-
/* @__PURE__ */Ee("tr",{ref:
|
|
601
|
-
/* @__PURE__ */Te("tbody",{...D("rowgroup"),className:C?"rosh-dt-body":void 0,children:0!==t.length||o?/* @__PURE__ */Ee(Be,{children:[B>0&&/* @__PURE__ */Te("tr",{"aria-hidden":"true",children:/* @__PURE__ */Te("td",{colSpan:te,style:{height:B,padding:0,border:0}})}),t.slice(T,E).map((e,t)=>{const r=T+t,n=h?.(e,r),a=!!n?.current,l=m?.(e,r),i=void 0===l&&p?()=>p(e,r):void 0,o=void 0!==l||void 0!==i;let s=!1;const c=(e,t)=>{if(s=!0,!o)return e;const r=[hs,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */Te(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */Te("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=
|
|
600
|
+
/* @__PURE__ */Ee("tr",{ref:I,...D("row"),className:"border-b border-gray-200 bg-gray-50",children:[b&&/* @__PURE__ */Te("th",{scope:"col",...D("columnheader"),rowSpan:H?2:void 0,style:{width:36,...x?{top:0}:{}},className:[le,re||x?"sticky z-20 bg-gray-50":"",re?"left-0":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */Te(dt,{"aria-label":k.table.selectAll,checked:Z,indeterminate:J&&!Z,onChange:()=>{if(!b)return;const e=new Set(X);b.onChange(Z?b.selected.filter(t=>!e.has(t)):[...b.selected,...X.filter(e=>!G.has(e))])}})}),L.map((e,t)=>ds(e)?/* @__PURE__ */Te("th",{scope:"colgroup",...D("columnheader"),colSpan:e.columns.length,style:x?{top:0}:void 0,className:[le,"text-center","font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-2xs":"text-xs","border-b border-gray-200",x?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:e.title},e.key??`group-${t}`):ie(e,U.indexOf(e),H?2:1))]}),H&&/* @__PURE__ */Te("tr",{...D("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>ds(e)?e.columns:[]).map(e=>ie(e,U.indexOf(e),1,R))})]}),
|
|
601
|
+
/* @__PURE__ */Te("tbody",{...D("rowgroup"),className:C?"rosh-dt-body":void 0,children:0!==t.length||o?/* @__PURE__ */Ee(Be,{children:[B>0&&/* @__PURE__ */Te("tr",{"aria-hidden":"true",children:/* @__PURE__ */Te("td",{colSpan:te,style:{height:B,padding:0,border:0}})}),t.slice(T,E).map((e,t)=>{const r=T+t,n=h?.(e,r),a=!!n?.current,l=m?.(e,r),i=void 0===l&&p?()=>p(e,r):void 0,o=void 0!==l||void 0!==i;let s=!1;const c=(e,t)=>{if(s=!0,!o)return e;const r=[hs,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */Te(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */Te("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=U.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(o&&!s){const e=U.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=U.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const g=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
602
602
|
return Ee("tr",{...cs(n),...D("row"),style:x?{height:x.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:g(n?.onFocus),onBlur:g(n?.onBlur),"aria-current":a&&!o?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[C?b?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",C&&ne?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",u?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[b&&(()=>{const t=M(e,r);/* @__PURE__ */
|
|
603
|
-
return Te("td",{...D("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,re?"sticky left-0 z-10 bg-white":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */Te(dt,{"aria-label":k.table.selectRow,checked:G.has(t),onChange:()=>(e=>{b&&b.onChange(G.has(e)?b.selected.filter(t=>t!==e):[...b.selected,e])})(t)})})})(),
|
|
603
|
+
return Te("td",{...D("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,re?"sticky left-0 z-10 bg-white":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */Te(dt,{"aria-label":k.table.selectRow,checked:G.has(t),onChange:()=>(e=>{b&&b.onChange(G.has(e)?b.selected.filter(t=>t!==e):[...b.selected,e])})(t)})})})(),U.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ne&&!!e.cardCorner,l=C&&!a&&"wide"!==e.only;/* @__PURE__ */
|
|
604
604
|
return Te("td",{...D("cell"),"data-label":l?Y(e):void 0,style:r?{left:(se[t]??0)+ee}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",C?us(e):"",le,ps[e.align??(e.numeric?"right":"left")],e.numeric&&!C?"font-mono":"","text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:C?
|
|
605
|
-
/* @__PURE__ */Te("span",{className:e.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:n}):n},e.key)})]},M(e,r))}),
|
|
605
|
+
/* @__PURE__ */Te("span",{className:e.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:n}):n},e.key)})]},M(e,r))}),O>0&&/* @__PURE__ */Te("tr",{"aria-hidden":"true",children:/* @__PURE__ */Te("td",{colSpan:te,style:{height:O,padding:0,border:0}})})]}):/* @__PURE__ */Te("tr",{...D("row"),className:C?"rosh-dt-empty":void 0,children:/* @__PURE__ */Te("td",{...D("cell"),colSpan:te,className:`${le} py-10 text-center text-gray-500`,children:$})})})]}),y]}),l&&l.pageCount>1&&/* @__PURE__ */Te("div",{className:C?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */Te(ss,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
|
|
606
606
|
return Te("div",C?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${N}`.trim(),children:/* @__PURE__ */Te("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */Te("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:ce})})}:{className:`rosh-dt-stack ${N}`.trim(),children:ce}:{className:N,children:ce})}function bs({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=Q().list,s=n??r,c=r>=s,d=t>0?o.selectedNotShown(e,t):e>0?o.selected(e):"";/* @__PURE__ */
|
|
607
607
|
return Ee(Be,{children:[i,d?`${d} — `:"",c?null!=n?o.allLoaded(s,a):o.count(s,a):o.loadedOf(r,s,a),l?` · ${o.loadingMore}`:""]})}function ys({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=Q().list;/* @__PURE__ */
|
|
608
608
|
return Ee("div",{className:`flex flex-col items-center justify-center text-center ${"card"===n?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===n?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
|
|
@@ -610,13 +610,13 @@ return Ee("div",{className:`flex flex-col items-center justify-center text-cente
|
|
|
610
610
|
/* @__PURE__ */Te("h3",{className:"text-sm font-medium text-gray-900",children:e??a.loadError}),
|
|
611
611
|
/* @__PURE__ */Te("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */Te("div",{className:"mt-4",children:/* @__PURE__ */Te(g,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function xs({data:e,width:t=120,height:r=32,stroke:n="currentColor",fill:a,strokeWidth:l=1.5,showDots:i=!1,className:o,style:s}){if(0===e.length)return null;const c=Math.max(...e),d=Math.min(...e),u=c-d||1,h=l+(i?2:0),m=e=>r-h-(e-d)/u*(r-2*h),p=1===e.length?[[0,r/2],[t,r/2]]:e.map((r,n)=>[n*t/(e.length-1),m(r)]),g=p.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "),f=`${g} L${t.toFixed(2)},${r} L0,${r} Z`;/* @__PURE__ */
|
|
612
612
|
return Ee("svg",{className:o,style:s,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[a&&/* @__PURE__ */Te("path",{d:f,fill:a,stroke:"none"}),
|
|
613
|
-
/* @__PURE__ */Te("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */Te("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}var vs=8,ws=["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)"],Ns={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},ks={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function $s(e){return ws[e]??ks.muted}function Ms(e,t,r){return t||(r?Ns[r]:$s(e))}function Cs(e,t={},r=8){const n={},a=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set;for(const r of e){const e=t[r];void 0===e||a.has(e)||(n[r]=e,a.add(e)),l.add(r)}const i=0===Object.keys(t).length;for(const l of e){if(void 0!==n[l])continue;if(!i&&l in t)continue;const e=Array.from({length:r},(e,t)=>t).find(e=>!a.has(e));if(void 0===e)break;n[l]=e,a.add(e)}return n}function Ls(e,t,r=8){if(void 0!==e[t]){const{[t]:r,...n}=e;return n}const n=new Set(Object.values(e)),a=Array.from({length:r},(e,t)=>t).find(e=>!n.has(e));return void 0===a?e:{...e,[t]:a}}function Ds(e,t,r,n){return r||n?Ms(e,r,n):e<t?$s(e):ks.muted}function Ss(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function Ps(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function As(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function js(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 zs(e,t,{intervals:r=5,integer:n=!1,zero:a=!0}={}){const l=a?Math.min(0,e):e,i=a?Math.max(0,t):Math.max(e,t);if(!Number.isFinite(l)||!Number.isFinite(i)||i-l<=0){const e=Number.isFinite(l)&&!a?l:0;return{lo:e,hi:e+1,ticks:[e,e+1]}}const o=Math.max(1,Math.floor(r));let s=10**Math.floor(Math.log10((i-l)/o));for(;;){for(const e of[1,2,2.5,5]){const t=e*s;if(n&&!Number.isInteger(t))continue;const r=Math.floor(l/t)*t,a=Math.ceil(i/t)*t,c=Math.round((a-r)/t);if(c<=o){const e=Array.from({length:c+1},(e,n)=>Number((r+n*t).toPrecision(12)));return{lo:e[0],hi:e[c],ticks:e}}}s*=10}}function Fs(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),o=a>0&&l>0?Math.log10(a)-i:0,s=e=>{if(o<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/o*(t.to-t.from)};return s.domain=[l,a],s.range=t,s.ticks=e=>{if(e<2||o<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},s}function Ts(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function Es(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function Bs(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}function
|
|
614
|
-
return Te("div",{className:f,ref:N,children:/* @__PURE__ */Te("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:w})});const D=t.filter(Number.isFinite),S=D.every(Number.isInteger),P=void 0===l&&void 0===i?zs(Math.min(0,...D),Math.max(0,...D),{intervals:o+1,integer:S}):null,A=void 0!==l&&void 0===i?zs(l,Math.max(l,...D),{intervals:o+1,integer:S,zero:!1}):null,j=P?P.lo:l??Math.min(0,...D),z=P?P.hi:A?A.hi:i??js(Math.max(...D,0)),F=P?P.ticks:A?[j,...A.ticks.filter(e=>e>j)]:Ss([j,z],{from:0,to:1}).ticks(o+1),T={top:12,right:16,bottom:26,left:
|
|
613
|
+
/* @__PURE__ */Te("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */Te("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}var vs=8,ws=["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)"],Ns={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},ks={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function $s(e){return ws[e]??ks.muted}function Ms(e,t,r){return t||(r?Ns[r]:$s(e))}function Cs(e,t={},r=8){const n={},a=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set;for(const r of e){const e=t[r];void 0===e||a.has(e)||(n[r]=e,a.add(e)),l.add(r)}const i=0===Object.keys(t).length;for(const l of e){if(void 0!==n[l])continue;if(!i&&l in t)continue;const e=Array.from({length:r},(e,t)=>t).find(e=>!a.has(e));if(void 0===e)break;n[l]=e,a.add(e)}return n}function Ls(e,t,r=8){if(void 0!==e[t]){const{[t]:r,...n}=e;return n}const n=new Set(Object.values(e)),a=Array.from({length:r},(e,t)=>t).find(e=>!n.has(e));return void 0===a?e:{...e,[t]:a}}function Ds(e,t,r,n){return r||n?Ms(e,r,n):e<t?$s(e):ks.muted}function Ss(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function Ps(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function As(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function js(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 zs(e,t,{intervals:r=5,integer:n=!1,zero:a=!0}={}){const l=a?Math.min(0,e):e,i=a?Math.max(0,t):Math.max(e,t);if(!Number.isFinite(l)||!Number.isFinite(i)||i-l<=0){const e=Number.isFinite(l)&&!a?l:0;return{lo:e,hi:e+1,ticks:[e,e+1]}}const o=Math.max(1,Math.floor(r));let s=10**Math.floor(Math.log10((i-l)/o));for(;;){for(const e of[1,2,2.5,5]){const t=e*s;if(n&&!Number.isInteger(t))continue;const r=Math.floor(l/t)*t,a=Math.ceil(i/t)*t,c=Math.round((a-r)/t);if(c<=o){const e=Array.from({length:c+1},(e,n)=>Number((r+n*t).toPrecision(12)));return{lo:e[0],hi:e[c],ticks:e}}}s*=10}}function Fs(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),o=a>0&&l>0?Math.log10(a)-i:0,s=e=>{if(o<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/o*(t.to-t.from)};return s.domain=[l,a],s.range=t,s.ticks=e=>{if(e<2||o<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},s}function Ts(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function Es(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function Bs(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}function Os(e,t,{fontSize:r=11,gap:n=8}={}){const a=e.reduce((e,t)=>Math.max(e,t.length),0);return Math.max(t,Math.ceil(.62*a*r+n+2))}function Is(e,t=720){const[r,n]=Ne(t);return Me(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&n(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function Rs(e,t,r){const n=(t/2+8).toFixed(1),a=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${n}px), calc(100% - 184px))`;var t};return e<=r/2?{left:a(e)}:{right:a(r-e)}}function Ws({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:o=4,formatValue:s,yAxisLabel:c,xTickAnchor:d="center",children:u,overlay:h,tooltip:m,onSelect:p,ariaLabel:g,className:f,emptyLabel:b}){const y=Q().charts,x=J(),v=s??(e=>ne(e,x)),w=b??y.noData,N=ke(null),k=Is(N),$=n??k,[M,C]=Ne(null),L=ve();if(Me(()=>{if(null!==M)return R(e=>"Escape"===e.key&&(C(null),!0))},[M]),0===e.length||!t.some(Number.isFinite))/* @__PURE__ */
|
|
614
|
+
return Te("div",{className:f,ref:N,children:/* @__PURE__ */Te("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:w})});const D=t.filter(Number.isFinite),S=D.every(Number.isInteger),P=void 0===l&&void 0===i?zs(Math.min(0,...D),Math.max(0,...D),{intervals:o+1,integer:S}):null,A=void 0!==l&&void 0===i?zs(l,Math.max(l,...D),{intervals:o+1,integer:S,zero:!1}):null,j=P?P.lo:l??Math.min(0,...D),z=P?P.hi:A?A.hi:i??js(Math.max(...D,0)),F=P?P.ticks:A?[j,...A.ticks.filter(e=>e>j)]:Ss([j,z],{from:0,to:1}).ticks(o+1),T={top:12,right:16,bottom:26,left:Os(F.map(v),48)+(c?10:0)},E=T.left,B=Math.max(E+1,$-T.right),O=T.top,I=r-T.bottom,W=Ss([j,z],{from:I,to:O}),K=Ps(e.length,{from:E,to:B},a),_=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor($/84))));/* @__PURE__ */
|
|
615
615
|
return Ee("div",{className:`relative ${f??""}`,ref:N,children:[
|
|
616
616
|
/* @__PURE__ */Ee("svg",{width:"100%",height:r,viewBox:`0 0 ${$} ${r}`,role:"img","aria-label":g,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:t=>{if(p&&null!==M&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void p(M);if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;C(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
|
|
617
|
-
/* @__PURE__ */Te("defs",{children:/* @__PURE__ */Te("clipPath",{id:L,children:/* @__PURE__ */Te("rect",{x:E,y:
|
|
618
|
-
/* @__PURE__ */Te("line",{x1:E,y1:W(Math.max(j,0)),x2:B,y2:W(Math.max(j,0)),stroke:ks.axis,strokeWidth:1,shapeRendering:"crispEdges"}),F.map(e=>/* @__PURE__ */Te("text",{x:E-8,y:W(e)+4,textAnchor:"end",fontSize:11,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:v(e)},`t${e}`)),c&&/* @__PURE__ */Te("text",{x:14,y:(I
|
|
619
|
-
/* @__PURE__ */Te("g",{clipPath:`url(#${L})`,children:u({x:K,y:W,left:E,right:B,top:
|
|
617
|
+
/* @__PURE__ */Te("defs",{children:/* @__PURE__ */Te("clipPath",{id:L,children:/* @__PURE__ */Te("rect",{x:E,y:O,width:B-E,height:I-O})})}),F.map(e=>/* @__PURE__ */Te("line",{x1:E,y1:W(e),x2:B,y2:W(e),stroke:ks.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
618
|
+
/* @__PURE__ */Te("line",{x1:E,y1:W(Math.max(j,0)),x2:B,y2:W(Math.max(j,0)),stroke:ks.axis,strokeWidth:1,shapeRendering:"crispEdges"}),F.map(e=>/* @__PURE__ */Te("text",{x:E-8,y:W(e)+4,textAnchor:"end",fontSize:11,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:v(e)},`t${e}`)),c&&/* @__PURE__ */Te("text",{x:14,y:(O+I)/2,transform:`rotate(-90 14 ${(O+I)/2})`,textAnchor:"middle",fontSize:11,fill:ks.label,children:c}),
|
|
619
|
+
/* @__PURE__ */Te("g",{clipPath:`url(#${L})`,children:u({x:K,y:W,left:E,right:B,top:O,bottom:I,width:$,height:r,clipId:L,active:M})}),h?.({x:K,y:W,left:E,right:B,top:O,bottom:I,width:$,height:r,clipId:L,active:M}),e.map((e,t)=>t%_===0?/* @__PURE__ */Te("text",{x:"start"===d?K(t):K.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */Te("rect",{x:K.center(r)-(B-E)/e.length/2,y:O,width:(B-E)/e.length,height:I-O,fill:"transparent",onMouseEnter:()=>C(r),onClick:p?()=>p(r):void 0,style:p?{cursor:"pointer"}:void 0},`h${r}`))]}),m&&null!==M&&
|
|
620
620
|
/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 z-10",style:Rs(K.center(M),K.bandwidth,$),children:m(M)})]})}function Ks({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=Q().charts,o=a??i.loading,s=`${ve()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
|
|
621
621
|
return Te("div",{className:l,children:/* @__PURE__ */Ee("svg",{width:"100%",height:e,viewBox:`0 0 ${t} ${e}`,role:"img","aria-label":o,"aria-busy":"true",children:[
|
|
622
622
|
/* @__PURE__ */Te("defs",{children:/* @__PURE__ */Ee("linearGradient",{id:s,x1:"0",y1:"0",x2:"1",y2:"0",children:[
|
|
@@ -627,26 +627,26 @@ return Te("div",{className:l,children:/* @__PURE__ */Ee("svg",{width:"100%",heig
|
|
|
627
627
|
return Te("line",{x1:c,y1:r,x2:d,y2:r,stroke:ks.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */Te("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:ks.grid},`t${t}`)),"bars"===r?Array.from({length:n},(e,t)=>{const r=(d-c)/n,a=.35+.4*Math.abs(Math.sin(1.1*(t+1))),l=(h-u)*a;/* @__PURE__ */
|
|
628
628
|
return Te("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:ks.grid},t)}):/* @__PURE__ */Te("path",{d:`M48,${h} C${c+.25*(d-c)},${u+.35*(h-u)} ${c+.55*(d-c)},${u+.15*(h-u)} ${d},${u+.55*(h-u)} L${d},${h} Z`,fill:ks.grid}),
|
|
629
629
|
/* @__PURE__ */Te("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${s})`})]})})}var _s=Ce({highlighted:null,setHighlighted:()=>{}});function qs({children:e}){const[t,r]=Ne(null),n=$e(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
|
|
630
|
-
return Te(_s.Provider,{value:n,children:e})}function
|
|
631
|
-
return Ee("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${i?"":"bg-white shadow-xl ring-1 ring-black/5"} ${l??""}`,style:i?
|
|
632
|
-
/* @__PURE__ */Te("ul",{className:"m-0 flex list-none flex-col gap-
|
|
630
|
+
return Te(_s.Provider,{value:n,children:e})}function Us(){return Pe(_s)}function Hs(e,t,r=.22){return null===t?null:t===e?1:r}function Vs(e,t="none"){if("none"===t||0===e.length)return null;if("last"===t){for(let t=e.length-1;t>=0;t-=1)if("number"==typeof e[t]&&Number.isFinite(e[t]))return t;return null}let r=null;return e.forEach((n,a)=>{if("number"!=typeof n||!Number.isFinite(n))return;if(null===r)return void(r=a);const l=e[r];("max"===t?n>l:n<l)&&(r=a)}),r}function Ys({variant:e="solid",title:t,rows:r,footnote:n,emphasisKey:a,className:l}){const i="glass"===e;/* @__PURE__ */
|
|
631
|
+
return Ee("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${i?"":"bg-white shadow-xl ring-1 ring-black/5"} ${l??""}`,style:i?O():void 0,children:[t&&/* @__PURE__ */Te("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
|
|
632
|
+
/* @__PURE__ */Te("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:r.map(e=>/* @__PURE__ */Ee("li",{className:"flex items-center gap-3",style:a&&e.key!==a?{opacity:.45}:void 0,children:[
|
|
633
633
|
/* @__PURE__ */Te("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??ks.muted}}),
|
|
634
634
|
/* @__PURE__ */Te("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
|
|
635
|
-
/* @__PURE__ */Te("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */Te("p",{className:"mt-2 text-2xs text-gray-500",children:n})]})}function Gs({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=220,width:l,max:i,formatValue:o,yAxisLabel:s,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:b="none",valueLabels:y=!1,onSelect:x,min:v,formatTooltipValue:w,tooltipLabels:N}){const k=ve(),{highlighted:$}=
|
|
635
|
+
/* @__PURE__ */Te("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */Te("p",{className:"mt-2 text-2xs text-gray-500",children:n})]})}function Gs({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=220,width:l,max:i,formatValue:o,yAxisLabel:s,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:b="none",valueLabels:y=!1,onSelect:x,min:v,formatTooltipValue:w,tooltipLabels:N}){const k=ve(),{highlighted:$}=Us(),M=Q().charts,C=J(),L=o??(e=>ne(e,C)),D=w??L;if(h)/* @__PURE__ */return Te(Ks,{height:a,width:l,variant:"bars",className:c});const S=(e,t)=>{const r=e.pointColors?.[t];if(r)return r;const n=e.pointTones?.[t];return n?Ns[n]:Ms(e.slot,e.color,e.tone)},P=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),A=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},j=t.map((e,t)=>P.reduce((e,r)=>e+A(r,t),0)),z=t.map((e,t)=>P.reduce((e,r)=>e+Math.max(0,A(r,t)),0)),F=t.map((e,t)=>P.reduce((e,r)=>e+Math.min(0,A(r,t)),0)),T=r&&"percent"===n,E=(e,t)=>j[t]>0?e/j[t]:null,B=T?[1]:r?[...z,...F]:P.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
|
|
636
636
|
return Te(Ws,{labels:t,values:B,height:a,width:l,max:T?1:i,min:T?void 0:v,formatValue:T?e=>le(Math.round(100*e),0,C):L,yAxisLabel:s,className:c,emptyLabel:d,onSelect:x,ariaLabel:M.acrossCategories(P.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */Te(Ys,{title:N?.[e]??t[e],rows:P.map(t=>({key:t.key,label:t.label,color:S(t,e),value:Number.isFinite(t.data[e])?T?`${le(100*(E(t.data[e],e)??0),1,C)} · ${D(t.data[e])}`:D(t.data[e]):void 0})),footnote:T?M.inCategory(D(j[e])):void 0}),overlay:y&&!T?({x:e,y:n})=>/* @__PURE__ */Te("g",{pointerEvents:"none",children:t.map((t,a)=>{if(r){if(!P.some(e=>Number.isFinite(e.data[a])))return null;const t=P.reduce((e,t)=>e+A(t,a),0),r=t>=0?z[a]:F[a];/* @__PURE__ */
|
|
637
637
|
return Te("text",{"data-value-label":"true",x:e.center(a),y:t>=0?n(r)-4:n(r)+12,textAnchor:"middle",fontSize:11,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:L(t)},`v${a}`)}const l=e.bandwidth/Math.max(1,P.length);return P.map((t,r)=>{const i=t.data[a];if(!Number.isFinite(i))return null;const o=i;/* @__PURE__ */
|
|
638
638
|
return Te("text",{"data-value-label":"true",x:e(a)+r*l+l/2,y:o>=0?n(o)-4:n(o)+12,textAnchor:"middle",fontSize:11,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:L(o)},`v${t.key}-${a}`)})})}):void 0,children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,o=Vs(r?j:P[0]?.data??[],b),s=l??(i>=0?i:o);/* @__PURE__ */
|
|
639
639
|
return Ee("g",{children:[
|
|
640
|
-
/* @__PURE__ */Te(li,{id:k,glow:p}),t.map((t,a)=>{const l=e.bandwidth/(r?1:Math.max(1,P.length));let i=0,o=0;const c=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return P.map((t,d)=>{const h=t.data[a];if(!Number.isFinite(h))return null;const f=T?E(h,a):h;if(null===f)return null;const b=S(t,a),y=r?e(a):e(a)+d*l;let x,v,w=!0;if(r){const e=f>=0?i:o,t=e+f;f>=0?i=t:o=t,x=n(Math.max(e,t)),v=n(Math.min(e,t)),w=0===e}else x=Math.min(n(f),c),v=Math.max(n(f),c);const N=Math.max(0,v-x-(r&&!w?2:0)),M=null===s||s===a,C=M?b:g?ks.muted:b,L=
|
|
641
|
-
return Te("rect",{x:y,y:x,width:Math.max(1,l),height:N,rx:u,fill:C,fillOpacity:L??(M?1:g?.32:.45),filter:p&&s===a?`url(#${Jl(k)})`:void 0,className:"rosh-viz-mark"+(m?` ${oi.rise}`:""),style:m?si(a*(r?1:P.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */Te("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:ks.axis,strokeWidth:1})]})}})}var Xs=e=>e.toFixed(2);function Zs(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Xs(e)},${Xs(t)}`).join(" ")}function Js(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Xs(e.start)},${Xs(e.y)}`,t+=` L${Xs(e.end)},${Xs(e.y)}`}),t}function Qs(e){if(e.length<3)return Zs(e);const t=e.length,r=[],n=[];for(let a=0;a<t-1;a+=1){const t=e[a+1][0]-e[a][0];r.push(t),n.push(0===t?0:(e[a+1][1]-e[a][1])/t)}const a=[n[0]];for(let e=1;e<t-1;e+=1)a.push(n[e-1]*n[e]<=0?0:(n[e-1]+n[e])/2);a.push(n[t-2]);for(let e=0;e<t-1;e+=1){if(0===n[e]){a[e]=0,a[e+1]=0;continue}const t=a[e]/n[e],r=a[e+1]/n[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);a[e]=i*t*n[e],a[e+1]=i*r*n[e]}}let l=`M${Xs(e[0][0])},${Xs(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${Xs(e[n][0]+t)},${Xs(e[n][1]+a[n]*t)} ${Xs(e[n+1][0]-t)},${Xs(e[n+1][1]-a[n+1]*t)} ${Xs(e[n+1][0])},${Xs(e[n+1][1])}`}return l}function ec(e,t=0){if(e.length<3)return Zs(e);const r=e.map(e=>e[1]),n=Math.min(...r),a=Math.max(...r),l=e=>Math.min(a,Math.max(n,e)),i=(1-t)/6;let o=`M${Xs(e[0][0])},${Xs(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],n=e[t],a=e[t+1],s=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(s[0]-n[0])*i,h=l(a[1]-(s[1]-n[1])*i);o+=` C${Xs(c)},${Xs(d)} ${Xs(u)},${Xs(h)} ${Xs(a[0])},${Xs(a[1])}`}return o}function tc(e){if(e.length<2)return Zs(e);let t=`M${Xs(e[0][0])},${Xs(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],o=(n+l)/2;t+=` C${Xs(o)},${Xs(a)} ${Xs(o)},${Xs(i)} ${Xs(l)},${Xs(i)}`}return t}function rc(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Xs(e[0][0])},${Xs(e[0][1])}`:"monotone"===t?Qs(e):"spline"===t?ec(e,r):"bump"===t?tc(e):Zs(e)}function nc(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${Xs(a[0])},${Xs(r)} L${Xs(n[0])},${Xs(r)} Z`}function ac(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Xs(e)},${Xs(t)}`).join(" L")} Z`}function lc(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const o=a+2*i*Math.PI/n;return[e+r*Math.cos(o),t+r*Math.sin(o)]})}function ic(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${ic(e,t,r,n,a,l)} ${ic(e,t,r,n,l,a+2*Math.PI)}`}const o=Math.abs(i)>Math.PI?1:0,s=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=s(n,a),[u,h]=s(n,l);if(r<=0)return`M${Xs(e)},${Xs(t)} L${Xs(c)},${Xs(d)} A${Xs(n)},${Xs(n)} 0 ${o} 1 ${Xs(u)},${Xs(h)} Z`;const[m,p]=s(r,l),[g,f]=s(r,a);return`M${Xs(c)},${Xs(d)} A${Xs(n)},${Xs(n)} 0 ${o} 1 ${Xs(u)},${Xs(h)} L${Xs(m)},${Xs(p)} A${Xs(r)},${Xs(r)} 0 ${o} 0 ${Xs(g)},${Xs(f)} Z`}function oc({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:o,centerLabel:s,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=Q().charts,g=J(),f=o??(e=>ne(e,g)),b=i??p.other,y=m??p.nothingToBreakDown,x=ve(),[v,w]=Ne(null),{highlighted:N}=
|
|
640
|
+
/* @__PURE__ */Te(li,{id:k,glow:p}),t.map((t,a)=>{const l=e.bandwidth/(r?1:Math.max(1,P.length));let i=0,o=0;const c=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return P.map((t,d)=>{const h=t.data[a];if(!Number.isFinite(h))return null;const f=T?E(h,a):h;if(null===f)return null;const b=S(t,a),y=r?e(a):e(a)+d*l;let x,v,w=!0;if(r){const e=f>=0?i:o,t=e+f;f>=0?i=t:o=t,x=n(Math.max(e,t)),v=n(Math.min(e,t)),w=0===e}else x=Math.min(n(f),c),v=Math.max(n(f),c);const N=Math.max(0,v-x-(r&&!w?2:0)),M=null===s||s===a,C=M?b:g?ks.muted:b,L=Hs(t.key,$);/* @__PURE__ */
|
|
641
|
+
return Te("rect",{x:y,y:x,width:Math.max(1,l),height:N,rx:u,fill:C,fillOpacity:L??(M?1:g?.32:.45),filter:p&&s===a?`url(#${Jl(k)})`:void 0,className:"rosh-viz-mark"+(m?` ${oi.rise}`:""),style:m?si(a*(r?1:P.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */Te("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:ks.axis,strokeWidth:1})]})}})}var Xs=e=>e.toFixed(2);function Zs(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Xs(e)},${Xs(t)}`).join(" ")}function Js(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Xs(e.start)},${Xs(e.y)}`,t+=` L${Xs(e.end)},${Xs(e.y)}`}),t}function Qs(e){if(e.length<3)return Zs(e);const t=e.length,r=[],n=[];for(let a=0;a<t-1;a+=1){const t=e[a+1][0]-e[a][0];r.push(t),n.push(0===t?0:(e[a+1][1]-e[a][1])/t)}const a=[n[0]];for(let e=1;e<t-1;e+=1)a.push(n[e-1]*n[e]<=0?0:(n[e-1]+n[e])/2);a.push(n[t-2]);for(let e=0;e<t-1;e+=1){if(0===n[e]){a[e]=0,a[e+1]=0;continue}const t=a[e]/n[e],r=a[e+1]/n[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);a[e]=i*t*n[e],a[e+1]=i*r*n[e]}}let l=`M${Xs(e[0][0])},${Xs(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${Xs(e[n][0]+t)},${Xs(e[n][1]+a[n]*t)} ${Xs(e[n+1][0]-t)},${Xs(e[n+1][1]-a[n+1]*t)} ${Xs(e[n+1][0])},${Xs(e[n+1][1])}`}return l}function ec(e,t=0){if(e.length<3)return Zs(e);const r=e.map(e=>e[1]),n=Math.min(...r),a=Math.max(...r),l=e=>Math.min(a,Math.max(n,e)),i=(1-t)/6;let o=`M${Xs(e[0][0])},${Xs(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],n=e[t],a=e[t+1],s=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(s[0]-n[0])*i,h=l(a[1]-(s[1]-n[1])*i);o+=` C${Xs(c)},${Xs(d)} ${Xs(u)},${Xs(h)} ${Xs(a[0])},${Xs(a[1])}`}return o}function tc(e){if(e.length<2)return Zs(e);let t=`M${Xs(e[0][0])},${Xs(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],o=(n+l)/2;t+=` C${Xs(o)},${Xs(a)} ${Xs(o)},${Xs(i)} ${Xs(l)},${Xs(i)}`}return t}function rc(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Xs(e[0][0])},${Xs(e[0][1])}`:"monotone"===t?Qs(e):"spline"===t?ec(e,r):"bump"===t?tc(e):Zs(e)}function nc(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${Xs(a[0])},${Xs(r)} L${Xs(n[0])},${Xs(r)} Z`}function ac(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Xs(e)},${Xs(t)}`).join(" L")} Z`}function lc(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const o=a+2*i*Math.PI/n;return[e+r*Math.cos(o),t+r*Math.sin(o)]})}function ic(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${ic(e,t,r,n,a,l)} ${ic(e,t,r,n,l,a+2*Math.PI)}`}const o=Math.abs(i)>Math.PI?1:0,s=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=s(n,a),[u,h]=s(n,l);if(r<=0)return`M${Xs(e)},${Xs(t)} L${Xs(c)},${Xs(d)} A${Xs(n)},${Xs(n)} 0 ${o} 1 ${Xs(u)},${Xs(h)} Z`;const[m,p]=s(r,l),[g,f]=s(r,a);return`M${Xs(c)},${Xs(d)} A${Xs(n)},${Xs(n)} 0 ${o} 1 ${Xs(u)},${Xs(h)} L${Xs(m)},${Xs(p)} A${Xs(r)},${Xs(r)} 0 ${o} 0 ${Xs(g)},${Xs(f)} Z`}function oc({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:o,centerLabel:s,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=Q().charts,g=J(),f=o??(e=>ne(e,g)),b=i??p.other,y=m??p.nothingToBreakDown,x=ve(),[v,w]=Ne(null),{highlighted:N}=Us(),k=ke(null),$=Is(k,Number.POSITIVE_INFINITY),M=e.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===M.length)/* @__PURE__ */return Te("p",{className:`text-sm text-gray-500 ${h??""}`,children:y});const C=[...M].sort((e,t)=>t.value-e.value),L=C.slice(0,l),D=C.slice(l),S=D.length>0?[...L,{key:"__other__",label:b,value:D.reduce((e,t)=>e+t.value,0),slot:-1,color:ks.muted}]:L,P=e=>Ms(e.slot,e.color,e.tone),A=S.reduce((e,t)=>e+t.value,0),j=Math.ceil(.62*Math.max(...S.map(e=>String(e.label).length),4)*11)+24,z="outside"===d&&$>=120+2*j,F=z?j:0,T=z?Math.max(120,Math.min(r,$-2*F)):r,E=T+2*F,B=F+T/2,O=T/2,I=T/2-12,R=n??("ring"===t?.58*I:0),W=Ts(S.length,a),K=Math.max(...S.map(e=>e.value)),_=e=>R+(I-R)*Math.sqrt(Math.max(0,e)/K);let q=-Math.PI/2;const U=(()=>{if(!z)return[];let e=-Math.PI/2;const r=S.map((r,n)=>{const l="rose"===t?Ts(S.length,a).step:r.value/A*Math.PI*2,i="rose"===t?Ts(S.length,a).center(n):e+l/2;e+=l;const o="rose"===t?_(r.value):I;return{key:r.key,label:r.label,share:r.value/A,right:Math.cos(i)>=0,anchor:[B+o*Math.cos(i),O+o*Math.sin(i)],y:O+(o+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u),n=Math.max(1,Math.floor((T-11-13)/26)+1),l=/* @__PURE__ */new Set;for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,n).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<26&&(t[e].y=t[e-1].y+26);for(let e=t.length-1;e>=0;e-=1){const r=e===t.length-1?T-13:t[e+1].y-26;t[e].y=Math.min(t[e].y,r)}t.forEach((e,r)=>{e.y=Math.max(e.y,0===r?11:t[r-1].y+26),l.add(e.key)})}return r.filter(e=>l.has(e.key))})(),H=(e,t)=>null!==v?v!==e:null!==N&&N!==t,V=null!==v?S[v]:void 0;/* @__PURE__ */
|
|
642
642
|
return Ee("div",{className:`relative ${h??""}`,ref:k,children:[
|
|
643
643
|
/* @__PURE__ */Ee("svg",{width:"100%",height:T,viewBox:`0 0 ${E} ${T}`,role:"img","aria-labelledby":x,onMouseLeave:()=>w(null),children:[
|
|
644
|
-
/* @__PURE__ */Te("title",{id:x,children:p.breakdown(f(A),S.length)}),S.map((e,r)=>{const n=P(e),l="rose"===t?W(r):q,i="rose"===t?W.step:e.value/A*Math.PI*2-a;"rose"!==t&&(q+=e.value/A*Math.PI*2);const o=l+Math.max(.001,i),s="rose"===t?_(e.value):
|
|
645
|
-
return Te("path",{d:ic(B,
|
|
644
|
+
/* @__PURE__ */Te("title",{id:x,children:p.breakdown(f(A),S.length)}),S.map((e,r)=>{const n=P(e),l="rose"===t?W(r):q,i="rose"===t?W.step:e.value/A*Math.PI*2-a;"rose"!==t&&(q+=e.value/A*Math.PI*2);const o=l+Math.max(.001,i),s="rose"===t?_(e.value):I;/* @__PURE__ */
|
|
645
|
+
return Te("path",{d:ic(B,O,R,s,l,o),fill:n,fillOpacity:H(r,e.key)?.4:1,stroke:ks.surface,strokeWidth:1,className:c?oi.sweep:void 0,style:c?si(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),U.map(e=>{const t=e.right?E-6:6,r=e.right?B+I+14:B-I-14;/* @__PURE__ */
|
|
646
646
|
return Ee("g",{children:[
|
|
647
647
|
/* @__PURE__ */Te("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${r},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:ks.grid,strokeWidth:1}),
|
|
648
648
|
/* @__PURE__ */Te("text",{x:t,y:e.y-2,fontSize:11,fill:ks.label,textAnchor:e.right?"end":"start",children:e.label}),
|
|
649
|
-
/* @__PURE__ */Te("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:ks.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:le(100*e.share,1,g)})]},`lbl-${e.key}`)}),s&&R>0&&/* @__PURE__ */Te("text",{x:B,y:
|
|
649
|
+
/* @__PURE__ */Te("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:ks.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:le(100*e.share,1,g)})]},`lbl-${e.key}`)}),s&&R>0&&/* @__PURE__ */Te("text",{x:B,y:O+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:ks.label,children:s})]}),V&&null!==v&&/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Te(Ys,{title:V.label,rows:[{key:"value",label:p.value,color:P(V),value:f(V.value)},{key:"share",label:p.share,color:ks.muted,value:le(V.value/A*100,1,g)}]})}),
|
|
650
650
|
/* @__PURE__ */Te("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:S.map((e,t)=>/* @__PURE__ */Ee("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
651
651
|
/* @__PURE__ */Te("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:P(e)}}),
|
|
652
652
|
/* @__PURE__ */Te("span",{className:"flex-1 truncate",children:e.label}),
|
|
@@ -697,12 +697,12 @@ return Te(ga,{groups:pc,children:/* @__PURE__ */Te("div",{className:"h-full over
|
|
|
697
697
|
/* @__PURE__ */Te("th",{className:"px-4 py-2 font-medium",children:"Status"}),
|
|
698
698
|
/* @__PURE__ */Te("th",{className:"px-4 py-2 font-medium text-right",children:"Actions"})]})}),
|
|
699
699
|
/* @__PURE__ */Te("tbody",{className:"divide-y divide-gray-100",children:gc.map(e=>/* @__PURE__ */Ee("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
|
|
700
|
-
/* @__PURE__ */Ee("td",{className:"px-4 py-
|
|
700
|
+
/* @__PURE__ */Ee("td",{className:"px-4 py-3",children:[
|
|
701
701
|
/* @__PURE__ */Te("div",{className:"font-medium text-gray-900",children:e.name}),
|
|
702
702
|
/* @__PURE__ */Te("div",{className:"text-xs text-gray-400",children:e.email})]}),
|
|
703
|
-
/* @__PURE__ */Te("td",{className:"px-4 py-
|
|
704
|
-
/* @__PURE__ */Te("td",{className:"px-4 py-
|
|
705
|
-
/* @__PURE__ */Te("td",{className:"px-4 py-
|
|
703
|
+
/* @__PURE__ */Te("td",{className:"px-4 py-3",children:e.role}),
|
|
704
|
+
/* @__PURE__ */Te("td",{className:"px-4 py-3",children:/* @__PURE__ */Te(ba,{status:e.status})}),
|
|
705
|
+
/* @__PURE__ */Te("td",{className:"px-4 py-3 text-right",children:/* @__PURE__ */Te(g,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
|
|
706
706
|
/* @__PURE__ */Ee("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
|
|
707
707
|
/* @__PURE__ */Te("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
|
|
708
708
|
/* @__PURE__ */Te(ss,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function bc(){/* @__PURE__ */
|
|
@@ -720,7 +720,7 @@ return Te("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
|
|
|
720
720
|
/* @__PURE__ */Te(ka,{header:"Preferences",children:/* @__PURE__ */Ee("div",{className:"space-y-4",children:[
|
|
721
721
|
/* @__PURE__ */Ee("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
722
722
|
/* @__PURE__ */Te(mt,{label:"Country",htmlFor:"country",children:/* @__PURE__ */Te(st,{value:a,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
|
|
723
|
-
/* @__PURE__ */Te(mt,{label:"Plan",children:/* @__PURE__ */Ee("div",{className:"space-y-
|
|
723
|
+
/* @__PURE__ */Te(mt,{label:"Plan",children:/* @__PURE__ */Ee("div",{className:"space-y-2 pt-1",children:[
|
|
724
724
|
/* @__PURE__ */Te(ht,{name:"plan",checked:"free"===e,onChange:()=>t("free"),label:"Free"}),
|
|
725
725
|
/* @__PURE__ */Te(ht,{name:"plan",checked:"pro"===e,onChange:()=>t("pro"),label:"Pro"}),
|
|
726
726
|
/* @__PURE__ */Te(ht,{name:"plan",checked:"team"===e,onChange:()=>t("team"),label:"Team"})]})})]}),
|
|
@@ -754,7 +754,7 @@ return Te("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
|
|
|
754
754
|
/* @__PURE__ */Ee("span",{children:[e.name," ",
|
|
755
755
|
/* @__PURE__ */Ee("span",{className:"text-gray-400",children:["×",e.qty]})]}),
|
|
756
756
|
/* @__PURE__ */Ee("span",{children:["$",e.qty*e.price]})]},e.name))}),
|
|
757
|
-
/* @__PURE__ */Ee("div",{className:"mt-3 space-y-
|
|
757
|
+
/* @__PURE__ */Ee("div",{className:"mt-3 space-y-2 border-t border-gray-100 pt-3 text-sm text-gray-600",children:[
|
|
758
758
|
/* @__PURE__ */Ee("div",{className:"flex justify-between",children:[
|
|
759
759
|
/* @__PURE__ */Te("span",{children:"Subtotal"}),
|
|
760
760
|
/* @__PURE__ */Ee("span",{children:["$",a]})]}),
|
|
@@ -778,7 +778,7 @@ return Te("div",{className:"h-full",children:/* @__PURE__ */Te(t,{side:"left",de
|
|
|
778
778
|
/* @__PURE__ */Ee("div",{className:"flex min-w-0 flex-1 flex-col overflow-auto",children:[
|
|
779
779
|
/* @__PURE__ */Ee("div",{className:"flex items-center justify-between gap-3 border-b border-gray-200 p-4",children:[
|
|
780
780
|
/* @__PURE__ */Te("h2",{className:"truncate text-base font-semibold text-gray-900",children:n.subject}),
|
|
781
|
-
/* @__PURE__ */Ee("div",{className:"flex shrink-0 gap-
|
|
781
|
+
/* @__PURE__ */Ee("div",{className:"flex shrink-0 gap-2",children:[
|
|
782
782
|
/* @__PURE__ */Te(g,{variant:"ghost",size:"sm",children:"Archive"}),
|
|
783
783
|
/* @__PURE__ */Te(g,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
|
|
784
784
|
/* @__PURE__ */Ee("div",{className:"flex items-center gap-3 border-b border-gray-100 p-4",children:[
|
|
@@ -839,7 +839,7 @@ return Te(Be,{children:e(Q().errors)})}var Tc=class extends je{state={error:null
|
|
|
839
839
|
/* @__PURE__ */Te("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */Te(zc,{code:500,actions:/* @__PURE__ */Ee(Be,{children:[
|
|
840
840
|
/* @__PURE__ */Te(g,{onClick:this.reset,children:/* @__PURE__ */Te(Fc,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */Ee("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
|
|
841
841
|
/* @__PURE__ */Te("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */Te(Fc,{pick:e=>e.details})}),
|
|
842
|
-
/* @__PURE__ */Te("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 Ec(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Bc(e){const t=Ec();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function
|
|
842
|
+
/* @__PURE__ */Te("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 Ec(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Bc(e){const t=Ec();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function Oc(){return Ec()?.matches??!1}function Ic(){return!1}function Rc(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),l=Math.min(t,r,n);let i=0,o=0;const s=(a+l)/2;if(a!==l){const e=a-l;o=s>.5?e/(2-a-l):e/(a+l),i=a===t?((r-n)/e+(r<n?6:0))/6:a===r?((n-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*o,100*s]}function Wc(e,t,r){r/=100;const n=(t/=100)*Math.min(r,1-r),a=t=>{const a=(t+e/30)%12;return r-n*Math.max(Math.min(a-3,9-a,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(a(0))}${l(a(8))}${l(a(4))}`}function Kc(e){const t=e||"system";return"system"===t?Oc()?"dark":"light":t}function _c(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Rc(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Wc(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Wc(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Wc(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Wc(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Wc(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Wc(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Wc(r,Math.min(n+20,100),Math.min(a+46,98)))}else t.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(e=>t.style.removeProperty(e))}function qc(e,t,r,n,a){const l=document.documentElement;if(e){const e=e=>`${parseInt(e.slice(1,3),16)} ${parseInt(e.slice(3,5),16)} ${parseInt(e.slice(5,7),16)}`;if(t&&l.style.setProperty("--custom-bg-color",t),r&&(l.style.setProperty("--window-header-rgb",e(r)),l.style.setProperty("--window-footer-rgb",e(r))),n&&l.style.setProperty("--window-content-rgb",e(n)),a){l.style.setProperty("--custom-button-color",a);const[e,t,r]=Rc(a);l.style.setProperty("--custom-button-hover",Wc(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var Uc=["square","soft","round"];function Hc(e){return"square"===e||"round"===e?e:"soft"}function Vc(e){const t=Hc(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function Yc(e){const t="string"==typeof e&&e?e:null;ye(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function Gc(e){"corners"in e&&Vc(e.corners),"icon_set"in e&&Yc(e.icon_set),document.documentElement.setAttribute("data-theme",Kc(e.theme)),_c(e.accent_color??null),qc(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 Xc(){const{prefs:e}=s(),t=ze(Bc,Oc,Ic),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,l=e.custom_title_color||null,i=e.custom_window_color||null,o=e.custom_button_color||null,c=Hc(e.corners),d="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,u="system"===r?t?"dark":"light":r;return Me(()=>(document.documentElement.setAttribute("data-theme",u),()=>document.documentElement.removeAttribute("data-theme")),[u]),Me(()=>(Vc(c),()=>document.documentElement.removeAttribute("data-corners")),[c]),Me(()=>(Yc(d),()=>Yc(null)),[d]),Me(()=>{_c(n)},[n]),Me(()=>{qc(n,a,l,i,o)},[n,a,l,i,o]),{theme:r,resolved:u,corners:c,iconSet:d}}function Zc(e){const t=Math.max(0,...e.map(e=>[...e].reduce((e,t)=>e+((t.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(t+3.5))/10}function Jc({size:e="sm",className:t=""}){const{language:r,languages:n,setLanguage:l}=a(),i=Q().language;return n.length<2?null:/* @__PURE__ */Ee("span",{className:`inline-flex items-center gap-2 text-gray-500 ${t}`.trim(),children:[
|
|
843
843
|
/* @__PURE__ */Te(be,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
|
|
844
844
|
/* @__PURE__ */Te("span",{className:"block",style:{width:`${Zc(n.map(e=>e.name))}em`},children:/* @__PURE__ */Te(st,{size:e,touchSize:e,"aria-label":i.title,value:r,onChange:e=>{l(e)},options:n.map(({tag:e,name:t})=>({value:e,label:t,lang:e}))})})]})}function Qc({description:e,className:t=""}){const{language:r,languages:n,setLanguage:l}=a(),i=Q().language;return n.length<2?null:/* @__PURE__ */Ee("div",{className:`space-y-4 ${t}`.trim(),children:[
|
|
845
845
|
/* @__PURE__ */Ee("div",{children:[
|
|
@@ -858,24 +858,24 @@ return Ee("li",{className:"grid gap-1",children:[
|
|
|
858
858
|
return Ee("div",{className:o,children:[n&&/* @__PURE__ */Te("p",{className:"text-sm font-medium text-gray-700",children:n}),
|
|
859
859
|
/* @__PURE__ */Te("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=sd(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=Ns[g],b=[t?.length?t.map(e=>`${e.label} ${u(e.value)}`).join(" · "):"",a??"",null!=r?(p?c.objectiveMet:c.objectiveMissed)(u(r)):""].filter(Boolean).join(" · ");/* @__PURE__ */
|
|
860
860
|
return Ee("div",{className:o,children:[
|
|
861
|
-
/* @__PURE__ */Ee("div",{className:"mb-
|
|
861
|
+
/* @__PURE__ */Ee("div",{className:"mb-2 flex items-baseline justify-between gap-3",children:[
|
|
862
862
|
/* @__PURE__ */Te("span",{className:"text-sm font-medium text-gray-700",children:n}),
|
|
863
863
|
/* @__PURE__ */Te("span",{className:"text-sm font-semibold tabular-nums",style:{color:f},children:u(e)})]}),
|
|
864
864
|
/* @__PURE__ */Ee("div",{className:"relative w-full rounded-full bg-gray-200",style:{height:12},role:"meter","aria-valuenow":Number((100*m).toFixed(2)),"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":u(e),"aria-label":n,children:[
|
|
865
|
-
/* @__PURE__ */Te("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */Te("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*sd(e.value)).toFixed(2)}%`,backgroundColor:Ns[e.tone??(0===r?g:"neutral")]}},`${e.label}-${r}`))}:{className:"h-full rounded-full",style:{width:`${(100*m).toFixed(2)}%`,backgroundColor:f}}),null!=r&&/* @__PURE__ */Te("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*sd(r)).toFixed(2)}%`,height:20,backgroundColor:ks.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */Te("p",{className:"mt-
|
|
865
|
+
/* @__PURE__ */Te("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */Te("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*sd(e.value)).toFixed(2)}%`,backgroundColor:Ns[e.tone??(0===r?g:"neutral")]}},`${e.label}-${r}`))}:{className:"h-full rounded-full",style:{width:`${(100*m).toFixed(2)}%`,backgroundColor:f}}),null!=r&&/* @__PURE__ */Te("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*sd(r)).toFixed(2)}%`,height:20,backgroundColor:ks.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */Te("p",{className:"mt-2 text-xs text-gray-500",children:b})]})}var dd={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function ud({label:e,value:t,unit:r,delta:n,deltaTone:a,trend:l,trendTone:i,footnote:o,className:s}){const c=Q().charts,d=J(),u=null==n?null:n>0?"up":n<0?"down":"flat",h=a?Ns[a]:void 0,m=i?Ns[i]:Ms(0);/* @__PURE__ */
|
|
866
866
|
return Ee("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${s??""}`,children:[
|
|
867
867
|
/* @__PURE__ */Te("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
868
|
-
/* @__PURE__ */Ee("span",{className:"flex items-baseline gap-
|
|
868
|
+
/* @__PURE__ */Ee("span",{className:"flex items-baseline gap-2",children:[
|
|
869
869
|
/* @__PURE__ */Te("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:t}),r&&/* @__PURE__ */Te("span",{className:"text-sm font-medium text-gray-500",children:r})]}),u&&/* @__PURE__ */Ee("span",{className:"text-xs font-medium",style:h?{color:h}:void 0,children:[
|
|
870
870
|
/* @__PURE__ */Te("span",{"aria-hidden":"true",children:dd[u].glyph})," ",ne(Math.abs(n),d),
|
|
871
|
-
/* @__PURE__ */Ee("span",{className:"sr-only",children:[" ",c[dd[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */Te(xs,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-
|
|
871
|
+
/* @__PURE__ */Ee("span",{className:"sr-only",children:[" ",c[dd[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */Te(xs,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-2 w-full"}),o&&/* @__PURE__ */Te("span",{className:"mt-1 text-xs text-gray-500",children:o})]})}function hd({shape:e,colour:t}){const r="shrink-0";switch(e){case"circle":/* @__PURE__ */
|
|
872
872
|
return Te("span",{className:`${r} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:t}});case"circle-outline":/* @__PURE__ */
|
|
873
873
|
return Te("span",{className:`${r} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:t}});case"rounded-square-outline":/* @__PURE__ */
|
|
874
874
|
return Te("span",{className:`${r} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:t}});case"square":/* @__PURE__ */
|
|
875
875
|
return Te("span",{className:`${r} h-2.5 w-2.5`,style:{backgroundColor:t}});case"bar":/* @__PURE__ */
|
|
876
876
|
return Te("span",{className:`${r} h-1 w-4 rounded-full`,style:{backgroundColor:t}});case"bar-vertical":/* @__PURE__ */
|
|
877
877
|
return Te("span",{className:`${r} h-3.5 w-1 rounded-full`,style:{backgroundColor:t}});default:/* @__PURE__ */
|
|
878
|
-
return Te("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function md({entries:e,interactive:t,fallbackSwatch:r,onClick:n}){const{highlighted:a,setHighlighted:l}=
|
|
878
|
+
return Te("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function md({entries:e,interactive:t,fallbackSwatch:r,onClick:n}){const{highlighted:a,setHighlighted:l}=Us();/* @__PURE__ */
|
|
879
879
|
return Te("ul",{className:"m-0 flex flex-wrap items-center gap-x-4 gap-y-1 p-0",children:e.map((e,i)=>{const o=t&&null!==a&&a!==e.key,s=/* @__PURE__ */Ee(Be,{children:[
|
|
880
880
|
/* @__PURE__ */Te(hd,{shape:e.swatch??r,colour:Ms(i,e.color,e.tone)}),e.label]});/* @__PURE__ */
|
|
881
881
|
return Te("li",{className:"list-none",children:t||n?/* @__PURE__ */Te("button",{type:"button",onClick:n?()=>n(e.key):void 0,"aria-pressed":n?Boolean(e.pressed):void 0,onMouseEnter:t?()=>l(e.key):void 0,onMouseLeave:t?()=>l(null):void 0,onFocus:t?()=>l(e.key):void 0,onBlur:t?()=>l(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(o?"opacity-40":""),children:s}):/* @__PURE__ */Te("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:s})},e.key)})})}function pd({title:e,subtitle:t,legend:r,table:n,tableLabel:a,busy:l=!1,loading:i=!1,skeletonVariant:o="area",skeletonHeight:s,interactiveLegend:c=!0,legendSwatch:d="rounded-square",onLegendClick:u,actions:h,children:m,className:p}){const g=Q().charts;/* @__PURE__ */
|
|
@@ -892,15 +892,15 @@ return Te("div",{className:o,children:/* @__PURE__ */Ee("svg",{ref:c,width:"100%
|
|
|
892
892
|
/* @__PURE__ */Te("path",{d:v,fill:ks.grid}),
|
|
893
893
|
/* @__PURE__ */Te("rect",{x:0,y:0,width:p(u),height:a,fill:ks.surface,fillOpacity:.72}),
|
|
894
894
|
/* @__PURE__ */Te("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:ks.surface,fillOpacity:.72}),
|
|
895
|
-
/* @__PURE__ */Te("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}var bd=12,yd=16,xd=26,vd=52,wd=e=>"number"==typeof e&&Number.isFinite(e);function Nd({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:o=0,max:s,yTickCount:c=4,formatValue:d,formatTooltipValue:u,tooltipLabels:h,yAxisLabel:m,referenceLines:p,labelEndpoints:g=!1,dots:f,dotVariant:b="border",pulse:y=!1,brush:x=!1,range:v,onRangeChange:w,loading:N=!1,animate:k=!0,reveal:$="left-to-right",fillVariant:M="gradient",gridStyle:C="solid",width:L,className:D,emptyLabel:S}){const P=Q().charts,A=J(),j=d??(e=>ne(e,A)),z=u??j,F=S??P.noData,T=ke(null),E=
|
|
896
|
-
return Te("div",{className:D,ref:T,children:/* @__PURE__ */Te(Ks,{height:r,width:L??E})});const
|
|
897
|
-
return Te("div",{className:D,ref:T,children:/* @__PURE__ */Te("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:F})});const Z=t.map((e,t)=>X.reduce((e,r)=>e+(wd(r.data[t])?r.data[t]:0),0)),ee=(e,t)=>Z[t]>0?e/Z[t]:null,te=[];if(n){let e=t.map(()=>0);for(const t of X)e=e.map((e,r)=>e+(wd(t.data[r])?t.data[r]:0)),te.push("percent"===a?e.map((e,t)=>ee(e,t)):[...e])}const re=n?(te.at(-1)??[]).filter(wd):X.flatMap(e=>e.data.filter(wd)),ae=!!l&&l.length>0,ie=n&&"percent"===a||ae||void 0!==s?null:zs(n?0:Math.min(0,...re),Math.max(0,...re),{intervals:c+1,integer:re.every(Number.isInteger)}),oe=ie?ie.lo:0,se=n&&"percent"===a?1:ie?ie.hi:s??js(Math.max(...re,0)),ce=n&&"percent"===a?e=>le(Math.round(100*e),0,A):j,de=ae?l:ie?ie.ticks:Ss([oe,se],{from:0,to:1}).ticks(c+1),ue=
|
|
895
|
+
/* @__PURE__ */Te("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}var bd=12,yd=16,xd=26,vd=52,wd=e=>"number"==typeof e&&Number.isFinite(e);function Nd({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:o=0,max:s,yTickCount:c=4,formatValue:d,formatTooltipValue:u,tooltipLabels:h,yAxisLabel:m,referenceLines:p,labelEndpoints:g=!1,dots:f,dotVariant:b="border",pulse:y=!1,brush:x=!1,range:v,onRangeChange:w,loading:N=!1,animate:k=!0,reveal:$="left-to-right",fillVariant:M="gradient",gridStyle:C="solid",width:L,className:D,emptyLabel:S}){const P=Q().charts,A=J(),j=d??(e=>ne(e,A)),z=u??j,F=S??P.noData,T=ke(null),E=Is(T),B=L??E,[O,I]=Ne(null),[W,K]=Ne(null),{highlighted:_}=Us(),q=ve();if(Me(()=>{if(null!==O)return R(e=>"Escape"===e.key&&(I(null),!0))},[O]),N)/* @__PURE__ */
|
|
896
|
+
return Te("div",{className:D,ref:T,children:/* @__PURE__ */Te(Ks,{height:r,width:L??E})});const U=t,H=v??W??[0,Math.max(0,U.length-1)],[V,Y]=H,G=e=>x?e.slice(V,Y+1):e,X=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(wd)).map(e=>({...e,data:G(e.data)}));if(t=G(U),0===X.length||0===t.length)/* @__PURE__ */
|
|
897
|
+
return Te("div",{className:D,ref:T,children:/* @__PURE__ */Te("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:F})});const Z=t.map((e,t)=>X.reduce((e,r)=>e+(wd(r.data[t])?r.data[t]:0),0)),ee=(e,t)=>Z[t]>0?e/Z[t]:null,te=[];if(n){let e=t.map(()=>0);for(const t of X)e=e.map((e,r)=>e+(wd(t.data[r])?t.data[r]:0)),te.push("percent"===a?e.map((e,t)=>ee(e,t)):[...e])}const re=n?(te.at(-1)??[]).filter(wd):X.flatMap(e=>e.data.filter(wd)),ae=!!l&&l.length>0,ie=n&&"percent"===a||ae||void 0!==s?null:zs(n?0:Math.min(0,...re),Math.max(0,...re),{intervals:c+1,integer:re.every(Number.isInteger)}),oe=ie?ie.lo:0,se=n&&"percent"===a?1:ie?ie.hi:s??js(Math.max(...re,0)),ce=n&&"percent"===a?e=>le(Math.round(100*e),0,A):j,de=ae?l:ie?ie.ticks:Ss([oe,se],{from:0,to:1}).ticks(c+1),ue=Os(de.map(ce),vd),he={left:ue,right:Math.max(ue+1,B-yd),top:bd,bottom:r-xd},me=Ps(t.length,{from:he.left,to:he.right}),pe=ae?As(l,{from:he.bottom,to:he.top}):null,ge=Ss([oe,se],{from:he.bottom,to:he.top}),fe=ge(Math.max(oe,0)),be=e=>pe?pe(e):ge(e),ye=pe?pe.levels.map(e=>({value:e,y:pe(e)})):de.map(e=>({value:e,y:ge(e)})),xe=e=>r=>{r.preventDefault(),I(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},we=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(B/96))));/* @__PURE__ */
|
|
898
898
|
return Ee("div",{className:`relative ${D??""}`,ref:T,children:[
|
|
899
|
-
/* @__PURE__ */Ee("svg",{width:"100%",height:r,viewBox:`0 0 ${B} ${r}`,role:"img","aria-label":P.overIntervals(X.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:()=>
|
|
899
|
+
/* @__PURE__ */Ee("svg",{width:"100%",height:r,viewBox:`0 0 ${B} ${r}`,role:"img","aria-label":P.overIntervals(X.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:()=>I(null),onBlur:()=>I(null),onKeyDown:e=>{"ArrowRight"===e.key&&xe(1)(e),"ArrowLeft"===e.key&&xe(-1)(e)},children:[
|
|
900
900
|
/* @__PURE__ */Te("defs",{children:/* @__PURE__ */Te("clipPath",{id:q,children:/* @__PURE__ */Te("rect",{x:he.left,y:he.top,width:he.right-he.left,height:he.bottom-he.top})})}),
|
|
901
901
|
/* @__PURE__ */Te(li,{id:q,fills:X.map((e,t)=>({color:Ms(e.slot,e.color,e.tone),variant:e.fillVariant??M})),fadeFrom:n?.42:.3,reveal:!!k&&$}),ye.map(e=>/* @__PURE__ */Te("line",{x1:he.left,y1:e.y,x2:he.right,y2:e.y,stroke:ks.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===C?"3 3":void 0},`grid-${e.value}`)),
|
|
902
902
|
/* @__PURE__ */Te("line",{x1:he.left,y1:fe,x2:he.right,y2:fe,stroke:ks.axis,strokeWidth:1,shapeRendering:"crispEdges"}),ye.map(e=>/* @__PURE__ */Te("text",{x:he.left-8,y:e.y+4,textAnchor:"end",fontSize:11,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:ce(e.value)},`ytick-${e.value}`)),m&&/* @__PURE__ */Te("text",{x:12,y:(he.top+he.bottom)/2,transform:`rotate(-90 12 ${(he.top+he.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:ks.label,children:m}),
|
|
903
|
-
/* @__PURE__ */Te("g",{clipPath:`url(#${q})`,mask:k&&$?`url(#${Ql(q)})`:void 0,children:X.map((e,r)=>{const a=Ms(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),s=
|
|
903
|
+
/* @__PURE__ */Te("g",{clipPath:`url(#${q})`,mask:k&&$?`url(#${Ql(q)})`:void 0,children:X.map((e,r)=>{const a=Ms(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),s=Hs(e.key,_);if("step"===l){const r=t.map((t,r)=>({start:me(r),end:me.end(r),value:e.data[r]})).filter(e=>wd(e.value)).map(e=>({start:e.start,end:e.end,y:be(e.value)}));/* @__PURE__ */
|
|
904
904
|
return Te("path",{d:Js(r),fill:"none",stroke:a,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:s??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,a)=>{const l=n?te[r]?.[a]:e.data[a];return wd(l)?[me.center(a),be(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*me.bandwidth);/* @__PURE__ */
|
|
905
905
|
return Te("g",{opacity:s??void 0,className:"rosh-viz-mark",children:t.map((t,i)=>{const o=n?te[r]?.[i]:e.data[i];if(!wd(o))return null;const s=be(o);/* @__PURE__ */
|
|
906
906
|
return Te("rect",{x:me.center(i)-l/2,y:Math.min(s,fe),width:l,height:Math.abs(fe-s),rx:2,fill:a,fillOpacity:.35,className:k?oi.rise:void 0,style:k?si(i,26):void 0},i)})},e.key)}const d=rc(c,i,o),u=n&&r>0?t.map((e,t)=>[me.center(t),be(te[r-1]?.[t]??0)-2]):null,h=u?ac(d,u):nc(d,c,fe);/* @__PURE__ */
|
|
@@ -909,15 +909,15 @@ return Ee("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===l
|
|
|
909
909
|
/* @__PURE__ */Te("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:ri(e.stroke??(e.forecast?"animated-dashed":"solid")),className:k&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?oi.march:void 0})]},e.key)})}),p?.map((e,t)=>{const r=e.color??Ns[e.tone??"critical"],n=be(e.value);/* @__PURE__ */
|
|
910
910
|
return Ee("g",{children:[
|
|
911
911
|
/* @__PURE__ */Te("line",{x1:he.left,y1:n,x2:he.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */Te("text",{x:he.right-4,y:n-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(f??(g?"last":"none"))&&X.map((e,r)=>{const a=f??(g?"last":"none"),l=Ms(e.slot,e.color,e.tone),i=[...e.data].map(wd).lastIndexOf(!0),o="all"===a?t.map((e,t)=>t).filter(t=>wd(n?te[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
|
|
912
|
-
return Ee("g",{children:[o.map(a=>{const o=n?te[r]?.[a]:e.data[a];return wd(o)?/* @__PURE__ */Te(gd,{cx:me.center(a),cy:be(o),color:l,variant:b,pulse:y&&a===i,title:`${t[a]}: ${e.label} ${j(o)}`},a):null}),g&&i>=0&&wd(n?te[r]?.[i]:e.data[i])&&/* @__PURE__ */Te("text",{x:me.center(i)-10,y:be(n?te[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:j(n?te[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%we===0?/* @__PURE__ */Te("text",{x:me.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==
|
|
913
|
-
/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 z-10",style:Rs(me.center(
|
|
914
|
-
return Te("div",{className:h,ref:x,children:/* @__PURE__ */Te("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:y})});const S=L.flatMap(e=>e.points),P=S.some(e=>null!=e.size),A=14,j=20,z=34,F=52,T=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,js(Math.max(...e))];return"log"===r?Fs(i,n):Ss(i,n)},E=T(S.map(e=>e.y),s,d,{from:t-z,to:A}),B=
|
|
912
|
+
return Ee("g",{children:[o.map(a=>{const o=n?te[r]?.[a]:e.data[a];return wd(o)?/* @__PURE__ */Te(gd,{cx:me.center(a),cy:be(o),color:l,variant:b,pulse:y&&a===i,title:`${t[a]}: ${e.label} ${j(o)}`},a):null}),g&&i>=0&&wd(n?te[r]?.[i]:e.data[i])&&/* @__PURE__ */Te("text",{x:me.center(i)-10,y:be(n?te[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:j(n?te[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%we===0?/* @__PURE__ */Te("text",{x:me.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==O&&/* @__PURE__ */Te("line",{x1:me.center(O),y1:he.top,x2:me.center(O),y2:he.bottom,stroke:ks.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */Te("rect",{x:me(t),y:he.top,width:Math.max(1,me.bandwidth),height:he.bottom-he.top,fill:"transparent",onMouseEnter:()=>I(t)},`hit-${t}`))]}),x&&U.length>2&&/* @__PURE__ */Te(fd,{className:"mt-1",labels:U,width:B,data:e[0]?.data??[],range:H,onRangeChange:e=>{w?w(e):K(e)}}),null!==O&&
|
|
913
|
+
/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 z-10",style:Rs(me.center(O),me.bandwidth,B),children:/* @__PURE__ */Te(Ys,{title:h?.[O]??t[O],rows:X.map((e,t)=>({key:e.key,label:e.label,color:Ms(e.slot,e.color,e.tone),value:wd(e.data[O])?n&&"percent"===a?`${le(100*(ee(e.data[O],O)??0),1,A)} · ${z(e.data[O])}`:z(e.data[O]):void 0})),footnote:n&&"percent"===a?P.inBucket(z(Z[O])):void 0})})]})}var kd=3;function $d({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:o,yDomain:s,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=Q().charts,g=J(),f=l??(e=>ne(e,g)),b=i??(e=>ne(e,g)),y=m??p.noObservations,x=ke(null),v=Is(x),w=r??v,N=ve(),[k,$]=Ne(null);Me(()=>{if(null!==k)return R(e=>"Escape"===e.key&&($(null),!0))},[k]);const M=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),L=o||s?C.map(e=>({...e,points:e.points.filter(e=>M(e.x,o)&&M(e.y,s))})).filter(e=>e.points.length>0):C,D=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
|
|
914
|
+
return Te("div",{className:h,ref:x,children:/* @__PURE__ */Te("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:y})});const S=L.flatMap(e=>e.points),P=S.some(e=>null!=e.size),A=14,j=20,z=34,F=52,T=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,js(Math.max(...e))];return"log"===r?Fs(i,n):Ss(i,n)},E=T(S.map(e=>e.y),s,d,{from:t-z,to:A}),B=Os(E.ticks(5).map(b),F),O=Math.max(B+1,w-j),I=T(S.map(e=>e.x),o,c,{from:B,to:O}),W=Es([0,Math.max(...S.map(e=>e.size??1))],{from:u[0],to:u[1]}),K=k?L[k.s]:void 0,_=k&&K?K.points[k.i]:void 0,q=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
|
|
915
915
|
return Ee("div",{className:`relative ${h??""}`,ref:x,children:[
|
|
916
916
|
/* @__PURE__ */Ee("svg",{width:"100%",height:t,viewBox:`0 0 ${w} ${t}`,role:"img","aria-label":p.scatter(L.map(e=>e.label),a??p.yAxis,n??p.xAxis)+(D>0?`. ${p.outsideRange(D)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>$(null),onBlur:()=>$(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=k?q.findIndex(e=>e.s===k.s&&e.i===k.i):0;$(q[Math.min(q.length-1,Math.max(0,r+t))])},children:[
|
|
917
|
-
/* @__PURE__ */Te("defs",{children:/* @__PURE__ */Te("clipPath",{id:N,children:/* @__PURE__ */Te("rect",{x:B-u[1],y:A-u[1],width:
|
|
918
|
-
/* @__PURE__ */Te("line",{x1:B,y1:E(e),x2:
|
|
919
|
-
/* @__PURE__ */Te("text",{x:B-8,y:E(e)+4,textAnchor:"end",fontSize:11,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),
|
|
920
|
-
/* @__PURE__ */Te("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=Ds(e.slot,3,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */Te("circle",{cx:
|
|
917
|
+
/* @__PURE__ */Te("defs",{children:/* @__PURE__ */Te("clipPath",{id:N,children:/* @__PURE__ */Te("rect",{x:B-u[1],y:A-u[1],width:O-B+2*u[1],height:t-z-A+2*u[1]})})}),E.ticks(5).map(e=>/* @__PURE__ */Ee("g",{children:[
|
|
918
|
+
/* @__PURE__ */Te("line",{x1:B,y1:E(e),x2:O,y2:E(e),stroke:ks.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
919
|
+
/* @__PURE__ */Te("text",{x:B-8,y:E(e)+4,textAnchor:"end",fontSize:11,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),I.ticks(5).map(e=>/* @__PURE__ */Te("text",{x:I(e),y:t-12,textAnchor:"middle",fontSize:11,fill:ks.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */Te("text",{x:(B+O)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:ks.label,children:n}),a&&/* @__PURE__ */Te("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:ks.label,children:a}),
|
|
920
|
+
/* @__PURE__ */Te("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=Ds(e.slot,3,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */Te("circle",{cx:I(n.x),cy:E(n.y),r:P?W(n.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:ks.surface,strokeWidth:2,onMouseEnter:()=>$({s:t,i:a})},`${e.key}-${a}`))})})]}),k&&K&&_&&/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Te(Ys,{title:_.label??K.label,rows:[{key:"x",label:n??p.xAxis,color:Ds(K.slot,3,K.color,K.tone),value:f(_.x)},{key:"y",label:a??p.yAxis,color:Ds(K.slot,3,K.color,K.tone),value:b(_.y)},...null!=_.size?[{key:"size",label:p.size,color:ks.muted,value:ne(_.size,g)}]:[]],footnote:_.label?K.label:void 0})})]})}function Md({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=220,width:l,max:i,min:o,formatValue:s,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=Q().charts,b=J(),y=s??(e=>ne(e,b)),x=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=Ms(0,d,u);/* @__PURE__ */
|
|
921
921
|
return Te(Ws,{labels:t,values:v,height:a,width:l,max:i,min:o,formatValue:y,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(x,t.length),tooltip:r=>/* @__PURE__ */Te(Ys,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:y(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:y(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */Te("g",{children:e.map((e,r)=>/* @__PURE__ */Te("rect",{x:t(r),y:a(e.high),width:Math.max(1,t.bandwidth),height:Math.max(1,a(e.low)-a(e.high)),rx:g,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */Ee("g",{children:[(()=>{const r=e.map((e,r)=>[t.center(r),a(e.high)]),l=e.map((e,r)=>[t.center(r),a(e.low)]);/* @__PURE__ */
|
|
922
922
|
return Ee(Be,{children:[
|
|
923
923
|
/* @__PURE__ */Te("path",{d:ac(rc(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
|
|
@@ -942,7 +942,7 @@ return Te(Ys,{title:r.label,rows:[{key:"open",label:c.open,color:a,value:u(r.ope
|
|
|
942
942
|
return Ee("g",{opacity:d?.45:1,children:[
|
|
943
943
|
/* @__PURE__ */Te("line",{x1:s,y1:n(e.high),x2:s,y2:n(e.low),stroke:o,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */Te("rect",{x:s-c/2,y:u,width:c,height:h,rx:1,fill:i?o:"transparent",fillOpacity:i?.85:1,stroke:o,strokeWidth:1.5}):/* @__PURE__ */Ee(Be,{children:[
|
|
944
944
|
/* @__PURE__ */Te("line",{x1:s-c/2,y1:n(e.open),x2:s,y2:n(e.open),stroke:o,strokeWidth:2}),
|
|
945
|
-
/* @__PURE__ */Te("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function Pd({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:o,label:s,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=Q().charts,p=J(),g=o??(e=>ne(e,p)),f=s??m.intensity,b=d??m.noActivity,y=ke(null),x=
|
|
945
|
+
/* @__PURE__ */Te("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function Pd({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:o,label:s,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=Q().charts,p=J(),g=o??(e=>ne(e,p)),f=s??m.intensity,b=d??m.noActivity,y=ke(null),x=Is(y),v=a??x,w=ve(),[N,k]=Ne(null);if(Me(()=>{if(null!==N)return R(e=>"Escape"===e.key&&(k(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
|
|
946
946
|
return Te("div",{className:c,ref:y,children:/* @__PURE__ */Te("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const $=l??Ms(0),M=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=n??L+26+26,S=Math.max(2,(Math.max(97,v)-C)/t.length),P=e=>{const t=M>0?Math.max(0,Math.min(1,e/M)):0;return`color-mix(in oklab, ${$} ${(8+92*t).toFixed(1)}%, ${ks.surface})`};/* @__PURE__ */
|
|
947
947
|
return Ee("div",{className:`relative ${c??""}`,ref:y,children:[
|
|
948
948
|
/* @__PURE__ */Ee("svg",{width:"100%",height:D,viewBox:`0 0 ${v} ${D}`,role:"img","aria-label":m.heatmap(f,e.length,t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>k(null),onBlur:()=>k(null),onKeyDown:r=>{const n="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,a="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===n&&0===a||(r.preventDefault(),k(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+n)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+a))})))},children:[
|
|
@@ -956,7 +956,7 @@ return Te("rect",{x:C+a*S+u/2,y:26*n+u/2,width:Math.max(1,S-u),height:26-u,rx:h,
|
|
|
956
956
|
return Ee("table",{className:"sr-only",children:[
|
|
957
957
|
/* @__PURE__ */Te("caption",{children:e}),
|
|
958
958
|
/* @__PURE__ */Te("thead",{children:/* @__PURE__ */Te("tr",{children:t.map(e=>/* @__PURE__ */Te("th",{scope:"col",children:e},e))})}),
|
|
959
|
-
/* @__PURE__ */Te("tbody",{children:r.map((e,t)=>/* @__PURE__ */Te("tr",{children:e.map((e,t)=>/* @__PURE__ */Te("td",{children:e},t))},t))})]})}var jd=3,zd=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function Fd({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:o=!0,className:s,emptyLabel:c}){const d=Q().charts,u=J(),h=i??(e=>ne(e,u)),m=c??d.nothingToCompare,p=ve(),[g,f]=Ne(null),{highlighted:b}=
|
|
959
|
+
/* @__PURE__ */Te("tbody",{children:r.map((e,t)=>/* @__PURE__ */Te("tr",{children:e.map((e,t)=>/* @__PURE__ */Te("td",{children:e},t))},t))})]})}var jd=3,zd=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function Fd({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:o=!0,className:s,emptyLabel:c}){const d=Q().charts,u=J(),h=i??(e=>ne(e,u)),m=c??d.nothingToCompare,p=ve(),[g,f]=Ne(null),{highlighted:b}=Us(),y=t;if(e.length<3||0===y.length)/* @__PURE__ */
|
|
960
960
|
return Te("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const x=r/2,v=r/2,w=r/2-46,N=Ts(e.length),k=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...y.map(e=>e.values[t]??0).filter(Number.isFinite))),$=(e,t)=>{const r=Math.max(0,Math.min(1,t/k[e])),n=N.center(e)-N.step/2;return[x+w*r*Math.cos(n),v+w*r*Math.sin(n)]},M=(e,t)=>null!==g?g!==e:null!==b&&b!==t,C=null!==g?y[g]:void 0;/* @__PURE__ */
|
|
961
961
|
return Ee("div",{className:`relative ${s??""}`,children:[
|
|
962
962
|
/* @__PURE__ */Ee("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
|
|
@@ -970,7 +970,7 @@ return Ee("g",{opacity:M(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:o?`url(#${Ql(p
|
|
|
970
970
|
/* @__PURE__ */Te("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:y.map((e,t)=>/* @__PURE__ */Ee("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
971
971
|
/* @__PURE__ */Te("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Ds(t,3,e.color,e.tone)}}),
|
|
972
972
|
/* @__PURE__ */Te("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
973
|
-
/* @__PURE__ */Te(Ad,{caption:d.acrossMeasures(y.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:y.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}var Td=300*Math.PI/180;function Ed({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:o,trackGap:s=6}){const c=Q().charts,d=J(),u=a??(e=>ne(e,d)),h=o??c.nothingToPlot,m=ve(),[p,g]=Ne(null),{highlighted:f}=
|
|
973
|
+
/* @__PURE__ */Te(Ad,{caption:d.acrossMeasures(y.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:y.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}var Td=300*Math.PI/180;function Ed({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:o,trackGap:s=6}){const c=Q().charts,d=J(),u=a??(e=>ne(e,d)),h=o??c.nothingToPlot,m=ve(),[p,g]=Ne(null),{highlighted:f}=Us();if(0===e.length)/* @__PURE__ */return Te("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const b=r/2,y=r/2,x=r/2-10,v=n??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(x-.16*r)/e.length):0,N=Math.max(1,Math.floor((x-.16*r)/w||1)),k="track"===t?e.slice(0,N):e,$=Math.min(s,Math.max(1,w-2)),M=Ts(k.length,.03),C=null!==p?k[p]:void 0;/* @__PURE__ */
|
|
974
974
|
return Ee("div",{className:`relative ${i??""}`,children:[
|
|
975
975
|
/* @__PURE__ */Ee("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
|
|
976
976
|
/* @__PURE__ */Te("title",{id:m,children:"track"===t?c.radialTrack(k.length):c.radialCycle(k.length)}),k.map((e,n)=>{const a=Ms(n,e.color,e.tone),i=Math.max(0,Math.min(1,e.value/v)),o=((e,t)=>null!==p?p!==e:null!==f&&f!==t)(n,e.key);if("track"===t){const t=x-n*w,r=t-w+$,s=-Math.PI/2;/* @__PURE__ */
|
|
@@ -981,7 +981,7 @@ return Te("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */Te("
|
|
|
981
981
|
/* @__PURE__ */Te("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:e.map((e,t)=>/* @__PURE__ */Ee("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
982
982
|
/* @__PURE__ */Te("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Ms(t,e.color,e.tone)}}),
|
|
983
983
|
/* @__PURE__ */Te("span",{className:"flex-1 truncate",children:e.label}),
|
|
984
|
-
/* @__PURE__ */Te("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function Bd({stages:e,shape:t="funnel",height:r,width:n=560,gap:a=4,formatValue:l,color:i,className:o,emptyLabel:s}){const c=Q().charts,d=J(),u=l??(e=>ne(e,d)),h=s??c.noStages,m=ve(),[p,g]=Ne(null),{highlighted:f}=
|
|
984
|
+
/* @__PURE__ */Te("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function Bd({stages:e,shape:t="funnel",height:r,width:n=560,gap:a=4,formatValue:l,color:i,className:o,emptyLabel:s}){const c=Q().charts,d=J(),u=l??(e=>ne(e,d)),h=s??c.noStages,m=ve(),[p,g]=Ne(null),{highlighted:f}=Us();if(0===e.length)/* @__PURE__ */return Te("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const b=i??Ms(0),y=r??54*e.length,x=Math.max(...e.map(e=>e.value),1),v=168,w=n-v,N=e=>w*Math.max(0,e/x)/2,k=v+w/2,$=t=>46+t/Math.max(1,e.length-1)*54,M=e=>`color-mix(in oklab, ${b} ${$(e).toFixed(0)}%, ${ks.surface})`,C=e=>$(e)>=55?ks.surface:ks.label,L=(e,t)=>null!==p?p!==e:null!==f&&f!==t,D=null!==p?e[p]:void 0;/* @__PURE__ */
|
|
985
985
|
return Ee("div",{className:`relative ${o??""}`,children:[
|
|
986
986
|
/* @__PURE__ */Ee("svg",{width:"100%",height:y,viewBox:`0 0 ${n} ${y}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
|
|
987
987
|
/* @__PURE__ */Te("title",{id:m,children:c.funnel(e.length,u(e[0].value),u(e[e.length-1].value))}),e.map((r,n)=>{const l=n*y/e.length+a/2,i=(n+1)*y/e.length-a/2,o=N(r.value),s="cone"===t?N(e[n+1]?.value??r.value):o,c=e[n-1]?.value,h=null!=c&&c>0?100*(1-r.value/c):null;/* @__PURE__ */
|
|
@@ -989,16 +989,16 @@ return Ee("g",{opacity:L(n,r.key)?.45:1,onMouseEnter:()=>g(n),children:[
|
|
|
989
989
|
/* @__PURE__ */Te("path",{d:`M${k-o},${l} L${k+o},${l} L${k+s},${i} L${k-s},${i} Z`,fill:M(n)}),
|
|
990
990
|
/* @__PURE__ */Te("text",{x:154,y:(l+i)/2-2,textAnchor:"end",fontSize:12,fill:ks.label,children:r.label}),
|
|
991
991
|
/* @__PURE__ */Ee("text",{x:154,y:(l+i)/2+14,textAnchor:"end",fontSize:11,fill:ks.muted,style:{fontVariantNumeric:"tabular-nums"},children:[u(r.value),null!=h?` · −${le(h,1,d)}`:""]}),(()=>{const t=le(r.value/(e[0].value||1)*100,0,d),a=2*Math.min(o,s)>=.62*t.length*12+12;/* @__PURE__ */
|
|
992
|
-
return Te("text",{x:a?k:k+Math.max(o,s)+6,y:(l+i)/2+4,textAnchor:a?"middle":"start",fontSize:12,fontWeight:600,fill:a?C(n):ks.label,style:{fontVariantNumeric:"tabular-nums"},children:t})})()]},r.key)})]}),D&&null!==p&&/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Te(Ys,{title:D.label,rows:[{key:"value",label:c.count,color:M(p),value:u(D.value)},{key:"share",label:c.ofFirstStage,color:ks.muted,value:le(D.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:Ns.critical,value:`−${le(100*(1-D.value/e[p-1].value),1,d)}`}]:[]]})})]})}function
|
|
992
|
+
return Te("text",{x:a?k:k+Math.max(o,s)+6,y:(l+i)/2+4,textAnchor:a?"middle":"start",fontSize:12,fontWeight:600,fill:a?C(n):ks.label,style:{fontVariantNumeric:"tabular-nums"},children:t})})()]},r.key)})]}),D&&null!==p&&/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Te(Ys,{title:D.label,rows:[{key:"value",label:c.count,color:M(p),value:u(D.value)},{key:"share",label:c.ofFirstStage,color:ks.muted,value:le(D.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:Ns.critical,value:`−${le(100*(1-D.value/e[p-1].value),1,d)}`}]:[]]})})]})}function Od({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:o,emptyLabel:s}){const c=Q().charts,d=J(),u=l??(e=>ne(e,d)),h=s??c.nothingToBreakDown,m=ke(null),p=Is(m),g=r??p,[f,b]=Ne(null),{highlighted:y}=Us(),x=id(e,g,t);if(0===x.length)/* @__PURE__ */
|
|
993
993
|
return Te("div",{className:o,ref:m,children:/* @__PURE__ */Te("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??Ms(0),w=Math.max(...x.map(e=>e.value),1),N=e=>34+e/w*62,k=e=>`color-mix(in oklab, ${v} ${N(e).toFixed(0)}%, ${ks.surface})`,$=e=>N(e)>=55?ks.surface:ks.label,M=f??y,C=f?x.find(e=>e.key===f):void 0;/* @__PURE__ */
|
|
994
994
|
return Ee("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
995
995
|
/* @__PURE__ */Te("svg",{width:"100%",height:t,viewBox:`0 0 ${g} ${t}`,role:"img","aria-label":c.treemap(e.length),onMouseLeave:()=>b(null),children:x.map(e=>{const t=Math.max(0,e.width-n),r=Math.max(0,e.height-n),l=t>6.2*e.label.length+12&&r>30,i=l&&r>44;/* @__PURE__ */
|
|
996
996
|
return Ee("g",{opacity:M&&M!==e.key?.55:1,onMouseEnter:()=>b(e.key),children:[
|
|
997
997
|
/* @__PURE__ */Te("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:k(e.value)}),l&&/* @__PURE__ */Te("text",{x:e.x+n/2+8,y:e.y+n/2+18,fontSize:12,fontWeight:600,fill:$(e.value),children:e.label}),i&&/* @__PURE__ */Te("text",{x:e.x+n/2+8,y:e.y+n/2+34,fontSize:11,fill:$(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Te(Ys,{title:C.label,rows:[{key:"value",label:c.value,color:k(C.value),value:u(C.value)}]})}),
|
|
998
|
-
/* @__PURE__ */Te(Ad,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:x.map(e=>[e.label,u(e.value)])})]})}function
|
|
998
|
+
/* @__PURE__ */Te(Ad,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:x.map(e=>[e.label,u(e.value)])})]})}function Id(e,t,r,n,a,l,i,o){if(n>=8)return;const s=e.reduce((e,t)=>e+Rd(t,8-n),0);if(s<=0)return;let c=t;e.forEach((e,t)=>{const d=Rd(e,8-n),u=d/s*r,h=`${i}/${e.key}`,m=0===n?t:a,p=0===n?e.key:l;o.push({id:h,label:e.label,value:d,depth:n,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&Id(e.children,c,u,n+1,m,p,h,o),c+=u})}function Rd(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+Rd(r,t-1),0):Math.max(0,e.value??0)}function Wd({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:o}){const s=Q().charts,c=J(),d=a??(e=>ne(e,c)),u=o??s.nothingToBreakDown,[h,m]=Ne(null),{highlighted:p}=Us(),g=[];if(Id(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return Te("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,b=t/2,y=t/2,x=(t/2-8-r)/f,v=g.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),w=e=>`color-mix(in oklab, ${Ms(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${ks.surface})`,N=e=>null!==h?e.id===h:null===p||e.branchKey===p,k=h?g.find(e=>e.id===h):void 0,$=e=>le(e.value/v*100,1,c);/* @__PURE__ */
|
|
999
999
|
return Ee("div",{className:`relative ${i??""}`,children:[
|
|
1000
1000
|
/* @__PURE__ */Ee("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":s.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */Te("path",{d:ic(b,y,r+e.depth*x+n/2,r+(e.depth+1)*x-n/2,e.start,e.end),fill:w(e),fillOpacity:N(e)?1:.45,stroke:ks.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */Te("text",{x:b,y:y+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:ks.label,children:l})]}),k&&/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Te(Ys,{title:k.label,rows:[{key:"value",label:s.value,color:w(k),value:d(k.value)},{key:"share",label:s.share,color:ks.muted,value:$(k)}]})}),
|
|
1001
|
-
/* @__PURE__ */Te(Ad,{caption:s.sunburst(d(v),f),head:[s.tableLevel,s.tableItem,s.value,s.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),$(e)])})]})}function Kd({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:o,emptyLabel:s}){const c=Q().charts,d=J(),u=i??(e=>ne(e,d)),h=s??c.noFlows,m=ke(null),p=
|
|
1001
|
+
/* @__PURE__ */Te(Ad,{caption:s.sunburst(d(v),f),head:[s.tableLevel,s.tableItem,s.value,s.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),$(e)])})]})}function Kd({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:o,emptyLabel:s}){const c=Q().charts,d=J(),u=i??(e=>ne(e,d)),h=s??c.noFlows,m=ke(null),p=Is(m),g=n??p,[f,b]=Ne(null),{highlighted:y}=Us();if(0===e.length||0===t.length)/* @__PURE__ */
|
|
1002
1002
|
return Te("div",{className:o,ref:m,children:/* @__PURE__ */Te("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const x=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>x.length<=1?0:x.indexOf(e)/(x.length-1)*(g-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),N=/* @__PURE__ */new Map;for(const t of e)N.set(t.depth,[...N.get(t.depth)??[],t]);const k=Math.max(...[...N.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),$=r-20,M=k>0?($-l*(Math.max(...[...N.values()].map(e=>e.length))-1))/k:0,C=/* @__PURE__ */new Map;for(const[e,t]of N){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*M)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>$&&a>0?Math.max(0,1-(n-$)/a):1;let o=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:o,h:a,index:n}),o+=a+l})}const L=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,S=/* @__PURE__ */new Map,P=(e,t)=>e.from===t||e.to===t,A="link"===f?.kind?t[f.index]:void 0,j="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
|
|
1003
1003
|
return Ee("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
1004
1004
|
/* @__PURE__ */Ee("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>b(null),children:[t.map((e,t)=>{const r=C.get(e.from),n=C.get(e.to);if(!r||!n)return null;const l=Math.max(1,e.value*M),i=r.y+(L.get(e.from)??0)+l/2,o=n.y+(D.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),D.set(e.to,(D.get(e.to)??0)+l);const s=r.x+a,c=n.x,d=Ms(r.index,e.color),u=`${e.from}→${e.to}`,h=S.get(u)??0;S.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:P(e,f.key):null!==y?P(e,y):null)(e,t);/* @__PURE__ */
|
|
@@ -1006,11 +1006,11 @@ return Te("path",{d:tc([[s,i],[c,o]]),fill:"none",stroke:d,strokeWidth:l,strokeO
|
|
|
1006
1006
|
return Ee("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>b({kind:"node",key:e.key}),children:[
|
|
1007
1007
|
/* @__PURE__ */Te("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:Ms(r.index,e.color,e.tone)}),
|
|
1008
1008
|
/* @__PURE__ */Te("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:ks.label,children:e.label})]},e.key)})]}),A&&/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Te(Ys,{title:`${A.from} → ${A.to}`,rows:[{key:"value",label:c.flow,color:Ms(C.get(A.from)?.index??0,A.color),value:u(A.value)}]})}),j&&/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Te(Ys,{title:j.label,rows:[{key:"value",label:c.throughput,color:Ms(C.get(j.key)?.index??0,j.color,j.tone),value:u(w.get(j.key)??0)}]})}),
|
|
1009
|
-
/* @__PURE__ */Te(Ad,{caption:c.sankey(e.length,t.length),head:[c.tableFrom,c.tableTo,c.value],rows:t.map(e=>[e.from,e.to,u(e.value)])})]})}function _d({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=Q().charts,d=J(),u=i??(e=>ne(e,d)),h=s??c.noFlows,[m,p]=Ne(null),{highlighted:g}=
|
|
1009
|
+
/* @__PURE__ */Te(Ad,{caption:c.sankey(e.length,t.length),head:[c.tableFrom,c.tableTo,c.value],rows:t.map(e=>[e.from,e.to,u(e.value)])})]})}function _d({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=Q().charts,d=J(),u=i??(e=>ne(e,d)),h=s??c.noFlows,[m,p]=Ne(null),{highlighted:g}=Us(),f=function(e,t,r,n){const a=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},l=e.map((t,r)=>e.reduce((e,t,n)=>e+a(r,n)+a(n,r),0)),i=Math.max(2,r),o=e.length>i,s=o?e.map((e,t)=>t).sort((e,t)=>l[t]-l[e]).slice(0,i-1).sort((e,t)=>e-t):e.map((e,t)=>t),c=new Map(s.map((e,t)=>[e,t])),d=o?s.length:-1,u=o?[...s.map(t=>e[t]),n]:[...e],h=u.map(()=>u.map(()=>0));let m=0;e.forEach((t,r)=>e.forEach((e,t)=>{const n=c.get(r)??d,l=c.get(t)??d;n!==d||l!==d?h[n][l]+=a(r,t):m+=a(r,t)}));const p=u.map((e,t)=>u.reduce((e,r,n)=>e+h[t][n]+h[n][t],0));return d>=0&&(p[d]+=m),{labels:u,matrix:h,totals:p,otherIndex:d,foldedCount:o?e.length-s.length:0}}(e,t,n,c.other),{labels:b,matrix:y,otherIndex:x,foldedCount:v}=f,w=(e,t)=>y[e]?.[t]??0,N=e=>e===x?ks.muted:Ms(e),k=f.totals,$=b.map((e,t)=>t).sort((e,t)=>k[t]-k[e]),M=$.reduce((e,t)=>e+k[t],0);if(M<=0)/* @__PURE__ */return Te("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const C=r/2,L=r/2,D=r/2-44,S=D-l,P=a*$.length,A=/* @__PURE__ */new Map;let j=-Math.PI/2;$.forEach((e,t)=>{const r=k[e]/M*(2*Math.PI-P);A.set(e,{start:j,end:j+r,slot:t}),j+=r+a});const z=/* @__PURE__ */new Map,F=[];for(const e of $)for(const t of $){const r=w(e,t);if(r<=0)continue;const n=A.get(e),a=r/Math.max(1,k[e])*(n.end-n.start),l=z.get(e)??0;z.set(e,l+a),F.push({from:e,to:t,value:r,a:n.start+l+a/2,b:A.get(t).start+(A.get(t).end-A.get(t).start)/2})}const T=(e,t)=>[C+t*Math.cos(e),L+t*Math.sin(e)],E="arc"===m?.kind?m.index:void 0,B="ribbon"===m?.kind?F[m.index]:void 0;/* @__PURE__ */
|
|
1010
1010
|
return Ee("div",{className:`relative ${o??""}`,children:[
|
|
1011
1011
|
/* @__PURE__ */Ee("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord($.length),onMouseLeave:()=>p(null),children:[F.map((e,t)=>{const[n,a]=T(e.a,S),[l,i]=T(e.b,S),o=N(e.from),s=((e,t)=>m?"ribbon"===m.kind?m.index===t:m.index===e.from||m.index===e.to:null!==g?b[e.from]===g||b[e.to]===g:null)(e,t);/* @__PURE__ */
|
|
1012
1012
|
return Te("path",{d:`M${n},${a} Q${C},${L} ${l},${i}`,fill:"none",stroke:o,strokeWidth:Math.max(1,e.value/M*r*.9),strokeOpacity:null===s||s?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:t})},`${b[e.from]}→${b[e.to]}`)}),$.map(e=>{const t=A.get(e),r=(t.start+t.end)/2,[n,a]=T(r,D+16),l=(e=>m?"arc"===m.kind?m.index===e:F[m.index].from===e||F[m.index].to===e:null!==g?b[e]===g:null)(e);/* @__PURE__ */
|
|
1013
1013
|
return Ee("g",{onMouseEnter:()=>p({kind:"arc",index:e}),children:[
|
|
1014
1014
|
/* @__PURE__ */Te("path",{d:ic(C,L,S,D,t.start,t.end),fill:N(e),fillOpacity:null===l||l?1:.45}),
|
|
1015
1015
|
/* @__PURE__ */Te("text",{x:n,y:a+4,fontSize:11,fill:ks.label,textAnchor:Math.cos(r)>.15?"start":Math.cos(r)<-.15?"end":"middle",children:b[e]})]},e)})]}),v>0&&/* @__PURE__ */Te("p",{className:"mt-1 text-xs text-gray-500",children:c.chordFolded(v)}),void 0!==E&&/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Te(Ys,{title:b[E],rows:[{key:"total",label:c.totalFlow,color:N(E),value:u(k[E])}]})}),B&&/* @__PURE__ */Te("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Te(Ys,{title:`${b[B.from]} → ${b[B.to]}`,rows:[{key:"value",label:c.flow,color:N(B.from),value:u(B.value)}]})}),
|
|
1016
|
-
/* @__PURE__ */Te(Ad,{caption:c.chord($.length),head:[c.tableFrom,c.tableTo,c.value],rows:F.map(e=>[b[e.from],b[e.to],u(e.value)])})]})}export{Qo as APP_UPDATE_POLL_MS,Pl as Accordion,ta as AlignmentGrid,ts as AppUpdateBanner,oa as AttachButton,la as AttachmentDropZone,ia as AttachmentList,Ac as AuthScreen,yl as Avatar,xl as AvatarGroup,Za as BORDER_WIDTHS,kl as Banner,Dd as BoxPlotChart,zt as BrandAssetEditor,Vl as BudgetBar,ks as CHART_INK,tn as COLUMN_COUNT_MAX,nn as COLUMN_COUNT_WIDTHS,an as COLUMN_SHARES_EQUAL,rn as COLUMN_SHARE_MIN,
|
|
1016
|
+
/* @__PURE__ */Te(Ad,{caption:c.chord($.length),head:[c.tableFrom,c.tableTo,c.value],rows:F.map(e=>[b[e.from],b[e.to],u(e.value)])})]})}export{Qo as APP_UPDATE_POLL_MS,Pl as Accordion,ta as AlignmentGrid,ts as AppUpdateBanner,oa as AttachButton,la as AttachmentDropZone,ia as AttachmentList,Ac as AuthScreen,yl as Avatar,xl as AvatarGroup,Za as BORDER_WIDTHS,kl as Banner,Dd as BoxPlotChart,zt as BrandAssetEditor,Vl as BudgetBar,ks as CHART_INK,tn as COLUMN_COUNT_MAX,nn as COLUMN_COUNT_WIDTHS,an as COLUMN_SHARES_EQUAL,rn as COLUMN_SHARE_MIN,Ua as CONTROL_HEIGHTS,Uc as CORNERS,Gt as Calendar,Sd as CandlestickChart,ka as Card,Ws as CartesianPlot,fd as ChartBrush,li as ChartDefs,gd as ChartDot,pd as ChartFrame,qs as ChartHighlightProvider,Ks as ChartSkeleton,Ys as ChartTooltip,Cc as ChatTemplate,dt as Checkbox_default,vc as CheckoutTemplate,_d as ChordChart,Rn as ColorPicker,On as ColorPickerPanel,Fn as ColorSwatch,Al as ColoredBadge,Gs as ColumnChart,sa as ComposerAttachments,no as ContainerFillChart,So as ContextMenu,Qn as CornersInput,ul as CountBadge,Yl as DAY_MS,mc as DashboardTemplate,fs as DataTable,fc as DataTablePage,fr as DatePicker_default,lr as DateRangePicker,vr as DateTimePicker_default,ol as DescriptionList,en as DisplayChips,Ka as Divider,ls as Drawer,Lo as DropdownMenu,Qa as ELEVATION_LEVELS,kc as EmailTemplate,jl as EmptyState,ed as EmptyValue,Tc as ErrorBoundary,zc as ErrorPage,Ga as FONT_WEIGHTS,ra as FilePicker_default,ft as FormErrorSummary,mt as FormField,yc as FormLayoutPage,Bd as FunnelChart,ca as GROUP_COLORS,da as GROUP_COLORS_SOLID,Sc as GalleryTemplate,Ra as Grid,Pd as HeatmapChart,fo as HelpCenter,In as HexInput,Ld as HistogramChart,_e as INPUT_BASE,Ke as INPUT_SIZES,Ie as IconButton_default,Zo as IconRail,Jo as IconRailButton,_n as ImageFocusPoint,Ea as Inline,Xr as InputNumber_default,Ye as Input_default,is as Kanban,xt as Label,Qc as LanguagePanel,Jc as LanguageSelect,Xn as LinkPicker,bs as ListFooter,ys as ListLoadError,Vo as ListRow,Sr as MAX_FRACTION_DIGITS,oi as MOTION,Xa as MOTION_DURATIONS,po as Markdown,jt as MediaUploadField,Rt as MediaUploadGrid,cd as Meter,_l as MetricBar,Yi as MilestoneTimeline,lt as NativeSelect,zr as NumericKeypad,Gi as POST_PRODUCTION_STATUSES,zl as PageHeader,ss as Pagination,na as PaperclipGlyph,Aa as Paragraph,oc as PieChart,Nn as Popover,Bt as PortalBrandingProvider,to as ProductionTimeline,jd as RADAR_SERIES_CAP,Ja as RADIUS_ROLES,Ha as ROW_HEIGHTS,Fd as RadarChart,Ed as RadialBarChart,gt as RadioGroup,ht as Radio_default,Md as RangeChart,od as RankedBars,kd as SCATTER_SERIES_CAP,vs as SERIES_SLOT_COUNT,ws as SERIES_VARS,qa as SPACING_ROLES,_a as SPACING_SCALE,Xi as STAGES,Ns as STATUS_VARS,Kd as SankeyChart,$d as ScatterChart,Un as SearchableSelect,Wr as Segmented,st as Select_default,cl as SettingRow,yo as SidebarActionButton,vo as SidebarGroupLabel,ko as SidebarNavGroup,No as SidebarNavItem,rl as Skeleton,Qr as Slider,Dr as Snippet,Ho as SortableList,xs as Sparkline,Ta as Stack,$a as StatCard,ud as StatTile,pl as Statistic,ba as StatusBadge,ga as StatusBadgeProvider,Sl as Stepper,Wd as SunburstChart,Ur as Switch_default,Ya as TYPE_SCALE,Ll as Tabs,va as TagInput,Da as Text,Zn as TextLinkField,Ge as Textarea_default,Tr as TileButton_default,td as TimeAgo,cr as TimePicker_default,Nd as TimeSeriesChart,Hi as TimelineTrack,Pa as Title,$o as TopNav,Oo as Tree,_o as TreeEmptySlot,Io as TreeGroup,Ro as TreeGroupLabel,Ko as TreeRow,qo as TreeSeam,Od as TreemapChart,Cd as WaterfallChart,vn as WidthsBar,Ts as angleScale,Pr as appendKey,Vc as applyCorners,Yc as applyIconSet,Gc as applyThemePrefs,ic as arcPath,ac as areaBetween,nc as areaFrom,Cs as assignSeriesSlots,Vs as autoHighlightIndex,Ar as backspace,Ps as bandScale,Bs as binValues,Ul as budgetState,tc as bumpPath,Zi as calcOverall,Ji as calcReportOverall,jn as colorFill,zn as colorSwatchClasses,sn as columnSharesWidths,kr as copyToClipboard,rc as curvePath,ri as dashFor,ti as fillFor,Zl as fillId,Xe as firstEnabledIndex,Xl as fmtSliderDate,qt as fromKey,Jl as glowId,ei as groundId,ua as groupColors,Ln as hexToHsv,Hs as highlightOpacity,Dn as hsvToHex,He as inputClasses,Tl as isSeverityTone,Va as isSpacingStep,yt as labelClasses,As as ladderScale,Zc as languageSelectWidth,Ze as lastEnabledIndex,Zs as linearPath,Ss as linearScale,Fs as logScale,Ql as maskId,Qe as matchTypeahead,wt as mediaFileName,Qs as monotonePath,Je as nextEnabledIndex,zs as niceAxis,js as niceMax,$n as parseHexColor,lc as polygonPoints,Es as radiusScale,on as resolveColumnShares,cn as resolveColumnWidths,Hc as resolveCorners,Ft as resolvePortalBrandAsset,Ms as resolveSeriesColor,Ds as resolveSeriesColorWithin,Kc as resolveTheme,wr as selectionAt,$s as seriesColor,El as severityOf,ec as splinePath,id as squarify,si as stagger,Js as stepPath,$l as tabButtonId,Ml as tabPanelId,Gl as toDayMs,Qt as toISODate,_t as toKey,Ls as toggleSeriesSlot,es as useAppUpdate,nd as useClickOutside,Po as useContextMenu,rd as useDebouncedValue,Us as useHighlight,Is as usePlotWidth,Ot as usePortalBranding,Qi as useProductionTimeline,fa as useStatusLabel,Xc as useTheme};
|