efficient-shell 4.180.0 → 4.181.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 +12 -0
- package/dist/Browser-QYHW6I6J.js +43 -0
- package/dist/Calculator-4K53PFBL.js +29 -0
- package/dist/ConfirmDialog-X2DPOYWO.js +1 -0
- package/dist/{CurrencyConverter-AMXUOQR2.js → CurrencyConverter-QEG6RFAS.js} +9 -9
- package/dist/Documents-SFNMDRYU.js +52 -0
- package/dist/Files-OX2UBSQQ.js +87 -0
- package/dist/Notepad-CNZEWFCR.js +25 -0
- package/dist/PdfViewer-UZGDE4HD.js +1 -0
- package/dist/PomodoroTimer-T6YAQFIE.js +91 -0
- package/dist/Preview-OOVIIQQG.js +182 -0
- package/dist/Sidebar-3NZRIL7F.js +44 -0
- package/dist/Spreadsheet-7NUDGOSX.js +37 -0
- package/dist/{Stock-GWVG2INU.js → Stock-BZFC2ROU.js} +6 -6
- package/dist/{Weather-APBCG4TO.js → Weather-S3N5OWYF.js} +17 -17
- package/dist/{WorldClock-2LMZYKWR.js → WorldClock-ACC3S6OA.js} +4 -4
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-FORN7LG7.js → chunk-2DX65GOO.js} +1 -1
- package/dist/{chunk-6CFBF543.js → chunk-5IWSOLLY.js} +2 -2
- package/dist/chunk-FOEVG7RT.js +21 -0
- package/dist/chunk-GMMTTWHB.js +3 -0
- package/dist/chunk-LMIQV3NB.js +13 -0
- package/dist/{chunk-SVO3ES2E.js → chunk-MIAJQGWE.js} +1 -1
- package/dist/chunk-MSIN5HKX.js +9 -0
- package/dist/chunk-OD5KLVU5.js +1 -0
- package/dist/{chunk-ILTSTULF.js → chunk-P4SGJTK3.js} +1 -1
- package/dist/chunk-PQLVWCUI.js +11 -0
- package/dist/chunk-QRV7RNQX.js +24 -0
- package/dist/chunk-R3PCJLQF.js +993 -0
- package/dist/chunk-SBDIHKLU.js +108 -0
- package/dist/chunk-VJP3R52B.js +6 -0
- package/dist/chunk-XUF7VW4U.js +136 -0
- package/dist/chunk-ZDF5AR5W.js +10 -0
- package/dist/chunk-ZZKIKW62.js +29 -0
- package/dist/index.js +639 -656
- package/dist/map/index.js +22 -22
- package/dist/markdown/index.js +6 -6
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/Browser-RZFOKBSF.js +0 -43
- package/dist/Calculator-R5OEHQ67.js +0 -29
- package/dist/ConfirmDialog-CMNQZQA3.js +0 -1
- package/dist/Documents-VD32HWDQ.js +0 -52
- package/dist/Files-NAY3WK6O.js +0 -89
- package/dist/Notepad-AHRPMF57.js +0 -25
- package/dist/PdfViewer-3SC3LE4U.js +0 -1
- package/dist/PomodoroTimer-LE6J2KUU.js +0 -99
- package/dist/Preview-OKR5QRQP.js +0 -188
- package/dist/Sidebar-BQ4P5LBI.js +0 -44
- package/dist/Spreadsheet-RME4IQ43.js +0 -37
- package/dist/chunk-4VTHXNGZ.js +0 -1003
- package/dist/chunk-5ZDM6WIC.js +0 -24
- package/dist/chunk-7WZEFHPS.js +0 -6
- package/dist/chunk-AA4TMQOS.js +0 -10
- package/dist/chunk-BSJIBRWC.js +0 -1
- package/dist/chunk-C2A4PIGZ.js +0 -13
- package/dist/chunk-CIXQKCFA.js +0 -11
- package/dist/chunk-KVOFUFPP.js +0 -3
- package/dist/chunk-N6STBYXR.js +0 -112
- package/dist/chunk-RQOP5JAJ.js +0 -9
- package/dist/chunk-UAIVAA5X.js +0 -21
- package/dist/chunk-ZAE6ROV7.js +0 -29
package/dist/chunk-4VTHXNGZ.js
DELETED
|
@@ -1,1003 +0,0 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-7WZEFHPS.js";import{SidebarLayout as t}from"./chunk-PE4F4MJE.js";import{BrandMark as r}from"./chunk-KDRAU4XQ.js";import{useShellLanguage as n}from"./chunk-LK7V32MR.js";import{toast_default as a}from"./chunk-3DGTIWZP.js";import{useIsMobile as l,useShortcutLabel as i,useShellPrefs as o}from"./chunk-CIXQKCFA.js";import{isAriaDisabled as s,swallowPress as c,describedByWith as d,iconButtonClasses 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 x,placeMenu as y,followAnchor as v,buttonClasses as w,POPUP_MAX_WIDTH as k,placeAtPoint as N}from"./chunk-OGXU7QFW.js";import{useTabLayer as M,focusableIn as $,useFocusTrap as C,useScrollLock as L,stopAfter as D}from"./chunk-ZAE6ROV7.js";import{PopupMenu as A,MenuSemanticsContext as j,leavesContextMenuAlone as P,PopupMenuDivider as S,PopupMenuLabel as z,itemLook as F,MenuCheckMark as B}from"./chunk-AA4TMQOS.js";import{useDismissPopupsOnOpen as E}from"./chunk-AFYQTVZO.js";import{glassStyle as T}from"./chunk-HZZNJHRH.js";import{registerModalEscapeInterceptor as I,onOverlayOpen as O,Z_LAYERS as R}from"./chunk-X4FJ54PP.js";import{useBrowserLayoutEffect as W,useBrowserValue as H,useHydrated as _,useBrowserValueOnce as K,useBrowserState as q}from"./chunk-D65T4H6J.js";import{useFileIntake as U,humanSize as V,FileIntakeAlert as Y}from"./chunk-WNEO7TSP.js";import{useShellLocale as Z,useShellStrings as G,DEFAULT_SHELL_STRINGS as X,currentShellStrings as J,splitAround as Q}from"./chunk-J3LIIIHJ.js";import{formatPlain as ee,formatFixed as te,formatPercent as re}from"./chunk-C3QOHMR6.js";import{calendarNames as ne,firstDayOfWeek as ae,formatDate as le,EMPTY_VALUE as ie,toInstant as oe,timeAgo as se,formatDateTime as ce}from"./chunk-W32SKK3D.js";import{setIconSet as de,Icon as ue}from"./chunk-YKZHOXI4.js";import{forwardRef as he,useId as me,useCallback as pe,useState as ge,useRef as fe,useMemo as be,useEffect as xe,createContext as ye,Children as ve,isValidElement as we,cloneElement as ke,useContext as Ne,Fragment as Me,Component as $e,useSyncExternalStore as Ce,useLayoutEffect as Le}from"react";import{jsx as De,jsxs as Ae,Fragment as je}from"react/jsx-runtime";import{createPortal as Pe}from"react-dom";var Se=he(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",pressed:l,disabledReason:i,disabled:o,onClick:m,"aria-disabled":p,"aria-describedby":g,...f},b){const x=me(),y=(Boolean(o)||s(p))&&null!=i&&""!==i,v=y||s(p),w=/* @__PURE__ */De("button",{ref:b,type:n,className:u({variant:t,size:r,pressed:l??(!0===f["aria-pressed"]||"true"===f["aria-pressed"]),className:a}),...f,disabled:y?void 0:o,"aria-disabled":!!v||p,"aria-describedby":d(g,y?x:void 0),onClick:v?c:m,children:e});return y?/* @__PURE__ */De(h,{reason:i,id:x,children:w}):w}),ze="block w-full rounded-(--radius-control) border border-gray-300 bg-white",Fe="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)]",Be={sm:"px-2.5 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-3.5 py-2 text-base",touch:"h-14 px-4 text-base"},Ee=`${ze} ${Be.md} ${Fe}`,Te="disabled:cursor-not-allowed disabled:opacity-60";function Ie(e){return[e?.readOnly?`block w-full rounded-(--radius-control) border border-gray-300 bg-gray-50 ${Be[e.size??"md"]} ${Fe}`:e?.size&&"md"!==e.size?`${ze} ${Be[e.size]} ${Fe}`:Ee,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",Te,e?.className??""].filter(Boolean).join(" ")}var Oe=he(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__ */De("input",{ref:o,"aria-invalid":e||void 0,readOnly:l,className:Ie({invalid:e,size:n,readOnly:l,className:[s,a].filter(Boolean).join(" ")}),...i});return t||r?/* @__PURE__ */Ae("div",{className:"relative",children:[t&&/* @__PURE__ */De("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:t}),c,r&&/* @__PURE__ */De("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):c}),Re=he(function({invalid:e,autoGrow:t,className:r="",onInput:n,rows:a=3,size:l,readOnly:i,...o},s){const c=pe(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}n?.(e)},[t,n]);/* @__PURE__ */
|
|
3
|
-
return De("textarea",{ref:s,"aria-invalid":e||void 0,rows:a,onInput:c,readOnly:i,className:Ie({invalid:e,size:l,readOnly:i,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...o})});function We(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function He(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function _e(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?We(e):He(e)}function Ke(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 qe=e=>Array.isArray(e.options);function Ue(e){const t=[];for(const r of e)qe(r)?t.push(...r.options):t.push(r);return t}function Ve(e,t){const r=[];for(const n of e){if(!qe(n)){t(n)&&r.push(n);continue}const e=n.options.filter(t);e.length&&r.push({...n,options:e})}return r}function Ye(e,t,r,n=""){const a=[];let l=0;return e.forEach((e,i)=>{if(!qe(e))return a.push(t(e,l)),void(l+=1);const o=`${r}-group-${i}`,s=l;l+=e.options.length,a.push(
|
|
4
|
-
/* @__PURE__ */Ae("div",{role:"group","aria-labelledby":o,children:[
|
|
5
|
-
/* @__PURE__ */De("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 Ze({selected:e}){/* @__PURE__ */
|
|
6
|
-
return De("svg",{"aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(e?"":"invisible"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})}var Ge=he(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 Ae("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:Ie({invalid:a,size:i,className:`pr-8 ${l}`.trim()}),...m,children:[void 0!==n&&!h&&/* @__PURE__ */De("option",{value:"",disabled:!0,children:n}),
|
|
8
|
-
/* @__PURE__ */De(Xe,{items:r})]})});function Xe({items:e}){const t=e=>/* @__PURE__ */De("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
9
|
-
return De(je,{children:e.map((e,r)=>(e=>qe(e))(e)?/* @__PURE__ */De("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var Je=he(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":x,"aria-label":y,"aria-labelledby":v,...w},k){const[N,M]=ge(!1),[$,C]=ge(-1),L=fe(null),D=fe(null),A=fe(null),j=fe(N);j.current=N;const P=fe({buffer:"",timer:null}),S=me(),z=`${S}-listbox`,F=i??`${S}-trigger`,B=e=>`${S}-opt-${e}`,E=be(()=>Ue(r),[r]),W=u?e:[],H=t,_=m(D,N,{matchTriggerWidth:!0}),K=u?E.findIndex(e=>W.includes(e.value)):E.findIndex(t=>t.value===e),q=u?E.filter(e=>W.includes(e.value)).map(e=>e.label).join(", ")||void 0:K>=0?E[K].label:void 0,U=!u&&K>=0?E[K].lang:void 0,V=u?E.filter(e=>W.includes(e.value)):K>=0?[E[K]]:[],Y=g&&V.length?g(V):void 0,Z=void 0!==Y&&f?f(V):void 0,G=pe((e=!0)=>{M(!1),C(-1),e&&D.current?.focus()},[]),X=pe(()=>{o||b||(C(K>=0?K:We(E)),M(!0))},[o,b,E,K]),J=pe(t=>{const r=E[t];if(r&&!r.disabled){if(u){const n=e;return H(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void C(t)}H(r.value),G()}},[E,u,e,H,G]);xe(()=>{if(!N)return;return I(e=>!("Escape"!==e.key||!j.current)&&(G(),!0),()=>A.current)},[N,G]),xe(()=>{if(!N)return;const e=e=>{const t=e.target;L.current?.contains(t)||A.current?.contains(t)||G(!1)};document.addEventListener("pointerdown",e);const t=O(()=>G(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[N,G]),xe(()=>{!N||$<0||A.current?.querySelector(`#${CSS.escape(B($))}`)?.scrollIntoView({block:"nearest"})});const Q=pe(e=>{const t=P.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=N?$:K,n=Ke(E,t.buffer,r);n<0||(N?C(n):u?(C(n),M(!0)):J(n))},[N,$,K,E,J,u]),ee=N?Ye(r,(t,r)=>{const n=(a=t.value,u?W.includes(a):e===a);var a;const l=r===$;/* @__PURE__ */
|
|
10
|
-
return Ae("div",{id:B(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 px-3 py-1.5 text-sm${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__ */De(Ze,{selected:n}),h?/* @__PURE__ */De("span",{className:"block min-w-0 flex-1 truncate",children:h(t,{selected:n,active:l})}):u?/* @__PURE__ */Ae("span",{className:"block min-w-0 flex-1",children:[
|
|
11
|
-
/* @__PURE__ */De("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */De("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.description?
|
|
12
|
-
/* @__PURE__ */Ae(je,{children:[
|
|
13
|
-
/* @__PURE__ */De("span",{lang:t.lang,className:"block truncate",children:t.label}),
|
|
14
|
-
/* @__PURE__ */De("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},S,"mx-1"):null;/* @__PURE__ */
|
|
15
|
-
return Ae("div",{ref:L,className:"relative",children:[
|
|
16
|
-
/* @__PURE__ */De("button",{ref:D,id:F,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":N,"aria-controls":N?z:void 0,"aria-activedescendant":N&&$>=0?B($):void 0,"aria-invalid":a||void 0,"aria-describedby":x,"aria-label":y,"aria-labelledby":v,title:d,disabled:o,"aria-readonly":b||void 0,onClick:()=>N?G():X(),onKeyDown:e=>{if(!o&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(N?C(e=>_e(E,e,1)):X());case"ArrowUp":return e.preventDefault(),void(N?C(e=>_e(E,e,-1)):X());case"Home":return void(N&&(e.preventDefault(),C(We(E))));case"End":return void(N&&(e.preventDefault(),C(He(E))));case"Enter":return void(N&&(e.preventDefault(),J($)));case" ":return e.preventDefault(),void(N?J($):X());case"Escape":return void(N&&(e.preventDefault(),e.stopPropagation(),G()));case"Tab":return void(N&&G(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),Q(e.key))}},className:Ie({invalid:a,size:s,readOnly:b,className:`${b?"":"pr-8 "}text-left ${l}`.trim()}),children:void 0!==Y?
|
|
17
|
-
/* @__PURE__ */Ae("span",{className:"relative block min-w-0 truncate",children:[
|
|
18
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-1.5 truncate",children:Y}),
|
|
19
|
-
/* @__PURE__ */De("span",{lang:void 0===Z?U:void 0,className:"sr-only",children:Z??q})]}):/* @__PURE__ */De("span",{lang:U,className:"block truncate "+(void 0===q?"text-gray-400":""),children:q??n??" "})}),!b&&/* @__PURE__ */De("svg",{"aria-hidden":"true",className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9l3.75-3.75L15.75 9M8.25 15l3.75 3.75L15.75 15"})}),
|
|
20
|
-
/* @__PURE__ */Ae("select",{ref:k,value:e,multiple:u||void 0,onChange:e=>H(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__ */De("option",{value:"",disabled:!0,children:n}),
|
|
21
|
-
/* @__PURE__ */De(Xe,{items:r})]}),N&&Pe(
|
|
22
|
-
/* @__PURE__ */De("div",{ref:A,id:z,role:"listbox","aria-labelledby":v??(y?void 0:F),"aria-label":v?void 0:y,"aria-multiselectable":u||void 0,className:"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:{zIndex:R.popup,left:_?.left,top:_?.top,bottom:_?.bottom,width:_?.width,maxHeight:_?.maxHeight??p,visibility:_?void 0:"hidden",...T()},children:ee}),document.body)]})}),Qe=he(function({touchSize:e="touch",...t},r){return l()&&!t.readOnly?/* @__PURE__ */De(Ge,{ref:r,...t,size:e}):/* @__PURE__ */De(Je,{ref:r,...t})});function et(e,t,r,n){const a=me(),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 tt=he(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=fe(null),h=et(n,a,o,s);xe(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=pe(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */De("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__ */Ae("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
|
|
23
|
-
/* @__PURE__ */Ae("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */De("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */De("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),rt="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",nt=he(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":o,...s},c){const d=et(r,n,i,o);return r||n?/* @__PURE__ */Ae("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
|
|
24
|
-
/* @__PURE__ */De("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${rt} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s}),
|
|
25
|
-
/* @__PURE__ */Ae("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */De("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */De("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */De("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${rt} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s})});function at({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===ve.count(o)?ve.only(o):null,d=we(c)?c:null,u={};d&&(s&&(u["aria-describedby"]=[d.props["aria-describedby"],s].filter(Boolean).join(" ")),a&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0));const h=d&&Object.keys(u).length>0?ke(d,u):o;/* @__PURE__ */
|
|
26
|
-
return Ae("div",{className:i,children:[e&&/* @__PURE__ */Ae("label",{id:r,htmlFor:t,className:"mb-1 block text-xs font-medium text-gray-600",children:[e,l&&/* @__PURE__ */De("span",{"aria-hidden":"true",className:"ml-0.5 text-red-500",children:"*"})]}),h,a?
|
|
27
|
-
/* @__PURE__ */De("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-[11px] text-red-600",children:a}):n?/* @__PURE__ */De("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-[11px] text-gray-400",children:n}):null]})}var lt={vertical:"flex flex-col gap-2",horizontal:"flex flex-wrap items-start gap-x-6 gap-y-2"};function it({label:e,hint:t,error:r,required:n,name:a,value:l,onChange:i,options:o,orientation:s="vertical",disabled:c=!1,className:d=""}){const u=me(),h=e?`${u}-label`:void 0;/* @__PURE__ */
|
|
28
|
-
return De(at,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */De("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:lt[s],children:o.map(e=>/* @__PURE__ */De(nt,{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 ot({errors:e,title:t,autoFocus:r=!0,className:n=""}){const a=G(),l=fe(null),i=fe(!1);if(xe(()=>{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
|
-
return Ae("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
|
-
/* @__PURE__ */De("h2",{className:"text-sm font-semibold text-red-800",children:t??a.form.errorSummaryTitle}),
|
|
31
|
-
/* @__PURE__ */De("ul",{className:"mt-1.5 space-y-1",children:e.map((e,t)=>/* @__PURE__ */De("li",{children:/* @__PURE__ */De("a",{href:`#${e.fieldId}`,onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&(t.scrollIntoView({block:"center"}),t.focus())})(e.fieldId)},className:"text-sm text-red-700 underline hover:text-red-900",children:e.message})},`${e.fieldId}-${t}`))})]})}var st="text-xs font-medium text-gray-600";function ct({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",st,t].filter(Boolean).join(" ")}function dt({required:e,children:t,className:r="",...n}){/* @__PURE__ */
|
|
32
|
-
return Ae("label",{className:ct({className:r}),...n,children:[t,e&&/* @__PURE__ */De("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var ut=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function ht(e){if(/^data:/i.test(e||""))return function(e){const t=ut.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 mt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function pt(e,t=X.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 gt(e,t,r=""){return["flex w-full flex-col items-center justify-center gap-1.5 rounded-lg border-2 border-dashed text-center transition-colors",t?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",r].filter(Boolean).join(" ")}function ft(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function bt({label:e,rounded:t="rounded-lg"}){/* @__PURE__ */
|
|
33
|
-
return Ae("div",{role:"status",className:`absolute inset-0 flex items-center justify-center gap-2 bg-white/60 ${t}`,children:[
|
|
34
|
-
/* @__PURE__ */De(vt,{}),
|
|
35
|
-
/* @__PURE__ */De("span",{className:"text-xs font-medium text-gray-600",children:e})]})}function xt({children:e}){/* @__PURE__ */
|
|
36
|
-
return De("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-1.5 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function yt(e,t=""){if(!e)return!1;const r=ut.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return mt.test(e)||n&&!a}function vt({className:e="h-5 w-5"}){/* @__PURE__ */
|
|
37
|
-
return Ae("svg",{className:`${e} animate-spin text-gray-400`,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
|
|
38
|
-
/* @__PURE__ */De("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
|
|
39
|
-
/* @__PURE__ */De("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function wt({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
40
|
-
return De("svg",{className:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M6 6l8 8M14 6l-8 8"})})}function kt({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
41
|
-
return Ae("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
|
|
42
|
-
/* @__PURE__ */De("path",{d:"M12 15V4"}),
|
|
43
|
-
/* @__PURE__ */De("path",{d:"M8 8l4-4 4 4"}),
|
|
44
|
-
/* @__PURE__ */De("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function Nt({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:x=!0,allowRemove:y=!0,replaceLabel:v,removeLabel:w,busy:k=!1,busyLabel:N,disabled:M=!1}){const $=G().media,C=p??$.cta,L=v??$.replace,D=w??$.remove,A=N??$.uploading,j=me(),P=fe(null),[S,z]=ge(null);xe(()=>()=>{P.current&&URL.revokeObjectURL(P.current)},[]);const F=M||k,B=!!e&&(yt(e,c)||e===S),E=m??pt(c,$),T=e=>{r?r(e):n?n(e):(e=>{P.current&&URL.revokeObjectURL(P.current);const r=URL.createObjectURL(e);P.current=r,z(e.type.startsWith("video/")?r:null),t(r)})(e)},I=U({accept:c,maxSizeBytes:d,acceptHint:f,multiple:!1,disabled:F,onAccept:([e])=>T(e)}),{dragOver:O}=I,R=()=>{F||(r?r():I.open())},W=e?ht(e):"",H=/* @__PURE__ */Ae("div",{children:[
|
|
45
|
-
/* @__PURE__ */Ae("div",{...I.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",O?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[B?/* @__PURE__ */De("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__ */De("img",{src:e??void 0,alt:W,className:"h-full w-full",style:{objectFit:u}}),b&&e&&/* @__PURE__ */De(xt,{children:W}),k&&/* @__PURE__ */De(bt,{label:A,rounded:"rounded-md"})]}),!M&&(x||y)&&/* @__PURE__ */Ae("div",{className:"mt-2 flex gap-2",children:[x&&/* @__PURE__ */De(g,{id:j,variant:"secondary",size:"sm",onClick:()=>R(),disabled:k,children:L}),y&&/* @__PURE__ */De(g,{variant:"ghost",size:"sm",onClick:()=>{P.current&&(URL.revokeObjectURL(P.current),P.current=null),z(null),t("")},disabled:k,children:D})]})]}),_=/* @__PURE__ */De("button",{type:"button",id:j,onClick:()=>R(),disabled:F,"aria-label":"string"==typeof E?E:$.upload,"aria-busy":k||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${j}-error`:l?`${j}-hint`:void 0,...I.zoneProps,className:gt(O,F,ft(F)),style:{minHeight:h},children:k?/* @__PURE__ */Ae("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
|
|
46
|
-
/* @__PURE__ */De(vt,{}),
|
|
47
|
-
/* @__PURE__ */De("span",{className:"text-xs font-medium text-gray-500",children:A})]}):/* @__PURE__ */Ae(je,{children:[
|
|
48
|
-
/* @__PURE__ */De("span",{className:"text-gray-400",children:/* @__PURE__ */De(kt,{})}),
|
|
49
|
-
/* @__PURE__ */De("span",{className:"px-3 text-xs text-gray-500",children:E}),
|
|
50
|
-
/* @__PURE__ */De("span",{className:"text-sm font-medium text-blue-600",children:C}),f&&/* @__PURE__ */De("span",{className:"text-xs text-gray-400",children:f})]})});/* @__PURE__ */
|
|
51
|
-
return Ae(at,{label:a,htmlFor:j,hint:l,error:i,required:o,className:s,children:[e?H:_,!r&&/* @__PURE__ */De("input",{...I.inputProps}),
|
|
52
|
-
/* @__PURE__ */De(Y,{rejections:I.rejections})]})}function Mt({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=fe(null),[x,y]=ge(null),[v,w]=ge(""),[k,N]=ge(""),[M,$]=ge(!1),[C,L]=ge(!1),D=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(s),A=G().brandAsset,j=v||e||a||"",P=x?null:e?t:l,S=x?null:e?n:i;xe(()=>()=>{b.current&&URL.revokeObjectURL(b.current)},[]);const z=()=>{b.current&&(URL.revokeObjectURL(b.current),b.current=null)};/* @__PURE__ */
|
|
53
|
-
return Ae("section",{"aria-label":A.region(s,o),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
54
|
-
/* @__PURE__ */Ae("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
55
|
-
/* @__PURE__ */De(Nt,{value:j,onChange:()=>{},onFile:e=>{if(f)return;z();const t=URL.createObjectURL(e);b.current=t,y(e),w(t),N("")},label:s,hint:k||A.usedFor(o),error:k||void 0,accept:u,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:M||C,disabled:f}),
|
|
56
|
-
/* @__PURE__ */Ae("div",{className:"mt-3 flex flex-wrap gap-2",children:[
|
|
57
|
-
/* @__PURE__ */De(g,{onClick:async()=>{if(x&&!f&&!M){$(!0),N("");try{await c(x),z(),y(null),w("")}catch(e){N(e instanceof Error?e.message:A.saveFailed(D,s))}finally{$(!1)}}},disabled:!x||f,loading:M,children:A.save(D,s)}),(x||e)&&/* @__PURE__ */De(g,{variant:"ghost-danger",onClick:async()=>{if(!f&&!C){if(x)return z(),y(null),w(""),void N("");if(e){L(!0),N("");try{await d()}catch(e){N(e instanceof Error?e.message:A.removeFailed(D,s))}finally{L(!1)}}}},disabled:f,loading:C,children:x?A.discard:A.remove(D,s)})]})]}),p.length>0&&/* @__PURE__ */Ae("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":A.previews(s),children:[
|
|
58
|
-
/* @__PURE__ */De("h3",{className:"text-sm font-semibold text-gray-900",children:A.preview}),
|
|
59
|
-
/* @__PURE__ */De("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const t=/* @__PURE__ */De(r,{src:j,alt:A.alt(o,s),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:P,isLight:S,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
|
|
60
|
-
return Ae("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
|
|
61
|
-
/* @__PURE__ */De("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */Ae("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
|
|
62
|
-
/* @__PURE__ */Ae("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[t,
|
|
63
|
-
/* @__PURE__ */De("span",{className:"truncate text-xs text-gray-700",children:e.title??o}),
|
|
64
|
-
/* @__PURE__ */De("span",{className:"text-gray-400",children:"×"})]}),
|
|
65
|
-
/* @__PURE__ */De("span",{className:"mb-1 ml-1 text-gray-400",children:"+"})]}):"search-result"===e.kind?/* @__PURE__ */Ae("div",{className:"rounded-lg border border-gray-200 bg-white p-3",children:[
|
|
66
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center gap-2",children:[
|
|
67
|
-
/* @__PURE__ */De("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}),
|
|
68
|
-
/* @__PURE__ */Ae("div",{className:"min-w-0 leading-tight",children:[
|
|
69
|
-
/* @__PURE__ */De("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??o}),e.url&&/* @__PURE__ */De("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
|
|
70
|
-
/* @__PURE__ */De("div",{className:"mt-1.5 text-sm font-medium text-blue-700",children:e.title??o}),e.description&&/* @__PURE__ */De("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */Ae("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,
|
|
71
|
-
/* @__PURE__ */De("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function $t(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 Ct=ye(null);function Lt(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 Dt({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=ge(t),[i,o]=ge(!0),[s,c]=ge(null),d=fe(e),u=fe(t);d.current=e,u.current=t,xe(()=>{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()}},[]),xe(()=>(Lt(a.favicon_url),()=>Lt(null)),[a.favicon_url]),xe(()=>{r&&(document.title=r(a))},[a,r]);const h=be(()=>({branding:a,loading:i,error:s}),[a,i,s]);/* @__PURE__ */
|
|
72
|
-
return De(Ct.Provider,{value:h,children:n})}function At(){const e=Ne(Ct);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var jt=/* @__PURE__ */De("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */De("path",{d:"M6 6l12 12M18 6L6 18"})});function Pt({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:x=!1,coverLabel:y,busy:v=!1,busyLabel:w,disabled:k=!1,readOnly:N=!1}){const M=G().media,$=f??M.cta,C=y??M.cover,L=w??M.uploading,D=me(),[A,j]=ge(null),P=k||v,S=!(!t&&!r||P||N),z=!!n&&!P&&!N,F=!!a&&!P&&!N,B=ft(P),E=g??pt(d,M),T=U({accept:d,maxSizeBytes:u,maxFiles:h,acceptHint:b,multiple:!0,disabled:!S,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),I=T.dragOver,O=()=>{S&&(t?t():T.open())},R={width:p,height:p},W=S&&/* @__PURE__ */Ae("button",{type:"button",onClick:()=>O(),"aria-label":M.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 ${B}`,style:R,children:[
|
|
73
|
-
/* @__PURE__ */De(kt,{className:"h-5 w-5"}),
|
|
74
|
-
/* @__PURE__ */De("span",{className:"text-xs font-medium text-gray-500",children:M.add})]}),H=S?/* @__PURE__ */Ae("button",{type:"button",onClick:()=>O(),"aria-label":"string"==typeof E?E:M.upload,className:gt(I,!1,B),style:{minHeight:p+32},children:[
|
|
75
|
-
/* @__PURE__ */De("span",{className:"text-gray-400",children:/* @__PURE__ */De(kt,{})}),
|
|
76
|
-
/* @__PURE__ */De("span",{className:"px-3 text-xs text-gray-500",children:E}),
|
|
77
|
-
/* @__PURE__ */De("span",{className:"text-sm font-medium text-blue-600",children:$}),b&&/* @__PURE__ */De("span",{className:"text-xs text-gray-400",children:b})]}):/* @__PURE__ */De("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:M.empty});/* @__PURE__ */
|
|
78
|
-
return Ae(at,{label:l,labelId:l?`${D}-label`:void 0,htmlFor:D,hint:i,error:o,required:s,className:c,children:[
|
|
79
|
-
/* @__PURE__ */Ae("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,...T.zoneProps,className:"relative rounded-lg transition-colors",style:{...P?{opacity:.6}:{},...I?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?H:/* @__PURE__ */Ae("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:yt(t.url,d),i=ht(t.url),o=x&&(t.cover??0===r);/* @__PURE__ */
|
|
80
|
-
return Ae("div",{draggable:F||void 0,onDragStart:F?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),j(r)}:void 0,onDragEnd:F?()=>j(null):void 0,onDragOver:F?e=>{null!=A&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:F?e=>{null!=A&&(e.preventDefault(),e.stopPropagation(),A!==r&&a(A,r),j(null))}:void 0,tabIndex:F?0:void 0,"aria-label":F?M.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",B,A===r?"opacity-50":""].join(" "),style:{...R,cursor:F?"move":void 0},children:[l?/* @__PURE__ */De("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */De("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),o&&/* @__PURE__ */De("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-1.5 py-0.5 text-xs font-medium text-white",children:C}),null!=t.caption&&/* @__PURE__ */De(xt,{children:t.caption}),z&&/* @__PURE__ */De("button",{type:"button",onClick:()=>n(t.id),"aria-label":M.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${B}`,style:{background:"var(--rosh-media-scrim-button)"},children:jt})]},t.id)}),W]}),v&&/* @__PURE__ */De(bt,{label:L})]}),!t&&r&&/* @__PURE__ */De("input",{...T.inputProps}),
|
|
81
|
-
/* @__PURE__ */De(Y,{rejections:T.rejections})]})}var St=e=>String(e).padStart(2,"0");function zt(e){return`${e.getFullYear()}-${St(e.getMonth()+1)}-${St(e.getDate())}`}function Ft(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 Bt=e=>`${e.getFullYear()}-${St(e.getMonth()+1)}`;var Et=()=>zt(/* @__PURE__ */new Date);var Tt=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),It=(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 Ot({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:o,onMonthChange:s,weekStartsOn:c,quickJump:d=!0,"aria-label":u,className:h=""}){const m=Ft(e),p=H(Et,null),g=Ft(p),f=G().calendar,b=Z(),x=ne(b),y=H(()=>ae(b),0),v=c??y,w=()=>{if(!g)return null;const e=Bt(g);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[k,N]=ge(()=>o||(m?Bt(m):w())),M=i??k??w(),$=null===M?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}(M,g),[C,L]=ge(()=>e??p),D=fe(null),A=fe(!1),[j,P]=ge("days"),S=be(()=>$?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))}($,v):[],[M,v]),z=e=>!!a&&e<a||!!l&&e>l,F=C??p,B=S.some(e=>zt(e)===F),E=$?S.find(e=>e.getMonth()===$.getMonth())??S[0]:null,T=B&&F?F:E?zt(E):"";if(xe(()=>{A.current&&(A.current=!1,D.current?.querySelector('[data-active="true"]')?.focus())},[T,M]),!$)/* @__PURE__ */
|
|
82
|
-
return Ae("div",{className:h,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
83
|
-
/* @__PURE__ */De("div",{className:"mb-2 h-6"}),Array.from({length:7},(e,t)=>/* @__PURE__ */De("div",{className:0===t?"py-1 text-xs":"py-1.5 min-h-11 sm:min-h-0 text-sm",children:" "},t))]});const I=e=>"years"===j?new Date($.getFullYear()+12*e,$.getMonth(),1):"months"===j?new Date($.getFullYear()+e,$.getMonth(),1):It($,e),O=e=>{const t=Bt(e);void 0===i&&N(t),s?.(t)},R=u??x.monthYear($.getFullYear(),$.getMonth());/* @__PURE__ */
|
|
84
|
-
return Ae("div",{className:h,children:[
|
|
85
|
-
/* @__PURE__ */Ae("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
86
|
-
/* @__PURE__ */De("button",{type:"button","aria-label":"years"===j?f.previousYears:"months"===j?f.previousYear:f.previousMonth,onClick:()=>O(I(-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__ */De("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),
|
|
87
|
-
/* @__PURE__ */De("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */Ae(je,{children:["years"!==j&&/* @__PURE__ */De("button",{type:"button","aria-label":f.chooseMonth(x.months[$.getMonth()]),onClick:()=>P(e=>"months"===e?"days":"months"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:x.months[$.getMonth()]}),
|
|
88
|
-
/* @__PURE__ */De("button",{type:"button","aria-label":f.chooseYear($.getFullYear()),onClick:()=>P(e=>"years"===e?"days":"years"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:$.getFullYear()})]}):/* @__PURE__ */De("span",{children:x.monthYear($.getFullYear(),$.getMonth())})}),
|
|
89
|
-
/* @__PURE__ */De("button",{type:"button","aria-label":"years"===j?f.nextYears:"months"===j?f.nextYear:f.nextMonth,onClick:()=>O(I(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__ */De("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})})]}),"months"===j&&/* @__PURE__ */De("div",{role:"group","aria-label":f.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:x.monthsShort.map((e,t)=>/* @__PURE__ */De("button",{type:"button","aria-pressed":t===$.getMonth(),onClick:()=>{O(new Date($.getFullYear(),t,1)),P("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===$.getMonth()?"bg-blue-600 font-semibold text-white":g&&t===g.getMonth()&&$.getFullYear()===g.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===j&&/* @__PURE__ */De("div",{role:"group","aria-label":f.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=$.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */De("button",{type:"button","aria-pressed":e===$.getFullYear(),onClick:()=>{O(new Date(e,$.getMonth(),1)),P("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===$.getFullYear()?"bg-blue-600 font-semibold text-white":e===g?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
90
|
-
/* @__PURE__ */Ae("div",{ref:D,role:"grid","aria-label":R,onKeyDown:e=>{const t=Ft(T)??g??$,r={ArrowLeft:()=>Tt(t,-1),ArrowRight:()=>Tt(t,1),ArrowUp:()=>Tt(t,-7),ArrowDown:()=>Tt(t,7),Home:()=>Tt(t,-(t.getDay()-v+7)%7),End:()=>Tt(t,6-(t.getDay()-v+7)%7),PageUp:()=>It(t,e.shiftKey?-12:-1),PageDown:()=>It(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),A.current=!0,L(zt(a)),void(Bt(a)!==M&&O(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),z(T)||n(T))},hidden:"days"!==j,children:[
|
|
91
|
-
/* @__PURE__ */De("div",{role:"row",className:"grid grid-cols-7 text-center text-xs font-medium text-gray-500",children:Array.from({length:7},(e,t)=>(t+v)%7).map(e=>
|
|
92
|
-
/* @__PURE__ */De("div",{role:"columnheader","aria-label":x.weekdays[e],className:"py-1",children:/* @__PURE__ */De("abbr",{title:x.weekdays[e],className:"no-underline",children:x.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */De("div",{role:"row",className:"grid grid-cols-7 text-center text-sm",children:S.slice(7*l,7*l+7).map(a=>{const l=zt(a),i=a.getMonth()!==$.getMonth(),o=l===e||"range"===r&&l===t,s=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=z(l);/* @__PURE__ */
|
|
93
|
-
return De("div",{role:"gridcell","aria-selected":o,children:/* @__PURE__ */De("button",{type:"button","data-active":l===T,tabIndex:l===T?0:-1,disabled:c,"aria-label":x.longDate(a.getFullYear(),a.getMonth(),a.getDate()),"aria-current":l===p?"date":void 0,onClick:()=>{L(l),n(l)},className:["w-full rounded-md py-1.5 min-h-11 sm:min-h-0 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",c?"cursor-not-allowed text-gray-300":o?"bg-blue-600 font-semibold text-white":s?"bg-blue-100 text-blue-800":i?"text-gray-500 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100",l!==p||o?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),children:a.getDate()})},l)})},l))]})]})}var Rt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Wt=e=>`${e.getFullYear()}-${Ht(e.getMonth()+1)}`,Ht=e=>String(e).padStart(2,"0");function _t(e){return`${e.getFullYear()}-${Ht(e.getMonth()+1)}-${Ht(e.getDate())}`}function Kt(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:_t(new Date(r,n,t.getDate()-14)),to:_t(a)};case"lastMonth":return{from:_t(i(1)),to:_t(l)};case"last3Months":return{from:_t(i(3)),to:_t(l)};case"last6Months":return{from:_t(i(6)),to:_t(l)};case"last12Months":return{from:_t(i(12)),to:_t(l)}}}function qt(e,t,r){const n=Wt(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Ut(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function Vt(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Yt=/* @__PURE__ */new Map;function Zt({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}){const f=G().dateRange,b=Z(),x=n??(b?function(e){let t=Yt.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Yt.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(b):Vt),y=u??f.placeholder,v=a??!l,[w,k]=ge(!1),[N,M]=ge(e),[$,C]=ge(t),[L,D]=ge(null),A=fe(null),j=fe(null),P=fe(null),S=me(),z=me(),F=me(),[B,E]=ge(!1),I=m(A,w,{preferredMaxWidth:520,preferredMaxHeight:B?720:560,popupRef:P}),H=fe(null),_=fe(null);W(()=>{const e=P.current;if(!w||!I||!e)return;const t=getComputedStyle(e),r=I.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(B)null!==_.current&&_.current<=r&&E(!1);else{const e=H.current?.offsetWidth??0;if(0===e)return;_.current=e,e>r+.5&&E(!0)}});const[K,q]=ge(!1);W(()=>{const e=!!o&&(j.current?.labels?.length??0)>0;e!==K&&q(e)});const U=!!c||!!s||K,V=/* @__PURE__ */new Date,[Y,X]=ge(()=>e?Wt(Ut(e)):qt(V,p,g)),J=Rt.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(Kt(e,V),p,g)),Q=e=>e?x(e):"";xe(()=>{if(!w)return;const e=e=>{const t=e.target;A.current?.contains(t)||P.current?.contains(t)||k(!1)};document.addEventListener("mousedown",e);const t=O(()=>k(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[w]);const ee=()=>{r("",""),k(!1)},te=e&&t?`${Q(e)} — ${Q(t)}`:e?f.fromOnly(Q(e)):t?f.toOnly(Q(t)):"",re=ne(b),ae=e=>{const t=Ft(e);return t?re.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},le=e&&t?f.range(ae(e),ae(t)):e?f.fromOnly(ae(e)):t?f.toOnly(ae(t)):y,ie=e=>B?"rounded-(--radius-control) border px-2.5 py-1 text-sm transition-colors "+(L===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"text-left px-3 py-1.5 text-sm rounded-(--radius-control) transition-colors "+(L===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),oe=/* @__PURE__ */Ae(je,{children:[J.map(e=>/* @__PURE__ */De("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=Kt(e,V);M(t.from),C(t.to),D(e),X(t.from.slice(0,7))})(e),className:ie(e),children:f[e]},e)),
|
|
94
|
-
/* @__PURE__ */De("button",{type:"button",onClick:()=>D("Custom"),className:ie("Custom"),children:f.custom})]}),se=
|
|
95
|
-
/* @__PURE__ */De(Ot,{mode:"range",min:p,max:g,value:N||null,endValue:$||null,month:Y,onMonthChange:X,onSelect:e=>{D("Custom"),!N||N&&$?(M(e),C("")):e<N?(C(N),M(e)):C(e)},weekStartsOn:d,"aria-label":f.dialog});/* @__PURE__ */
|
|
96
|
-
return Ae("div",{className:"relative"+(h?" w-full":""),ref:A,children:[
|
|
97
|
-
/* @__PURE__ */Ae("div",{className:`${h?"flex w-full":"inline-flex"} items-center gap-2 border rounded-lg px-2.5 py-1.5 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${e||t?"border-blue-400 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500"}`,children:[
|
|
98
|
-
/* @__PURE__ */Ae("button",{ref:j,type:"button",onClick:()=>{M(e),C(t),D(null),X(e?Wt(Ut(e)):qt(V,p,g)),k(!0)},"aria-haspopup":"dialog","aria-expanded":w,id:o,"aria-label":c,"aria-labelledby":s,"aria-describedby":[U?z:void 0,l?F:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":w?S:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(h?" min-w-0 flex-1 justify-start":""),children:[
|
|
99
|
-
/* @__PURE__ */De("svg",{className:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),
|
|
100
|
-
/* @__PURE__ */De("span",{className:"truncate",children:te||y})]}),v&&(e||t)&&/* @__PURE__ */De("button",{type:"button",onClick:ee,"aria-label":f.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),U&&/* @__PURE__ */De("span",{id:z,className:"sr-only",children:le}),l&&/* @__PURE__ */De("span",{id:F,className:"sr-only",children:f.required}),i&&/* @__PURE__ */Ae(je,{children:[
|
|
101
|
-
/* @__PURE__ */De("input",{type:"hidden",name:i.from,value:e}),
|
|
102
|
-
/* @__PURE__ */De("input",{type:"hidden",name:i.to,value:t})]}),w&&Pe(
|
|
103
|
-
/* @__PURE__ */Ae("div",{ref:P,id:S,role:"dialog","aria-label":f.dialog,"data-layout":B?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:R.popup,left:I?.left,right:I?.right,top:I?.top,bottom:I?.bottom,width:B&&I?I.maxWidth:"max-content",maxWidth:I?.maxWidth,maxHeight:I?.maxHeight,overflowY:"auto",visibility:I?void 0:"hidden",...T()},children:[
|
|
104
|
-
/* @__PURE__ */Ae("div",{className:B?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
|
|
105
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
|
|
106
|
-
/* @__PURE__ */De("span",{className:"text-xs font-medium text-gray-500",children:f.from}),
|
|
107
|
-
/* @__PURE__ */De("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(N?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:N?Q(N):f.start})]}),!B&&/* @__PURE__ */De("span",{className:"text-gray-300",children:"—"}),
|
|
108
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
|
|
109
|
-
/* @__PURE__ */De("span",{className:"text-xs font-medium text-gray-500",children:f.to}),
|
|
110
|
-
/* @__PURE__ */De("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+($?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:$?Q($):f.end})]})]}),B?/* @__PURE__ */Ae(je,{children:[J.length>0&&/* @__PURE__ */De("div",{className:"mb-3 flex flex-wrap gap-1.5",children:oe}),
|
|
111
|
-
/* @__PURE__ */De("div",{className:"w-full",children:se})]}):
|
|
112
|
-
/* @__PURE__ */Ae("div",{ref:H,className:"flex w-max gap-4",children:[
|
|
113
|
-
/* @__PURE__ */De("div",{className:"w-64",children:se}),J.length>0&&/* @__PURE__ */De("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:oe})]}),
|
|
114
|
-
/* @__PURE__ */Ae("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[v&&/* @__PURE__ */De("button",{type:"button",onClick:ee,className:"px-3 py-1.5 text-sm text-gray-500 hover:text-gray-700",children:f.clear}),
|
|
115
|
-
/* @__PURE__ */De("button",{type:"button",onClick:()=>k(!1),className:"px-3 py-1.5 text-sm text-gray-600 border border-gray-300 rounded-(--radius-control) hover:bg-gray-50",children:f.cancel}),
|
|
116
|
-
/* @__PURE__ */De("button",{type:"button",onClick:()=>{r(N,$),k(!1)},disabled:!N||!$,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 rounded-(--radius-control) hover:bg-blue-700 disabled:opacity-50",children:f.apply})]})]}),document.body)]})}var Gt=/^\d{2}:\d{2}(:\d{2})?$/,Xt=e=>String(e).padStart(2,"0");function Jt(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Xt(e.getHours())}:${Xt(e.getMinutes())}`;return t?`${r}:${Xt(e.getSeconds())}`:r}return Gt.test(e)?e:""}var Qt=he(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=Z();/* @__PURE__ */
|
|
117
|
-
return De("input",{ref:c,type:"time",lang:u,step:o,"aria-invalid":a||void 0,value:Jt(e,d),min:Jt(r,d)||void 0,max:Jt(n,d)||void 0,onChange:e=>t?.(Gt.test(e.target.value)?e.target.value:null),className:Ie({invalid:a,size:l,className:i}),...s})}),er=/^\d{4}-\d{2}-\d{2}$/,tr=/^(aria|data)-/,rr=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function nr(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":_t(e);if(er.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":_t(t)}function ar(e){if(!er.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 lr(e,t){const r=ar(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var ir=he(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:x,form:y,title:v,tabIndex:w,autoFocus:k,onFocus:N,onBlur:M,...$},C){const L=x??!b,D=nr(e),A=nr(r),j=nr(n),P=G().datePicker,S=Z(),z=ne(S),[F,B]=ge(!1),E=fe(null),T=fe(null),H=fe(null),_=me(),K=me(),q=me(),U=m(T,F,{popupRef:H}),[V,Y]=ge(!1);W(()=>{const e=!!h&&(T.current?.labels?.length??0)>0;e!==V&&Y(e)});const X=!c&&(!!u||V);if(xe(()=>{if(!F)return;const e=e=>{const t=e.target;E.current?.contains(t)||H.current?.contains(t)||B(!1)};document.addEventListener("pointerdown",e,!0);const t=O(()=>B(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[F]),xe(()=>{if(F)return I(e=>"Escape"===e.key&&(B(!1),T.current?.focus(),!0),()=>H.current)},[F]),i)/* @__PURE__ */
|
|
118
|
-
return De("input",{ref:C,type:"date",lang:S,id:h,name:p,disabled:g,"aria-label":c,"aria-describedby":d,"aria-invalid":a||void 0,value:D,min:A||void 0,max:j||void 0,onChange:e=>t?.(ar(e.target.value)),className:Ie({invalid:a,size:l,className:s}),"aria-labelledby":u,required:b,form:y,title:v,tabIndex:w,autoFocus:k,onFocus:N,onBlur:M,...$});const J=Object.fromEntries(Object.entries($).filter(([e])=>tr.test(e)&&!rr.has(e))),Q=$["aria-required"],ee=!!b||!0===Q||"true"===Q,te=[X?K:void 0,ee?q:void 0,d].filter(Boolean).join(" ")||void 0,re=_t(/* @__PURE__ */new Date),ae=(!A||re>=A)&&(!j||re<=j),le=f??P.placeholder;/* @__PURE__ */
|
|
119
|
-
return Ae("div",{ref:E,className:"relative",children:[
|
|
120
|
-
/* @__PURE__ */De("input",{ref:C,type:"hidden",name:p,form:y,value:D}),
|
|
121
|
-
/* @__PURE__ */Ae("button",{ref:T,type:"button",...J,id:h,disabled:g,title:v,tabIndex:w,autoFocus:k,onFocus:N,onBlur:M,"aria-haspopup":"dialog","aria-expanded":F,"aria-controls":F?_:void 0,"aria-labelledby":u,"aria-describedby":te,"aria-label":c?`${c}${D?`, ${lr(D,z)}`:""}`:void 0,onClick:()=>B(e=>!e),className:`${Ie({invalid:a,size:l,className:s})} flex items-center justify-between text-left`,children:[
|
|
122
|
-
/* @__PURE__ */De("span",{className:D?"text-gray-900":"text-gray-400",children:D?lr(D,z):le}),
|
|
123
|
-
/* @__PURE__ */De("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3M4 11h16M5 7h14a1 1 0 011 1v11a1 1 0 01-1 1H5a1 1 0 01-1-1V8a1 1 0 011-1z"})})]}),X&&/* @__PURE__ */De("span",{id:K,className:"sr-only",children:D?lr(D,z):le}),ee&&/* @__PURE__ */De("span",{id:q,className:"sr-only",children:P.required}),F&&Pe(
|
|
124
|
-
/* @__PURE__ */Ae("div",{ref:H,id:_,role:"dialog","aria-label":c??P.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:R.popup,left:U?.left,right:U?.right,top:U?.top,bottom:U?.bottom,maxWidth:U?.maxWidth,visibility:U?void 0:"hidden"},children:[
|
|
125
|
-
/* @__PURE__ */De(Ot,{value:D||null,min:A||null,max:j||null,weekStartsOn:o,onSelect:e=>{B(!1),T.current?.focus(),t?.(ar(e))}}),(L||ae)&&/* @__PURE__ */Ae("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[L&&/* @__PURE__ */De("button",{type:"button",onClick:()=>{B(!1),T.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:P.clear}),ae&&/* @__PURE__ */De("button",{type:"button",onClick:()=>{B(!1),T.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:P.today})]})]}),document.body)]})}),or=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,sr=e=>String(e).padStart(2,"0");function cr(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${sr(t.getMonth()+1)}-${sr(t.getDate())}T${sr(t.getHours())}:${sr(t.getMinutes())}`:or.test(e)?e:"";var t}var dr=he(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",...o},s){const c=Z();/* @__PURE__ */
|
|
126
|
-
return De("input",{ref:s,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:cr(e),min:cr(r)||void 0,max:cr(n)||void 0,onChange:e=>t?.(function(e){if(!or.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:Ie({invalid:a,size:l,className:i}),...o})});function ur(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 hr(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 mr(e,t,r){const n=await hr(t,r),l=J().copy;return n?a.success(l.copiedLabel(e)):a.error(l.failed),n}var pr={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},gr={sm:{box:"gap-1.5 px-2.5 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 py-1.5 text-sm",button:"-my-0.5"}};function fr(){/* @__PURE__ */
|
|
127
|
-
return De("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function br(){/* @__PURE__ */
|
|
128
|
-
return De("svg",{className:"h-4 w-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function xr({value:e,children:t,symbol:r,label:n,size:l="md",variant:i="bordered",hideCopyButton:o=!1,onCopy:s,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=ge(!1),g=fe(null),f=G().copy;xe(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=pe(async()=>{await hr(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),s?.(e)):a.error(f.failed)},[e,s,f]),{box:x,button:y}=gr[l],v=!o;/* @__PURE__ */
|
|
129
|
-
return Ae("div",{id:v?void 0:d,"aria-describedby":v?void 0:u,className:["inline-flex max-w-full items-center rounded-md",pr[i],x,h].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */De("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
|
|
130
|
-
/* @__PURE__ */De("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__ */Ae(je,{children:[
|
|
131
|
-
/* @__PURE__ */De(Se,{id:d,"aria-label":n?f.copyLabel(n):f.copy,"aria-describedby":u,onClick:b,className:`${y} text-gray-400`,children:/* @__PURE__ */De(m?br:fr,{})}),
|
|
132
|
-
/* @__PURE__ */De("span",{"aria-live":"polite",className:"sr-only",children:m?f.copied:""})]})]})}var yr=2;function vr(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 wr(e){return e.slice(0,-1)}var kr=["1","2","3","4","5","6","7","8","9",".","0"];function Nr({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=G().keypad,o=r=>{r!==e&&t(r)};/* @__PURE__ */
|
|
133
|
-
return Ae("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[kr.map(t=>/* @__PURE__ */De(g,{size:"touch-xl",variant:"secondary",onClick:()=>o(vr(e,t)),children:t},t)),
|
|
134
|
-
/* @__PURE__ */De(g,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>o(wr(e)),children:"⌫"}),r&&/* @__PURE__ */De(g,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var Mr={md:"h-24 p-3",lg:"h-32 p-4"},$r=he(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...o},s){/* @__PURE__ */
|
|
135
|
-
return Ae("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)]",Mr[r],i].filter(Boolean).join(" "),...o,children:[
|
|
136
|
-
/* @__PURE__ */De("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */De("span",{className:"text-sm text-gray-500",children:t})]})}),Cr={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},Lr="bg-white text-gray-900 shadow-sm ring-1 ring-inset ring-[color:var(--ink-faint)] rosh-segmented-on",Dr="text-gray-600 hover:text-gray-900";function Ar({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=me(),h=`inline-flex max-w-full items-center gap-1 overflow-x-auto rounded-(--radius-card) bg-gray-100 p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden ${l?"w-full":""} ${o}`.trim(),m=("relative inline-flex shrink-0 "+(l?"flex-1":"")).trim(),p="inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-(--radius-control) font-medium transition-colors "+(l?"flex-1":"");/* @__PURE__ */
|
|
137
|
-
return De("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const l=`${u}-${r.value}`,i=r.value===e,o=/* @__PURE__ */Ae("label",{htmlFor:l,className:[p,"relative",Cr[a],i?Lr:Dr,r.disabled?"cursor-not-allowed opacity-40":"cursor-pointer"].join(" "),children:[
|
|
138
|
-
/* @__PURE__ */De("input",{id:l,type:"radio",name:n,value:r.value,checked:i,disabled:r.disabled,"aria-describedby":r.title?`${l}-note`:void 0,onChange:()=>t(r.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),r.icon,r.label,r.title&&/* @__PURE__ */De("span",{id:`${l}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */De(f,{content:r.title,className:m,children:o},r.value):o})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e,l=/* @__PURE__ */Ae("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:[p,Cr[a],n?Lr:Dr,"disabled:cursor-not-allowed disabled:opacity-40"].join(" "),children:[r.icon,r.label]},r.value);return r.title?/* @__PURE__ */De(f,{content:r.title,className:m,children:l},r.value):l})})}var jr={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},Pr={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},Sr={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},zr=he(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=me(),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,x=[p,g??b].filter(Boolean).join(" ")||void 0,y=/* @__PURE__ */De("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":x,disabled:r,onClick:()=>t(!e),...d,className:["relative inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]","disabled:cursor-not-allowed disabled:opacity-40",jr[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */De("span",{className:["inline-block rounded-full bg-white shadow transition-transform",Pr[n],e?Sr[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */Ae("span",{className:`flex items-start gap-3 ${o}`.trim(),children:[y,
|
|
139
|
-
/* @__PURE__ */Ae("span",{className:"min-w-0",children:[a&&/* @__PURE__ */De("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */De("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */De("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */De("span",{className:o,children:y})});function Fr(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var Br=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function Er(e){const t=e.trim().replace(",",".");if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}function Tr({dir:e,compact:t,label:r,disabled:n,onStep:a}){const l=fe(a);l.current=a;const i=fe({}),o=pe(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);xe(()=>o,[o]),xe(()=>{n&&o()},[n,o]);const s=/* @__PURE__ */De("svg",{"aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:t?2.6:2,children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e>0?"M4.5 15.75l7.5-7.5 7.5 7.5":"M19.5 8.25l-7.5 7.5-7.5-7.5"})}),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__ */De("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__ */De(Se,{size:"sm",...c,children:s})}var Ir=he(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:x=!1,stepFrom:y,snap:v=!1,allowEmpty:w=!0,"aria-label":k,"aria-labelledby":N},M){const $=G(),[C,L]=ge(()=>Br(e,a)),D=fe(C);D.current=C;const A=fe(null),j=pe(e=>{A.current=e,"function"==typeof M?M(e):M&&(M.current=e)},[M]),P=fe(e),S=fe(e);S.current=e;const z=Boolean(o||s),F="compact"===x;xe(()=>{Er(D.current)!==e&&L(Br(e,a))},[e,a]);const B=e=>{if(z)return;let i=(Er(D.current)??y??(d?Er(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=Br(i,a);D.current=s,L(s),t(i)},E=fe(B);E.current=B;const[T,O]=ge(!1);xe(()=>{if(T&&!z)return I(e=>{if("Escape"!==e.key||document.activeElement!==A.current)return!1;const r=P.current;if(Er(D.current)===r)return!1;const n=Br(r,a);return D.current=n,L(n),S.current!==r&&t(r),!0})},[T,z,a,t]);const R=()=>{const e=Er(D.current);if(null==e){if(!w){const e=Br(S.current,a);return D.current=e,L(e),S.current}return D.current="",L(""),null!==S.current&&t(null),null}let i=e;const o=a??(v?Math.max(Fr(l??1),Fr(r??0)):void 0);if(v){const e=l??1,t=r??0;i=t+Math.round((i-t)/e)*e}null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n),null!=o&&(i=Number(i.toFixed(o)));const s=Br(i,a);return D.current=s,L(s),i===e&&i===S.current||t(i),i},W=/* @__PURE__ */De("input",{ref:j,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:Br(e,a),"aria-invalid":c||void 0,"aria-label":k,"aria-labelledby":N,onChange:e=>(e=>{if(s)return;if(""!==e&&!/^-?\d*[.,]?\d*$/.test(e))return;L(e);const r=Er(e);(null!==r||w)&&t(r)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!z)return void(P.current=R());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(),B(n))},onFocus:()=>{P.current=S.current,O(!0)},onBlur:()=>{O(!1),R(),b?.()},className:Ie({invalid:c,size:u,readOnly:s,className:[h?"pl-7":"",F?m?"pr-12":"pr-6":x?m?"pr-24":"pr-16":m?"pr-9":"","text-right tabular-nums",f].filter(Boolean).join(" ")})});if(!h&&!m&&!x)return W;const H=Er(C);/* @__PURE__ */
|
|
140
|
-
return Ae("div",{className:"relative",children:[h&&/* @__PURE__ */De("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__ */De("span",{className:`pointer-events-none absolute ${F?"right-6":x?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-sm text-gray-500`,children:m}),x&&(()=>{const e=/* @__PURE__ */De(Tr,{dir:-1,compact:F,label:$.number.decrease,disabled:z||null!=r&&null!=H&&H<=r,onStep:e=>E.current(-(e?i??10*(l??1):l??1))}),t=/* @__PURE__ */De(Tr,{dir:1,compact:F,label:$.number.increase,disabled:z||null!=n&&null!=H&&H>=n,onStep:e=>E.current(e?i??10*(l??1):l??1)});/* @__PURE__ */
|
|
141
|
-
return Ae("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]})})()]})}),Or=(e,t,r)=>Math.min(r,Math.max(t,e));function Rr(e,t,r,n){return Number(Or(e,t,r).toFixed(n))}function Wr({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:x,size:y="md",className:v=""}){const w=G(),k=me(),N=b??k,M=i??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(a),$=o??r,C=s??n,L=void 0!==u||void 0!==h,D=m??h,A=Or(e??h??r,r,n),j=e=>f?f(e):"string"==typeof c?`${e.toFixed(M)} ${c}`:void 0,P=null==e?u??(null!=h?j(h)??String(h):void 0):j(e);/* @__PURE__ */
|
|
142
|
-
return Ae("div",{className:`flex items-center gap-3 ${v}`.trim(),children:[
|
|
143
|
-
/* @__PURE__ */De("input",{id:N,type:"range",min:r,max:n,step:a,value:A,disabled:x,"aria-label":g?void 0:p,"aria-labelledby":g,"aria-valuetext":P,onKeyDown:i=>{const o="ArrowUp"===i.key||"ArrowRight"===i.key?1:"ArrowDown"===i.key||"ArrowLeft"===i.key?-1:0;if(!o||i.altKey||i.ctrlKey||i.metaKey)return;const s=i.shiftKey&&null!=l;if(!s&&!(null==e&&null!=D))return;i.preventDefault();t(Rr((e??D??A)+o*(s?l??a:a),r,n,M))},onChange:e=>t(Rr(Number(e.target.value),r,n,M)),className:"min-w-0 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===y?"h-1":"h-1.5")}),d&&/* @__PURE__ */De("div",{className:"sm"===y?"w-16 shrink-0":"w-20 shrink-0",children:/* @__PURE__ */De(Ir,{value:e,onChange:e=>{null!=e?e<$||e>C||t(e):L&&t(null)},min:$,max:C,step:a,shiftStep:l,stepFrom:D,precision:M,snap:!0,allowEmpty:L,suffix:c,disabled:x,placeholder:u??(null!=h?h.toFixed(M):void 0),size:"sm","aria-label":p?w.slider.value(p):void 0,"aria-labelledby":p?void 0:g})})]})}var Hr=/(^|[\s:])!?z-/;function _r({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:k="",triggerClassName:N,panelClassName:C=""}){const[L,A]=ge(s),j=(o??L)&&!f,P=_(),S=fe(null),z=fe(null),F=fe(null),B=fe(null),E=me(),T=m??E,H=me(),K=me(),q=me(),U=fe(null),V=fe(!1),Y=fe({openProp:o,onOpenChange:c});Y.current={openProp:o,onOpenChange:c};const Z=pe(e=>{void 0===Y.current.openProp&&A(e),Y.current.onOpenChange?.(e)},[]),G=pe((e=!1)=>{V.current=e,Z(!1)},[Z]),X=e=>{U.current=e.nativeEvent},J=pe(()=>{const e=F.current,t=z.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=b(t),a=Math.max(0,n.right-n.left-2*x),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=y({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]);W(()=>{j&&P&&J()}),xe(()=>{if(!j||!P)return;const e=v(()=>z.current,J),t=B.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>J());return r.observe(t),()=>{e(),r.disconnect()}},[j,P,J]),xe(()=>{if(!j)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(U.current===e)return!1;const t=e.target;return!(t&&(S.current?.contains(t)||F.current?.contains(t)))})(e)&&G(!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=O(()=>G()),a=I(e=>"Escape"===e.key&&(G(),z.current?.focus(),!0),()=>F.current);return()=>{t(),r(),n(),a()}},[j,G]),M(F,j&&P),W(()=>{if(!j||!P)return;const e=F.current;return()=>{if(V.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||z.current?.focus({preventScroll:!0})}},[j,P]),xe(()=>{if(!j||!P)return;const e=F.current;e&&(V.current=!1,(h?.current??$(e)[0]??e).focus({preventScroll:!0}))},[j,P]);const Q="function"==typeof t?t({close:()=>G()}):t,ee=r?{"aria-labelledby":K}:a?{"aria-label":a}:{"aria-labelledby":T};/* @__PURE__ */
|
|
144
|
-
return Ae("div",{ref:S,className:`relative inline-flex ${k}`.trim(),children:[
|
|
145
|
-
/* @__PURE__ */De("button",{ref:z,id:T,type:"button","aria-haspopup":"dialog","aria-expanded":j,"aria-controls":j&&P?H:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>j?G():Z(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!j)return;const t=(()=>{const e=F.current;return e?$(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:N??w({variant:"secondary"}),children:e}),j&&P&&Pe(
|
|
146
|
-
/* @__PURE__ */De("div",{ref:F,id:H,role:"dialog",...ee,"aria-describedby":n?q:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:X,onFocusCapture:X,onKeyDown:e=>{const t=F.current,r=z.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=D(r,t);G(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${C}`.trim(),style:Hr.test(C)?void 0:{zIndex:R.popup},children:/* @__PURE__ */Ae("div",{ref:B,children:[r&&/* @__PURE__ */De("h2",{id:K,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */De("p",{id:q,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */De("div",{className:"mt-3",children:Q}):Q]})}),document.body)]})}var Kr=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function qr(e){const t=e.trim().replace(/^#/,"");if(!Kr.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var Ur=e=>e.toUpperCase(),Vr=(e,t,r)=>Math.min(r,Math.max(t,e));function Yr(e){const t=qr(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 Zr({h:e,s:t,v:r}){const n=(e%360+360)%360,a=Vr(t,0,1),l=Vr(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 Gr=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>Zr({h:e%360,s:1,v:1})).join(", ")})`,Xr={sm:"h-5 w-5",md:"h-7 w-7",lg:"h-9 w-9"},Jr={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function Qr(e){return e?{background:e}:Jr}function en({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",Xr[e],r].filter(Boolean).join(" ")}var tn=he(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
|
|
147
|
-
return De("button",{ref:i,type:a,"aria-pressed":r,className:en({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */De("span",{"aria-hidden":"true",className:"absolute inset-0",style:Qr(e)})})}),rn=(e,t,r)=>Math.min(r,Math.max(t,e)),nn=e=>"string"==typeof e?{value:e}:e;var an={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function ln({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=G().color,h=qr(l??""),[m,p]=ge(()=>Yr(e||h||"")),g=fe(e);xe(()=>{e!==g.current&&(g.current=e,e?p(Yr(e)):h&&p(Yr(h)))},[e]);const b=r=>{o||r===e||(g.current=r,t(r))},x=e=>{const t=qr(e);t&&(p(Yr(t)),b(t))},y=e=>{p(e),b(Zr(e))},[v,w]=ge(!1),k=fe(m);k.current=m;const N=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,k.current);"end"===i?(w(!0),p(r)):y(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,k.current);"end"===i?p(r):y(r)},onPointerUp:t=>{"end"===i&&v&&(w(!1),y(e(t,k.current)))}}),M=N((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?Vr((r-a.left)/a.width,0,1):0,v:a.height>0?1-Vr((n-a.top)/a.height,0,1):0})};var r,n,a}),$=N((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*Vr((r-n.left)/n.width,0,1)):0)};var r,n}),C=v?Zr(m):e,L=e=>`${Math.round(100*e)}%`,D=(n??[]).map(nn),A=qr(e);/* @__PURE__ */
|
|
148
|
-
return Ae("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__ */Ae("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-1.5",children:[a&&/* @__PURE__ */De(f,{content:u.clear,children:/* @__PURE__ */De(tn,{color:"",size:"sm","aria-label":u.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(g.current="",t(""))}})}),D.map(e=>{const t=qr(e.value),r=e.label?`${e.label} · ${Ur(t??e.value)}`:Ur(t??e.value);/* @__PURE__ */
|
|
149
|
-
return De(f,{content:r,children:/* @__PURE__ */De(tn,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===A,disabled:o,onClick:()=>x(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
150
|
-
/* @__PURE__ */De("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:rn(e.s+a[0],0,1),v:rn(e.v+a[1],0,1)}:null}(m,e.key,e.shiftKey);t&&(e.preventDefault(),y(t))},...M,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:Zr({h:m.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */De("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),...an}})}),
|
|
151
|
-
/* @__PURE__ */De("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 rn(e-n,0,359);case"ArrowRight":case"ArrowUp":return rn(e+n,0,359);case"PageDown":return rn(e-10,0,359);case"PageUp":return rn(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(),y({...m,h:t}))},...$,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:Gr},children:/* @__PURE__ */De("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:Zr({h:m.h,s:1,v:1}),...an}})}),
|
|
152
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center gap-2",children:[
|
|
153
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true",className:"relative h-7 w-7 shrink-0 overflow-hidden rounded-md border border-gray-300",style:Qr(C||(h??""))}),
|
|
154
|
-
/* @__PURE__ */De(on,{value:C,placeholder:!e&&h?Ur(h):void 0,onChange:x,label:u.hex(r),disabled:o})]})]})}function on({value:e,onChange:t,label:r,placeholder:n,disabled:a,id:l,className:i=""}){const[o,s]=ge(null);/* @__PURE__ */
|
|
155
|
-
return De("input",{id:l,type:"text",value:o??(e?Ur(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{s(r.target.value);const n=qr(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:Ie({size:"sm",className:`min-w-0 flex-1 font-mono uppercase ${i}`.trim()})})}function sn({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=G().color,f=me(),b=qr(l??""),x=e||b||"",y=e?Ur(e):b?Ur(b):g.none;/* @__PURE__ */
|
|
156
|
-
return Ae("div",{className:`inline-flex items-center gap-2 ${p}`.trim(),children:[
|
|
157
|
-
/* @__PURE__ */De(_r,{id:s,trigger:/* @__PURE__ */De("span",{"aria-hidden":"true",className:"absolute inset-0",style:Qr(x)}),triggerLabel:g.swatch(r,y),triggerClassName:en({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:o,children:/* @__PURE__ */De(ln,{id:f,value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o})}),c&&
|
|
158
|
-
/* @__PURE__ */De("div",{className:"w-24 flex-none",children:/* @__PURE__ */De(on,{value:e,placeholder:!e&&b?Ur(b):void 0,onChange:r=>{o||r===e||t(r)},label:g.hex(r),disabled:o})})]})}var cn=he(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=me(),g=G().files,f=U({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__ */
|
|
159
|
-
return Ae(at,{label:s,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
|
|
160
|
-
/* @__PURE__ */Ae("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:gt(f.dragOver,o,`px-4 py-6 ${ft(o)}`),children:[
|
|
161
|
-
/* @__PURE__ */Ae("span",{children:[
|
|
162
|
-
/* @__PURE__ */De("span",{className:"text-sm font-medium text-blue-600",children:a?g.chooseMany:g.chooseOne}),
|
|
163
|
-
/* @__PURE__ */De("span",{className:"text-sm text-gray-500",children:` ${a?g.dragMany:g.dragOne}`})]}),n&&/* @__PURE__ */De("span",{className:"text-xs text-gray-400",children:n})]}),
|
|
164
|
-
/* @__PURE__ */De("input",{...f.inputProps}),e.length>0&&/* @__PURE__ */De("ul",{className:"mt-2 flex flex-col gap-1",children:e.map((r,n)=>/* @__PURE__ */Ae("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
|
|
165
|
-
/* @__PURE__ */De("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:r.name,children:r.name}),
|
|
166
|
-
/* @__PURE__ */De("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:V(r.size,g)}),
|
|
167
|
-
/* @__PURE__ */De("button",{type:"button",disabled:o,onClick:()=>{f.clearRejections(),t(e.filter((e,t)=>t!==n))},"aria-label":g.remove(r.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */De(wt,{})})]},`${r.name}-${n}`))}),
|
|
168
|
-
/* @__PURE__ */De(Y,{rejections:f.rejections})]})});function dn({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
169
|
-
return De("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:/* @__PURE__ */De("path",{d:"M21 11.5l-8.5 8.5a5.5 5.5 0 0 1-7.8-7.8l9-9a3.5 3.5 0 0 1 5 5l-9 9a1.5 1.5 0 0 1-2.1-2.1l8-8"})})}function un({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
170
|
-
return Ae("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
|
|
171
|
-
/* @__PURE__ */De("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),
|
|
172
|
-
/* @__PURE__ */De("path",{d:"M14 3v5h5"})]})}function hn({intake:e,dropLabel:t,className:r="",children:n}){const a=G().files;/* @__PURE__ */
|
|
173
|
-
return Ae("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,children:[n,
|
|
174
|
-
/* @__PURE__ */De("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */De("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 mn({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=G().files,l=fe(/* @__PURE__ */new Map);xe(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),xe(()=>()=>{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__ */De("ul",{className:`flex flex-wrap gap-1.5 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
|
|
175
|
-
return Ae("li",{className:"flex max-w-full items-center gap-1.5 rounded-md border border-gray-200 bg-gray-50 py-1 pl-1.5 pr-1 text-xs text-gray-700",children:[l?/* @__PURE__ */De("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */De("span",{className:"text-gray-400",children:/* @__PURE__ */De(un,{})}),
|
|
176
|
-
/* @__PURE__ */De("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
|
|
177
|
-
/* @__PURE__ */De("span",{className:"shrink-0 tabular-nums text-gray-400",children:V(e.size,a)}),t&&/* @__PURE__ */De("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__ */De(wt,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function pn({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=G().files,i=n??l.attach,o=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */Ae("span",{className:"relative inline-flex",children:[
|
|
178
|
-
/* @__PURE__ */De(Se,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */De(dn,{})}),t>0&&/* @__PURE__ */De("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-[10px] font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */De(g,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */De(dn,{}),children:o})}function gn({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=U({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),g=fe([]);return xe(()=>{u&&p.rejections.length>0&&p.rejections!==g.current&&(g.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */Ae(hn,{intake:p,dropLabel:o,className:h,children:[m,
|
|
179
|
-
/* @__PURE__ */De(mn,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
|
|
180
|
-
/* @__PURE__ */Ae("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
181
|
-
/* @__PURE__ */De(pn,{onClick:p.open,count:e.length,variant:c,label:s,disabled:i}),d]}),
|
|
182
|
-
/* @__PURE__ */De(Y,{rejections:p.rejections})]})}function fn({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
183
|
-
return De("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 bn(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,allowFreeText:o=!1,onSearchChange:s,rightAdornment:c,renderOption:d,clearable:u=!0,"aria-label":h,"aria-labelledby":g,"aria-describedby":f}=e,b=!0===e.multiple,x=e.multiple?e.value:e.value?[e.value]:[],y=e.multiple?"":e.value,v=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},w=x.length>0,[k,N]=ge(!1),[M,$]=ge(-1),C=me(),L=i??`${C}-input`,D=`${C}-listbox`,A=e=>`${C}-opt-${e}`,[j,P]=ge(""),S=G(),z=n??S.select.none,F=e=>{P(e),$(-1),s?.(e)},B=fe(null),E=fe(null),H=fe(null),_=fe(null),K=fe(k);K.current=k;const q=fe(!1),U=e=>{if(!K.current)return;K.current=!1;const t=j.trim();e&&o&&t&&(b?x.includes(t)||v([...x,t]):t!==y&&v([t])),N(!1),F("")},V=(e,t)=>{if(!e.disabled){if(b)return v(x.includes(e.value)?x.filter(t=>t!==e.value):[...x,e.value]),void $(t);v([e.value]),U(!1)}},[Y,Z]=ge(null);W(()=>{if(!c||k)return void Z(null);const e=_.current?.offsetWidth??0;Z(e?e+(te?32:8)+6:null)});const X=m(E,k,{matchTriggerWidth:!0}),J=be(()=>Ue(t),[t]),Q=x.join("\0"),ee=be(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of J)x.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(o)for(const r of x)t.has(r)||e.push(r);return e.join(", ")},[J,Q,o]),te=u&&w&&!l;xe(()=>{if(!k)return;const e=e=>{const t=e.target;B.current?.contains(t)||H.current?.contains(t)||U(!0)};document.addEventListener("mousedown",e);const t=O(()=>U(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[k,o,j,Q,e.onChange]),xe(()=>{if(k)return I(e=>!("Escape"!==e.key||!K.current)&&(U(!1),E.current?.blur(),!0),()=>H.current)},[k]);const re=be(()=>{const e=/* @__PURE__ */new Set;return Ve(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),ne=be(()=>{if(s)return re;const e=j.trim().toLowerCase();return e?Ve(re,t=>t.label.toLowerCase().includes(e)||(t.sublabel?.toLowerCase().includes(e)??!1)):re},[re,j,s]),ae=be(()=>Ue(ne),[ne]);/* @__PURE__ */
|
|
184
|
-
return Ae("div",{ref:B,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(B.current?.contains(t)||H.current?.contains(t))||q.current||document.activeElement!==E.current&&U(!0)},children:[
|
|
185
|
-
/* @__PURE__ */De("input",{id:L,ref:E,type:"text",autoComplete:"off",role:"combobox","aria-expanded":k,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":k?D:void 0,"aria-activedescendant":k&&M>=0&&M<ae.length?A(M):void 0,"aria-label":g?void 0:h,"aria-labelledby":g,"aria-describedby":f,value:k?j:ee,onChange:e=>{F(e.target.value),N(!0)},onFocus:()=>{l||(F(""),N(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(l)return;if(e.preventDefault(),!k)return void N(!0);if(0===ae.length)return;const t="ArrowDown"===e.key?1:-1;return void $(e=>_e(ae,e,t))}if("Enter"===e.key){e.preventDefault();const t=j.trim();k&&M>=0&&M<ae.length?V(ae[M],M):1!==ae.length||ae[0].disabled?o&&t&&(b?(x.includes(t)||v([...x,t]),F("")):(v([t]),U(!1),E.current?.blur())):V(ae[0],0)}else"Escape"===e.key?(U(!1),E.current?.blur()):"Tab"===e.key&&U(!0)},placeholder:r||z,className:`${Ee} ${a} ${te?"pr-8":""} ${l?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate`,style:Y?{paddingRight:Y}:void 0,disabled:l}),te&&/* @__PURE__ */De(fn,{ariaLabel:S.select.clear,onClear:()=>{v([]),U(!1)}}),c&&!k&&/* @__PURE__ */De("div",{ref:_,className:`absolute top-1/2 -translate-y-1/2 ${te?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:c}),k&&Pe(
|
|
186
|
-
/* @__PURE__ */De("div",{ref:H,onMouseDownCapture:()=>{q.current=!0,setTimeout(()=>{q.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:R.popup,left:X?.left,right:X?.right,top:X?.top,bottom:X?.bottom,minWidth:X?.minWidth,width:X?.width,visibility:X?void 0:"hidden",...T()},children:/* @__PURE__ */De("div",{id:D,role:ae.length?"listbox":void 0,"aria-labelledby":ae.length?g??(h?void 0:L):void 0,"aria-label":ae.length&&!g?h:void 0,"aria-multiselectable":!(!ae.length||!b)||void 0,className:"overflow-y-auto",style:{maxHeight:X?.maxHeight??p},children:0===ae.length?/* @__PURE__ */De("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:S.select.noMatches}):Ye(ne,(e,t)=>{const r=x.includes(e.value);/* @__PURE__ */
|
|
187
|
-
return Ae("button",{id:A(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||b)&&r.preventDefault(),V(e,t)},className:"w-full overflow-hidden text-left px-3 py-1.5 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===M?"bg-gray-100":r?"bg-blue-50/50":""}`),children:[b&&/* @__PURE__ */De(Ze,{selected:r}),
|
|
188
|
-
/* @__PURE__ */De("span",{className:"min-w-0 flex-1 truncate",children:d?d(e,{selected:r,active:t===M}):e.label}),e.sublabel&&/* @__PURE__ */De("span",{className:"min-w-0 max-w-[45%] shrink-0 truncate text-xs text-gray-400",children:e.sublabel})]},e.value)},C)})}),document.body)]})}function xn({value:e,onChange:t,options:r=[],placeholder:n,allowFreeText:a=!1,invalid:l,disabled:i,id:o,className:s=""}){const[c,d]=ge(!1),[u,h]=ge(""),g=G(),f=fe(null),b=fe(null),x=fe(null),y=m(f,c),v=e=>r.find(t=>t.value===e)?.label??e,w=be(()=>{const t=new Set(e),n=[],a=u.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!e.label.toLowerCase().includes(a)||n.push(e));return n},[r,e,u]),N=r=>{r&&!e.includes(r)?(t([...e,r]),h("")):h("")},M=r=>t(e.filter(e=>e!==r)),$=()=>{const e=u.trim();a&&e?N(e):h("")},C=fe(()=>{});C.current=()=>{$(),d(!1)},xe(()=>{if(!c)return;const e=e=>{const t=e.target;f.current?.contains(t)||x.current?.contains(t)||($(),d(!1))};document.addEventListener("mousedown",e);const t=O(()=>C.current());return()=>{document.removeEventListener("mousedown",e),t()}});const L=r.length>0;/* @__PURE__ */
|
|
189
|
-
return Ae("div",{ref:f,className:"relative",children:[
|
|
190
|
-
/* @__PURE__ */Ae("div",{onMouseDown:e=>{i||e.target.closest("button")||(e.preventDefault(),b.current?.focus())},className:Ie({invalid:l,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=>/* @__PURE__ */Ae("span",{className:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-1.5 py-0.5 text-xs font-medium text-blue-700",children:[
|
|
191
|
-
/* @__PURE__ */De("span",{className:"truncate",children:v(e)}),!i&&/* @__PURE__ */De("button",{type:"button","aria-label":g.select.removeItem?.(v(e))??`${g.select.remove} ${v(e)}`,onClick:()=>M(e),className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none",children:"×"})]},e)),
|
|
192
|
-
/* @__PURE__ */De("input",{id:o,ref:b,type:"text",autoComplete:"off",role:"combobox","aria-expanded":c&&L,"aria-invalid":l||void 0,disabled:i,value:u,placeholder:0===e.length?n:void 0,onChange:e=>{h(e.target.value),d(!0)},onFocus:()=>{!i&&L&&d(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&a){t.preventDefault();const e=u.trim(),r=e?w.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())):[];1===r.length?N(r[0].value):$()}else"Backspace"===t.key&&""===u&&e.length>0?M(e[e.length-1]):"Escape"===t.key?(d(!1),h(""),b.current?.blur()):"Tab"===t.key&&($(),d(!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"})]}),c&&L&&Pe(
|
|
193
|
-
/* @__PURE__ */De("div",{ref:x,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:R.popup,left:y?.left,right:y?.right,top:y?.top,bottom:y?.bottom,minWidth:y?.minWidth,maxWidth:y?.maxWidth??k,width:"max-content",visibility:y?void 0:"hidden",...T()},children:/* @__PURE__ */De("div",{className:"overflow-y-auto",style:{maxHeight:y?.maxHeight??p},children:0===w.length?/* @__PURE__ */De("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:r.length>0&&e.length>=r.length?g.select.allSelected:g.select.noMatches}):w.map(e=>/* @__PURE__ */De("button",{type:"button",onMouseDown:t=>{t.preventDefault(),N(e.value)},className:"w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.label},e.value))})}),document.body)]})}var yn={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}};function vn({children:e,header:t,footer:r,padded:n=!0,padding:a,headingLevel:l,headerActions:i,"aria-label":o,className:s="",bodyClassName:c="",style:d}){const u=yn[a??(n?"md":"none")],h=me(),m=null!=l&&null!=t,p=`h${l}`,g=m||null!=o&&""!==o,f=g?"section":"div",b=`rounded-(--radius-card) border border-gray-200 bg-white shadow-sm ${s}`.trim(),x=`border-b border-gray-100 ${u.edge} text-sm font-semibold text-gray-900`;/* @__PURE__ */
|
|
194
|
-
return Ae(f,{className:b,style:d,...m?{"aria-labelledby":h}:g?{"aria-label":o}:{},children:[null!=t&&(null!=i?
|
|
195
|
-
/* @__PURE__ */Ae("div",{className:`${x} flex items-center justify-between gap-3`,children:[m?/* @__PURE__ */De(p,{id:h,children:t}):/* @__PURE__ */De("span",{children:t}),i]}):m?
|
|
196
|
-
/* @__PURE__ */De(p,{id:h,className:x,children:t}):/* @__PURE__ */De("div",{className:x,children:t})),
|
|
197
|
-
/* @__PURE__ */De("div",{className:[u.body,c].filter(Boolean).join(" "),children:e}),r&&/* @__PURE__ */De("div",{className:`border-t border-gray-100 ${u.edge}`,children:r})]})}function wn({label:e,value:t,icon:r,delta:n,className:a=""}){const l=Z(),i="number"==typeof t&&l?ee(t,l):t,o="up"===n?.direction?"text-green-600":"down"===n?.direction?"text-red-600":"text-gray-500",s="up"===n?.direction?"▲":"down"===n?.direction?"▼":"→";/* @__PURE__ */
|
|
198
|
-
return Ae("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${a}`.trim(),children:[
|
|
199
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between",children:[
|
|
200
|
-
/* @__PURE__ */De("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),r&&/* @__PURE__ */De("span",{className:"text-gray-400",children:r})]}),
|
|
201
|
-
/* @__PURE__ */Ae("div",{className:"mt-2 flex items-baseline gap-2",children:[
|
|
202
|
-
/* @__PURE__ */De("span",{className:"text-2xl font-semibold text-gray-900",children:i}),n&&/* @__PURE__ */Ae("span",{className:`text-xs font-medium ${o}`,children:[s," ",n.value]})]})]})}var kn={default:"text-gray-900",secondary:"text-gray-500",tertiary:"text-gray-400",disabled:"text-gray-300",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600",link:"text-blue-600",inherit:""},Nn={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},Mn={normal:"font-normal",medium:"font-medium",semibold:"font-semibold"};function $n({children:e,tone:t="default",size:r="sm",weight:n="normal",truncate:a=!1,as:l="span",className:i="",...o}){/* @__PURE__ */
|
|
203
|
-
return De(l,{className:[kn[t],Nn[r],Mn[n],a?"block truncate":"",i].filter(Boolean).join(" "),title:o.title??(a&&"string"==typeof e?e:void 0),htmlFor:o.htmlFor,children:e})}var Cn={1:"text-2xl font-semibold",2:"text-xl font-semibold",3:"text-lg font-semibold",4:"text-base font-semibold",5:"text-sm font-semibold"};function Ln({children:e,level:t=2,tone:r="default",className:n=""}){/* @__PURE__ */
|
|
204
|
-
return De(`h${t}`,{className:[Cn[t],kn[r],n].filter(Boolean).join(" "),children:e})}function Dn({children:e,tone:t="secondary",size:r="sm",className:n=""}){/* @__PURE__ */
|
|
205
|
-
return De("p",{className:[kn[t],Nn[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var An={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},jn={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Pn={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function Sn({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
|
|
206
|
-
return De("div",{className:["flex flex-col",An[t],r?jn[r]:"",n?Pn[n]:"",a].filter(Boolean).join(" "),children:e})}function zn({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
|
|
207
|
-
return De("div",{className:["flex",a?"flex-wrap":"",An[t],jn[r],n?Pn[n]:"",l].filter(Boolean).join(" "),children:e})}var Fn={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Bn={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"},En={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 Tn({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
|
|
208
|
-
return De("div",{className:["grid",Fn[t],r?Bn[r]:"",n?En[n]:"",An[a],l].filter(Boolean).join(" "),children:e})}var In={sm:"my-2",md:"my-4",lg:"my-6"};function On({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=me();if("vertical"===e)/* @__PURE__ */
|
|
209
|
-
return De("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__ */
|
|
210
|
-
return De("hr",{className:`border-0 border-t border-gray-200 ${In[n]} ${a}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",o="right"===r?"w-4 shrink-0":"flex-1";
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
return Ae("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${In[n]} ${a}`.trim(),children:[
|
|
213
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true",className:`${i} border-t border-gray-200`}),
|
|
214
|
-
/* @__PURE__ */De("span",{id:l,className:"shrink-0 text-xs font-medium text-gray-500",children:t}),
|
|
215
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true",className:`${o} border-t border-gray-200`})]})}var Rn={text:"rounded",rect:"rounded-md",circle:"rounded-full"},Wn=e=>"number"==typeof e?`${e}px`:e;function Hn({variant:e="text",width:t,height:r,lines:n=1,className:a=""}){const l=`animate-pulse bg-gray-200 ${Rn[e]} ${a}`.trim();if("circle"===e){const e=Wn(r??t)??"2.5rem";/* @__PURE__ */
|
|
216
|
-
return De("span",{className:`inline-block ${l}`,style:{width:e,height:e},"aria-hidden":"true"})}const i={width:Wn(t)??"100%",height:Wn(r)??("text"===e?"1rem":"4rem")};/* @__PURE__ */
|
|
217
|
-
return De("span","text"===e&&n>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:n},(e,t)=>/* @__PURE__ */De("span",{className:`block ${l}`,style:{...i,width:t===n-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var _n={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},Kn={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},qn={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},Un={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function Vn({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__ */
|
|
218
|
-
return Ae("div",{className:[r?"rounded-lg border border-gray-200 bg-white":"",l].filter(Boolean).join(" "),children:[a&&/* @__PURE__ */De("div",{className:`${d} ${r?"border-b border-gray-100":""} text-sm font-semibold text-gray-900`.trim(),children:a}),
|
|
219
|
-
/* @__PURE__ */De("dl",{className:["grid",_n[s],o.sm?Kn[o.sm]:"",o.lg?qn[o.lg]:"",r?"":"gap-x-6 gap-y-3",r?"":"px-4 py-3"===d?"py-1":""].filter(Boolean).join(" "),children:e.map((e,t)=>/* @__PURE__ */Ae("div",{className:[e.span?Un[c]:"",r?`${d} border-b border-gray-100 last:border-b-0`:""].filter(Boolean).join(" "),children:[
|
|
220
|
-
/* @__PURE__ */De("dt",{className:`${u} text-gray-500`,children:e.label}),
|
|
221
|
-
/* @__PURE__ */De("dd",{className:`mt-0.5 min-w-0 break-words ${u} text-gray-900`,children:null===e.value||void 0===e.value||""===e.value?i:e.value})]},e.key??t))})]})}function Yn({name:e,value:t,description:r,controlId:n,unknownText:a="—",quiet:l=!1,className:i=""}){const o=null==t||""===t,s=l?"text-gray-500":"text-gray-800",c=o?"text-gray-400":l?"text-gray-500":"text-gray-900";/* @__PURE__ */
|
|
222
|
-
return Ae("div",{className:i,children:[
|
|
223
|
-
/* @__PURE__ */Ae("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children:[n?/* @__PURE__ */De("label",{htmlFor:n,className:`min-w-0 text-sm font-medium ${s}`,children:e}):/* @__PURE__ */De("span",{className:`min-w-0 text-sm font-medium ${s}`,children:e}),
|
|
224
|
-
/* @__PURE__ */De("span",{className:`shrink-0 text-sm ${c}`,children:o?a:t})]}),r&&/* @__PURE__ */De("p",{className:"mt-1 text-xs leading-relaxed text-gray-500",children:r})]})}var Zn={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function Gn({count:e=0,max:t=99,dot:r=!1,tone:n="danger",showZero:a=!1,children:l,className:i=""}){const o=r||e>0||0===e&&a,s=Z(),c=e>t?`${ee(t,s)}+`:ee(e,s),d=l?"":i,u=o?/* @__PURE__ */De("span",r?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${Zn[n]} ${d}`.trim(),"aria-hidden":l?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${Zn[n]} ${d}`.trim(),children:c}):null;return l?/* @__PURE__ */Ae("span",{className:`relative inline-flex ${i}`.trim(),children:[l,u&&/* @__PURE__ */De("span",{className:"absolute -right-1.5 -top-1.5 flex",children:u})]}):u}var Xn={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},Jn={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function Qn({title:e,value:t,precision:r,prefix:n,suffix:a,tone:l="default",size:i="md",className:o=""}){const s=Z(),c="number"!=typeof t?t:null!=r?te(t,r,s):s?ee(t,s):t;/* @__PURE__ */
|
|
225
|
-
return Ae("div",{className:o,children:[e&&/* @__PURE__ */De("div",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
226
|
-
/* @__PURE__ */Ae("div",{className:`mt-1 flex items-baseline gap-1 ${Jn[l]}`,children:[n&&/* @__PURE__ */De("span",{className:"text-sm",children:n}),
|
|
227
|
-
/* @__PURE__ */De("span",{className:`font-semibold tabular-nums ${Xn[i]}`,children:c}),a&&/* @__PURE__ */De("span",{className:"text-sm",children:a})]})]})}var ea={xs:24,sm:32,md:40,lg:56},ta={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function ra(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function na({src:e,name:t,size:r="md",status:n,className:a=""}){const l=ea[r],i=Math.max(8,Math.round(.28*l)),[o,s]=ge(!1);xe(()=>{s(!1)},[e]);const c=Boolean(e)&&!o;
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
return Ae("span",{className:`relative inline-flex shrink-0 ${a}`.trim(),style:{width:l,height:l},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[c?/* @__PURE__ */De("img",{src:e,alt:"",onError:()=>s(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */De("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*l)},children:ra(t)}),n&&/* @__PURE__ */De("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${ta[n]}`,style:{width:i,height:i}})]})}function aa({children:e,max:t,size:r="md",className:n=""}){const a=ve.toArray(e),l=t?a.slice(0,t):a,i=t?a.length-l.length:0,o=ea[r],s=Math.round(.3*o),c=Z();/* @__PURE__ */
|
|
230
|
-
return Ae("div",{className:`flex items-center ${n}`.trim(),children:[l.map((e,t)=>/* @__PURE__ */De("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-s},children:e},t)),i>0&&/* @__PURE__ */Ae("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:o,height:o,marginLeft:-s,fontSize:Math.round(.36*o)},children:["+",ee(i,c)]})]})}var la={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"}},ia={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white"};function oa({tone:e}){const t={className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
|
|
231
|
-
return De("svg",{...t,children:/* @__PURE__ */De("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.7-9.3a1 1 0 00-1.4-1.4L9 10.6 7.7 9.3a1 1 0 00-1.4 1.4l2 2a1 1 0 001.4 0l4-4z",clipRule:"evenodd"})});case"warning":/* @__PURE__ */
|
|
232
|
-
return De("svg",{...t,children:/* @__PURE__ */De("path",{fillRule:"evenodd",d:"M8.3 2.8a2 2 0 013.4 0l6 10A2 2 0 0116 16H4a2 2 0 01-1.7-3.2l6-10zM10 7a1 1 0 00-1 1v3a1 1 0 102 0V8a1 1 0 00-1-1zm0 7a1 1 0 100 2 1 1 0 000-2z",clipRule:"evenodd"})});case"danger":/* @__PURE__ */
|
|
233
|
-
return De("svg",{...t,children:/* @__PURE__ */De("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.7 7.3a1 1 0 00-1.4 1.4L8.6 10l-1.3 1.3a1 1 0 101.4 1.4L10 11.4l1.3 1.3a1 1 0 001.4-1.4L11.4 10l1.3-1.3a1 1 0 10-1.4-1.4L10 8.6 8.7 7.3z",clipRule:"evenodd"})});default:/* @__PURE__ */
|
|
234
|
-
return De("svg",{...t,children:/* @__PURE__ */De("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9 9a1 1 0 012 0v4a1 1 0 11-2 0V9zm1-4a1 1 0 100 2 1 1 0 000-2z",clipRule:"evenodd"})})}}function sa({tone:e="info",emphasis:t="subtle",title:r,children:n,icon:a,action:l,onDismiss:i,sticky:o=!1,className:s=""}){const c=la[e],d="solid"===t,u=G().banner,h=d?ia[e]:c.box,m=o?"sticky top-0 z-30":"",p=/* @__PURE__ */Ae(je,{children:[r&&/* @__PURE__ */De("div",{className:("font-semibold "+(d?"":"text-gray-900")).trim(),children:r}),n&&/* @__PURE__ */De("div",{className:`${d?"":"text-gray-700"} ${r?"mt-0.5":""}`.trim(),children:n})]});/* @__PURE__ */
|
|
235
|
-
return Ae("div",{role:"danger"===e?"alert":"status",className:`${m} flex items-start gap-3 rounded-lg border px-4 py-3 ${h} ${s}`.trim(),children:[
|
|
236
|
-
/* @__PURE__ */De("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:a??/* @__PURE__ */De(oa,{tone:e})}),null==l?/* @__PURE__ */De("div",{className:"min-w-0 flex-1 text-sm",children:p}):
|
|
237
|
-
/* @__PURE__ */Ae("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
|
|
238
|
-
/* @__PURE__ */De("div",{className:"min-w-0 grow basis-48 text-sm",children:p}),
|
|
239
|
-
/* @__PURE__ */De("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */De("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__ */De("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})}var ca=(e,t)=>`${e}-tab-${t}`,da=(e,t)=>`${e}-panel-${t}`,ua={underline:"flex items-center gap-1 border-b border-gray-200",pill:"inline-flex items-center gap-1 rounded-lg bg-gray-100 p-1"};function ha(e,t){return"pill"===e?"inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 "+(t?"bg-blue-600 text-white shadow-sm":"text-gray-600 hover:text-gray-900"):"-mb-px inline-flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 "+(t?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:border-gray-300 hover:text-gray-900")}function ma({items:e,value:t,onChange:r,variant:n="underline",idPrefix:a,className:l="","aria-label":i,"aria-labelledby":o}){const s=fe([]),c=(t,r)=>{for(let n=1;n<=e.length;n+=1){const a=((t+r*n)%e.length+e.length)%e.length;if(!e[a]?.disabled)return a}return null},d=t=>{const r=1===t?e.map((e,t)=>t):e.map((t,r)=>e.length-1-r);for(const t of r)if(!e[t]?.disabled)return t;return null};/* @__PURE__ */
|
|
240
|
-
return De("div",{role:"tablist","aria-label":i,"aria-labelledby":o,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=c(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=c(a,-1);else if("Home"===n.key)l=d(1);else{if("End"!==n.key)return;l=d(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),s.current[l]?.focus())},className:`${ua[n]} ${l}`.trim(),children:e.map((e,l)=>{const i=e.id===t,o=/* @__PURE__ */Ae("button",{ref:e=>{s.current[l]=e},type:"button",role:"tab",id:a?ca(a,e.id):void 0,"aria-controls":a?da(a,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:ha(n,i),children:[e.icon&&/* @__PURE__ */De("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e.icon}),e.label]},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */De(f,{content:e.tooltip,children:o},e.id):o})})}var pa=()=>/* @__PURE__ */De("svg",{viewBox:"0 0 12 12",fill:"none",className:"h-3.5 w-3.5","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M2.5 6.5L5 9l4.5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})});function ga({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
|
|
241
|
-
return De("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__ */De("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__ */De(pa,{}):n+1}),s=/* @__PURE__ */Ae("span",{className:"min-w-0 text-center",children:[
|
|
242
|
-
/* @__PURE__ */De("span",{className:"block text-sm font-medium "+("upcoming"===a?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */De("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
|
|
243
|
-
return Ae("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */De("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__ */Ae("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-1.5 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[o,s]}):/* @__PURE__ */Ae("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-1.5 px-2 text-center",children:[o,s]})]},t.id)})})}function fa({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,className:l=""}){const[i,o]=ge(t),s=r??i;/* @__PURE__ */
|
|
244
|
-
return De("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__ */
|
|
245
|
-
return Ae("div",{children:[
|
|
246
|
-
/* @__PURE__ */Ae("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:[
|
|
247
|
-
/* @__PURE__ */De("span",{children:e.title}),
|
|
248
|
-
/* @__PURE__ */De("svg",{className:"h-4 w-4 shrink-0 text-gray-400 transition-transform "+(t?"rotate-180":""),viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M6 8l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t&&/* @__PURE__ */De("div",{className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}var ba={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)]"},xa={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 ya(e,t="subtle"){return"solid"===t?xa[e]:ba[e]}var va=ye({}),wa=ye(void 0);function ka(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Na({groups:e,labelFor:t,children:r}){/* @__PURE__ */
|
|
249
|
-
return De(va.Provider,{value:e,children:/* @__PURE__ */De(wa.Provider,{value:t,children:r})})}function Ma(){const e=Ne(wa);return pe(t=>e?.(t)??ka(t),[e])}function $a({status:e,label:t,emphasis:r="subtle"}){const n=ya(Ne(va)[e]??"neutral",r),a=Ne(wa),l=t??a?.(e)??ka(e);/* @__PURE__ */
|
|
250
|
-
return De("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${n}`,children:l})}function Ca({colorClass:e,tone:t,children:r,size:n="sm",capitalize:a=!1,closable:l=!1,onClose:i,closeLabel:o,className:s=""}){const c=e??ba[t??"neutral"],d="xs"===n?"px-2 py-0.5 text-[10px]":"md"===n?"px-2.5 py-0.5 text-xs":"px-2 py-0.5 text-xs",u=a?"capitalize":"",h=G().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__ */
|
|
251
|
-
return Ae("span",{className:["inline-flex items-center rounded-full font-medium",d,u,c,s].filter(Boolean).join(" "),children:[r,l&&/* @__PURE__ */De("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__ */De("svg",{className:p,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]})}function La({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=G().emptyState,h=t??(e?void 0:u.message),m=r??n;/* @__PURE__ */
|
|
252
|
-
return Ae("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__ */De("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */De("svg",{className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),e&&/* @__PURE__ */De("h3",{className:"text-sm font-medium text-gray-900",children:e}),h&&/* @__PURE__ */De("p",{className:"text-sm text-gray-500 "+(e?"mt-2":""),children:h}),m&&/* @__PURE__ */De("p",{className:"text-xs text-gray-400 mt-1",children:m}),o&&/* @__PURE__ */De("div",{className:"mt-4",children:o})]})}function Da({title:t,description:r,subtitle:n,actions:a,children:l,icon:i,breadcrumbs:o}){const s=r??n,c=a??l;/* @__PURE__ */
|
|
253
|
-
return Ae("div",{className:"mb-6",children:[o&&o.length>0&&/* @__PURE__ */De(e,{items:o,className:"mb-3"}),
|
|
254
|
-
/* @__PURE__ */Ae("div",{className:"flex items-start justify-between gap-4",children:[
|
|
255
|
-
/* @__PURE__ */Ae("div",{children:[
|
|
256
|
-
/* @__PURE__ */Ae("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */De("span",{className:"shrink-0 text-gray-400",children:i}),t]}),s&&/* @__PURE__ */De("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),c&&/* @__PURE__ */De("div",{className:"flex items-center gap-2",children:c})]})]})}var Aa=["success","warning","danger"];function ja(e){return"string"==typeof e&&Aa.includes(e)}function Pa(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=Sa(t),a=Sa(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function Sa(e){return null!=e&&Number.isFinite(e)?e:null}var za={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 Fa=/* @__PURE__ */new Set;function Ba(e,t){if(null==e)return null;if(ja(e))return za[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}`;Fa.has(r)||(Fa.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${Aa.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 Ea({at:e,title:t,className:r}){/* @__PURE__ */
|
|
257
|
-
return De("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var Ta=e=>Math.min(100,Math.max(0,e));function Ia({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=G().meter,m=Z(),p=s??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var b,x;null==f&&(b=`MetricBar:max:${String(r)}`,x=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,Fa.has(b)||(Fa.add(b),console.error(x)));const y=Ba(l,"MetricBar"),v=null!=g?y??(null==(w=Pa(g,n,a))?null:za[w]):null;var w;const k=Sa(n),N=Sa(a),M=null!=g&&null!=f?Ta(g/f*100):0,$=null!=g?(o??(e=>100===f?re(e,1,m):ee(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=k||null!=N),L="md"===c?"h-2":"h-1.5",D=null!=g&&null!=f,A=/* @__PURE__ */Ae("div",{...D?{role:"meter","aria-label":d??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":f,"aria-valuenow":Math.min(f,Math.max(0,g)),"aria-valuetext":$}:{"aria-hidden":!0},className:D&&v?`relative mt-2 ${L} rounded-full bg-gray-200`:`relative mt-2 ${L} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[D&&
|
|
258
|
-
/* @__PURE__ */De("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${M}%`}}),C&&null!=f&&null!=k&&/* @__PURE__ */De(Ea,{at:Ta(k/f*100),title:h.warningAt(k),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=N&&/* @__PURE__ */De(Ea,{at:Ta(N/f*100),title:h.criticalAt(N),className:"bg-gray-500"})]}),j=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
|
|
259
|
-
return Ae("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */De("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
260
|
-
/* @__PURE__ */Ae("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
261
|
-
/* @__PURE__ */De("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${j}`,children:$}),
|
|
262
|
-
/* @__PURE__ */De("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:null!=g?i:p})]}),A]}:{className:u,children:[
|
|
263
|
-
/* @__PURE__ */Ae("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */De("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
264
|
-
/* @__PURE__ */De("span",{className:`text-sm font-semibold tabular-nums ${j}`,children:$}),
|
|
265
|
-
/* @__PURE__ */De("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:null!=g?i:p})]}),A]})}function Oa(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function Ra(e,t){const r=Oa(e);if(null==r)return"no-reading";const n=Oa(t);return null==n||0===n?"no-budget":r>n?"over":"within"}var Wa=e=>Math.min(100,Math.max(0,e));function Ha({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=G().meter,h=Z(),m=l??(e=>function(e,t=X.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=Oa(t),b=Oa(r),x=null!=b&&b>0?b:null,y=Oa(n)??0,v="over"===Ra(t,r),w=null!=x?x+y:null,k=null!=x&&null!=w?Wa(x/w*100):null,N=v&&y>0,M=null==w||null==f?0:v?N?k??0:0:Wa(f/w*100),$=N?k??0:0,C=v?N&&null!=w&&null!=f?Wa(f/w*100):100:0,L=Math.max(0,C-$),D=null!=f&&null!=x?f/x*100:null,A=null!=D?re(Math.round(D),0,h):null!=f?m(f):"—",j=a??(null==f?p:null==x?g:`${m(f)} / ${m(x)}`),P="md"===s?"h-2":"h-1.5",S=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",z=null!=f&&null!=x&&null!=w?/* @__PURE__ */Ae("div",{role:"meter","aria-label":c??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":w,"aria-valuenow":Math.min(w,f),"aria-valuetext":u.ofBudget(A),className:`relative mt-2 ${P} overflow-hidden rounded-full bg-gray-200`,children:[(!v||N)&&/* @__PURE__ */De("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${M}%`}}),L>0&&/* @__PURE__ */De("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${$}%`,width:`${L}%`}}),y>0&&null!=k&&/* @__PURE__ */De("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${k}%`}})]}):null;/* @__PURE__ */
|
|
266
|
-
return Ae("div","md"===s?{className:d,children:[null!=e&&/* @__PURE__ */De("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
267
|
-
/* @__PURE__ */Ae("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
268
|
-
/* @__PURE__ */De("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${S}`,children:A}),
|
|
269
|
-
/* @__PURE__ */De("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:j})]}),z]}:{className:d,children:[
|
|
270
|
-
/* @__PURE__ */Ae("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */De("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
271
|
-
/* @__PURE__ */De("span",{className:`text-sm font-semibold tabular-nums ${S}`,children:A}),
|
|
272
|
-
/* @__PURE__ */De("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:j})]}),z]})}var _a=864e5;function Ka(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const r=new Date(t).getUTCFullYear();return r<2e3||r>2100?null:t}function qa(e,t){return le(new Date(e).toISOString().slice(0,10),{locale:t})}var Ua=(e,t)=>`${e}-fill-${t}`,Va=e=>`${e}-glow`,Ya=e=>`${e}-reveal`,Za=e=>`${e}-ground`;function Ga(e,t,r,n){return"solid"===r?n:`url(#${Ua(e,t)})`}function Xa(e){return"solid"===e?void 0:"4 3"}function Ja({id:e,index:t,colour:r,variant:n,from:a,to:l}){const i=Ua(e,t);if("solid"===n)return null;if("gradient"===n||"gradient-reverse"===n){const e="gradient-reverse"===n;/* @__PURE__ */
|
|
273
|
-
return Ae("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
|
|
274
|
-
/* @__PURE__ */De("stop",{offset:"0%",stopColor:r,stopOpacity:e?l:a}),
|
|
275
|
-
/* @__PURE__ */De("stop",{offset:"100%",stopColor:r,stopOpacity:e?a:l})]})}const o=/* @__PURE__ */De("rect",{width:"100%",height:"100%",fill:r,fillOpacity:.45*a});return"duotone"===n?/* @__PURE__ */Ae("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
|
|
276
|
-
/* @__PURE__ */De("stop",{offset:"0%",stopColor:r,stopOpacity:a}),
|
|
277
|
-
/* @__PURE__ */De("stop",{offset:"45%",stopColor:r,stopOpacity:a}),
|
|
278
|
-
/* @__PURE__ */De("stop",{offset:"45%",stopColor:r,stopOpacity:.35*a}),
|
|
279
|
-
/* @__PURE__ */De("stop",{offset:"100%",stopColor:r,stopOpacity:.35*a})]}):/* @__PURE__ */Ae("pattern","striped"===n?{id:i,width:"10",height:"10",patternUnits:"userSpaceOnUse",patternTransform:"rotate(-45)",children:[o,
|
|
280
|
-
/* @__PURE__ */De("rect",{width:"5",height:"10",fill:r,fillOpacity:.7})]}:"blocks"===n?{id:i,width:"10",height:"10",patternUnits:"userSpaceOnUse",children:[o,
|
|
281
|
-
/* @__PURE__ */De("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8}),
|
|
282
|
-
/* @__PURE__ */De("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8})]}:"dotted"===n?{id:i,width:"8",height:"8",patternUnits:"userSpaceOnUse",children:[o,
|
|
283
|
-
/* @__PURE__ */De("circle",{cx:"2",cy:"2",r:"1.2",fill:r,fillOpacity:.85})]}:"lines"===n?{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",children:[o,
|
|
284
|
-
/* @__PURE__ */De("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"1.5",strokeOpacity:.8})]}:{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:[o,
|
|
285
|
-
/* @__PURE__ */De("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"2",strokeOpacity:.75})]})}function Qa({id:e,direction:t}){const r="center-out"===t?"rosh-viz-wipe-center":"right-to-left"===t?"rosh-viz-wipe-rtl":"rosh-viz-wipe";/* @__PURE__ */
|
|
286
|
-
return De("mask",{id:Ya(e),maskUnits:"objectBoundingBox",maskContentUnits:"objectBoundingBox",children:/* @__PURE__ */De("rect",{x:"0",y:"0",width:"1",height:"1",fill:"white",className:r})})}function el({id:e,fills:t=[],fadeFrom:r=.3,fadeTo:n=0,glow:a=!1,reveal:l=!1,background:i="none"}){/* @__PURE__ */
|
|
287
|
-
return Ae("defs",{children:[t.map((t,a)=>/* @__PURE__ */De(Ja,{id:e,index:a,colour:t.color,variant:t.variant??"gradient",from:r,to:n},a)),l&&/* @__PURE__ */De(Qa,{id:e,direction:l}),a&&/* @__PURE__ */Ae("filter",{id:Va(e),x:"-40%",y:"-40%",width:"180%",height:"180%",children:[
|
|
288
|
-
/* @__PURE__ */De("feGaussianBlur",{stdDeviation:"3.5",result:"blur"}),
|
|
289
|
-
/* @__PURE__ */Ae("feMerge",{children:[
|
|
290
|
-
/* @__PURE__ */De("feMergeNode",{in:"blur"}),
|
|
291
|
-
/* @__PURE__ */De("feMergeNode",{in:"SourceGraphic"})]})]}),"none"!==i&&/* @__PURE__ */De(tl,{id:Za(e),variant:i})]})}function tl({id:e,variant:t}){/* @__PURE__ */
|
|
292
|
-
return De("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */De("circle",{cx:"2",cy:"2",r:"1",fill:"currentColor"})}:"grid"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */De("path",{d:"M 20 0 L 0 0 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"cross-hatch"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */De("path",{d:"M 0 0 L 20 20 M 20 0 L 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"plus"===t?{id:e,width:"16",height:"16",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */De("path",{d:"M 8 4 L 8 12 M 4 8 L 12 8",fill:"none",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round"})}:{id:e,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:/* @__PURE__ */De("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"currentColor",strokeWidth:"0.5"})})}var rl={rise:"rosh-viz-rise",grow:"rosh-viz-grow",sweep:"rosh-viz-sweep",march:"rosh-viz-march",fade:"rosh-viz-fade"},nl=(e,t=60)=>({animationDelay:e*t+"ms"}),al={receipt:/* @__PURE__ */Ae(je,{children:[
|
|
293
|
-
/* @__PURE__ */De("path",{d:"M3.4 1.9h5.2v7.2l-1.3-.9-1.3.9-1.3-.9-1.3.9z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
|
|
294
|
-
/* @__PURE__ */De("path",{d:"M4.9 4.4h2.2M4.9 6.1h2.2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),check:/* @__PURE__ */De("path",{d:"M2.6 6.3 4.9 8.6 9.4 3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"}),doc:/* @__PURE__ */Ae(je,{children:[
|
|
295
|
-
/* @__PURE__ */De("path",{d:"M3.5 1.9h3.4l2 2v6.2H3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
|
|
296
|
-
/* @__PURE__ */De("path",{d:"M5.1 6.5h2.8M5.1 8.2h2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),flask:/* @__PURE__ */De("path",{d:"M4.6 1.8h2.8M5.4 1.8v3.1L3.3 9.3a.9.9 0 0 0 .8 1.3h3.8a.9.9 0 0 0 .8-1.3L6.6 4.9V1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),truck:/* @__PURE__ */Ae(je,{children:[
|
|
297
|
-
/* @__PURE__ */De("path",{d:"M1.8 2.9h4.9v4.4H1.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
|
|
298
|
-
/* @__PURE__ */De("path",{d:"M6.7 4.4h1.6l1.5 1.7v1.2H6.7z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
|
|
299
|
-
/* @__PURE__ */De("circle",{cx:"3.5",cy:"8.7",r:"1",fill:"currentColor"}),
|
|
300
|
-
/* @__PURE__ */De("circle",{cx:"8.4",cy:"8.7",r:"1",fill:"currentColor"})]}),flag:/* @__PURE__ */Ae(je,{children:[
|
|
301
|
-
/* @__PURE__ */De("path",{d:"M3.8 1.7v8.6",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"}),
|
|
302
|
-
/* @__PURE__ */De("path",{d:"M3.8 2.5h4.8L7.5 4.4l1.1 1.9H3.8z",fill:"currentColor"})]})};function ll({name:e}){/* @__PURE__ */
|
|
303
|
-
return De("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:al[e]})}function il(){/* @__PURE__ */
|
|
304
|
-
return Ae("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
|
|
305
|
-
/* @__PURE__ */De("path",{d:"M4.2 2.2v11.6"}),
|
|
306
|
-
/* @__PURE__ */De("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function ol(){/* @__PURE__ */
|
|
307
|
-
return De("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */De("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var sl=1e-6;function cl(e,t,r={}){const n=Number.isFinite(t)&&t>0?t:0,a=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(n<=0||a.length<2){const e=a[0]??0;return{anchorsMs:a,xs:a.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=a[a.length-1]-a[0],i=r.maxTimeShare??.3,o=Math.min(r.breakPx??48,n),s=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<a.length;e++){const t=a[e+1]-a[e];c.push(t),d.push(l>0?t/l*n:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,n-h*o);let p=0,g=0;for(let e=0;e<c.length;e++)u[e]||(p+=c[e],g+=1);const f=c.map((e,t)=>u[t]?o:0===g?0:p>0?m*e/p:m/g),b=function(e,t,r){const n=e.slice();let a=0;for(let e=0;e<n.length;e++)t[e]||n[e]>=r-sl||(a+=r-n[e],n[e]=r);if(a<=sl)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+sl&&(l+=n[e]-r);if(l<=sl)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+sl||(n[e]-=i*(n[e]-r)/l);return n}(f,u,s),x=b.reduce((e,t,r)=>u[r]?e:e+t,0),y=b.map((e,t)=>u[t]?e:x>0?e*m/x:e),v=[0];for(let e=0;e<y.length;e++)v.push(v[e]+y[e]);v[v.length-1]=n;const w=v.slice(0,-1).map((e,t)=>({fromMs:a[t],toMs:a[t+1],gapMs:c[t],fromPx:e,toPx:v[t+1],wantPx:d[t],clampedPx:f[t],px:v[t+1]-e,compressed:u[t]}));return{anchorsMs:a,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=a[0])return 0;if(e>=a[a.length-1])return n;for(let t=0;t+1<a.length;t++){if(e>a[t+1])continue;const r=a[t+1]-a[t],n=r>0?(e-a[t])/r:0;return v[t]+n*(v[t+1]-v[t])}return n},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),n);for(let e=0;e+1<a.length;e++){if(t>v[e+1]&&e+2<a.length)continue;const r=v[e+1]-v[e],n=r>0?(t-v[e])/r:0;return a[e]+n*(a[e+1]-a[e])}return a[a.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function dl(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var ul="mixed";function hl(e,t){return 5.6*Math.max(e.length,t.length)+8}var ml=(e,t,r)=>Math.min(Math.max(e,t),r),pl=e=>-(Math.cos(Math.PI*e)-1)/2;function gl(e,t){if(!(t>0))return{px:e.fromPx,ms:e.fromMs};if(t>=1||e.durationMs<=0)return{px:e.toPx,ms:e.toMs};const r=e.fromPx+(e.toPx-e.fromPx)*pl(t);return{px:r,ms:e.msByPx(r)}}var fl={lanes:{tag:0,laneA:17,laneH:30,rail:52,ruler:64,laneB:86,height:120},active:{tag:0,laneA:17,laneH:30,rail:38,ruler:50,laneB:74,height:108},none:{tag:0,laneA:16,laneH:14,rail:34,ruler:46,laneB:46,height:72}};function bl(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var xl=e=>5.6*e.length,yl={default:{},dfm:{glyph:"doc",token:"var(--tl-dfm)"},shipment:{diamond:!0,glyph:"truck",token:"var(--tl-shipment)"},testing:{glyph:"flask",token:"var(--tl-testing)"},completion:{glyph:"check",token:"var(--tl-completion)"},inspection:{glyph:"flask",token:"var(--tl-inspection)"},invoice:{glyph:"receipt",token:"var(--tl-invoice)"},report:{}},vl={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function wl(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:yl[t].glyph??(r?"flag":void 0)}function kl(e,t,r=!1){const n=yl[e],a=["rosh-tl-node","rosh-tl-mark",`is-${t}`];n.diamond&&a.push("is-diamond"),r&&a.push("is-provisional");const l="current"===t?"var(--tl-accent)":n.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:a.join(" "),style:i}}function Nl(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var Ml="undefined"==typeof document?xe:Le;function $l(e,t){const[r,n]=ge(0);return Ml(()=>{const r=t?e.current:null;if(!r)return;const a=()=>{const e=r.getBoundingClientRect().width;e>0&&n(e)};if(a(),"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(a);return l.observe(r),()=>{l.disconnect()}},[e,t]),r}function Cl(e,t,r){const n=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&n.set(e.x,Math.max(n.get(e.x)??0,e.widthPx));const a=[...n.keys()].sort((e,t)=>e-t);if(r<=0||a.length<2)return e;const l=Math.max(0,a[0]),i=Math.min(r,a[a.length-1]),o=i-l,s=[];for(let e=0;e+1<a.length;e++){const t=(n.get(a[e])??0)/2+(n.get(a[e+1])??0)/2+8;s.push(Math.max(28,t,a[e+1]-a[e]))}const c=s.reduce((e,t)=>e+t,0),d=Math.min(Math.max(c,o),.8*r);if(d<=o+.5)return e;const u=l,h=r-i,m=u+h,p=Math.max(0,r-d),g=m>0?p*u/m:0,f=g,b=g+d,x=s.map(e=>c>0?e*d/c:0),y=e=>{if(e<=l)return u>0?e*g/u:f;if(e>=i)return h>0?b+(e-i)*(r-b)/h:b;let t=f;for(let r=0;r+1<a.length;r++){if(e>a[r+1]){t+=x[r];continue}const n=a[r+1]-a[r];return t+(n>0?(e-a[r])/n*x[r]:0)}return b};return{anchorsMs:e.anchorsMs,xs:e.xs.map(y),gaps:e.gaps.map(e=>({...e,fromPx:y(e.fromPx),toPx:y(e.toPx),px:y(e.toPx)-y(e.fromPx)})),xByMs:t=>y(e.xByMs(t)),msByPx:t=>e.msByPx((e=>{if(e<=f)return g>0?e*u/g:l;if(e>=b)return r-b>0?i+(e-b)*h/(r-b):i;let t=f;for(let r=0;r+1<a.length;r++){if(!(e>t+x[r]))return a[r]+(x[r]>0?(e-t)/x[r]*(a[r+1]-a[r]):0);t+=x[r]}return i})(t)),inCut:e.inCut}}function Ll(e){if(!e||0===e.length)return null;const t=e.filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:null}function Dl({marks:e,innerRef:t}){/* @__PURE__ */
|
|
308
|
-
return De("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */Ae("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
|
|
309
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-name",children:e.label}),
|
|
310
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function Al({startMs:e,endMs:t,axis:r,geo:n,reveal:a}){const l=G().timeline,i=ne(Z()),o=n.ruler,s=[],c=[],d=r.gaps.filter(e=>e.compressed),u=new Date(e);u.setUTCDate(u.getUTCDate()+(8-u.getUTCDay())%7);for(let e=u.getTime();e<t;e+=7*_a){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*_a)-t<14||s.push(
|
|
311
|
-
/* @__PURE__ */De("i",{className:"rosh-tl-tick is-week",style:{left:`${t}px`,top:`${o}px`,height:"3px"}},`wk-${e}`))}const h=d.map(e=>{const t=(e.fromPx+e.toPx)/2,r=xl(l.days(Math.round(e.gapMs/_a)))/2+6;return[t-r,t+r]}),m=(e,t)=>h.some(([r,n])=>e<n&&t>r);s.push(
|
|
312
|
-
/* @__PURE__ */De("i",{"data-timeline-part":"start-tick",className:"rosh-tl-tick",style:{left:"0px",top:`${o}px`,height:"6px"}},"start"));const p=new Date(e);p.setUTCDate(1);let g=-1/0,f=!0;for(;p.getTime()<t;){const t=p.getTime();if(!(t<=e)&&!r.inCut(t)){const e=r.xByMs(t);if(s.push(
|
|
313
|
-
/* @__PURE__ */De("i",{className:"rosh-tl-tick",style:{left:`${e}px`,top:`${o}px`,height:"6px"}},`mo-${t}`)),e-g>=72||f){const r=f||0===p.getUTCMonth()?i.shortMonthYear(p.getUTCFullYear(),p.getUTCMonth()):i.monthsShort[p.getUTCMonth()];m(e,e+xl(r))||(c.push(
|
|
314
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-month"+(a?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${o+9}px`,...a?{animationDelay:"420ms"}:{}},children:r},`mon-${t}`)),g=e,f=!1)}}p.setUTCMonth(p.getUTCMonth()+1)}/* @__PURE__ */
|
|
315
|
-
return Ae("div",{"aria-hidden":"true","data-timeline-part":"ruler",children:[s,c,d.map(e=>{const t=Math.max(1,Math.round(e.gapMs/_a));/* @__PURE__ */
|
|
316
|
-
return Ae("span",{"data-timeline-part":"break",className:"rosh-tl-rulercut"+(a?" rosh-tl-fade":""),style:{left:(e.fromPx+e.toPx)/2+"px",top:`${o}px`,...a?{animationDelay:"420ms"}:{}},children:[
|
|
317
|
-
/* @__PURE__ */Ae("span",{className:"rosh-tl-cutglyph",children:[
|
|
318
|
-
/* @__PURE__ */De("i",{}),
|
|
319
|
-
/* @__PURE__ */De("i",{})]}),
|
|
320
|
-
/* @__PURE__ */De("span",{children:l.days(t)})]},`cut-${e.fromMs}`)})]})}function jl({pending:e,reveal:t}){const r=G().timeline,[n,a]=ge(!1),l=n?e:e.slice(0,2),i=e.length-l.length;/* @__PURE__ */
|
|
321
|
-
return Ae("div",{className:"rosh-tl-pending","data-timeline-part":"pending",children:[
|
|
322
|
-
/* @__PURE__ */De("p",{className:"rosh-tl-pending-head",children:r.notReached}),
|
|
323
|
-
/* @__PURE__ */De("ol",{className:"rosh-tl-ghosts","aria-label":r.notReached,children:l.map((e,n)=>/* @__PURE__ */Ae("li",{className:t?"rosh-tl-fade":void 0,style:t?{animationDelay:440+60*n+"ms"}:void 0,children:[
|
|
324
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true",className:"rosh-tl-node is-ghost"+(e.kind&&yl[e.kind].diamond?" is-diamond":"")}),
|
|
325
|
-
/* @__PURE__ */Ae("span",{children:[0===n&&/* @__PURE__ */De("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */De("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>a(!0),children:r.more(i)})]})}function Pl({marks:e,pending:t,currentKey:r,todayMs:n,reveal:a,ariaLabel:l,step:i,nodeProps:o,onKeyDown:s}){const c=G().timeline,d=e.findIndex(e=>e.key===r),u=e.length>0&&null!==n?Math.round((n-e[e.length-1].ms)/_a):0;/* @__PURE__ */
|
|
326
|
-
return Ae("div",{"data-timeline-part":"vertical",children:[
|
|
327
|
-
/* @__PURE__ */De("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:s,children:e.map((e,t)=>{const n=kl(e.kind,e.role),l=d>=0&&t<d,{glyph:s}=e;/* @__PURE__ */
|
|
328
|
-
return Ae("li",{className:a?"rosh-tl-fade":void 0,style:a?nl(t,i):void 0,...e.key===r?{"aria-current":"step"}:{},children:[
|
|
329
|
-
/* @__PURE__ */De("i",{"aria-hidden":"true",className:`rosh-tl-vline text-blue-600${l?" is-on":" is-dash"}${l&&a?" rosh-tl-drawy":""}`}),
|
|
330
|
-
/* @__PURE__ */Ae("button",{...o(e),className:`${n.className}${a?" rosh-tl-pop":""}`,style:{...n.style,...a?nl(t,i):{}},children:[s&&/* @__PURE__ */De(ll,{name:s}),"current"===e.role&&/* @__PURE__ */De("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(a?" is-on":"")})]}),
|
|
331
|
-
/* @__PURE__ */Ae("span",{className:"rosh-tl-vrow","aria-hidden":"true",children:[
|
|
332
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-name",children:e.label}),
|
|
333
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-date",children:e.dateText})]})]},e.key)})}),u>0&&/* @__PURE__ */Ae("p",{className:"rosh-tl-vgap","aria-hidden":"true",children:[
|
|
334
|
-
/* @__PURE__ */De("i",{className:"rosh-tl-vline is-dash"}),
|
|
335
|
-
/* @__PURE__ */De("span",{children:c.daysToToday(u)})]}),t.length>0&&/* @__PURE__ */De(jl,{pending:t,reveal:a})]})}function Sl({axis:e,geo:t,fillTo:r,reveal:n,trackPx:a,tweened:l=!1}){/* @__PURE__ */
|
|
336
|
-
return Ae("div",{"aria-hidden":"true",children:[
|
|
337
|
-
/* @__PURE__ */De("div",{className:"rosh-tl-rail bg-gray-200",style:{top:`${t.rail}px`,height:"6px",width:`${a}px`}}),null!==r&&/* @__PURE__ */De("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__ */Ae("div",{className:"rosh-tl-cut",style:{left:(e.fromPx+e.toPx)/2+"px",top:`${t.rail}px`,height:"6px"},children:[
|
|
338
|
-
/* @__PURE__ */De("i",{}),
|
|
339
|
-
/* @__PURE__ */De("i",{})]},`railcut-${e.fromMs}`))]})}function zl({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__ */
|
|
340
|
-
return Ae("div",{"aria-hidden":"true","data-timeline-part":"start",children:[
|
|
341
|
-
/* @__PURE__ */De("i",{className:`rosh-tl-start${n?" is-around":""}${o}`,style:{left:"0px",top:`${e.rail+3}px`,...s}}),null!=t&&!1!==t&&/* @__PURE__ */De("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__ */De("span",{className:`rosh-tl-edge is-end${o}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...s},children:r})]})}function Fl({x:e,geo:t,trackPx:r,label:n,reveal:a}){const l=G().timeline;/* @__PURE__ */
|
|
342
|
-
return Ae("div",{"aria-hidden":"true","data-timeline-part":"today",children:[
|
|
343
|
-
/* @__PURE__ */De("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"}:{}}}),
|
|
344
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${dl(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function Bl({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=xl(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__ */De("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */De("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 El({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
|
|
345
|
-
return Ae("div",{"aria-hidden":"true","data-timeline-part":"phase",children:[
|
|
346
|
-
/* @__PURE__ */De("div",{className:"rosh-tl-phase border-gray-300",style:{left:`${n}px`,width:`${a}px`,top:t.laneB+t.laneH-4+"px"}}),
|
|
347
|
-
/* @__PURE__ */Ae("span",{className:"rosh-tl-phase-label text-gray-500",style:{left:`${n+a/2}px`,top:`${t.laneB+t.laneH+5}px`},children:[e.label," · parallel"]})]})}function Tl({nodes:e,trackPx:t,geo:r,activeKey:n,hoveredKey:a,currentKey:l}){const i=G().timeline,o=(e,t)=>null!==t&&(e.key===t||e.members.some(e=>e.key===t)),s=e.find(e=>e.key===a)??e.find(e=>o(e,n))??null;if(!s)return null;const c=s.mark,d=c?c.label:`×${s.members.length}`,u=c?c.dateText:function(e){const t=e[0].dateText,r=e[e.length-1].dateText;return t===r?t:`${t} – ${r}`}(s.members),h=c?c.widthPx:hl(d,u),m=c?.onOpen;/* @__PURE__ */
|
|
348
|
-
return Ae("div",{"data-timeline-part":"label",className:`rosh-tl-label${s.key===a?" is-hot":""}${o(s,l)?" is-current":""}`,style:{left:`${dl(s.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */De("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */De("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
|
|
349
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function Il({groups:e,trackPx:t,geo:r,startMs:n,endMs:a,currentKey:l,hoveredKey:i,reveal:o,step:s,zoomedKey:c,popId:d,aimBubble:u,openCluster:h,setOpenCluster:m,previewCluster:p,setPreviewCluster:g,setZoomKey:f,startCaptionPx:b}){const x=[];e.forEach((e,t)=>{if("cluster"===e.type){const n=`cluster-${e.members[0].key}`,a=(r=e.members,`${(r[0]?.label??"").replace(/\s*v?\d+$/i,"").trim()||(r[0]?.label??"")} ×${r.length}`);if(x.push({key:n,group:e,text:a,x:e.members.reduce((e,t)=>e+t.baseX,0)/e.members.length,index:t,lane:-1,left:0,widthPx:Math.ceil(xl(a))+28}),n===c)for(const r of e.members)x.push({key:r.key,group:{type:"item",mark:r},text:r.label,x:r.x,index:t,lane:-1,left:0,widthPx:r.widthPx});return}var r;x.push({key:e.mark.key,group:e,text:e.mark.label,x:e.mark.x,index:t,lane:-1,left:0,widthPx:e.mark.widthPx})}),x.sort((e,t)=>e.x-t.x);const y=function(e,t,r,n,a={}){const l=t>0?t:0,i=n>0?n:1,o=a.gapPx??6,s=Math.max(1,a.laneCount??4),c=e.map((e,t)=>({item:e,index:t})).sort((e,t)=>(e.item.priority??0)-(t.item.priority??0)||e.item.ms-t.item.ms||e.index-t.index),d=Array.from({length:s},()=>[]),u=/* @__PURE__ */new Map;for(const{item:e}of c){const t=Math.max(0,e.widthPx);if(l<=0||t>l){u.set(e.key,-1);continue}const n=e.xPx??(e.ms-r)/i*l,a=Math.min(Math.max(n-t/2,0),l-t),c=a+t;let h=-1;for(let e=0;e<s;e++)if(d[e].every(e=>a>e.right+o||c+o<e.left)){d[e].push({left:a,right:c}),h=e;break}u.set(e.key,h)}return e.map(e=>({key:e.key,lane:u.get(e.key)??-1}))}([...b>0?[{key:"__rosh-tl-start__",ms:n,xPx:0,widthPx:b,priority:-2}]:[],...x.map(e=>({key:e.key,ms:"cluster"===e.group.type?e.group.members[0].ms:e.group.mark.ms,xPx:e.x,widthPx:e.widthPx,priority:"cluster"===e.group.type?-1:0}))],t,n,Math.max(a-n,_a),{laneCount:2}),v=new Map(y.map(e=>[e.key,e.lane]));for(const e of x)e.lane=v.get(e.key)??-1,e.left=dl(e.x,e.widthPx,t);const w=x.find(e=>e.key===(h??p)),k=e=>0===e?r.laneA:r.laneB,N=e=>0===e?r.rail-4:r.rail+6+3;/* @__PURE__ */
|
|
350
|
-
return Ae(je,{children:[x.map(e=>{const t=Math.max(0,e.lane),n=Math.round(e.index*s+60);if("cluster"===e.group.type){const a=h===e.key,l=e.group.members.map(e=>e.x),i=()=>{g(null),a||f(null)};/* @__PURE__ */
|
|
351
|
-
return Ae("div",{children:[
|
|
352
|
-
/* @__PURE__ */Ae("button",{type:"button","data-timeline-part":"cluster",className:`rosh-tl-pill${yl[e.group.kind]?.token?"":" text-blue-600"}${o?" rosh-tl-fade":""}`,"aria-expanded":a,"aria-controls":d,style:{left:`${e.left}px`,top:`${0===t?r.laneA+r.laneH-19:r.laneB}px`,color:yl[e.group.kind]?.token,...o?{animationDelay:`${n}ms`}:{}},onMouseEnter:()=>{g(e.key),f(e.key)},onMouseLeave:i,onFocus:()=>{g(e.key),f(e.key)},onBlur:i,onClick:()=>{m(a?null:e.key),f(a?null:e.key)},children:[
|
|
353
|
-
/* @__PURE__ */De("i",{"aria-hidden":"true"}),e.text]}),
|
|
354
|
-
/* @__PURE__ */De("i",{"aria-hidden":"true",className:"rosh-tl-cspan",style:{left:`${Math.min(...l)}px`,width:`${Math.max(1,Math.max(...l)-Math.min(...l))}px`,top:`${N(t)}px`}})]},e.key)}const a=e.group.mark;if(e.lane<0)return a.key===i?/* @__PURE__ */Ae("div",{"aria-hidden":"true","data-timeline-part":"reveal",className:"rosh-tl-label is-reveal is-hot",style:{left:`${e.left}px`,top:`${r.laneA}px`,width:`${e.widthPx}px`},children:[
|
|
355
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-name",children:a.label}),
|
|
356
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-date",children:a.dateText})]},e.key):null;const c=Math.abs(e.left+e.widthPx/2-a.x)<=8;/* @__PURE__ */
|
|
357
|
-
return Ae("div",{children:[
|
|
358
|
-
/* @__PURE__ */Ae("div",{"aria-hidden":"true","data-timeline-part":"label",className:`rosh-tl-label${0===t?" is-up":""}${a.key===l?" is-current":""}${a.key===i?" is-hot":""}${o?" rosh-tl-fade":""}`,style:{left:`${e.left}px`,top:`${k(t)}px`,width:`${e.widthPx}px`,height:`${r.laneH}px`,...o?{animationDelay:`${n}ms`}:{}},children:[
|
|
359
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-name",children:a.label}),
|
|
360
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-date",children:a.dateText})]}),!c&&/* @__PURE__ */De("i",{"aria-hidden":"true",className:"rosh-tl-lead"+(o?" rosh-tl-fade":""),style:{left:`${Math.min(e.left+e.widthPx/2,a.x)}px`,width:`${Math.abs(e.left+e.widthPx/2-a.x)}px`,top:`${N(t)}px`,...o?{animationDelay:`${n}ms`}:{}}})]},e.key)}),w&&"cluster"===w.group.type&&/* @__PURE__ */Ae("div",{ref:e=>{u(e,w.x)},id:d,className:"rosh-tl-popover","data-timeline-part":"cluster-popover",style:{top:`${r.rail+6+6}px`},onMouseEnter:()=>g(w.key),onMouseLeave:()=>g(null),children:[
|
|
361
|
-
/* @__PURE__ */De("p",{className:"rosh-tl-popover-head",children:w.text}),
|
|
362
|
-
/* @__PURE__ */De("ol",{children:w.group.members.map(e=>/* @__PURE__ */Ae("li",{children:[
|
|
363
|
-
/* @__PURE__ */De("span",{children:e.label}),
|
|
364
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function Ol({thumb:e,value:t,snap:r,axis:n,geo:a,startMs:l,endMs:i,trackPx:o,layerRef:s,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=G().timeline,p=Z(),g=fe(!1),f=c?c.px:n.xByMs(t),b=c?c.ms:t,x=Ll(e.stops),y=x?x.indexOf(t):-1,v=e=>{const r=s.current?.getBoundingClientRect();return r?n.msByPx(e-r.left):t},w=n=>{const a=r(n);a!==t&&e.onChange(a)},k=t=>{d?.(),g.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},N=t=>{g.current&&(g.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},M=e=>{if(!g.current)return;const t=v(e.clientX);w(t),h(function(e,t){if(!Number.isFinite(t))return null;const r=e.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms);for(let e=0;e+1<r.length;e++){const n=r[e],a=r[e+1];if(t<n.ms||t>a.ms)continue;const l=a.ms-n.ms;return{fromKey:n.key,toKey:a.key,t:l>0?ml((t-n.ms)/l,0,1):1,ms:t}}return null}(u,t))},$=e.valueText?e.valueText(b):qa(b,p),C=Math.max(1,Math.round((i-l)/_a));/* @__PURE__ */
|
|
365
|
-
return Ae(je,{children:[
|
|
366
|
-
/* @__PURE__ */De("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:a.rail-9+"px",height:"24px"},onPointerDown:e=>{k(e),w(v(e.clientX))},onPointerMove:M,onPointerUp:N,onPointerCancel:N}),
|
|
367
|
-
/* @__PURE__ */De("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${dl(f,88,o)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):qa(b,p)}),
|
|
368
|
-
/* @__PURE__ */De("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":x&&x.length>0?x.length-1:C,"aria-valuenow":x&&x.length>0?Math.max(0,y):Math.round((t-l)/_a),"aria-valuetext":$,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:k,onPointerMove:M,onPointerUp:N,onPointerCancel:N,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(x&&x.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?x[Math.min(e+1,x.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?x[Math.max(e-1,0)]:"Home"===r?x[0]:"End"===r?x[x.length-1]:null}const n=(e.shiftKey?7:1)*_a;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 Rl(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Wl({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:x=!0,ariaLabel:y,highlightKeys:v=null,onHoverChange:w,endMark:k=null}){const N="none"===s,M=K(Date.now,null),$=K(bl,!1),C=o??M,L=fe(null),D=G().timeline,A=Z(),j=e=>qa(e,A),P=fe(null),S=fe(null),z=fe(null),F=fe(/* @__PURE__ */new Map),B=fe(void 0),E=fe(void 0),T=fe(null),[O,R]=ge({}),[W,H]=ge(null),[_,q]=ge(null),[U,V]=ge(null),[Y,X]=ge(null),[J,Q]=ge(null),[ee,te]=ge(null),re=me(),ne=me(),ae=$l(L,!0),le=ae>0?ae-(l.length>0&&!N?176:0):0,ie=le>0&&le-20<320,oe=$l(P,!ie),se=oe>0?oe:600,ce=fl[s],de=N&&l.length>0,ue=de?Math.max(0,se-36):se,he=r=>r>=e-_a&&r<=t+_a,be=n.filter(e=>Number.isFinite(e.ms)&&he(e.ms)).slice().sort((e,t)=>e.ms-t.ms),ye="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],ve=cl([e,...[...be.map(e=>e.ms),...ye].filter(r=>r>e&&r<t),t],ue,"compressed"===(we=r)?{}:"spread"===we?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var we;const ke=ve.xByMs,Ne=be.filter(e=>!e.provisional),Me=g??(Ne.length>0?Ne[Ne.length-1].key:null),$e=be.map((e,t)=>{const r=e.date??j(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?vl[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:ke(e.ms),baseX:ke(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:wl(e,a,0===t&&"default"===a),role:e.key===Me?"current":n?"dot":"key",widthPx:N?Math.max(16,xl(e.caption??"")+6):O[e.key]||hl(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=j(t);return{key:r,ms:t,x:ke(t),baseX:ke(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??yl[e.kind].glyph,role:"key",widthPx:O[r]||hl(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+_a,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}]})():[],Pe=N&&k&&!de?[{key:k.key,ms:t,x:ue,baseX:ue,kind:"default",label:k.label,dateText:k.dateText??j(t),detail:k.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Se=[...$e,...Ce,...Le,...Pe].sort((e,t)=>e.x-t.x||e.ms-t.ms),ze=m?.start??D.start(j(e)),Fe=null==ze||!1===ze?0:"string"==typeof ze?Math.ceil(xl(ze)):96,Be="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):[],Ee=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:ul,members:t})}n=a}return r}(Se),Te=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ie=/* @__PURE__ */new Map;for(const e of Ee)if("cluster"===e.type)for(const t of e.members)Ie.set(t.key,Te(e));const Oe=U??Y??J,Re=Be.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Oe)??Ee.find(e=>"cluster"===e.type&&Te(e)===Oe),We=e=>({x:e.baseX,widthPx:e.widthPx}),He=Re&&"cluster"===Re.type?Re.members.map(We):f?Se.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(We):[],_e=He.length>1?Cl(ve,He,ue):ve,Ke=_e!==ve;if(Ke)for(const e of Se)e.isCap||(e.x=_e.xByMs(e.ms));const qe=Se.some(e=>e.x<14),Ue=Ke&&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):Ee.flatMap(e=>{if("item"===e.type)return[Ve(e.mark)];const t=Te(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}]}),Ze=/* @__PURE__ */new Map;for(const e of Ye)for(const t of e.members)Ze.set(t.key,e.key);const Ge=Ee.find(e=>"cluster"===e.type&&Te(e)===Ue),Xe=Ge&&"cluster"===Ge.type?{from:Math.min(...Ge.members.map(e=>e.x))-16,to:Math.max(...Ge.members.map(e=>e.x))+16}:null,Je=fe(Ue),[Qe,et]=ge(!1);xe(()=>{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("|");Ml(()=>{const e=S.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)}R(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]=ge(rt),lt=x&&nt===rt;xe(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,Se.length-1)),ot=Ll(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:ml(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:$}),[ht,mt]=ge(null),pt=fe(null),gt=fe({segments:ut,value:ct,playback:h});xe(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=fe(null),bt=pe(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=pe(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!h?.playing&&!!u;xe(()=>{if(!yt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void xt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(gl(t,0))):xt()},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:gl(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:gl(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=gl(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:pl(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)):xt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[yt,xt,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,kt=new Set(v??[]),Nt=Se.filter(e=>kt.has(e.key)).map(e=>e.x),Mt=Nt.length>0?{from:Math.min(...Nt),to:Math.max(...Nt)}:null,$t=pe(()=>{clearTimeout(B.current),clearTimeout(E.current),H(null),q(null),V(null),X(null),Q(null)},[]);xe(()=>()=>{clearTimeout(B.current),clearTimeout(E.current)},[]),xe(()=>{const e=T.current;e&&(T.current=null,F.current.get(e)?.focus())});const Ct=null!==_||null!==U||null!==Y||null!==J;xe(()=>{if(Ct)return I(e=>"Escape"===e.key&&($t(),!0))},[Ct,$t]);const Lt=pe((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,At=Dt?Dt.x:0;Ml(()=>{Lt(z.current,At)},[Lt,_,At]);const jt=ct??void 0,Pt=fe(null);xe(()=>{if(void 0===jt)return;const e=_e.xByMs(jt),t=Pt.current;if(Pt.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(Ze.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[jt]);const St=Ye.map(e=>e.key),zt=Me?Ze.get(Me)??null:null,Ft=ee&&St.includes(ee)?ee:zt&&St.includes(zt)?zt:St[0],Bt=e=>{const t=St.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?St.length-1:-1;r<0||r>St.length-1||(e.preventDefault(),te(St[r]),F.current.get(St[r])?.focus())},Et=()=>clearTimeout(E.current),Tt=e=>{Et(),Q(e)},It=()=>{clearTimeout(E.current),E.current=setTimeout(()=>Q(null),260)},Ot=e=>{Ue&&Ie.get(e)===Ue?Et():(Et(),Q(null))},Rt=e=>{clearTimeout(B.current),H(e),q(e),w?.((e=>{const t=Ye.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{H(t=>t===e?null:t),clearTimeout(B.current),B.current=setTimeout(()=>q(t=>t===e?null:t),160),w?.(null)},Ht=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Nl(e),"aria-describedby":_===e.key?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(Nl))),"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?Tt(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);Tt(e.key);const r=e.members[0];te(r.key),T.current=r.key}};var t,r},Kt="lanes"!==s||Se.length>1;if(ie)/* @__PURE__ */
|
|
369
|
-
return De("div",{ref:L,children:/* @__PURE__ */De(Pl,{marks:Se.filter(e=>!e.isCap),pending:l,currentKey:Me,todayMs:C,reveal:lt,ariaLabel:y,step:it,nodeProps:Ht,onKeyDown:Bt})});const qt=(e,t)=>null==e||!1===e?null:/* @__PURE__ */De("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__ */
|
|
370
|
-
return Ae("div",{ref:L,className:"rosh-tl-body"+(l.length>0&&!N?"":" is-solo"),children:[
|
|
371
|
-
/* @__PURE__ */Ae("div",{className:"flex items-stretch gap-3",children:[N&&qt(ze,!1),
|
|
372
|
-
/* @__PURE__ */De("div",{className:"rosh-tl-stage",style:{height:`${Rl(ce,Kt,p.length>0&&!N)}px`},children:/* @__PURE__ */Ae("div",{ref:P,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Xe)return;const t=P.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Xe.from&&r<=Xe.to?Et():It()},onMouseLeave:It,children:[!N&&/* @__PURE__ */De(Dl,{marks:Se,innerRef:S}),
|
|
373
|
-
/* @__PURE__ */De(Sl,{axis:_e,geo:ce,fillTo:wt,reveal:lt,trackPx:ue,tweened:!!u}),de&&
|
|
374
|
-
/* @__PURE__ */De("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"}}),Mt&&/* @__PURE__ */De("div",{"aria-hidden":"true",className:"rosh-tl-band","data-timeline-part":"highlight",style:{left:Mt.from-10+"px",width:Mt.to-Mt.from+20+"px",top:ce.rail-7+"px",height:"20px"}}),
|
|
375
|
-
/* @__PURE__ */De(Al,{startMs:e,endMs:t,axis:_e,geo:ce,reveal:lt}),
|
|
376
|
-
/* @__PURE__ */De(zl,{geo:ce,caption:N?null:ze,endCaption:N?null:m?.end,around:qe,reveal:lt,trackPx:se}),N&&/* @__PURE__ */De(Bl,{nodes:Ye,geo:ce,reveal:lt}),null!==C&&C>e&&C<=t+_a&&/* @__PURE__ */De(Fl,{x:_e.xByMs(Math.min(C,t)),geo:ce,trackPx:se,label:j(C),reveal:lt}),!N&&p.map(e=>/* @__PURE__ */De(El,{phase:e,geo:ce,xOf:_e.xByMs},e.key)),
|
|
377
|
-
/* @__PURE__ */De("ol",{className:"rosh-tl-nodes","aria-label":y,onKeyDown:Bt,children:Ye.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${ce.rail+3}px`,a=lt?nl(t,it):{},l=(e=>!!Mt&&e.x>=Mt.from-.5&&e.x<=Mt.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
|
|
378
|
-
return De("li",{children:/* @__PURE__ */De("button",{...Ht(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:n,...a}})},e.key);if(!e.mark){const t=e.kind===ul,i=kl(t?"default":e.kind,"key"),o=t?void 0:yl[e.kind]?.glyph;/* @__PURE__ */
|
|
379
|
-
return Ae("li",{...r(Me)?{"aria-current":"step"}:{},children:[
|
|
380
|
-
/* @__PURE__ */Ae("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__ */De(ll,{name:o}),t&&/* @__PURE__ */Ae("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */Ae("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=kl(i.kind,i.role,i.provisional),{glyph:s}=i;/* @__PURE__ */
|
|
381
|
-
return De("li",{...i.key===Me?{"aria-current":"step"}:{},children:/* @__PURE__ */Ae("button",{...Ht(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__ */De(ll,{name:s}),"current"===i.role&&/* @__PURE__ */De("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */De(Il,{groups:Be,trackPx:se,geo:ce,startMs:e,endMs:t,currentKey:Me,hoveredKey:W,reveal:lt,step:it,zoomedKey:Ue,popId:ne,aimBubble:Lt,startCaptionPx:Fe,openCluster:U,setOpenCluster:V,previewCluster:Y,setPreviewCluster:X,setZoomKey:Q}):"active"===s?/* @__PURE__ */De(Tl,{nodes:Ye,trackPx:se,geo:ce,activeKey:c,hoveredKey:W,currentKey:Me}):null,Dt&&/* @__PURE__ */De("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:()=>{It(),Wt(Dt.key)},onFocus:()=>{Et(),Rt(Dt.key)},onBlur:()=>{It(),Wt(Dt.key)},children:Dt.mark?/* @__PURE__ */Ae(je,{children:[
|
|
382
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-name",children:Dt.mark.label}),
|
|
383
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-date",children:Dt.mark.dateText}),Dt.mark.preview?/* @__PURE__ */De("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:Dt.mark.preview}):Dt.mark.detail&&/* @__PURE__ */De("span",{className:"rosh-tl-detail",children:Dt.mark.detail}),(Dt.mark.onOpen??Dt.mark.onClick)&&/* @__PURE__ */De("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})]}):
|
|
384
|
-
/* @__PURE__ */Ae("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
|
|
385
|
-
/* @__PURE__ */Ae("p",{className:"rosh-tl-popover-head",children:["×",Dt.members.length]}),
|
|
386
|
-
/* @__PURE__ */De("ol",{children:Dt.members.map(e=>/* @__PURE__ */Ae("li",{children:[
|
|
387
|
-
/* @__PURE__ */Ae("p",{className:"rosh-tl-foldrow",children:[
|
|
388
|
-
/* @__PURE__ */De("span",{children:e.label}),
|
|
389
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */De("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */De("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),u&&null!==ct&&
|
|
390
|
-
/* @__PURE__ */De(Ol,{thumb:u,value:ct,snap:st,axis:_e,geo:ce,startMs:e,endMs:t,trackPx:se,layerRef:P,glide:ht,onScrub:h?xt:void 0,nodes:dt,onProgress:bt})]})}),N&&qt(m?.end,!0)]}),l.length>0&&!N&&/* @__PURE__ */De(jl,{pending:l,reveal:lt})]})}function Hl({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const o=[...r?[/* @__PURE__ */De("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
|
|
391
|
-
return Ae("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
|
|
392
|
-
/* @__PURE__ */Ae("div",{className:"rosh-tl-head",children:[
|
|
393
|
-
/* @__PURE__ */Ae("div",{className:"rosh-tl-head-main",children:[e&&/* @__PURE__ */De("span",{className:"rosh-tl-ico text-gray-500","aria-hidden":"true",children:e}),
|
|
394
|
-
/* @__PURE__ */De("h4",{className:"rosh-tl-title text-gray-800",children:t}),o.length>0&&/* @__PURE__ */De("p",{className:"rosh-tl-meta text-gray-500",children:o.map((e,t)=>
|
|
395
|
-
/* @__PURE__ */Ae(Me,{children:[t>0&&/* @__PURE__ */De("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */De("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */De("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function _l({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=K(Date.now,null),h=[],m=[],p=G().timeline,g=Z();for(const e of n){const t=Ka(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=Ka(l??null);let b,x,y=!0;0===h.length?(x=f??u??0,b=x-30*_a,y=null!==f||null!==u):(b=h[0].ms,x=f??h[h.length-1].ms,x-b<_a&&(x=b+_a));const v=h.length>0?Math.max(0,Math.round((x-b)/_a)):0,w=a??(v>0?p.duration(v):void 0),k=[h.length>0?p.started(qa(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,n.length):void 0],N=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),M={};for(const e of h)e.phase&&(M[e.phase]=M[e.phase]||[]).push(e.ms);const $=Object.entries(M).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),C="rail"===o,L=y&&/* @__PURE__ */De("div",{className:"select-none",children:/* @__PURE__ */De(Wl,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:N,pending:m,phases:$,startMs:b,endMs:x,todayMs:u??void 0,edgeCaptions:s,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
|
|
396
|
-
return De("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */De(Hl,{icon:/* @__PURE__ */De(il,{}),heading:t??e,subject:r,meta:k,children:L})})}var Kl=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),ql=[{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 Ul(e){if(e.order_qty<=0)return 0;let t=0;for(const r of ql)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function Vl(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Ul(t),0)/t.length}function Yl(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:o,msPerDayOfPlayback:s=500,markers:c=[]}=e,[d,u]=ge(null),h=G().production;xe(()=>{o?u(new Date(o).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=ge(!1),g=fe(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};xe(()=>()=>f(),[]),xe(()=>{f()},[i]);const b=t.map(e=>Ka(e.date)).filter(e=>null!=e),x=K(Date.now,null)??Math.max(0,...b,...c.map(e=>Ka(e.date)??0),Ka(r??null)??0,Ka(n??null)??0),y=b.length?Math.min(...b):x,v=b.length?Math.max(...b):x,w=Ka(r??null)??y,k=Ka(n??null)??0,N=Kl.has((a||"").toLowerCase()),M=c.reduce((e,t)=>{const r=Ka(t.date);return null!=r&&r>e?r:e},0),$=(()=>{const e=[k,v,M,w+_a];return N||e.push(x),Math.max(...e)})(),C=Math.max(1,Math.round(($-w)/_a)),L=Ka(o??null)??v??w,D=Math.min(Math.max(d??L,w),$),A=t.find(e=>{const t=Ka(e.date);return null!=t&&t<=D})??null;let j=null;for(let e=t.length-1;e>=0;e--){const r=Ka(t[e].date);if(null!=r&&r>D){j=t[e];break}}const P=(()=>{if(A||!j||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${l}`,progress_number:h.start,date:r||new Date(w).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),S=A??P,z=A?Ka(A.date):P?w:null,F=j?Ka(j.date):null,B=!!(S&&j&&null!=z&&null!=F&&D>z&&D<F);let E,T;if(B&&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 S?.items??[])r[e.part_number]=e;const n={};for(const e of j?.items??[])n[e.part_number]=e;const a=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const l=r[e]??{},i=n[e]??{},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=Ka(S?.est_completion_date),i=Ka(j?.est_completion_date);let o;o=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):S?.est_completion_date||j?.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:""},T=S}else if(E=S??t[t.length-1]??null,E){const e=t.findIndex(e=>e.id===E.id);T=e>=0&&e<t.length-1?t[e+1]:null}else T=null;const I={};for(const e of T?.items??[])I[e.part_number]=e;const O=!(!i||E?.id===i),R=i?Math.min(Ka(o??null)??$,$):$,W=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:$,totalLeadDays:C,scrubMs:D,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),o&&u(new Date(o).getTime())},scrubbedAway:O,beforeAnchor:S,nextAfter:j,displayed:E,prevReport:T,prevByPN:I,isInterpolated:B,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*_a,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:Ka(n??null)}}function Zl({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=G().production,x=Z(),y=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),v=y.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:h(e),preview:e.preview??u?.(e),onOpen:s?()=>s(e.id):void 0})),w=new Map(y.map(({report:e,ms:t})=>[e.id,t])),k=y.map(({ms:e})=>e),N=c?n.map(e=>({...e,onOpen:c})):n;/* @__PURE__ */
|
|
397
|
-
return De("div",{className:"select-none",children:/* @__PURE__ */De(Wl,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:N,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),o(e)},playback:m,edgeCaptions:p,thumb:{valueMs:a,onChange:i,onDragStart:d,stops:k,ariaLabel:b.scrub,valueText:e=>{const t=(e=>y.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${qa(e,x)}`:qa(e,x)}},ariaLabel:b.label(qa(e,x),qa(t,x))})})}function Gl({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:x,setScrubMs:y,displayed:v,scrubbedAway:w,resetToCurrent:k,currentReportId:N,currentReportProgressNumber:M,estCompletionMs:$}=e,C=function(e,t,r){const[n,a]=ge(!1),l=fe(!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=>Ka(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),y,u),L=G().production,D=Z(),A=i??L.heading,j=e=>qa(e,D);if(0===h.length&&0===m.length)return null;const P=m.filter(e=>"shipment"===e.kind),S=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),B=v?Vl(v):0,E=h.find(e=>e.id===N),T=E?s(E):M,I=
|
|
398
|
-
/* @__PURE__ */Ae("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__ */De("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M2 1.5h2.3v7H2zM5.7 1.5H8v7H5.7z"})}):/* @__PURE__ */De("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M2 1.2 8.4 5 2 8.8z"})}),
|
|
399
|
-
/* @__PURE__ */De("span",{children:C.playing?L.pause:L.play})]}),O=w&&(c??T)?/* @__PURE__ */De("button",{type:"button",onClick:()=>{C.stop(),k()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(T))}):null,[R,W]=Q(L.showing),H=e=>/* @__PURE__ */De("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */Ae(je,{children:[e&&R,
|
|
400
|
-
/* @__PURE__ */De("b",{className:"font-medium",children:s(v)}),e&&W,
|
|
401
|
-
/* @__PURE__ */Ae("span",{className:"text-gray-500",children:[" · ",j(new Date(v.date).getTime())," · ",L.overall(Math.round(B))," · ",L.inStock(F)]})]}):/* @__PURE__ */De("span",{className:"text-gray-500",children:L.noReport})});if("rail"===d){const e=null!=$&&$>=f&&f>g,i=e?{key:"__estimate__",label:L.estimatedCompletion,dateText:j($)}:null;/* @__PURE__ */
|
|
402
|
-
return Ae("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
403
|
-
/* @__PURE__ */De(Zl,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel: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)=>y(t),onProgress:l,onStop:C.stop}}),
|
|
404
|
-
/* @__PURE__ */Ae("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[I,O,H(!1)]})]})}/* @__PURE__ */
|
|
405
|
-
return De("div",{className:"shrink-0",children:/* @__PURE__ */De(Hl,{icon:/* @__PURE__ */De(ol,{}),heading:A,subject:p,meta:[`${j(g)} → ${j(f)}`,L.leadTime(b)],actions:/* @__PURE__ */Ae(je,{children:[O,I]}),footer:/* @__PURE__ */Ae(je,{children:[H(!0),
|
|
406
|
-
/* @__PURE__ */Ae("div",{className:"rosh-tl-legend",children:[h.length>0&&/* @__PURE__ */Ae("span",{className:"border-gray-200 text-gray-500",children:[
|
|
407
|
-
/* @__PURE__ */De("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),P.length>0&&/* @__PURE__ */Ae("span",{className:"border-gray-200 text-gray-500",children:[
|
|
408
|
-
/* @__PURE__ */De("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */De(ll,{name:"truck"})}),L.shipment]}),S.length>0&&/* @__PURE__ */Ae("span",{className:"border-gray-200 text-gray-500",children:[
|
|
409
|
-
/* @__PURE__ */De("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */De(ll,{name:"flask"})}),L.inspection]}),z.length>0&&/* @__PURE__ */Ae("span",{className:"border-gray-200 text-gray-500",children:[
|
|
410
|
-
/* @__PURE__ */De("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */De(ll,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */De(Zl,{startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:o,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}})})})}var Xl=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function Jl({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:n,qtyField:a="instruction",showNewIndicator:l=!1,getInstructionQty:i=e=>e.quantity,getActualQty:o=e=>e.actual_qty,isFilled:s,isNew:c=e=>Boolean(e._isNew),className:d,style:u}){const h=G().containers,m=s?e.filter(s):e,p=e=>Xl(i(e)),g=e=>Xl(o(e)),f=m.some(e=>null!=o(e)&&g(e)>0),b=e=>f?p(e):"actual"===a?o(e)??i(e)??0:i(e)??0,x=m.reduce((e,t)=>e+Xl(b(t)),0),y=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+Xl(b(t)),0),w=m.reduce((e,t)=>e+p(t),0),k=m.reduce((e,t)=>e+g(t),0),N=e=>t?.(e)??0,M=r??(e=>N(e)*p(e)),$=n??(e=>N(e)*g(e)),C=m.reduce((e,t)=>e+M(t),0),L=m.reduce((e,t)=>e+$(t),0),D=f?Math.max(C,L):"actual"===a&&L||C,A=D<=34.65?"20ft":"40ft",j="20ft"===A?33:67,P=D>0?Math.max(1,Math.ceil(D/j)):0,S=P*j,z=D>0&&D>=.95*S&&D<=1.1*S;if(0===m.length)return null;const F=(e,t)=>j>0?Math.max(0,Math.min((e-t*j)/j*100,100)):0;/* @__PURE__ */
|
|
411
|
-
return Ae("div",{className:`mt-2 px-1 space-y-2 ${d??""}`.trim(),style:u,children:[
|
|
412
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
|
|
413
|
-
/* @__PURE__ */Ae("span",{children:[`${h.items(m.length)} · ${h.pieces(x)}`,f&&w!==k&&/* @__PURE__ */De("span",{className:"ml-1 text-gray-400",children:h.split(w,k)})]}),l&&y>0&&/* @__PURE__ */Ae("span",{className:"flex items-center gap-1 text-green-600",children:[
|
|
414
|
-
/* @__PURE__ */De("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(y,v)]})]}),D>0?/* @__PURE__ */Ae("div",{className:"space-y-1.5",children:[Array.from({length:P}).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__ */
|
|
415
|
-
return Ae("div",{className:"flex items-center gap-2",children:[
|
|
416
|
-
/* @__PURE__ */De("span",{className:"text-[10px] text-gray-400 w-8 shrink-0",children:A}),
|
|
417
|
-
/* @__PURE__ */Ae("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
|
|
418
|
-
/* @__PURE__ */De("div",{className:`absolute inset-y-0 left-0 ${s} transition-all`,style:{width:`${l}%`}}),a&&i>0&&/* @__PURE__ */De("div",{className:`absolute inset-y-0 left-0 ${c} transition-all`,style:{width:`${i}%`}})]}),
|
|
419
|
-
/* @__PURE__ */De("span",{className:"text-[10px] text-gray-500 w-16 text-right",children:a?h.fill(Math.min(L-t*j,j),j):h.fill(Math.min(C-t*j,j),j)})]},`bar-${t}`)}),
|
|
420
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between text-xs pt-0.5",children:[
|
|
421
|
-
/* @__PURE__ */Ae("span",{className:"text-gray-500 inline-flex items-center gap-1",children:[h.total,f?/* @__PURE__ */Ae(je,{children:[
|
|
422
|
-
/* @__PURE__ */Ae("span",{className:"inline-flex items-center gap-1 text-blue-700",children:[
|
|
423
|
-
/* @__PURE__ */De("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500"}),h.instructed(C)]}),
|
|
424
|
-
/* @__PURE__ */De("span",{className:"text-gray-400",children:"/"}),
|
|
425
|
-
/* @__PURE__ */Ae("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
|
|
426
|
-
/* @__PURE__ */De("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),h.loaded(L)]})]}):/* @__PURE__ */De("b",{className:"text-gray-700",children:h.volume(D)})]}),
|
|
427
|
-
/* @__PURE__ */Ae("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",P," × ",A]})]})]}):/* @__PURE__ */De("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var Ql=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g;function ei(e){const t=/^[a-zA-Z][a-zA-Z0-9+.-]*:/.exec(e.trim());return null===t||/^(?:https?|mailto|tel):$/i.test(t[0])}function ti(e){const t=[];let r,n=0,a=0;for(Ql.lastIndex=0;null!==(r=Ql.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
|
|
428
|
-
/* @__PURE__ */Ae("span",{className:"text-gray-400",children:["[",r[1],"]"]},a++)):void 0!==r[3]?t.push(
|
|
429
|
-
/* @__PURE__ */De("a",{href:ei(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(
|
|
430
|
-
/* @__PURE__ */De("strong",{className:"font-semibold text-gray-900",children:r[5]},a++)):void 0!==r[6]?t.push(
|
|
431
|
-
/* @__PURE__ */De("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__ */De("em",{children:r[7]},a++)),n=Ql.lastIndex;return n<e.length&&t.push(e.slice(n)),t}function ri({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),r=G().markdown;/* @__PURE__ */
|
|
432
|
-
return Ae("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-dashed border-gray-300 bg-gray-50 px-3 py-2.5",children:[
|
|
433
|
-
/* @__PURE__ */De("svg",{className:"mt-0.5 h-4 w-4 shrink-0 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M3 6a1.5 1.5 0 0 1 1.5-1.5h1.1l.4-.9a1 1 0 0 1 .9-.6h6.2a1 1 0 0 1 .9.6l.4.9h1.1A1.5 1.5 0 0 1 18 6v8.5A1.5 1.5 0 0 1 16.5 16h-13A1.5 1.5 0 0 1 2 14.5V6Zm7.5 1.5a3.25 3.25 0 1 0 0 6.5 3.25 3.25 0 0 0 0-6.5Z"})}),
|
|
434
|
-
/* @__PURE__ */Ae("span",{className:"text-xs text-gray-500",children:[
|
|
435
|
-
/* @__PURE__ */De("span",{className:"font-medium text-gray-600",children:`${r.screenshot} — `}),t]})]})}function ni(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 ai=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function li(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__ */
|
|
436
|
-
return De(`h${e}`,{className:2===e?"mt-2 text-[13px] font-semibold uppercase tracking-wide text-gray-500":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:ti(a[2])},t)}if(1===r.length&&/^---+$/.test(n))/* @__PURE__ */
|
|
437
|
-
return De("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=ai(e[0]),n=e.slice(2).map(ai);/* @__PURE__ */
|
|
438
|
-
return De("div",{className:"my-1 overflow-x-auto rounded-lg border border-gray-200",children:/* @__PURE__ */Ae("table",{className:"w-full border-collapse text-sm",children:[
|
|
439
|
-
/* @__PURE__ */De("thead",{children:/* @__PURE__ */De("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */De("th",{className:"border-b border-gray-200 px-3 py-1.5 text-left font-semibold text-gray-700",children:ti(e)},t))})}),
|
|
440
|
-
/* @__PURE__ */De("tbody",{children:n.map((e,t)=>/* @__PURE__ */De("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */De("td",{className:"border-t border-gray-100 px-3 py-1.5 align-top text-gray-700",children:ti(e)},t))},t))})]})},t)}(r,t);if(/^>\s?/.test(n)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
|
|
441
|
-
return De("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:ti(e)},t)}const l=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(n);if(l&&1===r.length)/* @__PURE__ */
|
|
442
|
-
return De(ri,{alt:l[1]},t);if(/^[-*]\s+/.test(n)){const e=ni(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
|
|
443
|
-
return De("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */De("li",{children:ti(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(n);if(i){const e=ni(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
|
|
444
|
-
return De("ol",{start:Number(i[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */De("li",{className:"pl-1",children:ti(e)},t))},t)}/* @__PURE__ */
|
|
445
|
-
return De("p",{children:ti(r.join(" "))},t)}var ii=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/;function oi(e){const t=e.replace(/\r\n/g,"\n").split("\n"),r=[];let n=[];const a=()=>{for(const e of n.join("\n").split(/\n{2,}/)){const t=e.replace(/\s+$/,"");""!==t.trim()&&r.push({text:t})}n=[]};for(let e=0;e<t.length;e+=1){const l=ii.exec(t[e]);if(!(null!==l&&!("`"===l[2][0]&&l[3].includes("`")))){n.push(t[e]);continue}a();const[,i,o,s]=l,c=[];for(e+=1;e<t.length;e+=1){const r=ii.exec(t[e]);if(null!==r&&r[2][0]===o[0]&&r[2].length>=o.length&&""===r[3])break;c.push(i?t[e].replace(new RegExp(`^ {0,${i.length}}`),""):t[e])}r.push({fence:{lang:s.split(/[ \t]/)[0],code:c.join("\n")}})}return a(),r}function si({children:e,className:t}){/* @__PURE__ */
|
|
446
|
-
return De("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:oi(e??"").map((e,t)=>"fence"in e?function({lang:e,code:t},r){/* @__PURE__ */
|
|
447
|
-
return De("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */De("code",{children:t})},r)}(e.fence,t):li(e.text,t))})}var ci=({open:e})=>/* @__PURE__ */De("svg",{className:"h-3.5 w-3.5 shrink-0 text-gray-400 transition-transform "+(e?"rotate-90":""),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */De("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 0 1 .02-1.06L11.168 10 7.23 6.29a.75.75 0 1 1 1.04-1.08l4.5 4.25a.75.75 0 0 1 0 1.08l-4.5 4.25a.75.75 0 0 1-1.06-.02Z",clipRule:"evenodd"})});function di({docs:e,loading:t=!1,categoryOrder:r,canEdit:n=!1,onNew:a,onEdit:l,renderBody:i,emptyMessage:o}){const s=G(),[c,d]=ge(""),[u,h]=ge(null),[m,p]=ge({}),g=c.trim().toLowerCase(),f=be(()=>{const t=/* @__PURE__ */new Map;for(const r of e){let e=t.get(r.category);e||(e={key:r.category,label:r.category_label||r.category,docs:[]},t.set(r.category,e)),e.docs.push(r)}if(!r?.length)return[...t.values()];const n=new Map(r.map((e,t)=>[e,t]));return[...t.values()].sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0))},[e,r]),b=e=>!g||e.title.toLowerCase().includes(g)||e.body.toLowerCase().includes(g)||e.category_label.toLowerCase().includes(g),x=be(()=>f.map(e=>({...e,docs:e.docs.filter(b)})).filter(e=>e.docs.length>0),[f,g]),y=be(()=>x.flatMap(e=>e.docs),[x]),v=(u?y.find(e=>e.slug===u):void 0)??y[0]??null,w=e=>!!g||(m[e]??e===v?.category);/* @__PURE__ */
|
|
448
|
-
return Ae("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
449
|
-
/* @__PURE__ */Ae("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
450
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
451
|
-
/* @__PURE__ */De("h2",{className:"text-sm font-semibold text-gray-900",children:s.help.title}),n&&a&&/* @__PURE__ */De("button",{type:"button",onClick:a,className:"text-xs text-blue-600 hover:underline",children:s.help.newArticle})]}),
|
|
452
|
-
/* @__PURE__ */De("div",{className:"px-2.5 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */Ae("div",{className:"relative",children:[
|
|
453
|
-
/* @__PURE__ */De("svg",{className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */De("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 1 0 3.36 9.85l3.14 3.15a.75.75 0 1 0 1.06-1.06l-3.15-3.14A5.5 5.5 0 0 0 9 3.5ZM5 9a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z",clipRule:"evenodd"})}),
|
|
454
|
-
/* @__PURE__ */De("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:s.help.searchPlaceholder,className:"w-full rounded-md border border-gray-300 bg-white py-1.5 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
|
|
455
|
-
/* @__PURE__ */De("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */De("p",{className:"px-3 py-6 text-center text-xs text-gray-400",children:s.help.loading}):0===x.length?/* @__PURE__ */De("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:g?s.help.noResults:o??s.help.empty}):x.map(e=>{const t=w(e.key);/* @__PURE__ */
|
|
456
|
-
return Ae("div",{className:"py-0.5",children:[
|
|
457
|
-
/* @__PURE__ */Ae("button",{type:"button",onClick:()=>{return t=e.key,p(e=>({...e,[t]:!w(t)}));var t},className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-left text-[10px] font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
|
|
458
|
-
/* @__PURE__ */De(ci,{open:t}),
|
|
459
|
-
/* @__PURE__ */De("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=v?.slug===e.slug;/* @__PURE__ */
|
|
460
|
-
return Ae("button",{type:"button",onClick:()=>h(e.slug),className:"w-full text-left pl-8 pr-3 py-1.5 text-sm flex items-center gap-1.5 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
|
|
461
|
-
/* @__PURE__ */De("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */De("span",{className:"ml-auto shrink-0 text-[10px] text-amber-600",children:s.help.draft})]},e.slug)})]},e.key)})})]}),
|
|
462
|
-
/* @__PURE__ */De("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:v?/* @__PURE__ */Ae(je,{children:[
|
|
463
|
-
/* @__PURE__ */Ae("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
464
|
-
/* @__PURE__ */Ae("div",{className:"min-w-0",children:[
|
|
465
|
-
/* @__PURE__ */De("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:v.title}),
|
|
466
|
-
/* @__PURE__ */Ae("p",{className:"text-xs text-gray-500 mt-0.5",children:[v.category_label,!1===v.is_published&&/* @__PURE__ */Ae("span",{className:"ml-2 text-amber-600",children:["· ",s.help.draft]})]})]}),n&&l&&/* @__PURE__ */De("button",{type:"button",onClick:()=>l(v),className:"shrink-0 text-sm text-blue-600 hover:underline",children:s.help.edit})]}),
|
|
467
|
-
/* @__PURE__ */De("div",{className:"flex-1 overflow-auto px-5 py-4",children:i?i(v):v.body?/* @__PURE__ */De(si,{children:v.body}):/* @__PURE__ */De("p",{className:"text-sm text-gray-500 italic",children:s.help.noBody})})]}):/* @__PURE__ */De("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:/* @__PURE__ */De("p",{className:"text-sm text-gray-500",children:t?s.help.loading:s.help.pickArticle})})})]})}var ui={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 hi({children:e,onClick:t,variant:r="primary",hotkey:n,disabled:a=!1,type:l="button",title:o,className:s=""}){const c=i(n??"");/* @__PURE__ */
|
|
468
|
-
return Ae("button",{type:l,onClick:t,disabled:a,title:o,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 ${ui[r]} ${s}`,children:[e,n&&/* @__PURE__ */De("kbd",{className:"kbd-submit rounded border px-1.5 py-0.5 text-[10px] font-medium",children:c})]})}function mi(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-1.5 h-5 rounded-full text-[11px] font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function pi({children:e,count:t}){return null==t?/* @__PURE__ */De("p",{className:"px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */Ae("p",{className:"flex items-center justify-between gap-2 px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:[
|
|
469
|
-
/* @__PURE__ */De("span",{className:"min-w-0 truncate",children:e}),
|
|
470
|
-
/* @__PURE__ */De("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function gi(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 py-1.5 pl-2.5 pr-2.5 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function fi({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:o=0}){const s=Ba(i,"SidebarNavItem"),c=G().severity,d=s?(h=c,(u=s).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */Ae(je,{children:[null!=a&&/* @__PURE__ */De("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4 "+(r?"text-blue-600":"text-gray-400"),children:a}),s&&
|
|
471
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true",title:d,className:`shrink-0 h-1.5 w-1.5 rounded-full ${s.fill}`}),
|
|
472
|
-
/* @__PURE__ */De("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),s&&/* @__PURE__ */De("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */De("span",{className:mi(r),children:t}),null!=l&&/* @__PURE__ */De("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
|
|
473
|
-
return De("button",1===o?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */De("span",{className:gi(r),children:m})}:{type:"button",onClick:n,className:"flex w-full items-center justify-between gap-2 rounded-lg px-2.5 py-1.5 text-sm text-left "+(r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:m})}function bi({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=me(),[i,o]=q(()=>{if(a){let e=null;try{e=window.localStorage.getItem(a)}catch{}if("1"===e||"0"===e)return"1"===e}return n},n),s=!i&&ve.toArray(r).some(e=>we(e)&&!0===e.props.active);/* @__PURE__ */
|
|
474
|
-
return Ae("div",{children:[
|
|
475
|
-
/* @__PURE__ */Ae("button",{type:"button",onClick:()=>{const e=!i;if(o(e),a)try{window.localStorage.setItem(a,e?"1":"0")}catch{}},"aria-expanded":i,"aria-controls":l,className:"flex w-full items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm font-medium text-left "+(s?"bg-blue-50 text-blue-700":"text-gray-800 hover:bg-gray-100"),children:[
|
|
476
|
-
/* @__PURE__ */De("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
477
|
-
/* @__PURE__ */De("svg",{className:"mr-auto ml-0.5 size-3 shrink-0 text-gray-400 transition-transform "+(i?"":"-rotate-90"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.6,"aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})}),null!=t&&t>0&&/* @__PURE__ */De("span",{className:mi(s),children:t})]}),
|
|
478
|
-
/* @__PURE__ */De("div",{id:l,role:"group","aria-label":e,hidden:!i,children:r})]})}function xi({items:e,activeKey:t,onSelect:r,brand:n,actions:a,className:l}){/* @__PURE__ */
|
|
479
|
-
return Ae("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[n&&/* @__PURE__ */De("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:n}),
|
|
480
|
-
/* @__PURE__ */De("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const n=e.key===t;/* @__PURE__ */
|
|
481
|
-
return Ae("button",{type:"button",disabled:e.disabled,"aria-current":n?"page":void 0,onClick:()=>!e.disabled&&r?.(e.key),className:"relative inline-flex items-center gap-1.5 px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40 "+(n?"text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.icon&&/* @__PURE__ */De("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
482
|
-
/* @__PURE__ */De("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */De("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-1.5 text-[11px] font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */De("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */De("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var yi=/(^|[\s:])!?z-/,vi=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function wi({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]=ge(!1),[g,f]=ge(-1),x=fe(null),w=fe(null),k=fe(null),N=fe({text:"",at:0}),M=me(),$=me(),C=u??$,L=pe(e=>{p(!1),e&&w.current?.focus()},[]),D=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(vi(t[l]))return l}return-1},j=()=>k.current?.closest("[data-popup-menu-tree]")??null;xe(()=>{if(!m)return;const e=e=>{const t=e.target;x.current?.contains(t)||j()?.contains(t)||L(!1)};document.addEventListener("pointerdown",e,!0);const t=O(()=>L(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,L]);const P=pe(()=>{const e=j(),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=y({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]);W(()=>{m&&P()}),xe(()=>{if(m)return v(()=>w.current,P)},[m,P]),xe(()=>{if(!m)return;const e=k.current,r=vi(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),xe(()=>{if(m)return I(e=>"Escape"===e.key&&(L(!0),!0),()=>k.current)},[m,L]);const E=e=>{f(e),p(!0)},T=e=>{e.disabled||(L(!0),e.onSelect())},H=c??"a",_=(e,t)=>({"data-dropdown-index":e,tabIndex:e===g?0:-1,onMouseEnter:()=>{t.disabled||f(e)}}),K=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
|
|
483
|
-
return De("div",{role:"separator",children:/* @__PURE__ */De(S,{})},e.key);if("label"===e.type)/* @__PURE__ */
|
|
484
|
-
return De("div",{id:`${M}-label-${t}`,children:/* @__PURE__ */De(z,{children:e.label})},e.key);if("checkbox"===e.type){const r=F(!1,e.disabled,"");/* @__PURE__ */
|
|
485
|
-
return Ae("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),..._(t,e),children:[
|
|
486
|
-
/* @__PURE__ */De(B,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=F(!1,e.disabled,"");/* @__PURE__ */
|
|
487
|
-
return Ae("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>T(e),..._(t,e),children:[
|
|
488
|
-
/* @__PURE__ */De(B,{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=F(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */Ae("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,..._(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */Ae(H,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>L(!0),..._(t,e),children:[e.icon,e.label]},e.key)}const r=F(e.danger,e.disabled,"");/* @__PURE__ */
|
|
489
|
-
return Ae("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>T(e),..._(t,e),children:[e.icon,e.label]},e.key)},q={...yi.test(o)?{}:{zIndex:R.popup},minWidth:s};/* @__PURE__ */
|
|
490
|
-
return Ae("div",{ref:x,className:`relative inline-flex ${l}`.trim(),children:[
|
|
491
|
-
/* @__PURE__ */De("button",{ref:w,id:C,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?M:void 0,"aria-label":a,"aria-describedby":h,disabled:d,onClick:()=>m?L(!1):E(D(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),E(D(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),E(D(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&&
|
|
492
|
-
/* @__PURE__ */De(A,{portal:!0,className:o,style:q,children:/* @__PURE__ */De("div",{ref:k,id:M,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(D(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f(D(g-1,-1));else if("Home"===e.key)e.preventDefault(),f(D(0,1));else if("End"===e.key)e.preventDefault(),f(D(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),L(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),n=e.key.toLowerCase(),a=r-N.current.at<500?N.current.text+n:n;N.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?g+1:Math.max(g,0),s=k.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(vi(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(K(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(K(t[r],r)),r+=1;const o="label"===t[l-1]?.type?`${M}-label-${l-1}`:void 0;e.push(/* @__PURE__ */De("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()})})]})}function ki(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function Ni({at:e,onClose:t,children:r,owner:n,"aria-label":a,minWidth:l=180,className:i="",autoFocus:o=!0}){const s=fe(null),[c,d]=ge(null),u=fe(t);u.current=t,W(()=>{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=fe(null),m=fe(!1);xe(()=>(h.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!s.current?.contains(e)||h.current?.focus?.({preventScroll:!0})}),[]),xe(()=>{c&&!m.current&&o&&(m.current=!0,ki(s.current)[0]?.focus({preventScroll:!0}))},[c,o]),xe(()=>{if(o)return;const e=e=>{if(s.current?.contains(document.activeElement))return;const t=ki(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]),xe(()=>I(e=>"Escape"===e.key&&(u.current(),!0),()=>s.current),[]),xe(()=>{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=pe(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void u.current();const t=ki(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__ */
|
|
493
|
-
return De(A,{portal:!0,minWidth:l,style:g,onClose:t,className:i,children:/* @__PURE__ */De(j.Provider,{value:!0,children:/* @__PURE__ */De("div",{ref:s,role:"menu","aria-label":a,"data-context-menu":"",onKeyDown:p,children:r})})})}function Mi(){const[e,t]=ge(null),r=pe(()=>t(null),[]),n=pe((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=pe(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 $i="Alt+ArrowUp Alt+ArrowDown";function Ci(e){return!e.altKey||e.ctrlKey||e.metaKey?null:"ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":null}var Li=/* @__PURE__ */Ae("svg",{"aria-hidden":"true",viewBox:"0 0 8 14",fill:"currentColor",className:"h-3.5 w-2",children:[
|
|
494
|
-
/* @__PURE__ */De("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
495
|
-
/* @__PURE__ */De("circle",{cx:"6",cy:"3",r:"1.1"}),
|
|
496
|
-
/* @__PURE__ */De("circle",{cx:"2",cy:"7",r:"1.1"}),
|
|
497
|
-
/* @__PURE__ */De("circle",{cx:"6",cy:"7",r:"1.1"}),
|
|
498
|
-
/* @__PURE__ */De("circle",{cx:"2",cy:"11",r:"1.1"}),
|
|
499
|
-
/* @__PURE__ */De("circle",{cx:"6",cy:"11",r:"1.1"})]});function Di({hint:e,dragging:t,revealClassName:r,marker:n}){const a=G().tree;/* @__PURE__ */
|
|
500
|
-
return De(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__ */De("span",{"aria-hidden":"true",[`data-${n}-grip`]:"",className:"flex h-4 w-2 items-center justify-center text-gray-400",children:Li})})}function Ai({id:e}){/* @__PURE__ */
|
|
501
|
-
return De("span",{id:e,hidden:!0,children:G().tree.moveHint})}var ji='[role="treeitem"]';function Pi(e){return[...e.querySelectorAll(ji)].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 Si({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=fe(null);W(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(ji)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??Pi(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=pe(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(ji);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const n=Pi(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(ji))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__ */
|
|
502
|
-
return De("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 zi({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
503
|
-
return De("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 Fi({children:e}){/* @__PURE__ */
|
|
504
|
-
return De("div",{role:"presentation",className:"px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e})}var Bi={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function Ei({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:x,rowProps:y,className:v=""}){const w=void 0!==l,k=me(),N=[y?.["aria-describedby"],x?k:void 0].filter(Boolean).join(" ")||void 0,M=a?"bg-blue-50 text-blue-700":"into"===p?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
|
|
505
|
-
return Ae("div",{...y,role:"treeitem","aria-level":t,"aria-selected":a,"aria-expanded":w?l:void 0,tabIndex:a?0:-1,"aria-keyshortcuts":y?.["aria-keyshortcuts"]??(x?$i:void 0),"aria-describedby":N,"data-drop":p,"data-draggable":f||void 0,onKeyDown:e=>{if(y?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=Ci(e);t&&x?(e.preventDefault(),x(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=>{y?.onClick?.(e),e.defaultPrevented||o?.()},className:["group/treerow relative flex min-h-8 select-none items-center gap-1.5 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)]",M,"into"===p?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",g?"opacity-40":"",v].filter(Boolean).join(" "),children:["before"===p&&/* @__PURE__ */De("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__ */De("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&&
|
|
506
|
-
/* @__PURE__ */De(Di,{marker:"tree",hint:b,dragging:g,revealClassName:"group-hover/treerow:opacity-100 group-focus-visible/treerow:opacity-100"}),
|
|
507
|
-
/* @__PURE__ */De("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:($=!!l,/* @__PURE__ */De("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+($?"rotate-90":""),children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}))}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=r&&/* @__PURE__ */De("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}),
|
|
508
|
-
/* @__PURE__ */Ae("span",{className:"relative flex min-w-0 flex-1 items-center gap-1.5",children:[m??/* @__PURE__ */Ae("span",{className:`min-w-0 truncate ${a?"font-semibold":"font-medium"} ${s?"text-gray-400 line-through":""}`,children:[e,null!=n&&/* @__PURE__ */De("span",{className:"ml-2 font-normal text-gray-500",children:n})]}),null!=c&&!1!==c&&/* @__PURE__ */De("span",{className:"shrink-0 rounded bg-gray-100 px-1 py-0.5 text-[10px] font-medium tabular-nums text-gray-500",children:c}),null!=d&&!h&&/* @__PURE__ */De("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&&
|
|
509
|
-
/* @__PURE__ */Ae("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:Bi,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:[
|
|
510
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
511
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
512
|
-
/* @__PURE__ */De("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:d})]}),x&&/* @__PURE__ */De(Ai,{id:k})]});var $}function Ti({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=G().tree,l=r?a.dropHere:t??a.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
|
|
513
|
-
return De("div",{...n,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */Ae("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
|
|
514
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */De("span",{className:i,children:l})})}function Ii({onInsert:e,label:t,drop:r=!1,seamProps:n}){const a=G().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__ */
|
|
515
|
-
return Ae("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:[
|
|
516
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
517
|
-
/* @__PURE__ */De("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__ */De(f,{content:l,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */De("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__ */De("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,className:"h-3 w-3",children:/* @__PURE__ */De("path",{strokeLinecap:"round",d:"M12 5v14M5 12h14"})})})})]})}var Oi=ye("compact");function Ri({"aria-label":e,"aria-labelledby":t,children:r,spacing:n="compact",className:a="",rootProps:l}){/* @__PURE__ */
|
|
518
|
-
return De(Oi.Provider,{value:n,children:/* @__PURE__ */De("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 Wi({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=Ne(Oi),p=fe(null),g=me(),f=[d?.["aria-describedby"],c?g:void 0].filter(Boolean).join(" ")||void 0,b=d?.tabIndex;W(()=>{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__ */
|
|
519
|
-
return Ae("div",{role:"listitem","data-list-item":"","data-drop":s,className:"relative flex min-w-0 flex-col",children:[s&&/* @__PURE__ */De("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]}`}),
|
|
520
|
-
/* @__PURE__ */Ae("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?$i:void 0),"aria-describedby":f,onKeyDown:e=>{if(d?.onKeyDown?.(e),e.defaultPrevented||!c)return;const t=Ci(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__ */De(Di,{marker:"list",hint:i,dragging:o,revealClassName:"group-hover/listrow:opacity-100 group-focus-within/listrow:opacity-100"}),
|
|
521
|
-
/* @__PURE__ */De("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__ */De("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:t}),c&&/* @__PURE__ */De(Ai,{id:g})]}),null!=r&&!1!==r&&/* @__PURE__ */De("div",{"data-list-below":"",children:r})]})}var Hi=ye({labels:"none",shown:"none"}),_i="button[data-icon-rail-button]:not([disabled])";function Ki(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 qi({"aria-label":e,orientation:t="vertical",children:r,className:n="",labels:a="none",labelsFit:l=!1,onLabelsShown:i}){const o=fe(null),s="none"!==a&&l,[c,d]=ge(null),u="none"===a?"none":s?c??"none":"all",h=fe(()=>{});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+6+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,...Ki(e,t,r.length)}))},W(()=>{h.current()}),xe(()=>{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=fe(null),p=fe(i);p.current=i,xe(()=>{s&&null!==c&&m.current!==c&&(m.current=c,p.current?.(c))},[s,c]),W(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(_i)];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__ */
|
|
522
|
-
return De("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(_i)],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__ */De(Hi.Provider,{value:{labels:a,shown:u},children:r})})}function Ui({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}=Ne(Hi),u=void 0===l||!1===l||0===l?t:/* @__PURE__ */De(Gn,{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__ */De("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__ */Ae(je,{children:[
|
|
523
|
-
/* @__PURE__ */De("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:u}),
|
|
524
|
-
/* @__PURE__ */De("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",m?"beside"===c?"ml-1.5":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):u});/* @__PURE__ */
|
|
525
|
-
return De(f,{content:e,side:i,children:p})}var Vi=6e4;function Yi({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=ge(null);return xe(()=>{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 Zi({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=Yi({currentVersion:e,versionUrl:t,pollMs:r}),o=G();if(null===i)return null;const s=a??(()=>window.location.reload());/* @__PURE__ */
|
|
526
|
-
return De("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-[9999] w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */Ae(sa,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */De(g,{type:"button",variant:"primary",size:"md",onClick:s,children:o.update.refreshNow}),children:[
|
|
527
|
-
/* @__PURE__ */De("span",{className:"font-medium",children:n??o.update.available}),
|
|
528
|
-
/* @__PURE__ */Ae("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var Gi={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Xi={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function Ji({onClose:e}){const t=G().dialog;/* @__PURE__ */
|
|
529
|
-
return De("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */De("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M6 6l8 8M14 6l-8 8"})})})}function Qi({open:e,onClose:t,side:r="right",size:n="md",title:a,description:l,footer:i,children:o,blocking:s=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=fe(null),g=me(),f=me(),b=me();if(E(e),C(p,e,c),L(e),xe(()=>{if(e)return I(()=>(s||t(),!0),()=>p.current)},[e,s,t]),!e)return null;const x="bottom"===r,y=x?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
|
|
530
|
-
return Ae("div",{className:"fixed inset-0",style:{zIndex:R.overlay},role:"presentation",children:[
|
|
531
|
-
/* @__PURE__ */De("div",{className:"fixed inset-0 bg-black/30",onClick:s?void 0:t,"aria-hidden":"true"}),
|
|
532
|
-
/* @__PURE__ */Ae("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":a?b:u,"aria-label":a||u?void 0:d,"aria-describedby":h??(l?f:o?g:void 0),style:y,className:["fixed flex flex-col bg-white shadow-xl",x?"":`w-full max-w-full ${Gi[n]}`,Xi[r],x?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */Ae("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
533
|
-
/* @__PURE__ */Ae("div",{className:"min-w-0",children:[
|
|
534
|
-
/* @__PURE__ */De("h2",{id:b,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */De("p",{id:f,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!s&&/* @__PURE__ */De(Ji,{onClose:t})]}):!s&&/* @__PURE__ */De("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */De(Ji,{onClose:t})}),
|
|
535
|
-
/* @__PURE__ */Ae("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */De("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(s?"":"pr-8")).trim(),children:l}),o]}),i&&/* @__PURE__ */De("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function eo({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:o,isLoading:s=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=G().kanban,f=Z(),b=c??g.loading,x=h??g.dropHere,y=p??g.addItem,[v,w]=ge(null),[k,N]=ge(null),M=be(()=>{const n={};for(const e of t)n[e.value]=[];for(const t of e)(n[r(t)]??=[]).push(t);if(o)for(const e of Object.keys(n))n[e].sort(o);return n},[e,t,r,o]),$=()=>{w(null),N(null)},C=fe(null),L=fe(/* @__PURE__ */new Map);W(()=>{if(null!==v)return;const e=C.current;if(!e)return;const t=/* @__PURE__ */new Map,r=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const n=e.dataset.kanbanCard,a=e.getBoundingClientRect();t.set(n,a);const l=L.current.get(n);if(l){const t=l.left-a.left,n=l.top-a.top;(t||n)&&r.push([e,t,n])}}),L.current=t,r.length){for(const[e,t,n]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${n}px)`;requestAnimationFrame(()=>{for(const[e]of r)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[M,v]);return s?/* @__PURE__ */De("div",{className:"text-sm text-gray-500 p-4",children:b}):0!==e.length||u?/* @__PURE__ */De("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */De("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=M[e.value]??[],r=null!==k&&k.col===e.value,o=null!==v?t.findIndex(e=>n(e)===v):-1,s=r&&(-1===o||k.index!==o&&k.index!==o+1)?k.index:-1;/* @__PURE__ */
|
|
536
|
-
return Ae("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(r?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:t=>{t.preventDefault(),(e=>{if(v&&k&&k.col===e){const t=(M[e]??[]).findIndex(e=>n(e)===v),r=-1!==t;if(!r||k.index!==t&&k.index!==t+1){const n=r&&k.index>t?k.index-1:k.index;a(v,e,n)}}$()})(e.value)},children:[
|
|
537
|
-
/* @__PURE__ */Ae("div",{className:`flex items-center justify-between px-3 py-2 rounded-t-xl text-sm font-medium ${e.accent??"text-gray-700 bg-gray-100"}`,children:[
|
|
538
|
-
/* @__PURE__ */Ae("span",{className:"flex items-center gap-2",children:[
|
|
539
|
-
/* @__PURE__ */De("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
|
|
540
|
-
/* @__PURE__ */De("span",{className:"text-xs opacity-70",children:ee(t.length,f)})]}),
|
|
541
|
-
/* @__PURE__ */Ae("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>N(r=>r&&r.col===e.value&&r.index===t.length?r:{col:e.value,index:t.length}),children:[t.map((r,a)=>{const o=n(r),c=o===v;/* @__PURE__ */
|
|
542
|
-
return Ae(Me,{children:[s===a&&/* @__PURE__ */De("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
|
|
543
|
-
/* @__PURE__ */De("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;N(t=>t&&t.col===e.value&&t.index===i?t:{col:e.value,index:i})},onDragEnd:$,onClick:i?()=>i(r):void 0,style:null===v?void 0:{opacity:c?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(i?"cursor-pointer":""),children:l(r)})]},o)}),t.length>0&&s===t.length&&/* @__PURE__ */De("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===t.length&&/* @__PURE__ */De("div",{className:"text-[11px] text-center rounded-lg transition-all duration-150 "+(r?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:x})]}),m&&/* @__PURE__ */De("div",{className:"p-2 pt-0",children:/* @__PURE__ */Ae("button",{type:"button",onClick:()=>m(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 py-1.5 text-xs font-medium text-gray-500 opacity-0 transition hover:bg-gray-100 hover:text-gray-700 focus-visible:opacity-100 group-hover:opacity-100",children:[
|
|
544
|
-
/* @__PURE__ */De("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),y]})})]},e.value)})})}):/* @__PURE__ */De(je,{children:d??/* @__PURE__ */De("div",{className:"text-sm text-gray-500 p-4",children:g.empty})})}var to="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 ro({page:e,pageCount:t,onPageChange:r,siblingCount:n=1,showEdges:a=!1,className:l=""}){const i=G().pagination,o=Z();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__ */
|
|
545
|
-
return Ae("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[a&&/* @__PURE__ */De("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${to} text-gray-600 hover:bg-gray-100`,children:"«"}),
|
|
546
|
-
/* @__PURE__ */De("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${to} text-gray-600 hover:bg-gray-100`,children:"‹"}),s.map((t,r)=>"…"===t?/* @__PURE__ */De("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */De("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${to} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:ee(t,o)},t)),
|
|
547
|
-
/* @__PURE__ */De("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${to} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */De("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${to} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function no(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 ao=e=>Array.isArray(e.columns),lo=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",io="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",oo={sm:"px-2 py-1.5",md:"px-3 py-2"},so={left:"text-left",right:"text-right",center:"text-center"};function co({direction:e}){/* @__PURE__ */
|
|
548
|
-
return Ae("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
549
|
-
/* @__PURE__ */De("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */De("path",{d:"M4 0L8 5H0z"})}),
|
|
550
|
-
/* @__PURE__ */De("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */De("path",{d:"M4 5L0 0h8z"})})]})}function uo({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:x,virtualized:y,stackOnNarrow:v=!1,stackBelow:w,className:k=""}){const N=G(),M=f??N.table.empty,$=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!y,L=C?e:e.flatMap(e=>{if(!ao(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}:{},A=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[j,P]=ge(0),S=y?.overscan??6,z=y?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/y.rowHeight)-S);P(e=>e===t?e:t)}:void 0,F=y?Math.ceil(y.height/y.rowHeight)+2*S:t.length,B=y?Math.min(j,Math.max(0,t.length-F)):0,E=Math.min(t.length,B+F),T=y?B*y.rowHeight:0,I=y?(t.length-E)*y.rowHeight:0,O=fe(null),[R,H]=ge(0);W(()=>{if(!y)return;const e=O.current?.offsetHeight??0;H(t=>t===e?t:e)});const _=e=>e.sortField??e.key,K=e=>n&&n.field===_(e)?n.direction:null,q=L.flatMap(e=>ao(e)?e.columns:[e]),U=L.some(ao),V=/* @__PURE__ */new Map;if(C)for(const e of L)if(ao(e))for(const t of e.columns)V.set(t,A(e.title,e.label));const Y=e=>{const t=A(e.title,e.label),r=V.get(e);return t&&r?`${r} · ${t}`:t},Z=new Set(b?.selected??[]),X=b?t.map((e,t)=>$(e,t)):[],J=X.length>0&&X.every(e=>Z.has(e)),Q=X.some(e=>Z.has(e)),ee=b?36:0,te=q.length+(b?1:0),re=q.some(e=>"left"===e.fixed),ne=C&&!b&&q.some(e=>e.cardCorner),ae=g??"a",le=`${oo[c]} ${"sm"===c?"text-xs":"text-sm"}`,ie=(e,t,r,n=0)=>{const l=K(e),i=so[e.align??(e.numeric?"right":"left")],o="left"===e.fixed,s=!(!e.sortable||!a);/* @__PURE__ */
|
|
551
|
-
return De("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}:{},...y?{top:n}:{}},className:[le,i,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs",o?y?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":y?"sticky z-10 bg-gray-50":"",C&&s?"rosh-dt-sort":"",C?lo(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:s?/* @__PURE__ */Ae("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=_(e),r=K(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,
|
|
552
|
-
/* @__PURE__ */De(co,{direction:l})]}):e.title},e.key)};let oe=0;const se=q.map(e=>{if("left"!==e.fixed)return null;const t=oe;return oe+=e.width??0,t}),ce=/* @__PURE__ */Ae(je,{children:[
|
|
553
|
-
/* @__PURE__ */Ae("div",{onScroll:z,style:y?{maxHeight:y.height}:void 0,className:`relative overflow-x-auto ${y?"overflow-y-auto":""} ${s?"rounded-lg border border-gray-200":""}${C?" rosh-dt-scroll":""}`.trim(),children:[o&&
|
|
554
|
-
/* @__PURE__ */Ae("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
555
|
-
/* @__PURE__ */De("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-gray-200 border-t-blue-600"}),
|
|
556
|
-
/* @__PURE__ */De("span",{className:"sr-only",children:N.table.loading})]}),
|
|
557
|
-
/* @__PURE__ */Ae("table",{...D("table"),className:(C?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */De("caption",{className:"sr-only",children:i}),
|
|
558
|
-
/* @__PURE__ */Ae("thead",{...D("rowgroup"),className:C?"rosh-dt-head":void 0,children:[
|
|
559
|
-
/* @__PURE__ */Ae("tr",{ref:O,...D("row"),className:"border-b border-gray-200 bg-gray-50",children:[b&&/* @__PURE__ */De("th",{scope:"col",...D("columnheader"),rowSpan:U?2:void 0,style:{width:36,...y?{top:0}:{}},className:[le,re||y?"sticky z-20 bg-gray-50":"",re?"left-0":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */De(tt,{"aria-label":N.table.selectAll,checked:J,indeterminate:Q&&!J,onChange:()=>{if(!b)return;const e=new Set(X);b.onChange(J?b.selected.filter(t=>!e.has(t)):[...b.selected,...X.filter(e=>!Z.has(e))])}})}),L.map((e,t)=>ao(e)?/* @__PURE__ */De("th",{scope:"colgroup",...D("columnheader"),colSpan:e.columns.length,style:y?{top:0}:void 0,className:[le,"text-center","font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs","border-b border-gray-200",y?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:e.title},e.key??`group-${t}`):ie(e,q.indexOf(e),U?2:1))]}),U&&/* @__PURE__ */De("tr",{...D("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>ao(e)?e.columns:[]).map(e=>ie(e,q.indexOf(e),1,R))})]}),
|
|
560
|
-
/* @__PURE__ */De("tbody",{...D("rowgroup"),className:C?"rosh-dt-body":void 0,children:0!==t.length||o?/* @__PURE__ */Ae(je,{children:[T>0&&/* @__PURE__ */De("tr",{"aria-hidden":"true",children:/* @__PURE__ */De("td",{colSpan:te,style:{height:T,padding:0,border:0}})}),t.slice(B,E).map((e,t)=>{const r=B+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=[io,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */De(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */De("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=q.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(o&&!s){const e=q.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=q.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const g=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
561
|
-
return Ae("tr",{...no(n),...D("row"),style:y?{height:y.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:g(n?.onFocus),onBlur:g(n?.onBlur),"aria-current":a&&!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=$(e,r);/* @__PURE__ */
|
|
562
|
-
return De("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__ */De(tt,{"aria-label":N.table.selectRow,checked:Z.has(t),onChange:()=>(e=>{b&&b.onChange(Z.has(e)?b.selected.filter(t=>t!==e):[...b.selected,e])})(t)})})})(),q.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ne&&!!e.cardCorner,l=C&&!a&&"wide"!==e.only;/* @__PURE__ */
|
|
563
|
-
return De("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?lo(e):"",le,so[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?
|
|
564
|
-
/* @__PURE__ */De("span",{className:e.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:n}):n},e.key)})]},$(e,r))}),I>0&&/* @__PURE__ */De("tr",{"aria-hidden":"true",children:/* @__PURE__ */De("td",{colSpan:te,style:{height:I,padding:0,border:0}})})]}):/* @__PURE__ */De("tr",{...D("row"),className:C?"rosh-dt-empty":void 0,children:/* @__PURE__ */De("td",{...D("cell"),colSpan:te,className:`${le} py-10 text-center text-gray-500`,children:M})})})]}),x]}),l&&l.pageCount>1&&/* @__PURE__ */De("div",{className:C?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */De(ro,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
|
|
565
|
-
return De("div",C?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${k}`.trim(),children:/* @__PURE__ */De("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */De("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:ce})})}:{className:`rosh-dt-stack ${k}`.trim(),children:ce}:{className:k,children:ce})}function ho({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=G().list,s=n??r,c=r>=s,d=t>0?o.selectedNotShown(e,t):e>0?o.selected(e):"";/* @__PURE__ */
|
|
566
|
-
return Ae(je,{children:[i,d?`${d} — `:"",c?null!=n?o.allLoaded(s,a):o.count(s,a):o.loadedOf(r,s,a),l?` · ${o.loadingMore}`:""]})}function mo({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=G().list;/* @__PURE__ */
|
|
567
|
-
return Ae("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:[
|
|
568
|
-
/* @__PURE__ */De("svg",{className:"h-10 w-10 text-red-300 mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,"aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m0 3.75h.008M10.34 3.94l-8.4 14.55A1.5 1.5 0 003.24 21h17.52a1.5 1.5 0 001.3-2.51l-8.4-14.55a1.5 1.5 0 00-2.6 0z"})}),
|
|
569
|
-
/* @__PURE__ */De("h3",{className:"text-sm font-medium text-gray-900",children:e??a.loadError}),
|
|
570
|
-
/* @__PURE__ */De("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */De("div",{className:"mt-4",children:/* @__PURE__ */De(g,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function po({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__ */
|
|
571
|
-
return Ae("svg",{className:o,style:s,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[a&&/* @__PURE__ */De("path",{d:f,fill:a,stroke:"none"}),
|
|
572
|
-
/* @__PURE__ */De("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */De("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}function go({data:e,labels:t,height:r=120,color:n="currentColor",colors:a,max:l,gap:i=6,className:o,style:s}){const c=Z();if(0===e.length)return null;const d=l??(Math.max(...e,0)||1);/* @__PURE__ */
|
|
573
|
-
return Ae("div",{className:o,style:s,children:[
|
|
574
|
-
/* @__PURE__ */De("div",{className:"flex items-end",style:{height:r,gap:i},children:e.map((e,r)=>/* @__PURE__ */De("div",{className:"flex flex-1 flex-col justify-end",style:{height:"100%"},children:/* @__PURE__ */De("div",{className:"w-full rounded-t",style:{height:`${Math.max(0,e/d*100)}%`,minHeight:e>0?2:0,backgroundColor:a?.[r]??n},title:null!=t?.[r]?`${t[r]}: ${ee(e,c)}`:ee(e,c)})},r))}),t&&/* @__PURE__ */De("div",{className:"mt-1 flex",style:{gap:i},children:t.map((e,t)=>/* @__PURE__ */De("div",{className:"flex-1 truncate text-center text-[10px] text-gray-400",children:e},t))})]})}var fo=["var(--rosh-donut-1)","var(--rosh-donut-2)","var(--rosh-donut-3)","var(--rosh-donut-4)","var(--rosh-donut-5)","var(--rosh-donut-6)","var(--rosh-donut-7)","var(--rosh-donut-8)"];function bo({segments:e,size:t=120,thickness:r=16,centerLabel:n,className:a,style:l}){const i=e.reduce((e,t)=>e+Math.max(0,t.value),0)||1,o=(t-r)/2,s=t/2,c=2*Math.PI*o;let d=0;/* @__PURE__ */
|
|
575
|
-
return Ae("div",{className:`relative inline-flex items-center justify-center ${a??""}`.trim(),style:{width:t,height:t,...l},children:[
|
|
576
|
-
/* @__PURE__ */Ae("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-hidden":"true",style:{transform:"rotate(-90deg)"},children:[
|
|
577
|
-
/* @__PURE__ */De("circle",{cx:s,cy:s,r:o,fill:"none",stroke:"var(--rosh-donut-track)",strokeWidth:r}),e.map((e,t)=>{const n=Math.max(0,e.value)/i*c,a=/* @__PURE__ */De("circle",{cx:s,cy:s,r:o,fill:"none",stroke:e.color??fo[t%fo.length],strokeWidth:r,strokeDasharray:`${n} ${c-n}`,strokeDashoffset:-d},t);return d+=n,a})]}),null!=n&&/* @__PURE__ */De("div",{className:"absolute text-center text-sm font-semibold text-gray-900",children:n})]})}var xo=(e,t)=>Number.isInteger(e)?ee(e,t):te(e,1,t);function yo({series:e,labels:t,height:r=160,strokeWidth:n=2,showDots:a=!1,max:l,min:i,showScale:o=!1,showLegend:s=!1,className:c,style:d}){const u=Z(),h=e.filter(e=>e.data.length>0);if(0===h.length)return null;const m=h.flatMap(e=>e.data),p=l??Math.max(...m),g=i??Math.min(...m),f=p-g||1,b=e=>e.color??"currentColor";/* @__PURE__ */
|
|
578
|
-
return Ae("div",{className:c,style:d,children:[s&&h.some(e=>e.label)&&/* @__PURE__ */De("div",{className:"mb-1.5 flex flex-wrap items-center gap-x-3 gap-y-0.5",children:h.map((e,t)=>e.label&&/* @__PURE__ */Ae("span",{className:"flex items-center gap-1 text-xs text-gray-500",children:[
|
|
579
|
-
/* @__PURE__ */De("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:b(e)}}),e.label]},t))}),
|
|
580
|
-
/* @__PURE__ */Ae("div",{className:"flex",children:[o&&/* @__PURE__ */Ae("div",{className:"flex flex-col justify-between pr-1.5 text-right text-[10px] leading-none text-gray-400",style:{height:r},children:[
|
|
581
|
-
/* @__PURE__ */De("span",{children:xo(p,u)}),
|
|
582
|
-
/* @__PURE__ */De("span",{children:xo(g+f/2,u)}),
|
|
583
|
-
/* @__PURE__ */De("span",{children:xo(g,u)})]}),
|
|
584
|
-
/* @__PURE__ */Ae("svg",{className:"min-w-0 flex-1",width:"100%",height:r,viewBox:"0 0 100 100",preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[o&&[0,50,100].map(e=>/* @__PURE__ */De("line",{x1:0,y1:e,x2:100,y2:e,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1,vectorEffect:"non-scaling-stroke"},e)),h.map((e,r)=>{const l=function(e,t,r){return 1===e.length?[[0,100-(e[0]-t)/r*100],[100,100-(e[0]-t)/r*100]]:e.map((n,a)=>[100*a/(e.length-1),100-(n-t)/r*100])}(e.data,g,f),i=function(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")}(l);/* @__PURE__ */
|
|
585
|
-
return Ae("g",{children:[e.fill&&/* @__PURE__ */De("path",{d:`${i} L100,100 L0,100 Z`,fill:e.fill,stroke:"none"}),
|
|
586
|
-
/* @__PURE__ */De("path",{d:i,fill:"none",stroke:b(e),strokeWidth:n,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"}),a&&e.data.length>1&&l.map(([r,a],l)=>/* @__PURE__ */De("path",{d:`M${r.toFixed(2)},${a.toFixed(2)} h0.01`,stroke:b(e),strokeWidth:2.5*n,strokeLinecap:"round",vectorEffect:"non-scaling-stroke",children:/* @__PURE__ */De("title",{children:`${null!=t?.[l]?`${t[l]}: `:""}${e.label?`${e.label} `:""}${ee(e.data[l],u)}`})},l))]},r)})]})]}),t&&/* @__PURE__ */De("div",{className:"mt-1 flex justify-between "+(o?"pl-6":""),children:t.map((e,t)=>/* @__PURE__ */De("div",{className:"truncate text-[10px] text-gray-400",children:e},t))})]})}var vo={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},wo=[12,18,14,22,19,27,24,31,28,35,30,38],ko=["J","F","M","A","M","J","J","A","S","O","N","D"],No=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function Mo(){/* @__PURE__ */
|
|
587
|
-
return De(Na,{groups:vo,children:/* @__PURE__ */De("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Ae("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
588
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between gap-4",children:[
|
|
589
|
-
/* @__PURE__ */Ae("div",{children:[
|
|
590
|
-
/* @__PURE__ */De("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
|
|
591
|
-
/* @__PURE__ */De("p",{className:"text-sm text-gray-500",children:"Overview of your store this month"})]}),
|
|
592
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center gap-2",children:[
|
|
593
|
-
/* @__PURE__ */De(g,{variant:"secondary",size:"sm",children:"Export"}),
|
|
594
|
-
/* @__PURE__ */De(g,{size:"sm",children:"New report"})]})]}),
|
|
595
|
-
/* @__PURE__ */Ae("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
|
|
596
|
-
/* @__PURE__ */De(wn,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
|
|
597
|
-
/* @__PURE__ */De(wn,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
|
|
598
|
-
/* @__PURE__ */De(wn,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
|
|
599
|
-
/* @__PURE__ */De(wn,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
|
|
600
|
-
/* @__PURE__ */Ae("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[
|
|
601
|
-
/* @__PURE__ */De(vn,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */De("div",{className:"text-blue-600",children:/* @__PURE__ */De(go,{data:wo,labels:ko,height:160})})}),
|
|
602
|
-
/* @__PURE__ */De(vn,{header:"Traffic sources",children:/* @__PURE__ */Ae("div",{className:"flex items-center gap-4",children:[
|
|
603
|
-
/* @__PURE__ */De(bo,{size:120,segments:[{label:"Direct",value:45},{label:"Search",value:30},{label:"Social",value:15},{label:"Email",value:10}],centerLabel:/* @__PURE__ */De("span",{className:"text-gray-900",children:"100%"})}),
|
|
604
|
-
/* @__PURE__ */Ae("ul",{className:"space-y-1.5 text-sm text-gray-600",children:[
|
|
605
|
-
/* @__PURE__ */Ae("li",{className:"flex items-center gap-2",children:[
|
|
606
|
-
/* @__PURE__ */De($o,{c:fo[0]}),"Direct · 45%"]}),
|
|
607
|
-
/* @__PURE__ */Ae("li",{className:"flex items-center gap-2",children:[
|
|
608
|
-
/* @__PURE__ */De($o,{c:fo[1]}),"Search · 30%"]}),
|
|
609
|
-
/* @__PURE__ */Ae("li",{className:"flex items-center gap-2",children:[
|
|
610
|
-
/* @__PURE__ */De($o,{c:fo[2]}),"Social · 15%"]}),
|
|
611
|
-
/* @__PURE__ */Ae("li",{className:"flex items-center gap-2",children:[
|
|
612
|
-
/* @__PURE__ */De($o,{c:fo[3]}),"Email · 10%"]})]})]})})]}),
|
|
613
|
-
/* @__PURE__ */De(vn,{header:"Recent orders",padded:!1,children:/* @__PURE__ */Ae("table",{className:"w-full text-sm",children:[
|
|
614
|
-
/* @__PURE__ */De("thead",{children:/* @__PURE__ */Ae("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
|
|
615
|
-
/* @__PURE__ */De("th",{className:"px-4 py-2 font-medium",children:"Order"}),
|
|
616
|
-
/* @__PURE__ */De("th",{className:"px-4 py-2 font-medium",children:"Customer"}),
|
|
617
|
-
/* @__PURE__ */De("th",{className:"px-4 py-2 font-medium",children:"Total"}),
|
|
618
|
-
/* @__PURE__ */De("th",{className:"px-4 py-2 font-medium",children:"Status"})]})}),
|
|
619
|
-
/* @__PURE__ */De("tbody",{className:"divide-y divide-gray-100",children:No.map(e=>/* @__PURE__ */Ae("tr",{className:"text-gray-700",children:[
|
|
620
|
-
/* @__PURE__ */De("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:e.id}),
|
|
621
|
-
/* @__PURE__ */De("td",{className:"px-4 py-2",children:/* @__PURE__ */Ae("span",{className:"flex items-center gap-2",children:[
|
|
622
|
-
/* @__PURE__ */De(na,{size:"xs",name:e.customer}),e.customer]})}),
|
|
623
|
-
/* @__PURE__ */De("td",{className:"px-4 py-2",children:e.total}),
|
|
624
|
-
/* @__PURE__ */De("td",{className:"px-4 py-2",children:/* @__PURE__ */De($a,{status:e.status})})]},e.id))})]})}),
|
|
625
|
-
/* @__PURE__ */Ae("p",{className:"flex items-center gap-2 text-xs text-gray-400",children:[
|
|
626
|
-
/* @__PURE__ */De("span",{className:"text-emerald-600",children:/* @__PURE__ */De(po,{data:wo,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}function $o({c:e}){/* @__PURE__ */
|
|
627
|
-
return De("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:e}})}var Co={active:"success",invited:"queued",suspended:"danger",pending:"pending"},Lo=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function Do(){const[e,t]=ge(1),[r,n]=ge(""),[a,l]=ge("");/* @__PURE__ */
|
|
628
|
-
return De(Na,{groups:Co,children:/* @__PURE__ */De("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Ae("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
629
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between gap-4",children:[
|
|
630
|
-
/* @__PURE__ */De("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
|
|
631
|
-
/* @__PURE__ */De(g,{size:"sm",children:"Invite member"})]}),
|
|
632
|
-
/* @__PURE__ */Ae(vn,{padded:!1,children:[
|
|
633
|
-
/* @__PURE__ */Ae("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
|
|
634
|
-
/* @__PURE__ */De("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */De(Oe,{value:a,onChange:e=>l(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */De(Ao,{})})}),
|
|
635
|
-
/* @__PURE__ */De("div",{className:"w-40",children:/* @__PURE__ */De(Qe,{value:r,onChange:n,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
|
|
636
|
-
/* @__PURE__ */De(g,{variant:"secondary",size:"sm",children:"Filter"})]}),
|
|
637
|
-
/* @__PURE__ */Ae("table",{className:"w-full text-sm",children:[
|
|
638
|
-
/* @__PURE__ */De("thead",{children:/* @__PURE__ */Ae("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
|
|
639
|
-
/* @__PURE__ */De("th",{className:"px-4 py-2 font-medium",children:"Name"}),
|
|
640
|
-
/* @__PURE__ */De("th",{className:"px-4 py-2 font-medium",children:"Role"}),
|
|
641
|
-
/* @__PURE__ */De("th",{className:"px-4 py-2 font-medium",children:"Status"}),
|
|
642
|
-
/* @__PURE__ */De("th",{className:"px-4 py-2 font-medium text-right",children:"Actions"})]})}),
|
|
643
|
-
/* @__PURE__ */De("tbody",{className:"divide-y divide-gray-100",children:Lo.map(e=>/* @__PURE__ */Ae("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
|
|
644
|
-
/* @__PURE__ */Ae("td",{className:"px-4 py-2.5",children:[
|
|
645
|
-
/* @__PURE__ */De("div",{className:"font-medium text-gray-900",children:e.name}),
|
|
646
|
-
/* @__PURE__ */De("div",{className:"text-xs text-gray-400",children:e.email})]}),
|
|
647
|
-
/* @__PURE__ */De("td",{className:"px-4 py-2.5",children:e.role}),
|
|
648
|
-
/* @__PURE__ */De("td",{className:"px-4 py-2.5",children:/* @__PURE__ */De($a,{status:e.status})}),
|
|
649
|
-
/* @__PURE__ */De("td",{className:"px-4 py-2.5 text-right",children:/* @__PURE__ */De(g,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
|
|
650
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
|
|
651
|
-
/* @__PURE__ */De("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
|
|
652
|
-
/* @__PURE__ */De(ro,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function Ao(){/* @__PURE__ */
|
|
653
|
-
return Ae("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[
|
|
654
|
-
/* @__PURE__ */De("circle",{cx:"9",cy:"9",r:"6"}),
|
|
655
|
-
/* @__PURE__ */De("path",{d:"M14 14l3 3",strokeLinecap:"round"})]})}function jo(){const[e,t]=ge("pro"),[r,n]=ge(!0),[a,l]=ge("us");/* @__PURE__ */
|
|
656
|
-
return De("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Ae("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
|
|
657
|
-
/* @__PURE__ */Ae("div",{children:[
|
|
658
|
-
/* @__PURE__ */De("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
659
|
-
/* @__PURE__ */De("p",{className:"text-sm text-gray-500",children:"Update your profile and preferences."})]}),
|
|
660
|
-
/* @__PURE__ */De(vn,{header:"Profile",children:/* @__PURE__ */Ae("div",{className:"space-y-4",children:[
|
|
661
|
-
/* @__PURE__ */Ae("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
662
|
-
/* @__PURE__ */De(at,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */De(Oe,{id:"fn",defaultValue:"Alice"})}),
|
|
663
|
-
/* @__PURE__ */De(at,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */De(Oe,{id:"ln",defaultValue:"Nguyen"})})]}),
|
|
664
|
-
/* @__PURE__ */De(at,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */De(Oe,{id:"email",type:"email",defaultValue:"alice@acme.co"})}),
|
|
665
|
-
/* @__PURE__ */De(at,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */De(Re,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
|
|
666
|
-
/* @__PURE__ */De(vn,{header:"Preferences",children:/* @__PURE__ */Ae("div",{className:"space-y-4",children:[
|
|
667
|
-
/* @__PURE__ */Ae("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
668
|
-
/* @__PURE__ */De(at,{label:"Country",htmlFor:"country",children:/* @__PURE__ */De(Qe,{value:a,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
|
|
669
|
-
/* @__PURE__ */De(at,{label:"Plan",children:/* @__PURE__ */Ae("div",{className:"space-y-1.5 pt-1",children:[
|
|
670
|
-
/* @__PURE__ */De(nt,{name:"plan",checked:"free"===e,onChange:()=>t("free"),label:"Free"}),
|
|
671
|
-
/* @__PURE__ */De(nt,{name:"plan",checked:"pro"===e,onChange:()=>t("pro"),label:"Pro"}),
|
|
672
|
-
/* @__PURE__ */De(nt,{name:"plan",checked:"team"===e,onChange:()=>t("team"),label:"Team"})]})})]}),
|
|
673
|
-
/* @__PURE__ */De(tt,{checked:r,onChange:n,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
|
|
674
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-end gap-2",children:[
|
|
675
|
-
/* @__PURE__ */De(g,{variant:"secondary",children:"Cancel"}),
|
|
676
|
-
/* @__PURE__ */De(g,{type:"submit",children:"Save changes"})]})]})})}var Po=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function So(){const[e,t]=ge(!0),[r,n]=ge("us"),a=Po.reduce((e,t)=>e+t.qty*t.price,0),l=a+9;/* @__PURE__ */
|
|
677
|
-
return De("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Ae("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
678
|
-
/* @__PURE__ */De("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
679
|
-
/* @__PURE__ */Ae("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
680
|
-
/* @__PURE__ */Ae("form",{className:"space-y-5 lg:col-span-2",onSubmit:e=>e.preventDefault(),children:[
|
|
681
|
-
/* @__PURE__ */De(vn,{header:"Contact",children:/* @__PURE__ */De("div",{className:"space-y-4",children:/* @__PURE__ */De(at,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */De(Oe,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
|
|
682
|
-
/* @__PURE__ */De(vn,{header:"Shipping address",children:/* @__PURE__ */Ae("div",{className:"space-y-4",children:[
|
|
683
|
-
/* @__PURE__ */Ae("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
684
|
-
/* @__PURE__ */De(at,{label:"First name",required:!0,children:/* @__PURE__ */De(Oe,{placeholder:"Alice"})}),
|
|
685
|
-
/* @__PURE__ */De(at,{label:"Last name",required:!0,children:/* @__PURE__ */De(Oe,{placeholder:"Nguyen"})})]}),
|
|
686
|
-
/* @__PURE__ */De(at,{label:"Address",required:!0,children:/* @__PURE__ */De(Oe,{placeholder:"123 Market St"})}),
|
|
687
|
-
/* @__PURE__ */Ae("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[
|
|
688
|
-
/* @__PURE__ */De(at,{label:"City",children:/* @__PURE__ */De(Oe,{placeholder:"San Francisco"})}),
|
|
689
|
-
/* @__PURE__ */De(at,{label:"ZIP",children:/* @__PURE__ */De(Oe,{placeholder:"94103"})}),
|
|
690
|
-
/* @__PURE__ */De(at,{label:"Country",children:/* @__PURE__ */De(Qe,{value:r,onChange:n,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
|
|
691
|
-
/* @__PURE__ */De(tt,{checked:e,onChange:t,label:"Billing address same as shipping"})]})}),
|
|
692
|
-
/* @__PURE__ */De(vn,{header:"Payment",children:/* @__PURE__ */Ae("div",{className:"space-y-4",children:[
|
|
693
|
-
/* @__PURE__ */De(at,{label:"Card number",required:!0,children:/* @__PURE__ */De(Oe,{placeholder:"1234 5678 9012 3456"})}),
|
|
694
|
-
/* @__PURE__ */Ae("div",{className:"grid grid-cols-2 gap-4",children:[
|
|
695
|
-
/* @__PURE__ */De(at,{label:"Expiry",required:!0,children:/* @__PURE__ */De(Oe,{placeholder:"MM / YY"})}),
|
|
696
|
-
/* @__PURE__ */De(at,{label:"CVC",required:!0,children:/* @__PURE__ */De(Oe,{placeholder:"123"})})]})]})})]}),
|
|
697
|
-
/* @__PURE__ */Ae("div",{className:"space-y-4",children:[
|
|
698
|
-
/* @__PURE__ */Ae(vn,{header:"Order summary",children:[
|
|
699
|
-
/* @__PURE__ */De("ul",{className:"space-y-2 text-sm",children:Po.map(e=>/* @__PURE__ */Ae("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
|
|
700
|
-
/* @__PURE__ */Ae("span",{children:[e.name," ",
|
|
701
|
-
/* @__PURE__ */Ae("span",{className:"text-gray-400",children:["×",e.qty]})]}),
|
|
702
|
-
/* @__PURE__ */Ae("span",{children:["$",e.qty*e.price]})]},e.name))}),
|
|
703
|
-
/* @__PURE__ */Ae("div",{className:"mt-3 space-y-1.5 border-t border-gray-100 pt-3 text-sm text-gray-600",children:[
|
|
704
|
-
/* @__PURE__ */Ae("div",{className:"flex justify-between",children:[
|
|
705
|
-
/* @__PURE__ */De("span",{children:"Subtotal"}),
|
|
706
|
-
/* @__PURE__ */Ae("span",{children:["$",a]})]}),
|
|
707
|
-
/* @__PURE__ */Ae("div",{className:"flex justify-between",children:[
|
|
708
|
-
/* @__PURE__ */De("span",{children:"Shipping"}),
|
|
709
|
-
/* @__PURE__ */Ae("span",{children:["$",9]})]}),
|
|
710
|
-
/* @__PURE__ */Ae("div",{className:"flex justify-between text-base font-semibold text-gray-900",children:[
|
|
711
|
-
/* @__PURE__ */De("span",{children:"Total"}),
|
|
712
|
-
/* @__PURE__ */Ae("span",{children:["$",l]})]})]}),
|
|
713
|
-
/* @__PURE__ */Ae(g,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
|
|
714
|
-
/* @__PURE__ */De(sa,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var zo=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],Fo=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know…",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported…",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by…",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th…",time:"Yest"}];function Bo(){const[e,r]=ge(1),n=Fo.find(t=>t.id===e)??Fo[0];/* @__PURE__ */
|
|
715
|
-
return De("div",{className:"h-full",children:/* @__PURE__ */De(t,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */Ae("div",{className:"flex h-full flex-col p-2",children:[
|
|
716
|
-
/* @__PURE__ */De(g,{block:!0,className:"mb-2",children:"Compose"}),zo.map((e,t)=>/* @__PURE__ */Ae("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
717
|
-
/* @__PURE__ */De("span",{children:e.label}),null!=e.count&&/* @__PURE__ */De("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */Ae("div",{className:"flex h-full",children:[
|
|
718
|
-
/* @__PURE__ */De("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:Fo.map(t=>/* @__PURE__ */Ae("button",{onClick:()=>r(t.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(t.id===e?"bg-blue-50/50":""),children:[
|
|
719
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between gap-2",children:[
|
|
720
|
-
/* @__PURE__ */De("span",{className:"truncate text-sm "+(t.unread?"font-semibold text-gray-900":"text-gray-700"),children:t.from}),
|
|
721
|
-
/* @__PURE__ */De("span",{className:"shrink-0 text-[11px] text-gray-400",children:t.time})]}),
|
|
722
|
-
/* @__PURE__ */De("div",{className:"truncate text-sm "+(t.unread?"text-gray-800":"text-gray-600"),children:t.subject}),
|
|
723
|
-
/* @__PURE__ */De("div",{className:"truncate text-xs text-gray-400",children:t.preview})]},t.id))}),
|
|
724
|
-
/* @__PURE__ */Ae("div",{className:"flex min-w-0 flex-1 flex-col overflow-auto",children:[
|
|
725
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between gap-3 border-b border-gray-200 p-4",children:[
|
|
726
|
-
/* @__PURE__ */De("h2",{className:"truncate text-base font-semibold text-gray-900",children:n.subject}),
|
|
727
|
-
/* @__PURE__ */Ae("div",{className:"flex shrink-0 gap-1.5",children:[
|
|
728
|
-
/* @__PURE__ */De(g,{variant:"ghost",size:"sm",children:"Archive"}),
|
|
729
|
-
/* @__PURE__ */De(g,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
|
|
730
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center gap-3 border-b border-gray-100 p-4",children:[
|
|
731
|
-
/* @__PURE__ */De(na,{name:n.from}),
|
|
732
|
-
/* @__PURE__ */Ae("div",{className:"min-w-0",children:[
|
|
733
|
-
/* @__PURE__ */De("div",{className:"text-sm font-medium text-gray-900",children:n.from}),
|
|
734
|
-
/* @__PURE__ */Ae("div",{className:"text-xs text-gray-400",children:["to me · ",n.time]})]})]}),
|
|
735
|
-
/* @__PURE__ */Ae("div",{className:"space-y-3 p-4 text-sm leading-relaxed text-gray-700",children:[
|
|
736
|
-
/* @__PURE__ */De("p",{children:"Hi,"}),
|
|
737
|
-
/* @__PURE__ */Ae("p",{children:[n.preview," The full details are attached — happy to walk through anything on a quick call."]}),
|
|
738
|
-
/* @__PURE__ */Ae("p",{children:["Best,",
|
|
739
|
-
/* @__PURE__ */De("br",{}),n.from]})]})]})]})})})}var Eo=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],To=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function Io(){const[e,r]=ge(1),n=Eo.find(t=>t.id===e)??Eo[0];/* @__PURE__ */
|
|
740
|
-
return De("div",{className:"h-full",children:/* @__PURE__ */De(t,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */De("div",{className:"h-full overflow-auto",children:Eo.map(t=>/* @__PURE__ */Ae("button",{onClick:()=>r(t.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(t.id===e?"bg-blue-50/50":""),children:[
|
|
741
|
-
/* @__PURE__ */De(na,{name:t.name,status:t.status}),
|
|
742
|
-
/* @__PURE__ */Ae("div",{className:"min-w-0 flex-1",children:[
|
|
743
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between gap-2",children:[
|
|
744
|
-
/* @__PURE__ */De("span",{className:"truncate text-sm font-medium text-gray-900",children:t.name}),
|
|
745
|
-
/* @__PURE__ */De("span",{className:"shrink-0 text-[11px] text-gray-400",children:t.time})]}),
|
|
746
|
-
/* @__PURE__ */De("div",{className:"truncate text-xs text-gray-500",children:t.last})]})]},t.id))}),children:/* @__PURE__ */Ae("div",{className:"flex h-full flex-col",children:[
|
|
747
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center gap-3 border-b border-gray-200 p-3",children:[
|
|
748
|
-
/* @__PURE__ */De(na,{name:n.name,status:n.status,size:"sm"}),
|
|
749
|
-
/* @__PURE__ */Ae("div",{children:[
|
|
750
|
-
/* @__PURE__ */De("div",{className:"text-sm font-medium text-gray-900",children:n.name}),
|
|
751
|
-
/* @__PURE__ */De("div",{className:"text-xs text-gray-400 capitalize",children:n.status})]})]}),
|
|
752
|
-
/* @__PURE__ */De("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:To.map((e,t)=>/* @__PURE__ */De("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */De("div",{style:{maxWidth:"75%"},className:"rounded-2xl px-3 py-2 text-sm "+(e.mine?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm"),children:e.text})},t))}),
|
|
753
|
-
/* @__PURE__ */Ae("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
|
|
754
|
-
/* @__PURE__ */De("div",{className:"flex-1",children:/* @__PURE__ */De(Oe,{placeholder:"Type a message…"})}),
|
|
755
|
-
/* @__PURE__ */De(g,{type:"submit",children:"Send"})]})]})})})}var Oo={featured:"success",new:"active",draft:"draft"},Ro=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,t)=>({id:t,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][t],tag:["featured","new","draft"][t%3],bg:e}));function Wo(){const[e,t]=ge("all"),r="all"===e?Ro:Ro.filter(t=>t.tag===e);/* @__PURE__ */
|
|
756
|
-
return De(Na,{groups:Oo,children:/* @__PURE__ */De("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Ae("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
757
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between gap-4",children:[
|
|
758
|
-
/* @__PURE__ */De("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
|
|
759
|
-
/* @__PURE__ */De(g,{size:"sm",children:"Upload"})]}),
|
|
760
|
-
/* @__PURE__ */De(ma,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
|
|
761
|
-
/* @__PURE__ */De("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */Ae(vn,{padded:!1,className:"overflow-hidden",children:[
|
|
762
|
-
/* @__PURE__ */De("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */De("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */De($a,{status:e.tag})})}),
|
|
763
|
-
/* @__PURE__ */Ae("div",{className:"flex items-center justify-between gap-2 p-3",children:[
|
|
764
|
-
/* @__PURE__ */De("span",{className:"truncate text-sm font-medium text-gray-900",children:e.title}),
|
|
765
|
-
/* @__PURE__ */De("span",{className:"text-xs text-gray-400",children:"2.4 MB"})]})]},e.id))})]})})})}var Ho={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function _o({mode:e="login"}){const[t,r]=ge(!0),n=Ho[e];/* @__PURE__ */
|
|
766
|
-
return De("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Ae("div",{className:"w-full max-w-sm",children:[
|
|
767
|
-
/* @__PURE__ */Ae("div",{className:"mb-6 text-center",children:[
|
|
768
|
-
/* @__PURE__ */De("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
|
|
769
|
-
/* @__PURE__ */De("h1",{className:"text-lg font-semibold text-gray-900",children:n.title}),
|
|
770
|
-
/* @__PURE__ */De("p",{className:"text-sm text-gray-500",children:n.subtitle})]}),
|
|
771
|
-
/* @__PURE__ */De(vn,{children:/* @__PURE__ */Ae("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===e&&/* @__PURE__ */De(at,{label:"Name",htmlFor:"au-name",children:/* @__PURE__ */De(Oe,{id:"au-name",placeholder:"Alice Nguyen"})}),
|
|
772
|
-
/* @__PURE__ */De(at,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */De(Oe,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */De(at,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */De(Oe,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */Ae("div",{className:"flex items-center justify-between",children:[
|
|
773
|
-
/* @__PURE__ */De(tt,{checked:t,onChange:r,label:"Remember me"}),
|
|
774
|
-
/* @__PURE__ */De("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
|
|
775
|
-
/* @__PURE__ */De(g,{type:"submit",block:!0,children:n.cta})]})}),
|
|
776
|
-
/* @__PURE__ */De("p",{className:"mt-4 text-center text-sm text-gray-500",children:/* @__PURE__ */Ae(je,"register"===e?{children:["Already have an account? ",
|
|
777
|
-
/* @__PURE__ */De("a",{href:"#",className:"text-blue-600 hover:underline",children:"Sign in"})]}:{children:["New here? ",
|
|
778
|
-
/* @__PURE__ */De("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var Ko={403:e=>({title:e.forbidden,body:e.forbiddenBody}),404:e=>({title:e.notFound,body:e.notFoundBody}),500:e=>({title:e.serverError,body:e.serverErrorBody})};function qo({code:e=404,actions:t}){const r=Ko[e](G().errors);/* @__PURE__ */
|
|
779
|
-
return Ae("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
|
|
780
|
-
/* @__PURE__ */De("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:e}),
|
|
781
|
-
/* @__PURE__ */De("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:r.title}),
|
|
782
|
-
/* @__PURE__ */De("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */De("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function Uo({pick:e}){/* @__PURE__ */
|
|
783
|
-
return De(je,{children:e(G().errors)})}var Vo=class extends $e{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),this.props.onError?.(e,t)}componentDidUpdate(e){if(!this.state.error)return;const t=e.resetKeys??[],r=this.props.resetKeys??[];(t.length!==r.length||t.some((e,t)=>!Object.is(e,r[t])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
|
|
784
|
-
/* @__PURE__ */Ae("div",{className:"flex h-full flex-col",children:[
|
|
785
|
-
/* @__PURE__ */De("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */De(qo,{code:500,actions:/* @__PURE__ */Ae(je,{children:[
|
|
786
|
-
/* @__PURE__ */De(g,{onClick:this.reset,children:/* @__PURE__ */De(Uo,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */Ae("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
|
|
787
|
-
/* @__PURE__ */De("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */De(Uo,{pick:e=>e.details})}),
|
|
788
|
-
/* @__PURE__ */De("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 Yo(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Zo(e){const t=Yo();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function Go(){return Yo()?.matches??!1}function Xo(){return!1}function Jo(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 Qo(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 es(e){const t=e||"system";return"system"===t?Go()?"dark":"light":t}function ts(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Jo(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Qo(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Qo(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Qo(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Qo(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Qo(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Qo(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Qo(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 rs(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]=Jo(a);l.style.setProperty("--custom-button-hover",Qo(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var ns=["square","soft","round"];function as(e){return"square"===e||"round"===e?e:"soft"}function ls(e){const t=as(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function is(e){const t="string"==typeof e&&e?e:null;de(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function os(e){"corners"in e&&ls(e.corners),"icon_set"in e&&is(e.icon_set),document.documentElement.setAttribute("data-theme",es(e.theme)),ts(e.accent_color??null),rs(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 ss(){const{prefs:e}=o(),t=Ce(Zo,Go,Xo),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,l=e.custom_title_color||null,i=e.custom_window_color||null,s=e.custom_button_color||null,c=as(e.corners),d="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,u="system"===r?t?"dark":"light":r;return xe(()=>(document.documentElement.setAttribute("data-theme",u),()=>document.documentElement.removeAttribute("data-theme")),[u]),xe(()=>(ls(c),()=>document.documentElement.removeAttribute("data-corners")),[c]),xe(()=>(is(d),()=>is(null)),[d]),xe(()=>{ts(n)},[n]),xe(()=>{rs(n,a,l,i,s)},[n,a,l,i,s]),{theme:r,resolved:u,corners:c,iconSet:d}}function cs(e){/* @__PURE__ */
|
|
789
|
-
return Ae("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...e,children:[
|
|
790
|
-
/* @__PURE__ */De("circle",{cx:"12",cy:"12",r:"9"}),
|
|
791
|
-
/* @__PURE__ */De("path",{d:"M3 12h18M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3Z"})]})}function ds(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 us({size:e="sm",className:t=""}){const{language:r,languages:a,setLanguage:l}=n(),i=G().language;return a.length<2?null:/* @__PURE__ */Ae("span",{className:`inline-flex items-center gap-1.5 text-gray-500 ${t}`.trim(),children:[
|
|
792
|
-
/* @__PURE__ */De(ue,{name:"globe",fallback:cs,"aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
|
|
793
|
-
/* @__PURE__ */De("span",{className:"block",style:{width:`${ds(a.map(e=>e.name))}em`},children:/* @__PURE__ */De(Qe,{size:e,touchSize:e,"aria-label":i.title,value:r,onChange:e=>{l(e)},options:a.map(({tag:e,name:t})=>({value:e,label:t,lang:e}))})})]})}function hs({description:e,className:t=""}){const{language:r,languages:a,setLanguage:l}=n(),i=G().language;return a.length<2?null:/* @__PURE__ */Ae("div",{className:`space-y-4 ${t}`.trim(),children:[
|
|
794
|
-
/* @__PURE__ */Ae("div",{children:[
|
|
795
|
-
/* @__PURE__ */De("h3",{className:"text-sm font-semibold text-gray-900",children:i.title}),
|
|
796
|
-
/* @__PURE__ */De("p",{className:"mt-0.5 text-sm text-gray-500",children:e??i.description})]}),
|
|
797
|
-
/* @__PURE__ */De(it,{name:"shell-language",value:r,onChange:e=>{l(e)},hint:i.reloadNote,options:a.map(({tag:e,name:t})=>({value:e,label:/* @__PURE__ */De("span",{lang:e,children:t})}))})]})}function ms({label:e="Not available"}){/* @__PURE__ */
|
|
798
|
-
return De("span",{className:"text-gray-400",role:"img","aria-label":e,children:ie})}function ps({value:e,precise:t,locale:r,className:n}){const a=Z(),l=oe(e);if(!l)/* @__PURE__ */return De(ms,{});const i="string"==typeof e?e:l.toISOString();/* @__PURE__ */
|
|
799
|
-
return De("time",{dateTime:i,title:ce(i,{locale:r??a}),className:n,children:se(l,{precise:t,locale:r??a})})}function gs(e,t=300){const[r,n]=ge(e);return xe(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function fs(e,t){xe(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var bs=8,xs=["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)"],ys={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},vs={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function ws(e){return xs[e]??vs.muted}function ks(e,t,r){return t||(r?ys[r]:ws(e))}function Ns(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 Ms(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function $s(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function Cs(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 Ls(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 Ds(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 As(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 js(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}var Ps=e=>e.toFixed(2);function Ss(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Ps(e)},${Ps(t)}`).join(" ")}function zs(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Ps(e.start)},${Ps(e.y)}`,t+=` L${Ps(e.end)},${Ps(e.y)}`}),t}function Fs(e){if(e.length<3)return Ss(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${Ps(e[0][0])},${Ps(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${Ps(e[n][0]+t)},${Ps(e[n][1]+a[n]*t)} ${Ps(e[n+1][0]-t)},${Ps(e[n+1][1]-a[n+1]*t)} ${Ps(e[n+1][0])},${Ps(e[n+1][1])}`}return l}function Bs(e,t=0){if(e.length<3)return Ss(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${Ps(e[0][0])},${Ps(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${Ps(c)},${Ps(d)} ${Ps(u)},${Ps(h)} ${Ps(a[0])},${Ps(a[1])}`}return o}function Es(e){if(e.length<2)return Ss(e);let t=`M${Ps(e[0][0])},${Ps(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${Ps(o)},${Ps(a)} ${Ps(o)},${Ps(i)} ${Ps(l)},${Ps(i)}`}return t}function Ts(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Ps(e[0][0])},${Ps(e[0][1])}`:"monotone"===t?Fs(e):"spline"===t?Bs(e,r):"bump"===t?Es(e):Ss(e)}function Is(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${Ps(a[0])},${Ps(r)} L${Ps(n[0])},${Ps(r)} Z`}function Os(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Ps(e)},${Ps(t)}`).join(" L")} Z`}function Rs(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 Ws(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${Ws(e,t,r,n,a,l)} ${Ws(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${Ps(e)},${Ps(t)} L${Ps(c)},${Ps(d)} A${Ps(n)},${Ps(n)} 0 ${o} 1 ${Ps(u)},${Ps(h)} Z`;const[m,p]=s(r,l),[g,f]=s(r,a);return`M${Ps(c)},${Ps(d)} A${Ps(n)},${Ps(n)} 0 ${o} 1 ${Ps(u)},${Ps(h)} L${Ps(m)},${Ps(p)} A${Ps(r)},${Ps(r)} 0 ${o} 0 ${Ps(g)},${Ps(f)} Z`}function Hs(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const n=Math.max(...e),a=Math.min(...e),l=t*t,i=r*r;return Math.max(i*n/l,l/(i*a))}function _s(e,t,r,n){const a=n?r.height:r.width,l=a>0?t/a:0;let i=0;return{tiles:e.map(e=>{const o=t>0?e.value/t*a:0,s=n?{...e,x:r.x,y:r.y+i,width:l,height:o}:{...e,x:r.x+i,y:r.y,width:o,height:l};return i+=o,s}),rest:n?{x:r.x+l,y:r.y,width:r.width-l,height:r.height}:{x:r.x,y:r.y+l,width:r.width,height:r.height-l}}}function Ks(e,t,r){const n=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===n.length||t<=0||r<=0)return[];const a=n.reduce((e,t)=>e+t.value,0),l=t*r,i=[];let o={x:0,y:0,width:t,height:r},s=[],c=0,d=[...n.map(e=>({...e,value:e.value/a*l}))];for(;d.length>0;){const e=d[0],t=Math.min(o.width,o.height),r=o.width>=o.height,n=Hs(s.map(e=>e.value),c,t),a=Hs([...s.map(e=>e.value),e.value],c+e.value,t);if(0===s.length||a<=n)s.push(e),c+=e.value,d=d.slice(1);else{const e=_s(s,c,o,r);i.push(...e.tiles),o=e.rest,s=[],c=0}}s.length>0&&i.push(..._s(s,c,o,o.width>=o.height).tiles);const u=new Map(e.map(e=>[e.key,e.value]));return i.map(e=>({...e,value:u.get(e.key)??e.value}))}var qs=ye({highlighted:null,setHighlighted:()=>{}});function Us({children:e}){const[t,r]=ge(null),n=be(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
|
|
800
|
-
return De(qs.Provider,{value:n,children:e})}function Vs(){return Ne(qs)}function Ys(e,t,r=.22){return null===t?null:t===e?1:r}function Zs(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 Gs(e,t=720){const[r,n]=ge(t);return xe(()=>{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 Xs({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:o=30,animate:s=!0,className:c,emptyLabel:d}){const u=G().charts,h=Z(),m=r??(e=>ee(e,h)),p=d??u.nothingToRank;if(0===e.length)/* @__PURE__ */
|
|
801
|
-
return De("p",{className:`text-sm text-gray-500 ${c??""}`,children:p});const g=Zs(e.map(e=>e.value),a),f=n??(null===g?void 0:e[g]?.key),b=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),x=ws(0);/* @__PURE__ */
|
|
802
|
-
return De("ol",{className:`m-0 list-none p-0 ${c??""}`,style:{display:"grid",rowGap:`${Math.max(4,o-i)}px`},children:e.map((e,t)=>{const r=e.key===f,n=r?l?ys[l]:ws(1):f?vs.muted:x,a=Number.isFinite(e.value)?e.value:null,o=null!==a&&b>0?Math.max(0,Math.min(1,a/b)):0;/* @__PURE__ */
|
|
803
|
-
return Ae("li",{className:"grid gap-1",children:[
|
|
804
|
-
/* @__PURE__ */Ae("div",{className:"flex items-baseline justify-between gap-3",children:[
|
|
805
|
-
/* @__PURE__ */Ae("span",{className:"truncate font-mono text-xs text-gray-600 "+(r?"font-semibold":""),title:e.label,children:[e.label,r&&/* @__PURE__ */De("span",{className:"sr-only",children:` ${u.emphasised}`})]}),
|
|
806
|
-
/* @__PURE__ */De("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-gray-700",style:r?{color:n}:void 0,children:null===a?"—":m(a)})]}),
|
|
807
|
-
/* @__PURE__ */De("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */De("div",{className:`rounded-sm ${s?rl.grow:""}`,style:{width:`${(100*o).toFixed(2)}%`,height:i,backgroundColor:n,minWidth:o>0?2:0,...s?nl(t):{}}})})]},e.key)})})}var Js=e=>Math.max(0,Math.min(1,e));function Qs({value:e,segments:t,objective:r,label:n,detail:a,formatValue:l,tone:i,className:o,unavailableLabel:s}){const c=G().charts,d=Z(),u=l??(e=>re(100*e,1,d)),h=s??c.notEnough;if(null==e||!Number.isFinite(e))/* @__PURE__ */
|
|
808
|
-
return Ae("div",{className:o,children:[n&&/* @__PURE__ */De("p",{className:"text-sm font-medium text-gray-700",children:n}),
|
|
809
|
-
/* @__PURE__ */De("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=Js(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=ys[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__ */
|
|
810
|
-
return Ae("div",{className:o,children:[
|
|
811
|
-
/* @__PURE__ */Ae("div",{className:"mb-1.5 flex items-baseline justify-between gap-3",children:[
|
|
812
|
-
/* @__PURE__ */De("span",{className:"text-sm font-medium text-gray-700",children:n}),
|
|
813
|
-
/* @__PURE__ */De("span",{className:"text-sm font-semibold tabular-nums",style:{color:f},children:u(e)})]}),
|
|
814
|
-
/* @__PURE__ */Ae("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:[
|
|
815
|
-
/* @__PURE__ */De("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */De("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*Js(e.value)).toFixed(2)}%`,backgroundColor:ys[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__ */De("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*Js(r)).toFixed(2)}%`,height:20,backgroundColor:vs.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */De("p",{className:"mt-1.5 text-xs text-gray-500",children:b})]})}var ec={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function tc({label:e,value:t,unit:r,delta:n,deltaTone:a,trend:l,trendTone:i,footnote:o,className:s}){const c=G().charts,d=Z(),u=null==n?null:n>0?"up":n<0?"down":"flat",h=a?ys[a]:void 0,m=i?ys[i]:ks(0);/* @__PURE__ */
|
|
816
|
-
return Ae("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${s??""}`,children:[
|
|
817
|
-
/* @__PURE__ */De("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
818
|
-
/* @__PURE__ */Ae("span",{className:"flex items-baseline gap-1.5",children:[
|
|
819
|
-
/* @__PURE__ */De("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:t}),r&&/* @__PURE__ */De("span",{className:"text-sm font-medium text-gray-500",children:r})]}),u&&/* @__PURE__ */Ae("span",{className:"text-xs font-medium",style:h?{color:h}:void 0,children:[
|
|
820
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true",children:ec[u].glyph})," ",ee(Math.abs(n),d),
|
|
821
|
-
/* @__PURE__ */Ae("span",{className:"sr-only",children:[" ",c[ec[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */De(po,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-1.5 w-full"}),o&&/* @__PURE__ */De("span",{className:"mt-1 text-xs text-gray-500",children:o})]})}function rc({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=G().charts,o=a??i.loading,s=`${me()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
|
|
822
|
-
return De("div",{className:l,children:/* @__PURE__ */Ae("svg",{width:"100%",height:e,viewBox:`0 0 ${t} ${e}`,role:"img","aria-label":o,"aria-busy":"true",children:[
|
|
823
|
-
/* @__PURE__ */De("defs",{children:/* @__PURE__ */Ae("linearGradient",{id:s,x1:"0",y1:"0",x2:"1",y2:"0",children:[
|
|
824
|
-
/* @__PURE__ */De("stop",{offset:"0%",stopColor:vs.surface,stopOpacity:"0"}),
|
|
825
|
-
/* @__PURE__ */De("stop",{offset:"45%",stopColor:vs.surface,stopOpacity:"0.55"}),
|
|
826
|
-
/* @__PURE__ */De("stop",{offset:"55%",stopColor:vs.surface,stopOpacity:"0.55"}),
|
|
827
|
-
/* @__PURE__ */De("stop",{offset:"100%",stopColor:vs.surface,stopOpacity:"0"})]})}),Array.from({length:5},(e,t)=>{const r=u+(h-u)*t/4;/* @__PURE__ */
|
|
828
|
-
return De("line",{x1:c,y1:r,x2:d,y2:r,stroke:vs.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */De("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:vs.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__ */
|
|
829
|
-
return De("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:vs.grid},t)}):/* @__PURE__ */De("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:vs.grid}),
|
|
830
|
-
/* @__PURE__ */De("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${s})`})]})})}function nc({shape:e,colour:t}){const r="shrink-0";switch(e){case"circle":/* @__PURE__ */
|
|
831
|
-
return De("span",{className:`${r} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:t}});case"circle-outline":/* @__PURE__ */
|
|
832
|
-
return De("span",{className:`${r} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:t}});case"rounded-square-outline":/* @__PURE__ */
|
|
833
|
-
return De("span",{className:`${r} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:t}});case"square":/* @__PURE__ */
|
|
834
|
-
return De("span",{className:`${r} h-2.5 w-2.5`,style:{backgroundColor:t}});case"bar":/* @__PURE__ */
|
|
835
|
-
return De("span",{className:`${r} h-1 w-4 rounded-full`,style:{backgroundColor:t}});case"bar-vertical":/* @__PURE__ */
|
|
836
|
-
return De("span",{className:`${r} h-3.5 w-1 rounded-full`,style:{backgroundColor:t}});default:/* @__PURE__ */
|
|
837
|
-
return De("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function ac({entries:e,interactive:t,fallbackSwatch:r}){const{highlighted:n,setHighlighted:a}=Vs();/* @__PURE__ */
|
|
838
|
-
return De("ul",{className:"m-0 flex flex-wrap items-center gap-x-4 gap-y-1 p-0",children:e.map((e,l)=>{const i=t&&null!==n&&n!==e.key,o=/* @__PURE__ */Ae(je,{children:[
|
|
839
|
-
/* @__PURE__ */De(nc,{shape:e.swatch??r,colour:ks(l,e.color,e.tone)}),e.label]});/* @__PURE__ */
|
|
840
|
-
return De("li",{className:"list-none",children:t?/* @__PURE__ */De("button",{type:"button",onMouseEnter:()=>a(e.key),onMouseLeave:()=>a(null),onFocus:()=>a(e.key),onBlur:()=>a(null),className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(i?"opacity-40":""),children:o}):/* @__PURE__ */De("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:o})},e.key)})})}function lc({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",actions:u,children:h,className:m}){const p=G().charts;/* @__PURE__ */
|
|
841
|
-
return De(Us,{children:/* @__PURE__ */Ae("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${m??""}`,"aria-busy":l||i||void 0,children:[
|
|
842
|
-
/* @__PURE__ */Ae("header",{className:"flex items-start justify-between gap-4",children:[
|
|
843
|
-
/* @__PURE__ */Ae("div",{className:"min-w-0",children:[
|
|
844
|
-
/* @__PURE__ */De("h3",{className:"truncate text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */De("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),u&&/* @__PURE__ */De("div",{className:"shrink-0",children:u})]}),i?/* @__PURE__ */De(rc,{variant:o,height:s}):/* @__PURE__ */De("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:h}),!i&&r&&r.length>1&&/* @__PURE__ */De(ac,{entries:r,interactive:c,fallbackSwatch:d}),!i&&n&&/* @__PURE__ */Ae("details",{className:"border-t border-gray-100 pt-3",children:[
|
|
845
|
-
/* @__PURE__ */De("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:a??p.showTable}),
|
|
846
|
-
/* @__PURE__ */De("div",{className:"mt-3 overflow-x-auto",style:{color:vs.label},children:n})]})]})})}function ic({variant:e="solid",title:t,rows:r,footnote:n,emphasisKey:a,className:l}){const i="glass"===e;/* @__PURE__ */
|
|
847
|
-
return Ae("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?T():void 0,children:[t&&/* @__PURE__ */De("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
|
|
848
|
-
/* @__PURE__ */De("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:r.map(e=>/* @__PURE__ */Ae("li",{className:"flex items-center gap-2.5",style:a&&e.key!==a?{opacity:.45}:void 0,children:[
|
|
849
|
-
/* @__PURE__ */De("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??vs.muted}}),
|
|
850
|
-
/* @__PURE__ */De("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
|
|
851
|
-
/* @__PURE__ */De("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */De("p",{className:"mt-2 text-[11px] text-gray-500",children:n})]})}function oc({cx:e,cy:t,color:r,variant:n="default",pulse:a=!1,title:l}){const i="border"===n?3:"colored-border"===n?1.5:0,o="border"===n?3:3.5;/* @__PURE__ */
|
|
852
|
-
return Ae("g",{children:[a&&/* @__PURE__ */De("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:o,fill:r,fillOpacity:.45}),"border"===n&&/* @__PURE__ */De("circle",{cx:e,cy:t,r:o+i,fill:vs.surface}),
|
|
853
|
-
/* @__PURE__ */De("circle",{cx:e,cy:t,r:o,fill:"colored-border"===n?vs.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */De("title",{children:l})})]})}function sc({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:o}){const s=G().charts,c=fe(null),d=e.length-1,[u,h]=r,m=i??ks(0),p=e=>0===d?0:e/d*l,g=e=>"number"==typeof e&&Number.isFinite(e),f=t.filter(g),b=Math.max(...f,1),x=e=>a-e/b*(a-6),y=[];e.forEach((e,r)=>{if(!g(t[r]))return;const n=y[y.length-1];n&&n.to===r-1?n.to=r:y.push({from:r,to:r})});const v=y.map(e=>{const r=[];for(let n=e.from;n<=e.to;n+=1)r.push(`${n===e.from?"M":"L"}${p(n).toFixed(2)},${x(t[n]).toFixed(2)}`);return`${r.join(" ")} L${p(e.to).toFixed(2)},${a} L${p(e.from).toFixed(2)},${a} Z`}).join(" "),w=(e,t)=>{const r=Math.max(0,Math.min(d,t));n("from"===e?[Math.min(r,h-1),h]:[u,Math.max(r,u+1)])},k=e=>t=>{const r=t.shiftKey?5:1,n="from"===e?u:h;"ArrowLeft"===t.key&&(t.preventDefault(),w(e,n-r)),"ArrowRight"===t.key&&(t.preventDefault(),w(e,n+r)),"Home"===t.key&&(t.preventDefault(),w(e,0)),"End"===t.key&&(t.preventDefault(),w(e,d))},N=fe(null),M=e=>t=>{N.current=e,t.currentTarget.setPointerCapture(t.pointerId)},$=e=>t=>{N.current===e&&w(e,(e=>{const t=c.current?.getBoundingClientRect();if(!t||0===t.width)return u;const r=Math.max(0,Math.min(1,(e-t.left)/t.width));return Math.round(r*d)})(t.clientX))},C=e=>()=>{N.current===e&&(N.current=null)},L=t=>{const r="from"===t?u:h;/* @__PURE__ */
|
|
854
|
-
return De("rect",{x:p(r)-4.5,y:0,width:9,height:a,rx:3,fill:m,className:"cursor-ew-resize rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",tabIndex:0,role:"slider","aria-label":"from"===t?s.windowStart:s.windowEnd,"aria-valuemin":0,"aria-valuemax":d,"aria-valuenow":r,"aria-valuetext":e[r],style:{touchAction:"none"},onKeyDown:k(t),onPointerDown:M(t),onPointerMove:$(t),onPointerUp:C(t),onPointerCancel:C(t)},t)};/* @__PURE__ */
|
|
855
|
-
return De("div",{className:o,children:/* @__PURE__ */Ae("svg",{ref:c,width:"100%",height:a,viewBox:`0 0 ${l} ${a}`,role:"group","aria-label":s.window(e[u],e[h],e.length),children:[
|
|
856
|
-
/* @__PURE__ */De("path",{d:v,fill:vs.grid}),
|
|
857
|
-
/* @__PURE__ */De("rect",{x:0,y:0,width:p(u),height:a,fill:vs.surface,fillOpacity:.72}),
|
|
858
|
-
/* @__PURE__ */De("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:vs.surface,fillOpacity:.72}),
|
|
859
|
-
/* @__PURE__ */De("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}function cc(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 dc({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,tooltip:h,ariaLabel:m,className:p,emptyLabel:g}){const f=G().charts,b=Z(),x=s??(e=>ee(e,b)),y=g??f.noData,v=fe(null),w=Gs(v),k=n??w,[N,M]=ge(null),$=me();if(xe(()=>{if(null!==N)return I(e=>"Escape"===e.key&&(M(null),!0))},[N]),0===e.length)/* @__PURE__ */
|
|
860
|
-
return De("div",{className:p,ref:v,children:/* @__PURE__ */De("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:y})});const C={top:12,right:16,bottom:26,left:c?58:48},L=C.left,D=Math.max(L+1,k-C.right),A=C.top,j=r-C.bottom,P=t.filter(Number.isFinite),S=l??Math.min(0,...P),z=Ns([S,i??Cs(Math.max(...P,0))],{from:j,to:A}),F=Ms(e.length,{from:L,to:D},a),B=z.ticks(o+1),E=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor(k/84))));/* @__PURE__ */
|
|
861
|
-
return Ae("div",{className:`relative ${p??""}`,ref:v,children:[
|
|
862
|
-
/* @__PURE__ */Ae("svg",{width:"100%",height:r,viewBox:`0 0 ${k} ${r}`,role:"img","aria-label":m,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>M(null),onBlur:()=>M(null),onKeyDown:t=>{if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;M(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
|
|
863
|
-
/* @__PURE__ */De("defs",{children:/* @__PURE__ */De("clipPath",{id:$,children:/* @__PURE__ */De("rect",{x:L,y:A,width:D-L,height:j-A})})}),B.map(e=>/* @__PURE__ */De("line",{x1:L,y1:z(e),x2:D,y2:z(e),stroke:vs.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
864
|
-
/* @__PURE__ */De("line",{x1:L,y1:z(Math.max(S,0)),x2:D,y2:z(Math.max(S,0)),stroke:vs.axis,strokeWidth:1,shapeRendering:"crispEdges"}),B.map(e=>/* @__PURE__ */De("text",{x:L-8,y:z(e)+4,textAnchor:"end",fontSize:11,fill:vs.label,style:{fontVariantNumeric:"tabular-nums"},children:x(e)},`t${e}`)),c&&/* @__PURE__ */De("text",{x:14,y:(A+j)/2,transform:`rotate(-90 14 ${(A+j)/2})`,textAnchor:"middle",fontSize:11,fill:vs.label,children:c}),
|
|
865
|
-
/* @__PURE__ */De("g",{clipPath:`url(#${$})`,children:u({x:F,y:z,left:L,right:D,top:A,bottom:j,width:k,height:r,clipId:$,active:N})}),e.map((e,t)=>t%E===0?/* @__PURE__ */De("text",{x:"start"===d?F(t):F.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:vs.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */De("rect",{x:F.center(r)-(D-L)/e.length/2,y:A,width:(D-L)/e.length,height:j-A,fill:"transparent",onMouseEnter:()=>M(r)},`h${r}`))]}),h&&null!==N&&
|
|
866
|
-
/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 z-10",style:cc(F.center(N),F.bandwidth,k),children:h(N)})]})}var uc=12,hc=16,mc=26,pc=52,gc=e=>"number"==typeof e&&Number.isFinite(e);function fc({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,yAxisLabel:u,referenceLines:h,labelEndpoints:m=!1,dots:p,dotVariant:g="border",pulse:f=!1,brush:b=!1,range:x,onRangeChange:y,loading:v=!1,animate:w=!0,reveal:k="left-to-right",fillVariant:N="gradient",gridStyle:M="solid",width:$,className:C,emptyLabel:L}){const D=G().charts,A=Z(),j=d??(e=>ee(e,A)),P=L??D.noData,S=fe(null),z=Gs(S),F=$??z,[B,E]=ge(null),[T,O]=ge(null),{highlighted:R}=Vs(),W=me();if(xe(()=>{if(null!==B)return I(e=>"Escape"===e.key&&(E(null),!0))},[B]),v)/* @__PURE__ */
|
|
867
|
-
return De("div",{className:C,ref:S,children:/* @__PURE__ */De(rc,{height:r,width:$??z})});const H=t,_=x??T??[0,Math.max(0,H.length-1)],[K,q]=_,U=e=>b?e.slice(K,q+1):e,V=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(gc)).map(e=>({...e,data:U(e.data)}));if(t=U(H),0===V.length||0===t.length)/* @__PURE__ */
|
|
868
|
-
return De("div",{className:C,ref:S,children:/* @__PURE__ */De("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:P})});const Y={left:pc,right:Math.max(pc+1,F-hc),top:uc,bottom:r-mc},X=Ms(t.length,{from:Y.left,to:Y.right}),J=t.map((e,t)=>V.reduce((e,r)=>e+(gc(r.data[t])?r.data[t]:0),0)),Q=(e,t)=>J[t]>0?e/J[t]:null,te=[];if(n){let e=t.map(()=>0);for(const t of V)e=e.map((e,r)=>e+(gc(t.data[r])?t.data[r]:0)),te.push("percent"===a?e.map((e,t)=>Q(e,t)):[...e])}const ne=l&&l.length>0?$s(l,{from:Y.bottom,to:Y.top}):null,ae=n?(te.at(-1)??[]).filter(gc):V.flatMap(e=>e.data.filter(gc)),le=Ns([0,n&&"percent"===a?1:s??Cs(Math.max(...ae,0))],{from:Y.bottom,to:Y.top}),ie=e=>ne?ne(e):le(e),oe=n&&"percent"===a?e=>re(Math.round(100*e),0,A):j,se=ne?ne.levels.map(e=>({value:e,y:ne(e)})):le.ticks(c+1).map(e=>({value:e,y:le(e)})),ce=e=>r=>{r.preventDefault(),E(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},de=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(F/96))));/* @__PURE__ */
|
|
869
|
-
return Ae("div",{className:`relative ${C??""}`,ref:S,children:[
|
|
870
|
-
/* @__PURE__ */Ae("svg",{width:"100%",height:r,viewBox:`0 0 ${F} ${r}`,role:"img","aria-label":D.overIntervals(V.map(e=>e.label),t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:e=>{"ArrowRight"===e.key&&ce(1)(e),"ArrowLeft"===e.key&&ce(-1)(e)},children:[
|
|
871
|
-
/* @__PURE__ */De("defs",{children:/* @__PURE__ */De("clipPath",{id:W,children:/* @__PURE__ */De("rect",{x:Y.left,y:Y.top,width:Y.right-Y.left,height:Y.bottom-Y.top})})}),
|
|
872
|
-
/* @__PURE__ */De(el,{id:W,fills:V.map((e,t)=>({color:ks(e.slot,e.color,e.tone),variant:e.fillVariant??N})),fadeFrom:n?.42:.3,reveal:!!w&&k}),se.map(e=>/* @__PURE__ */De("line",{x1:Y.left,y1:e.y,x2:Y.right,y2:e.y,stroke:vs.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===M?"3 3":void 0},`grid-${e.value}`)),
|
|
873
|
-
/* @__PURE__ */De("line",{x1:Y.left,y1:Y.bottom,x2:Y.right,y2:Y.bottom,stroke:vs.axis,strokeWidth:1,shapeRendering:"crispEdges"}),se.map(e=>/* @__PURE__ */De("text",{x:Y.left-8,y:e.y+4,textAnchor:"end",fontSize:11,fill:vs.label,style:{fontVariantNumeric:"tabular-nums"},children:oe(e.value)},`ytick-${e.value}`)),u&&/* @__PURE__ */De("text",{x:12,y:(Y.top+Y.bottom)/2,transform:`rotate(-90 12 ${(Y.top+Y.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:vs.label,children:u}),
|
|
874
|
-
/* @__PURE__ */De("g",{clipPath:`url(#${W})`,mask:w&&k?`url(#${Ya(W)})`:void 0,children:V.map((e,r)=>{const a=ks(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),s=Ys(e.key,R);if("step"===l){const r=t.map((t,r)=>({start:X(r),end:X.end(r),value:e.data[r]})).filter(e=>gc(e.value)).map(e=>({start:e.start,end:e.end,y:ie(e.value)}));/* @__PURE__ */
|
|
875
|
-
return De("path",{d:zs(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 gc(l)?[X.center(a),ie(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*X.bandwidth);/* @__PURE__ */
|
|
876
|
-
return De("g",{opacity:s??void 0,className:"rosh-viz-mark",children:t.map((t,i)=>{const o=n?te[r]?.[i]:e.data[i];if(!gc(o))return null;const s=ie(o);/* @__PURE__ */
|
|
877
|
-
return De("rect",{x:X.center(i)-l/2,y:s,width:l,height:Math.max(0,Y.bottom-s),rx:2,fill:a,fillOpacity:.35,className:w?rl.rise:void 0,style:w?nl(i,26):void 0},i)})},e.key)}const d=Ts(c,i,o),u=n&&r>0?t.map((e,t)=>[X.center(t),ie(te[r-1]?.[t]??0)-2]):null,h=u?Os(d,u):Is(d,c,Y.bottom);/* @__PURE__ */
|
|
878
|
-
return Ae("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===l||n)&&
|
|
879
|
-
/* @__PURE__ */De("path",{d:h,fill:Ga(W,r,e.fillVariant??N,a),stroke:"none"}),
|
|
880
|
-
/* @__PURE__ */De("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:Xa(e.stroke??(e.forecast?"animated-dashed":"solid")),className:w&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?rl.march:void 0})]},e.key)})}),h?.map((e,t)=>{const r=e.color??ys[e.tone??"critical"],n=ie(e.value);/* @__PURE__ */
|
|
881
|
-
return Ae("g",{children:[
|
|
882
|
-
/* @__PURE__ */De("line",{x1:Y.left,y1:n,x2:Y.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */De("text",{x:Y.right-4,y:n-5,textAnchor:"end",fontSize:10.5,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(p??(m?"last":"none"))&&V.map((e,r)=>{const a=p??(m?"last":"none"),l=ks(e.slot,e.color,e.tone),i=[...e.data].map(gc).lastIndexOf(!0),o="all"===a?t.map((e,t)=>t).filter(t=>gc(n?te[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
|
|
883
|
-
return Ae("g",{children:[o.map(a=>{const o=n?te[r]?.[a]:e.data[a];return gc(o)?/* @__PURE__ */De(oc,{cx:X.center(a),cy:ie(o),color:l,variant:g,pulse:f&&a===i,title:`${t[a]}: ${e.label} ${j(o)}`},a):null}),m&&i>=0&&gc(n?te[r]?.[i]:e.data[i])&&/* @__PURE__ */De("text",{x:X.center(i)-10,y:ie(n?te[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:vs.label,style:{fontVariantNumeric:"tabular-nums"},children:j(n?te[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%de===0?/* @__PURE__ */De("text",{x:X.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:vs.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==B&&/* @__PURE__ */De("line",{x1:X.center(B),y1:Y.top,x2:X.center(B),y2:Y.bottom,stroke:vs.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */De("rect",{x:X(t),y:Y.top,width:Math.max(1,X.bandwidth),height:Y.bottom-Y.top,fill:"transparent",onMouseEnter:()=>E(t)},`hit-${t}`))]}),b&&H.length>2&&/* @__PURE__ */De(sc,{className:"mt-1",labels:H,width:F,data:e[0]?.data??[],range:_,onRangeChange:e=>{y?y(e):O(e)}}),null!==B&&
|
|
884
|
-
/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 z-10",style:cc(X.center(B),X.bandwidth,F),children:/* @__PURE__ */De(ic,{title:t[B],rows:V.map((e,t)=>({key:e.key,label:e.label,color:ks(e.slot,e.color,e.tone),value:gc(e.data[B])?n&&"percent"===a?`${re(100*(Q(e.data[B],B)??0),1,A)} · ${j(e.data[B])}`:j(e.data[B]):void 0})),footnote:n&&"percent"===a?D.inBucket(j(J[B])):void 0})})]})}function bc({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"}){const x=me(),{highlighted:y}=Vs(),v=G().charts,w=Z(),k=o??(e=>ee(e,w));if(h)/* @__PURE__ */return De(rc,{height:a,width:l,variant:"bars",className:c});const N=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),M=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},$=t.map((e,t)=>N.reduce((e,r)=>e+M(r,t),0)),C=t.map((e,t)=>N.reduce((e,r)=>e+Math.max(0,M(r,t)),0)),L=t.map((e,t)=>N.reduce((e,r)=>e+Math.min(0,M(r,t)),0)),D=r&&"percent"===n,A=(e,t)=>$[t]>0?e/$[t]:null,j=D?[1]:r?[...C,...L]:N.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
|
|
885
|
-
return De(dc,{labels:t,values:j,height:a,width:l,max:D?1:i,formatValue:D?e=>re(Math.round(100*e),0,w):k,yAxisLabel:s,className:c,emptyLabel:d,ariaLabel:v.acrossCategories(N.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */De(ic,{title:t[e],rows:N.map(t=>({key:t.key,label:t.label,color:ks(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?D?`${re(100*(A(t.data[e],e)??0),1,w)} · ${k(t.data[e])}`:k(t.data[e]):void 0})),footnote:D?v.inCategory(k($[e])):void 0}),children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,o=Zs(r?$:N[0]?.data??[],b),s=l??(i>=0?i:o);/* @__PURE__ */
|
|
886
|
-
return Ae("g",{children:[
|
|
887
|
-
/* @__PURE__ */De(el,{id:x,glow:p}),t.map((t,a)=>{const l=e.bandwidth/(r?1:Math.max(1,N.length));let i=0,o=0;const c=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return N.map((t,d)=>{const h=t.data[a];if(!Number.isFinite(h))return null;const f=D?A(h,a):h;if(null===f)return null;const b=ks(t.slot,t.color,t.tone),v=r?e(a):e(a)+d*l;let w,k,M=!0;if(r){const e=f>=0?i:o,t=e+f;f>=0?i=t:o=t,w=n(Math.max(e,t)),k=n(Math.min(e,t)),M=0===e}else w=Math.min(n(f),c),k=Math.max(n(f),c);const $=Math.max(0,k-w-(r&&!M?2:0)),C=null===s||s===a,L=C?b:g?vs.muted:b,j=Ys(t.key,y);/* @__PURE__ */
|
|
888
|
-
return De("rect",{x:v,y:w,width:Math.max(1,l),height:$,rx:u,fill:L,fillOpacity:j??(C?1:g?.32:.45),filter:p&&s===a?`url(#${Va(x)})`:void 0,className:"rosh-viz-mark"+(m?` ${rl.rise}`:""),style:m?nl(a*(r?1:N.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */De("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:vs.axis,strokeWidth:1})]})}})}var xc=3;function yc({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=G().charts,g=Z(),f=l??(e=>ee(e,g)),b=i??(e=>ee(e,g)),x=m??p.noObservations,y=fe(null),v=Gs(y),w=r??v,k=me(),[N,M]=ge(null);xe(()=>{if(null!==N)return I(e=>"Escape"===e.key&&(M(null),!0))},[N]);const $=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.filter(e=>e.points.length>0).slice(0,3),L=o||s?C.map(e=>({...e,points:e.points.filter(e=>$(e.x,o)&&$(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__ */
|
|
889
|
-
return De("div",{className:h,ref:y,children:/* @__PURE__ */De("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:x})});const A=L.flatMap(e=>e.points),j=A.some(e=>null!=e.size),P=14,S=20,z=34,F=52,B=Math.max(F+1,w-S),E=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,Cs(Math.max(...e))];return"log"===r?Ls(i,n):Ns(i,n)},T=E(A.map(e=>e.x),o,c,{from:F,to:B}),O=E(A.map(e=>e.y),s,d,{from:t-z,to:P}),R=As([0,Math.max(...A.map(e=>e.size??1))],{from:u[0],to:u[1]}),W=N?L[N.s]:void 0,H=N&&W?W.points[N.i]:void 0,_=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
|
|
890
|
-
return Ae("div",{className:`relative ${h??""}`,ref:y,children:[
|
|
891
|
-
/* @__PURE__ */Ae("svg",{width:"100%",height:t,viewBox:`0 0 ${w} ${t}`,role:"img","aria-label":p.scatter(L.map(e=>e.label),a??p.yAxis,n??p.xAxis)+(D>0?`. ${p.outsideRange(D)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>M(null),onBlur:()=>M(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=N?_.findIndex(e=>e.s===N.s&&e.i===N.i):0;M(_[Math.min(_.length-1,Math.max(0,r+t))])},children:[
|
|
892
|
-
/* @__PURE__ */De("defs",{children:/* @__PURE__ */De("clipPath",{id:k,children:/* @__PURE__ */De("rect",{x:F-u[1],y:P-u[1],width:B-F+2*u[1],height:t-z-P+2*u[1]})})}),O.ticks(5).map(e=>/* @__PURE__ */Ae("g",{children:[
|
|
893
|
-
/* @__PURE__ */De("line",{x1:F,y1:O(e),x2:B,y2:O(e),stroke:vs.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
894
|
-
/* @__PURE__ */De("text",{x:F-8,y:O(e)+4,textAnchor:"end",fontSize:11,fill:vs.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),T.ticks(5).map(e=>/* @__PURE__ */De("text",{x:T(e),y:t-12,textAnchor:"middle",fontSize:11,fill:vs.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */De("text",{x:(F+B)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:vs.label,children:n}),a&&/* @__PURE__ */De("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:vs.label,children:a}),
|
|
895
|
-
/* @__PURE__ */De("g",{clipPath:`url(#${k})`,children:L.map((e,t)=>{const r=ks(t,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */De("circle",{cx:T(n.x),cy:O(n.y),r:j?R(n.size??0):u[0]+1,fill:r,fillOpacity:N&&N.s!==t?.25:.62,stroke:vs.surface,strokeWidth:2,onMouseEnter:()=>M({s:t,i:a})},`${e.key}-${a}`))})})]}),N&&W&&H&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(ic,{title:H.label??W.label,rows:[{key:"x",label:n??p.xAxis,color:ks(N.s,W.color,W.tone),value:f(H.x)},{key:"y",label:a??p.yAxis,color:ks(N.s,W.color,W.tone),value:b(H.y)},...null!=H.size?[{key:"size",label:p.size,color:vs.muted,value:ee(H.size,g)}]:[]],footnote:H.label?W.label:void 0})})]})}function vc({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=G().charts,b=Z(),x=s??(e=>ee(e,b)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=ks(0,d,u);/* @__PURE__ */
|
|
896
|
-
return De(dc,{labels:t,values:v,height:a,width:l,max:i,min:o,formatValue:x,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(y,t.length),tooltip:r=>/* @__PURE__ */De(ic,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:x(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:x(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */De("g",{children:e.map((e,r)=>/* @__PURE__ */De("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__ */Ae("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__ */
|
|
897
|
-
return Ae(je,{children:[
|
|
898
|
-
/* @__PURE__ */De("path",{d:Os(Ts(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
|
|
899
|
-
/* @__PURE__ */De("path",{d:Ts(r,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
|
|
900
|
-
/* @__PURE__ */De("path",{d:Ts(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */De("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:vs.axis,strokeWidth:1})]})})}function wc({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:o=3,connectors:s=!0}){const c=G().charts,d=Z(),u=n??(e=>ee(e,d));let h=0;const m=e.map(e=>{if(e.total){const t={from:0,to:h,value:h,total:!0};return{...e,...t}}const t=h;return h+=e.value,{...e,from:t,to:h,value:e.value,total:!1}}),p=m.flatMap(e=>[e.from,e.to]);/* @__PURE__ */
|
|
901
|
-
return De(dc,{labels:e.map(e=>e.label),values:p,height:t,width:r,formatValue:u,yAxisLabel:a,className:l,emptyLabel:i,bandPadding:.36,ariaLabel:c.waterfall(e.length,u(m[0]?.from??0),u(h)),tooltip:e=>{const t=m[e],r=t?.total?ys.neutral:t.value>=0?ys.good:ys.critical;/* @__PURE__ */
|
|
902
|
-
return De(ic,{title:t?.label,rows:[{key:"step",color:r,label:t?.total?c.balance:t.value>=0?c.increase:c.decrease,value:t?.total?u(t.to):`${t.value>=0?"+":"−"}${u(Math.abs(t.value))}`},...t?.total?[]:[{key:"running",label:c.runningTotal,color:ys.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */Ae("g",{children:[s&&m.slice(0,-1).map((r,n)=>
|
|
903
|
-
/* @__PURE__ */De("line",{x1:e.end(n),y1:t(r.to),x2:e(n+1),y2:t(r.to),stroke:vs.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${n}`)),m.map((n,a)=>{const l=n.total?ys.neutral:n.value>=0?ys.good:ys.critical,i=Math.min(t(n.from),t(n.to)),s=Math.max(1,Math.abs(t(n.to)-t(n.from)));/* @__PURE__ */
|
|
904
|
-
return De("rect",{x:e(a),y:i,width:Math.max(1,e.bandwidth),height:s,rx:o,fill:l,fillOpacity:null===r||r===a?1:.45},a)})]})})}function kc({values:e,bins:t=10,precomputed:r,height:n=220,width:a,color:l,tone:i,formatBound:o,formatCount:s,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=G().charts,p=Z(),g=o??(e=>Number.isInteger(e)?ee(e,p):te(e,1,p)),f=s??(e=>ee(e,p)),b=c??m.countAxis,x=d??m.distribution,y=r??js(e??[],t),v=ks(0,l,i),w=y.map(e=>g(e.from)),k=y.map(e=>e.count);/* @__PURE__ */
|
|
905
|
-
return De(dc,{labels:w,values:k,height:n,width:a,bandPadding:0,xTickAnchor:"start",formatValue:f,yAxisLabel:b,className:u,emptyLabel:h,ariaLabel:m.histogram(x,y.length,(e??[]).length),tooltip:e=>/* @__PURE__ */De(ic,{title:`${g(y[e].from)} – ${g(y[e].to)}`,rows:[{key:"count",label:m.observations,color:v,value:f(y[e].count)}]}),children:({x:e,y:t,bottom:r,active:n})=>/* @__PURE__ */De("g",{children:y.map((a,l)=>/* @__PURE__ */De("rect",{x:e(l)+.5,y:t(a.count),width:Math.max(1,e.bandwidth-1),height:Math.max(0,r-t(a.count)),fill:v,fillOpacity:null===n||n===l?.85:.42},l))})})}function Nc({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:o,className:s,emptyLabel:c}){const d=G().charts,u=Z(),h=l??(e=>ee(e,u)),m=o??d.distribution,p=ks(0,n,a),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
|
|
906
|
-
return De(dc,{labels:e.map(e=>e.label),values:g,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:s,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
|
|
907
|
-
return De(ic,{title:r.label,rows:[{key:"max",label:d.maximum,color:p,value:h(r.max)},{key:"q3",label:d.q3,color:p,value:h(r.q3)},{key:"median",label:d.median,color:p,value:h(r.median)},{key:"q1",label:d.q1,color:p,value:h(r.q1)},{key:"min",label:d.minimum,color:p,value:h(r.min)}],emphasisKey:"median",footnote:r.outliers?.length?d.outliers(r.outliers.length):void 0})},children:({x:t,y:r,active:n})=>/* @__PURE__ */De("g",{children:e.map((e,a)=>{const l=t.center(a),i=Math.max(6,t.bandwidth);/* @__PURE__ */
|
|
908
|
-
return Ae("g",{opacity:null!==n&&n!==a?.45:1,children:[
|
|
909
|
-
/* @__PURE__ */De("line",{x1:l,y1:r(e.max),x2:l,y2:r(e.q3),stroke:p,strokeWidth:1.5}),
|
|
910
|
-
/* @__PURE__ */De("line",{x1:l,y1:r(e.q1),x2:l,y2:r(e.min),stroke:p,strokeWidth:1.5}),
|
|
911
|
-
/* @__PURE__ */De("line",{x1:l-i/4,y1:r(e.max),x2:l+i/4,y2:r(e.max),stroke:p,strokeWidth:1.5}),
|
|
912
|
-
/* @__PURE__ */De("line",{x1:l-i/4,y1:r(e.min),x2:l+i/4,y2:r(e.min),stroke:p,strokeWidth:1.5}),
|
|
913
|
-
/* @__PURE__ */De("rect",{x:l-i/2,y:r(e.q3),width:i,height:Math.max(1,r(e.q1)-r(e.q3)),rx:2,fill:p,fillOpacity:.22,stroke:p,strokeWidth:1.5}),
|
|
914
|
-
/* @__PURE__ */De("line",{x1:l-i/2,y1:r(e.median),x2:l+i/2,y2:r(e.median),stroke:p,strokeWidth:3}),(e.outliers??[]).map((e,t)=>/* @__PURE__ */De("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:vs.surface,strokeWidth:1.5},t))]},a)})})})}function Mc({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:o,emptyLabel:s}){const c=G().charts,d=Z(),u=a??(e=>Number.isInteger(e)?ee(e,d):te(e,2,d)),h=i??c.price,m=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),p=Math.min(...m),g=Math.max(...m),f=.08*(g-p)||1;/* @__PURE__ */
|
|
915
|
-
return De(dc,{labels:e.map(e=>e.label),values:m,height:r,width:n,min:p-f,max:g+f,bandPadding:.42,formatValue:u,yAxisLabel:l,className:o,emptyLabel:s,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],n=r.close>=r.open,a=n?ys.good:ys.critical;/* @__PURE__ */
|
|
916
|
-
return De(ic,{title:r.label,rows:[{key:"open",label:c.open,color:a,value:u(r.open)},{key:"high",label:c.high,color:a,value:u(r.high)},{key:"low",label:c.low,color:a,value:u(r.low)},{key:"close",label:c.close,color:a,value:u(r.close)}],emphasisKey:"close",footnote:n?c.closedAbove:c.closedBelow})},children:({x:r,y:n,active:a})=>/* @__PURE__ */De("g",{children:e.map((e,l)=>{const i=e.close>=e.open,o=i?ys.good:ys.critical,s=r.center(l),c=Math.max(3,r.bandwidth),d=null!==a&&a!==l,u=n(Math.max(e.open,e.close)),h=Math.max(1,Math.abs(n(e.close)-n(e.open)));/* @__PURE__ */
|
|
917
|
-
return Ae("g",{opacity:d?.45:1,children:[
|
|
918
|
-
/* @__PURE__ */De("line",{x1:s,y1:n(e.high),x2:s,y2:n(e.low),stroke:o,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */De("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__ */Ae(je,{children:[
|
|
919
|
-
/* @__PURE__ */De("line",{x1:s-c/2,y1:n(e.open),x2:s,y2:n(e.open),stroke:o,strokeWidth:2}),
|
|
920
|
-
/* @__PURE__ */De("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function $c({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=G().charts,p=Z(),g=o??(e=>ee(e,p)),f=s??m.intensity,b=d??m.noActivity,x=fe(null),y=Gs(x),v=a??y,w=me(),[k,N]=ge(null);if(xe(()=>{if(null!==k)return I(e=>"Escape"===e.key&&(N(null),!0))},[k]),0===e.length||0===t.length)/* @__PURE__ */
|
|
921
|
-
return De("div",{className:c,ref:x,children:/* @__PURE__ */De("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const M=l??ks(0),$=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=n??L+26+26,A=Math.max(2,(Math.max(97,v)-C)/t.length),j=e=>{const t=$>0?Math.max(0,Math.min(1,e/$)):0;return`color-mix(in oklab, ${M} ${(8+92*t).toFixed(1)}%, ${vs.surface})`};/* @__PURE__ */
|
|
922
|
-
return Ae("div",{className:`relative ${c??""}`,ref:x,children:[
|
|
923
|
-
/* @__PURE__ */Ae("svg",{width:"100%",height:D,viewBox:`0 0 ${v} ${D}`,role:"img","aria-label":m.heatmap(f,e.length,t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>N(null),onBlur:()=>N(null),onKeyDown:r=>{const n="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,a="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===n&&0===a||(r.preventDefault(),N(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+n)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+a))})))},children:[
|
|
924
|
-
/* @__PURE__ */De("defs",{children:/* @__PURE__ */Ae("linearGradient",{id:w,x1:"0",x2:"1",children:[
|
|
925
|
-
/* @__PURE__ */De("stop",{offset:"0",stopColor:j(0)}),
|
|
926
|
-
/* @__PURE__ */De("stop",{offset:"1",stopColor:j($)})]})}),e.map((e,t)=>/* @__PURE__ */De("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:vs.label,children:e},`r${t}`)),e.map((e,n)=>t.map((t,a)=>{const l=r[n]?.[a]??0,i=k&&(k.r!==n||k.c!==a);/* @__PURE__ */
|
|
927
|
-
return De("rect",{x:C+a*A+u/2,y:26*n+u/2,width:Math.max(1,A-u),height:26-u,rx:h,fill:j(l),opacity:i?.55:1,onMouseEnter:()=>N({r:n,c:a}),children:/* @__PURE__ */De("title",{children:`${e} · ${t}: ${g(l)}`})},`${n}-${a}`)})),t.map((e,r)=>r%Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor((v-C)/56))))===0?/* @__PURE__ */De("text",{x:C+r*A+A/2,y:L+15,textAnchor:"middle",fontSize:11,fill:vs.label,children:e},`c${r}`):null),
|
|
928
|
-
/* @__PURE__ */De("rect",{x:C,y:L+26,width:Math.min(180,Math.max(40,v-C)),height:8,rx:4,fill:`url(#${w})`}),
|
|
929
|
-
/* @__PURE__ */De("text",{x:C,y:L+48,fontSize:10.5,fill:vs.label,children:"0"}),
|
|
930
|
-
/* @__PURE__ */De("text",{x:C+Math.min(180,Math.max(40,v-C)),y:L+48,textAnchor:"end",fontSize:10.5,fill:vs.label,style:{fontVariantNumeric:"tabular-nums"},children:g($)})]}),k&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */De(ic,{title:`${e[k.r]} · ${t[k.c]}`,rows:[{key:"v",label:f,color:M,value:null==r[k.r]?.[k.c]?void 0:g(r[k.r][k.c])}]})})]})}function Cc({caption:e,head:t,rows:r}){/* @__PURE__ */
|
|
931
|
-
return Ae("table",{className:"sr-only",children:[
|
|
932
|
-
/* @__PURE__ */De("caption",{children:e}),
|
|
933
|
-
/* @__PURE__ */De("thead",{children:/* @__PURE__ */De("tr",{children:t.map(e=>/* @__PURE__ */De("th",{scope:"col",children:e},e))})}),
|
|
934
|
-
/* @__PURE__ */De("tbody",{children:r.map((e,t)=>/* @__PURE__ */De("tr",{children:e.map((e,t)=>/* @__PURE__ */De("td",{children:e},t))},t))})]})}var Lc=3,Dc=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function Ac({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=G().charts,u=Z(),h=i??(e=>ee(e,u)),m=c??d.nothingToCompare,p=me(),[g,f]=ge(null),{highlighted:b}=Vs(),x=t.slice(0,3);if(e.length<3||0===x.length)/* @__PURE__ */
|
|
935
|
-
return De("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const y=r/2,v=r/2,w=r/2-46,k=Ds(e.length),N=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...x.map(e=>e.values[t]??0).filter(Number.isFinite))),M=(e,t)=>{const r=Math.max(0,Math.min(1,t/N[e])),n=k.center(e)-k.step/2;return[y+w*r*Math.cos(n),v+w*r*Math.sin(n)]},$=(e,t)=>null!==g?g!==e:null!==b&&b!==t,C=null!==g?x[g]:void 0;/* @__PURE__ */
|
|
936
|
-
return Ae("div",{className:`relative ${s??""}`,children:[
|
|
937
|
-
/* @__PURE__ */Ae("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
|
|
938
|
-
/* @__PURE__ */De("title",{id:p,children:d.acrossMeasures(x.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const n=w*(r+1)/l;return"circle"===a?/* @__PURE__ */De("circle",{cx:y,cy:v,r:n,fill:"none",stroke:vs.grid,strokeWidth:1},r):/* @__PURE__ */De("path",{d:Dc(Rs(y,v,n,e.length)),fill:"none",stroke:vs.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,n]=M(t,N[t]);/* @__PURE__ */
|
|
939
|
-
return Ae("g",{children:[
|
|
940
|
-
/* @__PURE__ */De("line",{x1:y,y1:v,x2:r,y2:n,stroke:vs.grid,strokeWidth:1}),
|
|
941
|
-
/* @__PURE__ */De("text",{x:y+(w+18)*Math.cos(k.center(t)-k.step/2),y:v+(w+18)*Math.sin(k.center(t)-k.step/2)+4,textAnchor:"middle",fontSize:11,fill:vs.label,children:e.label})]},e.key)}),
|
|
942
|
-
/* @__PURE__ */De(el,{id:p,reveal:!!o&&"center-out"}),x.map((t,r)=>{const a=ks(r,t.color,t.tone),l=e.map((e,r)=>M(r,t.values[r]??0));/* @__PURE__ */
|
|
943
|
-
return Ae("g",{opacity:$(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:o?`url(#${Ya(p)})`:void 0,children:["area"===n&&/* @__PURE__ */De("path",{d:Dc(l),fill:a,fillOpacity:.18,stroke:"none"}),
|
|
944
|
-
/* @__PURE__ */De("path",{d:Dc(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */De("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:vs.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(ic,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:ks(g,C.color,C.tone),value:h(C.values[t]??0)}))})}),
|
|
945
|
-
/* @__PURE__ */De("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:x.map((e,t)=>/* @__PURE__ */Ae("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
946
|
-
/* @__PURE__ */De("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:ks(t,e.color,e.tone)}}),
|
|
947
|
-
/* @__PURE__ */De("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
948
|
-
/* @__PURE__ */De(Cc,{caption:d.acrossMeasures(x.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:x.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}function jc({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=G().charts,g=Z(),f=o??(e=>ee(e,g)),b=i??p.other,x=m??p.nothingToBreakDown,y=me(),[v,w]=ge(null),{highlighted:k}=Vs(),N=e.filter(e=>e.value>0);if(0===N.length)/* @__PURE__ */return De("p",{className:`text-sm text-gray-500 ${h??""}`,children:x});const M=[...N].sort((e,t)=>t.value-e.value),$=M.slice(0,l),C=M.slice(l),L=C.length>0?[...$,{key:"__other__",label:b,value:C.reduce((e,t)=>e+t.value,0)}]:$,D=L.reduce((e,t)=>e+t.value,0),A=r/2,j=r/2,P=r/2-12,S=n??("ring"===t?.58*P:0),z=Ds(L.length,a),F=Math.max(...L.map(e=>e.value)),B=e=>S+(P-S)*Math.sqrt(Math.max(0,e)/F);let E=-Math.PI/2;const T=(()=>{if("outside"!==d)return[];let e=-Math.PI/2;const r=L.map((r,n)=>{const l="rose"===t?Ds(L.length,a).step:r.value/D*Math.PI*2,i="rose"===t?Ds(L.length,a).center(n):e+l/2;e+=l;const o="rose"===t?B(r.value):P;return{key:r.key,label:r.label,share:r.value/D,right:Math.cos(i)>=0,anchor:[A+o*Math.cos(i),j+o*Math.sin(i)],y:j+(o+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u);for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<15&&(t[e].y=t[e-1].y+15)}return r})(),I=(e,t)=>null!==v?v!==e:null!==k&&k!==t,O=null!==v?L[v]:void 0;/* @__PURE__ */
|
|
949
|
-
return Ae("div",{className:`relative ${h??""}`,children:[
|
|
950
|
-
/* @__PURE__ */Ae("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":y,onMouseLeave:()=>w(null),children:[
|
|
951
|
-
/* @__PURE__ */De("title",{id:y,children:p.breakdown(f(D),L.length)}),L.map((e,r)=>{const n=ks(r,e.color,e.tone),l="rose"===t?z(r):E,i="rose"===t?z.step:e.value/D*Math.PI*2-a;"rose"!==t&&(E+=e.value/D*Math.PI*2);const o=l+Math.max(.001,i),s="rose"===t?B(e.value):P;/* @__PURE__ */
|
|
952
|
-
return De("path",{d:Ws(A,j,S,s,l,o),fill:n,fillOpacity:I(r,e.key)?.4:1,stroke:vs.surface,strokeWidth:1,className:c?rl.sweep:void 0,style:c?nl(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),T.map(e=>{const t=e.right?r-6:6,n=e.right?r-58:58;/* @__PURE__ */
|
|
953
|
-
return Ae("g",{children:[
|
|
954
|
-
/* @__PURE__ */De("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${n},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:vs.grid,strokeWidth:1}),
|
|
955
|
-
/* @__PURE__ */De("text",{x:t,y:e.y-2,fontSize:10.5,fill:vs.label,textAnchor:e.right?"end":"start",children:e.label}),
|
|
956
|
-
/* @__PURE__ */De("text",{x:t,y:e.y+10,fontSize:10.5,fontWeight:600,fill:vs.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:re(100*e.share,1,g)})]},`lbl-${e.key}`)}),s&&S>0&&/* @__PURE__ */De("text",{x:A,y:j+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:vs.label,children:s})]}),O&&null!==v&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(ic,{title:O.label,rows:[{key:"value",label:p.value,color:ks(v,O.color,O.tone),value:f(O.value)},{key:"share",label:p.share,color:vs.muted,value:re(O.value/D*100,1,g)}]})}),
|
|
957
|
-
/* @__PURE__ */De("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:L.map((e,t)=>/* @__PURE__ */Ae("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
958
|
-
/* @__PURE__ */De("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:ks(t,e.color,e.tone)}}),
|
|
959
|
-
/* @__PURE__ */De("span",{className:"flex-1 truncate",children:e.label}),
|
|
960
|
-
/* @__PURE__ */De("span",{className:"tabular-nums text-gray-800",children:re(e.value/D*100,1,g)})]},e.key))})]})}var Pc=300*Math.PI/180;function Sc({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:o,trackGap:s=6}){const c=G().charts,d=Z(),u=a??(e=>ee(e,d)),h=o??c.nothingToPlot,m=me(),[p,g]=ge(null),{highlighted:f}=Vs();if(0===e.length)/* @__PURE__ */return De("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const b=r/2,x=r/2,y=r/2-10,v=n??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(y-.16*r)/e.length):0,k=Math.max(1,Math.floor((y-.16*r)/w||1)),N="track"===t?e.slice(0,k):e,M=Math.min(s,Math.max(1,w-2)),$=Ds(N.length,.03),C=null!==p?N[p]:void 0;/* @__PURE__ */
|
|
961
|
-
return Ae("div",{className:`relative ${i??""}`,children:[
|
|
962
|
-
/* @__PURE__ */Ae("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
|
|
963
|
-
/* @__PURE__ */De("title",{id:m,children:"track"===t?c.radialTrack(N.length):c.radialCycle(N.length)}),N.map((e,n)=>{const a=ks(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=y-n*w,r=t-w+M,s=-Math.PI/2;/* @__PURE__ */
|
|
964
|
-
return Ae("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),className:l?rl.sweep:void 0,style:l?nl(n,70):void 0,children:[
|
|
965
|
-
/* @__PURE__ */De("path",{d:Ws(b,x,r,t,s,s+Pc),fill:vs.grid}),
|
|
966
|
-
/* @__PURE__ */De("path",{d:Ws(b,x,r,t,s,s+Pc*i),fill:a})]},e.key)}const s=.14*r;/* @__PURE__ */
|
|
967
|
-
return De("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */De("path",{d:Ws(b,x,s,s+(y-s)*i,$(n),$(n)+$.step),fill:a})},e.key)})]}),C&&null!==p&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(ic,{title:C.label,rows:[{key:"value",label:c.value,color:ks(p,C.color,C.tone),value:u(C.value)}]})}),
|
|
968
|
-
/* @__PURE__ */De("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__ */Ae("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
969
|
-
/* @__PURE__ */De("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:ks(t,e.color,e.tone)}}),
|
|
970
|
-
/* @__PURE__ */De("span",{className:"flex-1 truncate",children:e.label}),
|
|
971
|
-
/* @__PURE__ */De("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function zc({stages:e,shape:t="funnel",height:r,width:n=560,gap:a=4,formatValue:l,color:i,className:o,emptyLabel:s}){const c=G().charts,d=Z(),u=l??(e=>ee(e,d)),h=s??c.noStages,m=me(),[p,g]=ge(null),{highlighted:f}=Vs();if(0===e.length)/* @__PURE__ */return De("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const b=i??ks(0),x=r??54*e.length,y=Math.max(...e.map(e=>e.value),1),v=168,w=n-v,k=e=>w*Math.max(0,e/y)/2,N=v+w/2,M=t=>46+t/Math.max(1,e.length-1)*54,$=e=>`color-mix(in oklab, ${b} ${M(e).toFixed(0)}%, ${vs.surface})`,C=e=>M(e)>=55?vs.surface:vs.label,L=(e,t)=>null!==p?p!==e:null!==f&&f!==t,D=null!==p?e[p]:void 0;/* @__PURE__ */
|
|
972
|
-
return Ae("div",{className:`relative ${o??""}`,children:[
|
|
973
|
-
/* @__PURE__ */Ae("svg",{width:"100%",height:x,viewBox:`0 0 ${n} ${x}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
|
|
974
|
-
/* @__PURE__ */De("title",{id:m,children:c.funnel(e.length,u(e[0].value),u(e[e.length-1].value))}),e.map((r,n)=>{const l=n*x/e.length+a/2,i=(n+1)*x/e.length-a/2,o=k(r.value),s="cone"===t?k(e[n+1]?.value??r.value):o,c=e[n-1]?.value,h=null!=c&&c>0?100*(1-r.value/c):null;/* @__PURE__ */
|
|
975
|
-
return Ae("g",{opacity:L(n,r.key)?.45:1,onMouseEnter:()=>g(n),children:[
|
|
976
|
-
/* @__PURE__ */De("path",{d:`M${N-o},${l} L${N+o},${l} L${N+s},${i} L${N-s},${i} Z`,fill:$(n)}),
|
|
977
|
-
/* @__PURE__ */De("text",{x:154,y:(l+i)/2-2,textAnchor:"end",fontSize:12,fill:vs.label,children:r.label}),
|
|
978
|
-
/* @__PURE__ */Ae("text",{x:154,y:(l+i)/2+14,textAnchor:"end",fontSize:11,fill:vs.muted,style:{fontVariantNumeric:"tabular-nums"},children:[u(r.value),null!=h?` · −${re(h,1,d)}`:""]}),
|
|
979
|
-
/* @__PURE__ */De("text",{x:N,y:(l+i)/2+4,textAnchor:"middle",fontSize:11.5,fontWeight:600,fill:C(n),style:{fontVariantNumeric:"tabular-nums"},children:re(r.value/(e[0].value||1)*100,0,d)})]},r.key)})]}),D&&null!==p&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(ic,{title:D.label,rows:[{key:"value",label:c.count,color:$(p),value:u(D.value)},{key:"share",label:c.ofFirstStage,color:vs.muted,value:re(D.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:ys.critical,value:`−${re(100*(1-D.value/e[p-1].value),1,d)}`}]:[]]})})]})}function Fc({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:o,emptyLabel:s}){const c=G().charts,d=Z(),u=l??(e=>ee(e,d)),h=s??c.nothingToBreakDown,m=fe(null),p=Gs(m),g=r??p,[f,b]=ge(null),{highlighted:x}=Vs(),y=Ks(e,g,t);if(0===y.length)/* @__PURE__ */
|
|
980
|
-
return De("div",{className:o,ref:m,children:/* @__PURE__ */De("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??ks(0),w=Math.max(...y.map(e=>e.value),1),k=e=>34+e/w*62,N=e=>`color-mix(in oklab, ${v} ${k(e).toFixed(0)}%, ${vs.surface})`,M=e=>k(e)>=55?vs.surface:vs.label,$=f??x,C=f?y.find(e=>e.key===f):void 0;/* @__PURE__ */
|
|
981
|
-
return Ae("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
982
|
-
/* @__PURE__ */De("svg",{width:"100%",height:t,viewBox:`0 0 ${g} ${t}`,role:"img","aria-label":c.treemap(e.length),onMouseLeave:()=>b(null),children:y.map(e=>{const t=Math.max(0,e.width-n),r=Math.max(0,e.height-n),l=t>6.2*e.label.length+12&&r>30,i=l&&r>44;/* @__PURE__ */
|
|
983
|
-
return Ae("g",{opacity:$&&$!==e.key?.55:1,onMouseEnter:()=>b(e.key),children:[
|
|
984
|
-
/* @__PURE__ */De("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:N(e.value)}),l&&/* @__PURE__ */De("text",{x:e.x+n/2+8,y:e.y+n/2+18,fontSize:11.5,fontWeight:600,fill:M(e.value),children:e.label}),i&&/* @__PURE__ */De("text",{x:e.x+n/2+8,y:e.y+n/2+34,fontSize:11,fill:M(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(ic,{title:C.label,rows:[{key:"value",label:c.value,color:N(C.value),value:u(C.value)}]})}),
|
|
985
|
-
/* @__PURE__ */De(Cc,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function Bc(e,t,r,n,a,l,i,o){if(n>=8)return;const s=e.reduce((e,t)=>e+Ec(t,8-n),0);if(s<=0)return;let c=t;e.forEach((e,t)=>{const d=Ec(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&&Bc(e.children,c,u,n+1,m,p,h,o),c+=u})}function Ec(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+Ec(r,t-1),0):Math.max(0,e.value??0)}function Tc({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:o}){const s=G().charts,c=Z(),d=a??(e=>ee(e,c)),u=o??s.nothingToBreakDown,[h,m]=ge(null),{highlighted:p}=Vs(),g=[];if(Bc(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return De("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,b=t/2,x=t/2,y=(t/2-8-r)/f,v=g.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),w=e=>`color-mix(in oklab, ${ks(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${vs.surface})`,k=e=>null!==h?e.id===h:null===p||e.branchKey===p,N=h?g.find(e=>e.id===h):void 0,M=e=>re(e.value/v*100,1,c);/* @__PURE__ */
|
|
986
|
-
return Ae("div",{className:`relative ${i??""}`,children:[
|
|
987
|
-
/* @__PURE__ */Ae("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__ */De("path",{d:Ws(b,x,r+e.depth*y+n/2,r+(e.depth+1)*y-n/2,e.start,e.end),fill:w(e),fillOpacity:k(e)?1:.45,stroke:vs.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */De("text",{x:b,y:x+5,textAnchor:"middle",fontSize:15,fontWeight:600,fill:vs.label,children:l})]}),N&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(ic,{title:N.label,rows:[{key:"value",label:s.value,color:w(N),value:d(N.value)},{key:"share",label:s.share,color:vs.muted,value:M(N)}]})}),
|
|
988
|
-
/* @__PURE__ */De(Cc,{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),M(e)])})]})}function Ic({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:o,emptyLabel:s}){const c=G().charts,d=Z(),u=i??(e=>ee(e,d)),h=s??c.noFlows,m=fe(null),p=Gs(m),g=n??p,[f,b]=ge(null),{highlighted:x}=Vs();if(0===e.length||0===t.length)/* @__PURE__ */
|
|
989
|
-
return De("div",{className:o,ref:m,children:/* @__PURE__ */De("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const y=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>y.length<=1?0:y.indexOf(e)/(y.length-1)*(g-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),k=/* @__PURE__ */new Map;for(const t of e)k.set(t.depth,[...k.get(t.depth)??[],t]);const N=Math.max(...[...k.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),M=r-20,$=N>0?(M-l*(Math.max(...[...k.values()].map(e=>e.length))-1))/N:0,C=/* @__PURE__ */new Map;for(const[e,t]of k){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*$)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>M&&a>0?Math.max(0,1-(n-M)/a):1;let 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,A=/* @__PURE__ */new Map,j=(e,t)=>e.from===t||e.to===t,P="link"===f?.kind?t[f.index]:void 0,S="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
|
|
990
|
-
return Ae("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
991
|
-
/* @__PURE__ */Ae("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>b(null),children:[t.map((e,t)=>{const r=C.get(e.from),n=C.get(e.to);if(!r||!n)return null;const l=Math.max(1,e.value*$),i=r.y+(L.get(e.from)??0)+l/2,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=ks(r.index,e.color),u=`${e.from}→${e.to}`,h=A.get(u)??0;A.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:j(e,f.key):null!==x?j(e,x):null)(e,t);/* @__PURE__ */
|
|
992
|
-
return De("path",{d:Es([[s,i],[c,o]]),fill:"none",stroke:d,strokeWidth:l,strokeOpacity:null===m||m?.42:.12,onMouseEnter:()=>b({kind:"link",index:t})},h?`${u}#${h}`:u)}),e.map(e=>{const r=C.get(e.key);if(!r)return null;const n=r.x>g/2,l=(i=e.key,f?"node"===f.kind?f.key===i:j(t[f.index],i):null!==x?x===i:null);var i;/* @__PURE__ */
|
|
993
|
-
return Ae("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>b({kind:"node",key:e.key}),children:[
|
|
994
|
-
/* @__PURE__ */De("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:ks(r.index,e.color,e.tone)}),
|
|
995
|
-
/* @__PURE__ */De("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:vs.label,children:e.label})]},e.key)})]}),P&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(ic,{title:`${P.from} → ${P.to}`,rows:[{key:"value",label:c.flow,color:ks(C.get(P.from)?.index??0,P.color),value:u(P.value)}]})}),S&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(ic,{title:S.label,rows:[{key:"value",label:c.throughput,color:ks(C.get(S.key)?.index??0,S.color,S.tone),value:u(w.get(S.key)??0)}]})}),
|
|
996
|
-
/* @__PURE__ */De(Cc,{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 Oc({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=G().charts,d=Z(),u=i??(e=>ee(e,d)),h=s??c.noFlows,[m,p]=ge(null),{highlighted:g}=Vs(),f=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},b=e.map((t,r)=>e.reduce((e,t,n)=>e+f(r,n)+f(n,r),0)),x=e.map((e,t)=>t).sort((e,t)=>b[t]-b[e]).slice(0,n),y=x.reduce((e,t)=>e+b[t],0);if(y<=0)/* @__PURE__ */return De("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const v=r/2,w=r/2,k=r/2-44,N=k-l,M=a*x.length,$=/* @__PURE__ */new Map;let C=-Math.PI/2;x.forEach((e,t)=>{const r=b[e]/y*(2*Math.PI-M);$.set(e,{start:C,end:C+r,slot:t}),C+=r+a});const L=/* @__PURE__ */new Map,D=[];for(const e of x)for(const t of x){const r=f(e,t);if(r<=0)continue;const n=$.get(e),a=r/Math.max(1,b[e])*(n.end-n.start),l=L.get(e)??0;L.set(e,l+a),D.push({from:e,to:t,value:r,a:n.start+l+a/2,b:$.get(t).start+($.get(t).end-$.get(t).start)/2})}const A=(e,t)=>[v+t*Math.cos(e),w+t*Math.sin(e)],j="arc"===m?.kind?m.index:void 0,P="ribbon"===m?.kind?D[m.index]:void 0;/* @__PURE__ */
|
|
997
|
-
return Ae("div",{className:`relative ${o??""}`,children:[
|
|
998
|
-
/* @__PURE__ */Ae("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord(x.length),onMouseLeave:()=>p(null),children:[D.map((t,n)=>{const[a,l]=A(t.a,N),[i,o]=A(t.b,N),s=ks($.get(t.from).slot),c=((t,r)=>m?"ribbon"===m.kind?m.index===r:m.index===t.from||m.index===t.to:null!==g?e[t.from]===g||e[t.to]===g:null)(t,n);/* @__PURE__ */
|
|
999
|
-
return De("path",{d:`M${a},${l} Q${v},${w} ${i},${o}`,fill:"none",stroke:s,strokeWidth:Math.max(1,t.value/y*r*.9),strokeOpacity:null===c||c?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:n})},`${e[t.from]}→${e[t.to]}`)}),x.map(t=>{const r=$.get(t),n=(r.start+r.end)/2,[a,l]=A(n,k+16),i=(t=>m?"arc"===m.kind?m.index===t:D[m.index].from===t||D[m.index].to===t:null!==g?e[t]===g:null)(t);/* @__PURE__ */
|
|
1000
|
-
return Ae("g",{onMouseEnter:()=>p({kind:"arc",index:t}),children:[
|
|
1001
|
-
/* @__PURE__ */De("path",{d:Ws(v,w,N,k,r.start,r.end),fill:ks(r.slot),fillOpacity:null===i||i?1:.45}),
|
|
1002
|
-
/* @__PURE__ */De("text",{x:a,y:l+4,fontSize:11,fill:vs.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==j&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(ic,{title:e[j],rows:[{key:"total",label:c.totalFlow,color:ks($.get(j).slot),value:u(b[j])}]})}),P&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(ic,{title:`${e[P.from]} → ${e[P.to]}`,rows:[{key:"value",label:c.flow,color:ks($.get(P.from).slot),value:u(P.value)}]})}),
|
|
1003
|
-
/* @__PURE__ */De(Cc,{caption:c.chord(x.length),head:[c.tableFrom,c.tableTo,c.value],rows:D.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{Vi as APP_UPDATE_POLL_MS,fa as Accordion,Zi as AppUpdateBanner,pn as AttachButton,hn as AttachmentDropZone,mn as AttachmentList,_o as AuthScreen,na as Avatar,aa as AvatarGroup,sa as Banner,go as BarChart,Nc as BoxPlotChart,Mt as BrandAssetEditor,Ha as BudgetBar,vs as CHART_INK,ns as CORNERS,Ot as Calendar,Mc as CandlestickChart,vn as Card,dc as CartesianPlot,sc as ChartBrush,el as ChartDefs,oc as ChartDot,lc as ChartFrame,Us as ChartHighlightProvider,rc as ChartSkeleton,ic as ChartTooltip,Io as ChatTemplate,tt as Checkbox_default,So as CheckoutTemplate,Oc as ChordChart,sn as ColorPicker,ln as ColorPickerPanel,tn as ColorSwatch,Ca as ColoredBadge,bc as ColumnChart,gn as ComposerAttachments,Jl as ContainerFillChart,Ni as ContextMenu,Gn as CountBadge,_a as DAY_MS,Mo as DashboardTemplate,uo as DataTable,Do as DataTablePage,ir as DatePicker_default,Zt as DateRangePicker,dr as DateTimePicker_default,Vn as DescriptionList,On as Divider,bo as DonutChart,Qi as Drawer,wi as DropdownMenu,Bo as EmailTemplate,La as EmptyState,ms as EmptyValue,Vo as ErrorBoundary,qo as ErrorPage,cn as FilePicker_default,ot as FormErrorSummary,at as FormField,jo as FormLayoutPage,zc as FunnelChart,ba as GROUP_COLORS,xa as GROUP_COLORS_SOLID,Wo as GalleryTemplate,Tn as Grid,$c as HeatmapChart,di as HelpCenter,on as HexInput,kc as HistogramChart,Ee as INPUT_BASE,Be as INPUT_SIZES,Se as IconButton_default,qi as IconRail,Ui as IconRailButton,zn as Inline,Ir as InputNumber_default,Oe as Input_default,eo as Kanban,dt as Label,hs as LanguagePanel,us as LanguageSelect,yo as LineChart,ho as ListFooter,mo as ListLoadError,Wi as ListRow,yr as MAX_FRACTION_DIGITS,rl as MOTION,si as Markdown,Nt as MediaUploadField,Pt as MediaUploadGrid,Qs as Meter,Ia as MetricBar,_l as MilestoneTimeline,Ge as NativeSelect,Nr as NumericKeypad,Kl as POST_PRODUCTION_STATUSES,Da as PageHeader,ro as Pagination,dn as PaperclipGlyph,Dn as Paragraph,jc as PieChart,_r as Popover,Dt as PortalBrandingProvider,Gl as ProductionTimeline,Lc as RADAR_SERIES_CAP,Ac as RadarChart,Sc as RadialBarChart,it as RadioGroup,nt as Radio_default,vc as RangeChart,Xs as RankedBars,xc as SCATTER_SERIES_CAP,bs as SERIES_SLOT_COUNT,xs as SERIES_VARS,ql as STAGES,ys as STATUS_VARS,Ic as SankeyChart,yc as ScatterChart,bn as SearchableSelect,Ar as Segmented,Qe as Select_default,Yn as SettingRow,hi as SidebarActionButton,pi as SidebarGroupLabel,bi as SidebarNavGroup,fi as SidebarNavItem,Hn as Skeleton,Wr as Slider,xr as Snippet,Ri as SortableList,po as Sparkline,Sn as Stack,wn as StatCard,tc as StatTile,Qn as Statistic,$a as StatusBadge,Na as StatusBadgeProvider,ga as Stepper,Tc as SunburstChart,zr as Switch_default,ma as Tabs,xn as TagInput,$n as Text,Re as Textarea_default,$r as TileButton_default,ps as TimeAgo,Qt as TimePicker_default,fc as TimeSeriesChart,Wl as TimelineTrack,Ln as Title,xi as TopNav,Si as Tree,Ti as TreeEmptySlot,zi as TreeGroup,Fi as TreeGroupLabel,Ei as TreeRow,Ii as TreeSeam,Fc as TreemapChart,wc as WaterfallChart,Ds as angleScale,vr as appendKey,ls as applyCorners,is as applyIconSet,os as applyThemePrefs,Ws as arcPath,Os as areaBetween,Is as areaFrom,Zs as autoHighlightIndex,wr as backspace,Ms as bandScale,js as binValues,Ra as budgetState,Es as bumpPath,Ul as calcOverall,Vl as calcReportOverall,Qr as colorFill,en as colorSwatchClasses,mr as copyToClipboard,Ts as curvePath,Xa as dashFor,Ga as fillFor,Ua as fillId,We as firstEnabledIndex,qa as fmtSliderDate,Ft as fromKey,Va as glowId,Za as groundId,ya as groupColors,Yr as hexToHsv,Ys as highlightOpacity,Zr as hsvToHex,Ie as inputClasses,ja as isSeverityTone,ct as labelClasses,$s as ladderScale,ds as languageSelectWidth,He as lastEnabledIndex,Ss as linearPath,Ns as linearScale,Ls as logScale,Ya as maskId,Ke as matchTypeahead,ht as mediaFileName,Fs as monotonePath,_e as nextEnabledIndex,Cs as niceMax,qr as parseHexColor,Rs as polygonPoints,As as radiusScale,as as resolveCorners,$t as resolvePortalBrandAsset,ks as resolveSeriesColor,es as resolveTheme,ur as selectionAt,ws as seriesColor,Pa as severityOf,Bs as splinePath,Ks as squarify,nl as stagger,zs as stepPath,ca as tabButtonId,da as tabPanelId,Ka as toDayMs,_t as toISODate,zt as toKey,Yi as useAppUpdate,fs as useClickOutside,Mi as useContextMenu,gs as useDebouncedValue,Vs as useHighlight,Gs as usePlotWidth,At as usePortalBranding,Yl as useProductionTimeline,Ma as useStatusLabel,ss as useTheme};
|