efficient-shell 5.2.0 → 5.6.1
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 +165 -33
- package/THIRD_PARTY_NOTICES.md +32 -0
- package/dist/{Browser-FKZ6M2MK.js → Browser-RXGEZ77D.js} +17 -17
- package/dist/Calculator-MVPKTZZF.js +29 -0
- package/dist/ConfirmDialog-XOYCYFA7.js +1 -0
- package/dist/{CurrencyConverter-OV5ZQIAJ.js → CurrencyConverter-2IGOOR3I.js} +8 -8
- package/dist/{Documents-HGGL3AWI.js → Documents-YBLR7WVX.js} +27 -27
- package/dist/Files-7XNR5IL2.js +87 -0
- package/dist/{Notepad-PO724TVP.js → Notepad-ZQYQXV75.js} +13 -13
- package/dist/PdfViewer-SQVMMA7B.js +1 -0
- package/dist/{PomodoroTimer-LN5MYRZO.js → PomodoroTimer-XIUN4M73.js} +19 -19
- package/dist/{Preview-CUOO5WQ7.js → Preview-YCOA5JPP.js} +129 -129
- package/dist/Sidebar-VI7E3EKI.js +44 -0
- package/dist/{Spreadsheet-2N2JXBCY.js → Spreadsheet-SRAUU3OA.js} +14 -14
- package/dist/{Stock-65WVUGLI.js → Stock-7EKOAQ7C.js} +3 -3
- package/dist/{Weather-TXJICMJN.js → Weather-RWI6NKB2.js} +16 -16
- package/dist/{WorldClock-RIHLKZGC.js → WorldClock-CEHWDFEO.js} +6 -6
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-TKFAFZRY.js → chunk-3HJTOINK.js} +1 -1
- package/dist/{chunk-YJ6JMGMS.js → chunk-4SWPNARR.js} +4 -4
- package/dist/{chunk-Y553QKEH.js → chunk-5ABLFFC5.js} +15 -15
- package/dist/{chunk-JJIPGAXI.js → chunk-6LTDJKIL.js} +72 -71
- package/dist/{chunk-BFFXVA53.js → chunk-7WC3EOFS.js} +1 -1
- package/dist/chunk-AP2QEJXQ.js +1 -0
- package/dist/{chunk-3PTA2C74.js → chunk-CLPJDJH4.js} +1 -1
- package/dist/{chunk-R3622MOL.js → chunk-F6B3J3GW.js} +1 -1
- package/dist/{chunk-UG4ZPXXU.js → chunk-GG7AE6OC.js} +1 -1
- package/dist/{chunk-MTH7EAH3.js → chunk-IMMHJIV5.js} +21 -21
- package/dist/{chunk-ML22KF7T.js → chunk-JXAAZGLJ.js} +1 -1
- package/dist/{chunk-BFUBBDU6.js → chunk-KXAUDC3A.js} +26 -26
- package/dist/{chunk-KHJ5XSEH.js → chunk-N3A3GWJI.js} +8 -8
- package/dist/{chunk-UAJQB45Y.js → chunk-P4CIOJHP.js} +3 -3
- package/dist/{chunk-6GV4467L.js → chunk-RBDGN4YU.js} +5 -5
- package/dist/chunk-RC2EG6P4.js +1026 -0
- package/dist/{chunk-YQI7KXX3.js → chunk-RL626E7Q.js} +2 -2
- package/dist/{chunk-HIAHERCD.js → chunk-RMJZOKHY.js} +9 -9
- package/dist/chunk-SFCDHHQP.js +1 -0
- package/dist/{chunk-M4OGNYOM.js → chunk-SKB6L53D.js} +11 -11
- package/dist/{chunk-H3UEYXRA.js → chunk-TFETN2GI.js} +1 -1
- package/dist/chunk-TNBCUZVE.js +1 -0
- package/dist/{chunk-TLTFS2D6.js → chunk-VWBQ2P5G.js} +56 -56
- package/dist/chunk-WOEFPBQF.js +1 -0
- package/dist/{chunk-ASSDCWKP.js → chunk-WWF2EQXF.js} +1 -1
- package/dist/chunk-XWSWYMGM.js +2 -0
- package/dist/{chunk-SSBOC52S.js → chunk-YGC7AX3X.js} +9 -9
- package/dist/{chunk-QZNRMJE6.js → chunk-YIH6JLMV.js} +2 -2
- package/dist/{chunk-OTP5WPI4.js → chunk-Z7D6Y5WA.js} +16 -16
- package/dist/file-intake/index.js +1 -1
- package/dist/format/index.d.ts +1 -1
- package/dist/format/index.js +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/icons/efficient-looks.d.ts +28 -0
- package/dist/icons/efficient-looks.js +920 -0
- package/dist/icons/efficient.d.ts +746 -298
- package/dist/icons/efficient.js +336 -470
- package/dist/icons/heroicons.d.ts +1 -1
- package/dist/icons/index.d.ts +10 -4
- package/dist/icons/index.js +1 -1
- package/dist/icons/lucide.d.ts +1 -1
- package/dist/{index-DpUDK9zG.d.ts → index-CHufemKB.d.ts} +69 -1
- package/dist/{index-Dk5VKml6.d.ts → index-ZI6vl2Wq.d.ts} +367 -78
- package/dist/index.d.ts +5 -5
- package/dist/index.js +231 -231
- package/dist/locales/zh-Hans.d.ts +1 -1
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +7 -7
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/{registry-FHdUeVww.d.ts → registry-J-TU7zKx.d.ts} +14 -4
- package/dist/{strings-aKfRDZWB.d.ts → strings-BVB64Nck.d.ts} +26 -0
- package/dist/ui/index.d.ts +4 -4
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +61 -1
- package/package.json +8 -2
- package/dist/Calculator-LBFBTFSD.js +0 -29
- package/dist/ConfirmDialog-JAEFVRJM.js +0 -1
- package/dist/Files-DAQKIF6W.js +0 -87
- package/dist/PdfViewer-6ALXGVTV.js +0 -1
- package/dist/Sidebar-T4ABK2WV.js +0 -44
- package/dist/chunk-4QBLTEFU.js +0 -1
- package/dist/chunk-AJB5G52B.js +0 -1
- package/dist/chunk-FWOPZB6I.js +0 -1
- package/dist/chunk-PS6PSCOR.js +0 -1018
- package/dist/chunk-YKZHOXI4.js +0 -2
package/dist/chunk-PS6PSCOR.js
DELETED
|
@@ -1,1018 +0,0 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-R3622MOL.js";import{SidebarLayout as t}from"./chunk-YJ6JMGMS.js";import{BrandMark as r}from"./chunk-M4OGNYOM.js";import{useShellLanguage as a}from"./chunk-UG4ZPXXU.js";import{toast_default as n}from"./chunk-TKFAFZRY.js";import{useIsMobile as l,useShortcutLabel as i,useShellPrefs as s}from"./chunk-SSBOC52S.js";import{isAriaDisabled as o,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 N,placeAtPoint as k}from"./chunk-OGXU7QFW.js";import{useTabLayer as $,focusableIn as M,useFocusTrap as C,useScrollLock as L,stopAfter as D}from"./chunk-MTH7EAH3.js";import{PopupMenu as P,MenuSemanticsContext as A,leavesContextMenuAlone as S,PopupMenuDivider as j,PopupMenuLabel as z,itemLook as F,MenuCheckMark as E}from"./chunk-HIAHERCD.js";import{useDismissPopupsOnOpen as O}from"./chunk-AFYQTVZO.js";import{glassStyle as T}from"./chunk-HZZNJHRH.js";import{registerModalEscapeInterceptor as B,onOverlayOpen as I,Z_LAYERS as R}from"./chunk-X4FJ54PP.js";import{useBrowserLayoutEffect as W,useBrowserValue as K,useHydrated as H,useBrowserValueOnce as _,useBrowserState as q}from"./chunk-D65T4H6J.js";import{ChevronUpDownFallback as U,DateFallback as V,ChevronLeftFallbackB as Y,ChevronRightFallbackB as G,ChevronUpFallback as X,ChevronDownFallback as Z,CloseFallbackB as J,CheckFallback as Q,DateFallbackB as ee,EyeFallback as te,EyeOffFallback as re,LinkFallback as ae,AttachFallback as ne,ChevronDownFallbackB as le,CloseFallbackC as ie,InboxFallback as se,PauseFallback as oe,PlayFallback as ce,SearchFallbackB as de,AddFallbackB as ue,WarningFallbackB as he,SearchFallbackC as me,GlobeFallbackB as pe,UploadFallback as ge,CheckFallbackC as fe,CopyFallback as be,PageFallbackB as xe,InfoFallbackB as ye,CloseCircleFallbackB as ve,WarningFallbackC as we,CheckCircleFallbackB as Ne,ChevronRightFallbackC as ke,CloseFallbackD as $e,CheckFallbackD as Me,CameraFallback as Ce}from"./chunk-JJIPGAXI.js";import{useFileIntake as Le,humanSize as De,FileIntakeAlert as Pe}from"./chunk-3PTA2C74.js";import{useShellLocale as Ae,useShellStrings as Se,DEFAULT_SHELL_STRINGS as je,currentShellStrings as ze,splitAround as Fe}from"./chunk-AJB5G52B.js";import{formatPlain as Ee,formatFixed as Oe,formatPercent as Te}from"./chunk-C3QOHMR6.js";import{calendarNames as Be,firstDayOfWeek as Ie,formatDate as Re,EMPTY_VALUE as We,toInstant as Ke,timeAgo as He,formatDateTime as _e}from"./chunk-W32SKK3D.js";import{Icon as qe,setIconSet as Ue}from"./chunk-YKZHOXI4.js";import{forwardRef as Ve,useId as Ye,useCallback as Ge,useState as Xe,useRef as Ze,useMemo as Je,useEffect as Qe,createContext as et,Children as tt,isValidElement as rt,cloneElement as at,useContext as nt,Fragment as lt,Component as it,useSyncExternalStore as st,useLayoutEffect as ot}from"react";import{jsx as ct,jsxs as dt,Fragment as ut}from"react/jsx-runtime";import{createPortal as ht}from"react-dom";var mt=Ve(function({children:e,variant:t="ghost",size:r="md",type:a="button",className:n="",pressed:l,disabledReason:i,disabled:s,onClick:m,"aria-disabled":p,"aria-describedby":g,...f},b){const x=Ye(),y=(Boolean(s)||o(p))&&null!=i&&""!==i,v=y||o(p),w=/* @__PURE__ */ct("button",{ref:b,type:a,className:u({variant:t,size:r,pressed:l??(!0===f["aria-pressed"]||"true"===f["aria-pressed"]),className:n}),...f,disabled:y?void 0:s,"aria-disabled":!!v||p,"aria-describedby":d(g,y?x:void 0),onClick:v?c:m,children:e});return y?/* @__PURE__ */ct(h,{reason:i,id:x,children:w}):w}),pt="block w-full rounded-(--radius-control) border border-gray-300 bg-white",gt="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)]",ft={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"},bt=`${pt} ${ft.md} ${gt}`,xt="disabled:cursor-not-allowed disabled:opacity-60";function yt(e){return[e?.readOnly?`block w-full rounded-(--radius-control) border border-gray-300 bg-gray-50 ${ft[e.size??"md"]} ${gt}`:e?.size&&"md"!==e.size?`${pt} ${ft[e.size]} ${gt}`:bt,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",xt,e?.className??""].filter(Boolean).join(" ")}var vt=Ve(function({invalid:e,leftIcon:t,rightAdornment:r,size:a,className:n="",readOnly:l,...i},s){const o=`${t?"pl-9":""} ${r?"pr-9":""}`.trim(),c=
|
|
2
|
-
/* @__PURE__ */ct("input",{ref:s,"aria-invalid":e||void 0,readOnly:l,className:yt({invalid:e,size:a,readOnly:l,className:[o,n].filter(Boolean).join(" ")}),...i});return t||r?/* @__PURE__ */dt("div",{className:"relative",children:[t&&/* @__PURE__ */ct("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:t}),c,r&&/* @__PURE__ */ct("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):c}),wt=Ve(function({invalid:e,autoGrow:t,className:r="",onInput:a,rows:n=3,size:l,readOnly:i,...s},o){const c=Ge(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}a?.(e)},[t,a]);/* @__PURE__ */
|
|
3
|
-
return ct("textarea",{ref:o,"aria-invalid":e||void 0,rows:n,onInput:c,readOnly:i,className:yt({invalid:e,size:l,readOnly:i,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...s})});function Nt(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function kt(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function $t(e,t,r){let a=t+r;for(;a>=0&&a<e.length;){if(!e[a].disabled)return a;a+=r}return t>=0&&t<e.length&&!e[t].disabled?t:r>0?Nt(e):kt(e)}function Mt(e,t,r){const a=t.toLowerCase(),n=e.length;if(!a||0===n)return-1;for(let t=1;t<=n;t++){const l=((r+t)%n+n)%n,i=e[l];if(!i.disabled&&i.label.toLowerCase().startsWith(a))return l}return-1}var Ct=e=>Array.isArray(e.options);function Lt(e){const t=[];for(const r of e)Ct(r)?t.push(...r.options):t.push(r);return t}function Dt(e,t){const r=[];for(const a of e){if(!Ct(a)){t(a)&&r.push(a);continue}const e=a.options.filter(t);e.length&&r.push({...a,options:e})}return r}function Pt(e,t,r,a=""){const n=[];let l=0;return e.forEach((e,i)=>{if(!Ct(e))return n.push(t(e,l)),void(l+=1);const s=`${r}-group-${i}`,o=l;l+=e.options.length,n.push(
|
|
4
|
-
/* @__PURE__ */dt("div",{role:"group","aria-labelledby":s,children:[
|
|
5
|
-
/* @__PURE__ */ct("div",{id:s,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${a}`.trim(),children:e.label}),e.options.map((e,r)=>t(e,o+r))]},s))}),n}function At({selected:e}){/* @__PURE__ */
|
|
6
|
-
return ct(qe,{name:"check",fallback:Q,"aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(e?"":"invisible"),strokeWidth:2.5})}var St=Ve(function({value:e,onChange:t,options:r,placeholder:a,invalid:n,className:l="",size:i,touchSize:s,renderOption:o,renderValue:c,valueText:d,readOnly:u,multiple:h,...m},p){const g=t;/* @__PURE__ */
|
|
7
|
-
return dt("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":n||void 0,className:yt({invalid:n,size:i,className:`pr-8 ${l}`.trim()}),...m,children:[void 0!==a&&!h&&/* @__PURE__ */ct("option",{value:"",disabled:!0,children:a}),
|
|
8
|
-
/* @__PURE__ */ct(jt,{items:r})]})});function jt({items:e}){const t=e=>/* @__PURE__ */ct("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
9
|
-
return ct(ut,{children:e.map((e,r)=>(e=>Ct(e))(e)?/* @__PURE__ */ct("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var zt=Ve(function({value:e,onChange:t,options:r,placeholder:a,invalid:n,className:l="",id:i,disabled:s,size:o,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},N){const[k,$]=Xe(!1),[M,C]=Xe(-1),L=Ze(null),D=Ze(null),P=Ze(null),A=Ze(k);A.current=k;const S=Ze({buffer:"",timer:null}),j=Ye(),z=`${j}-listbox`,F=i??`${j}-trigger`,E=e=>`${j}-opt-${e}`,O=Je(()=>Lt(r),[r]),W=u?e:[],K=t,H=m(D,k,{matchTriggerWidth:!0}),_=u?O.findIndex(e=>W.includes(e.value)):O.findIndex(t=>t.value===e),q=u?O.filter(e=>W.includes(e.value)).map(e=>e.label).join(", ")||void 0:_>=0?O[_].label:void 0,V=!u&&_>=0?O[_].lang:void 0,Y=u?O.filter(e=>W.includes(e.value)):_>=0?[O[_]]:[],G=g&&Y.length?g(Y):void 0,X=void 0!==G&&f?f(Y):void 0,Z=Ge((e=!0)=>{$(!1),C(-1),e&&D.current?.focus()},[]),J=Ge(()=>{s||b||(C(_>=0?_:Nt(O)),$(!0))},[s,b,O,_]),Q=Ge(t=>{const r=O[t];if(r&&!r.disabled){if(u){const a=e;return K(a.includes(r.value)?a.filter(e=>e!==r.value):[...a,r.value]),void C(t)}K(r.value),Z()}},[O,u,e,K,Z]);Qe(()=>{if(!k)return;return B(e=>!("Escape"!==e.key||!A.current)&&(Z(),!0),()=>P.current)},[k,Z]),Qe(()=>{if(!k)return;const e=e=>{const t=e.target;L.current?.contains(t)||P.current?.contains(t)||Z(!1)};document.addEventListener("pointerdown",e);const t=I(()=>Z(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[k,Z]),Qe(()=>{!k||M<0||P.current?.querySelector(`#${CSS.escape(E(M))}`)?.scrollIntoView({block:"nearest"})});const ee=Ge(e=>{const t=S.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=k?M:_,a=Mt(O,t.buffer,r);a<0||(k?C(a):u?(C(a),$(!0)):Q(a))},[k,M,_,O,Q,u]),te=k?Pt(r,(t,r)=>{const a=(n=t.value,u?W.includes(n):e===n);var n;const l=r===M;/* @__PURE__ */
|
|
10
|
-
return dt("div",{id:E(r),role:"option",lang:t.description||h?void 0:t.lang,"aria-selected":a,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||C(r)},onClick:()=>Q(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":a?"font-medium text-blue-600":"text-gray-700"}`,children:[u&&/* @__PURE__ */ct(At,{selected:a}),h?/* @__PURE__ */ct("span",{className:"block min-w-0 flex-1 truncate",children:h(t,{selected:a,active:l})}):u?/* @__PURE__ */dt("span",{className:"block min-w-0 flex-1",children:[
|
|
11
|
-
/* @__PURE__ */ct("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */ct("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.description?
|
|
12
|
-
/* @__PURE__ */dt(ut,{children:[
|
|
13
|
-
/* @__PURE__ */ct("span",{lang:t.lang,className:"block truncate",children:t.label}),
|
|
14
|
-
/* @__PURE__ */ct("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},j,"mx-1"):null;/* @__PURE__ */
|
|
15
|
-
return dt("div",{ref:L,className:"relative",children:[
|
|
16
|
-
/* @__PURE__ */ct("button",{ref:D,id:F,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":k?z:void 0,"aria-activedescendant":k&&M>=0?E(M):void 0,"aria-invalid":n||void 0,"aria-describedby":x,"aria-label":y,"aria-labelledby":v,title:d,disabled:s,"aria-readonly":b||void 0,onClick:()=>k?Z():J(),onKeyDown:e=>{if(!s&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(k?C(e=>$t(O,e,1)):J());case"ArrowUp":return e.preventDefault(),void(k?C(e=>$t(O,e,-1)):J());case"Home":return void(k&&(e.preventDefault(),C(Nt(O))));case"End":return void(k&&(e.preventDefault(),C(kt(O))));case"Enter":return void(k&&(e.preventDefault(),Q(M)));case" ":return e.preventDefault(),void(k?Q(M):J());case"Escape":return void(k&&(e.preventDefault(),e.stopPropagation(),Z()));case"Tab":return void(k&&Z(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),ee(e.key))}},className:yt({invalid:n,size:o,readOnly:b,className:`${b?"":"pr-8 "}text-left ${l}`.trim()}),children:void 0!==G?
|
|
17
|
-
/* @__PURE__ */dt("span",{className:"relative block min-w-0 truncate",children:[
|
|
18
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-1.5 truncate",children:G}),
|
|
19
|
-
/* @__PURE__ */ct("span",{lang:void 0===X?V:void 0,className:"sr-only",children:X??q})]}):/* @__PURE__ */ct("span",{lang:V,className:"block truncate "+(void 0===q?"text-gray-400":""),children:q??a??" "})}),!b&&/* @__PURE__ */ct(qe,{name:"chevron-up-down",fallback:U,"aria-hidden":"true",className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400",strokeWidth:2}),
|
|
20
|
-
/* @__PURE__ */dt("select",{ref:N,value:e,multiple:u||void 0,onChange:e=>K(u?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:s,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...w,children:[void 0!==a&&!u&&/* @__PURE__ */ct("option",{value:"",disabled:!0,children:a}),
|
|
21
|
-
/* @__PURE__ */ct(jt,{items:r})]}),k&&ht(
|
|
22
|
-
/* @__PURE__ */ct("div",{ref:P,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:H?.left,top:H?.top,bottom:H?.bottom,width:H?.width,maxHeight:H?.maxHeight??p,visibility:H?void 0:"hidden",...T()},children:te}),document.body)]})}),Ft=Ve(function({touchSize:e="touch",...t},r){return l()&&!t.readOnly?/* @__PURE__ */ct(St,{ref:r,...t,size:e}):/* @__PURE__ */ct(zt,{ref:r,...t})});function Et(e,t,r,a){const n=Ye(),l=!!e&&!!t,i=l?`${n}-label`:void 0,s=l?`${n}-description`:void 0;return{labelId:i,descriptionId:s,labelledBy:r??i,describedBy:[a,s].filter(Boolean).join(" ")||void 0}}var Ot=Ve(function({checked:e,onChange:t,indeterminate:r=!1,label:a,description:n,disabled:l,className:i="","aria-labelledby":s,"aria-describedby":o,...c},d){const u=Ze(null),h=Et(a,n,s,o);Qe(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=Ge(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */ct("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 a||n?/* @__PURE__ */dt("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
|
|
23
|
-
/* @__PURE__ */dt("span",{className:"text-sm leading-tight",children:[a&&/* @__PURE__ */ct("span",{id:h.labelId,className:"font-medium text-gray-700",children:a}),n&&/* @__PURE__ */ct("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:n})]})]}):p(i)}),Tt="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",Bt=Ve(function({checked:e,onChange:t,label:r,description:a,disabled:n,className:l="","aria-labelledby":i,"aria-describedby":s,...o},c){const d=Et(r,a,i,s);return r||a?/* @__PURE__ */dt("label",{className:`flex items-start gap-2 ${n?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
|
|
24
|
-
/* @__PURE__ */ct("input",{ref:c,type:"radio",checked:e,disabled:n,onChange:e=>t(e.target.checked),className:`${Tt} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...o}),
|
|
25
|
-
/* @__PURE__ */dt("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */ct("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),a&&/* @__PURE__ */ct("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:a})]})]}):/* @__PURE__ */ct("input",{ref:c,type:"radio",checked:e,disabled:n,onChange:e=>t(e.target.checked),className:`${Tt} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...o})});function It({label:e,htmlFor:t,labelId:r,hint:a,error:n,required:l,className:i="",children:s}){const o=t?n?`${t}-error`:a?`${t}-hint`:void 0:void 0,c=1===tt.count(s)?tt.only(s):null,d=rt(c)?c:null,u={};d&&(o&&(u["aria-describedby"]=[d.props["aria-describedby"],o].filter(Boolean).join(" ")),n&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0));const h=d&&Object.keys(u).length>0?at(d,u):s;/* @__PURE__ */
|
|
26
|
-
return dt("div",{className:i,children:[e&&/* @__PURE__ */dt("label",{id:r,htmlFor:t,className:"mb-1 block text-xs font-medium text-gray-600",children:[e,l&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"ml-0.5 text-red-500",children:"*"})]}),h,n?
|
|
27
|
-
/* @__PURE__ */ct("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-[11px] text-red-600",children:n}):a?/* @__PURE__ */ct("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-[11px] text-gray-400",children:a}):null]})}var Rt={vertical:"flex flex-col gap-2",horizontal:"flex flex-wrap items-start gap-x-6 gap-y-2"};function Wt({label:e,hint:t,error:r,required:a,name:n,value:l,onChange:i,options:s,orientation:o="vertical",disabled:c=!1,className:d=""}){const u=Ye(),h=e?`${u}-label`:void 0;/* @__PURE__ */
|
|
28
|
-
return ct(It,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:a,className:d,children:/* @__PURE__ */ct("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":a||void 0,className:Rt[o],children:s.map(e=>/* @__PURE__ */ct(Bt,{name:n,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 Kt({errors:e,title:t,autoFocus:r=!0,className:a=""}){const n=Se(),l=Ze(null),i=Ze(!1);if(Qe(()=>{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 dt("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)] ${a}`.trim(),children:[
|
|
30
|
-
/* @__PURE__ */ct("h2",{className:"text-sm font-semibold text-red-800",children:t??n.form.errorSummaryTitle}),
|
|
31
|
-
/* @__PURE__ */ct("ul",{className:"mt-1.5 space-y-1",children:e.map((e,t)=>/* @__PURE__ */ct("li",{children:/* @__PURE__ */ct("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 Ht="text-xs font-medium text-gray-600";function _t({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",Ht,t].filter(Boolean).join(" ")}function qt({required:e,children:t,className:r="",...a}){/* @__PURE__ */
|
|
32
|
-
return dt("label",{className:_t({className:r}),...a,children:[t,e&&/* @__PURE__ */ct("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var Ut=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function Vt(e){if(/^data:/i.test(e||""))return function(e){const t=Ut.exec(e);if(!t)return"media";const[,r,a]=t,n=a.split("+")[0].split(".").pop().replace(/^x-/i,"");return n?`${r.toLowerCase()}.${n.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 Yt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function Gt(e,t=je.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 Xt(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 Zt(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function Jt({label:e,rounded:t="rounded-lg"}){/* @__PURE__ */
|
|
33
|
-
return dt("div",{role:"status",className:`absolute inset-0 flex items-center justify-center gap-2 bg-white/60 ${t}`,children:[
|
|
34
|
-
/* @__PURE__ */ct(tr,{}),
|
|
35
|
-
/* @__PURE__ */ct("span",{className:"text-xs font-medium text-gray-600",children:e})]})}function Qt({children:e}){/* @__PURE__ */
|
|
36
|
-
return ct("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 er(e,t=""){if(!e)return!1;const r=Ut.exec(e);if(r)return"video"===r[1].toLowerCase();const a=t.includes("video"),n=t.includes("image")||"*"===t||""===t;return Yt.test(e)||a&&!n}function tr({className:e="h-5 w-5"}){/* @__PURE__ */
|
|
37
|
-
return dt("svg",{className:`${e} animate-spin text-gray-400`,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
|
|
38
|
-
/* @__PURE__ */ct("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
|
|
39
|
-
/* @__PURE__ */ct("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function rr({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
40
|
-
return ct(qe,{name:"close",fallback:J,className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function ar({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
41
|
-
return ct(qe,{name:"upload",fallback:ge,strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function nr({value:e,onChange:t,onPick:r,onFile:a,label:n,hint:l,error:i,required:s,className:o,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:N=!1,busyLabel:k,disabled:$=!1}){const M=Se().media,C=p??M.cta,L=v??M.replace,D=w??M.remove,P=k??M.uploading,A=Ye(),S=Ze(null),[j,z]=Xe(null);Qe(()=>()=>{S.current&&URL.revokeObjectURL(S.current)},[]);const F=$||N,E=!!e&&(er(e,c)||e===j),O=m??Gt(c,M),T=e=>{r?r(e):a?a(e):(e=>{S.current&&URL.revokeObjectURL(S.current);const r=URL.createObjectURL(e);S.current=r,z(e.type.startsWith("video/")?r:null),t(r)})(e)},B=Le({accept:c,maxSizeBytes:d,acceptHint:f,multiple:!1,disabled:F,onAccept:([e])=>T(e)}),{dragOver:I}=B,R=()=>{F||(r?r():B.open())},W=e?Vt(e):"",K=/* @__PURE__ */dt("div",{children:[
|
|
42
|
-
/* @__PURE__ */dt("div",{...B.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",I?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[E?/* @__PURE__ */ct("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__ */ct("img",{src:e??void 0,alt:W,className:"h-full w-full",style:{objectFit:u}}),b&&e&&/* @__PURE__ */ct(Qt,{children:W}),N&&/* @__PURE__ */ct(Jt,{label:P,rounded:"rounded-md"})]}),!$&&(x||y)&&/* @__PURE__ */dt("div",{className:"mt-2 flex gap-2",children:[x&&/* @__PURE__ */ct(g,{id:A,variant:"secondary",size:"sm",onClick:()=>R(),disabled:N,children:L}),y&&/* @__PURE__ */ct(g,{variant:"ghost",size:"sm",onClick:()=>{S.current&&(URL.revokeObjectURL(S.current),S.current=null),z(null),t("")},disabled:N,children:D})]})]}),H=/* @__PURE__ */ct("button",{type:"button",id:A,onClick:()=>R(),disabled:F,"aria-label":"string"==typeof O?O:M.upload,"aria-busy":N||void 0,"aria-invalid":!!i||void 0,"aria-required":s||void 0,"aria-describedby":i?`${A}-error`:l?`${A}-hint`:void 0,...B.zoneProps,className:Xt(I,F,Zt(F)),style:{minHeight:h},children:N?/* @__PURE__ */dt("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
|
|
43
|
-
/* @__PURE__ */ct(tr,{}),
|
|
44
|
-
/* @__PURE__ */ct("span",{className:"text-xs font-medium text-gray-500",children:P})]}):/* @__PURE__ */dt(ut,{children:[
|
|
45
|
-
/* @__PURE__ */ct("span",{className:"text-gray-400",children:/* @__PURE__ */ct(ar,{})}),
|
|
46
|
-
/* @__PURE__ */ct("span",{className:"px-3 text-xs text-gray-500",children:O}),
|
|
47
|
-
/* @__PURE__ */ct("span",{className:"text-sm font-medium text-blue-600",children:C}),f&&/* @__PURE__ */ct("span",{className:"text-xs text-gray-400",children:f})]})});/* @__PURE__ */
|
|
48
|
-
return dt(It,{label:n,htmlFor:A,hint:l,error:i,required:s,className:o,children:[e?K:H,!r&&/* @__PURE__ */ct("input",{...B.inputProps}),
|
|
49
|
-
/* @__PURE__ */ct(Pe,{rejections:B.rejections})]})}function lr({committedUrl:e,committedHasAlpha:t=null,committedIsLight:a=null,fallbackUrl:n,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:s,assetName:o,onSave:c,onRemove:d,accept: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=Ze(null),[x,y]=Xe(null),[v,w]=Xe(""),[N,k]=Xe(""),[$,M]=Xe(!1),[C,L]=Xe(!1),D=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(o),P=Se().brandAsset,A=v||e||n||"",S=x?null:e?t:l,j=x?null:e?a:i;Qe(()=>()=>{b.current&&URL.revokeObjectURL(b.current)},[]);const z=()=>{b.current&&(URL.revokeObjectURL(b.current),b.current=null)};/* @__PURE__ */
|
|
50
|
-
return dt("section",{"aria-label":P.region(o,s),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
51
|
-
/* @__PURE__ */dt("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
52
|
-
/* @__PURE__ */ct(nr,{value:A,onChange:()=>{},onFile:e=>{if(f)return;z();const t=URL.createObjectURL(e);b.current=t,y(e),w(t),k("")},label:o,hint:N||P.usedFor(s),error:N||void 0,accept:u,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:$||C,disabled:f}),
|
|
53
|
-
/* @__PURE__ */dt("div",{className:"mt-3 flex flex-wrap gap-2",children:[
|
|
54
|
-
/* @__PURE__ */ct(g,{onClick:async()=>{if(x&&!f&&!$){M(!0),k("");try{await c(x),z(),y(null),w("")}catch(e){k(e instanceof Error?e.message:P.saveFailed(D,o))}finally{M(!1)}}},disabled:!x||f,loading:$,children:P.save(D,o)}),(x||e)&&/* @__PURE__ */ct(g,{variant:"ghost-danger",onClick:async()=>{if(!f&&!C){if(x)return z(),y(null),w(""),void k("");if(e){L(!0),k("");try{await d()}catch(e){k(e instanceof Error?e.message:P.removeFailed(D,o))}finally{L(!1)}}}},disabled:f,loading:C,children:x?P.discard:P.remove(D,o)})]})]}),p.length>0&&/* @__PURE__ */dt("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":P.previews(o),children:[
|
|
55
|
-
/* @__PURE__ */ct("h3",{className:"text-sm font-semibold text-gray-900",children:P.preview}),
|
|
56
|
-
/* @__PURE__ */ct("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const t=/* @__PURE__ */ct(r,{src:A,alt:P.alt(s,o),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:S,isLight:j,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
|
|
57
|
-
return dt("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
|
|
58
|
-
/* @__PURE__ */ct("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */dt("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
|
|
59
|
-
/* @__PURE__ */dt("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,
|
|
60
|
-
/* @__PURE__ */ct("span",{className:"truncate text-xs text-gray-700",children:e.title??s}),
|
|
61
|
-
/* @__PURE__ */ct("span",{className:"text-gray-400",children:"×"})]}),
|
|
62
|
-
/* @__PURE__ */ct("span",{className:"mb-1 ml-1 text-gray-400",children:"+"})]}):"search-result"===e.kind?/* @__PURE__ */dt("div",{className:"rounded-lg border border-gray-200 bg-white p-3",children:[
|
|
63
|
-
/* @__PURE__ */dt("div",{className:"flex items-center gap-2",children:[
|
|
64
|
-
/* @__PURE__ */ct("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}),
|
|
65
|
-
/* @__PURE__ */dt("div",{className:"min-w-0 leading-tight",children:[
|
|
66
|
-
/* @__PURE__ */ct("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??s}),e.url&&/* @__PURE__ */ct("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
|
|
67
|
-
/* @__PURE__ */ct("div",{className:"mt-1.5 text-sm font-medium text-blue-700",children:e.title??s}),e.description&&/* @__PURE__ */ct("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */dt("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,
|
|
68
|
-
/* @__PURE__ */ct("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function ir(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 sr=et(null);function or(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 cr({load:e,fallback:t,documentTitle:r,children:a}){const[n,l]=Xe(t),[i,s]=Xe(!0),[o,c]=Xe(null),d=Ze(e),u=Ze(t);d.current=e,u.current=t,Qe(()=>{const e=new AbortController;let t=!0;return l(u.current),s(!0),c(null),d.current(e.signal).then(e=>{t&&(l(e),s(!1))},e=>{t&&(c(e instanceof Error?e:new Error("Could not load portal branding.")),s(!1))}),()=>{t=!1,e.abort()}},[]),Qe(()=>(or(n.favicon_url),()=>or(null)),[n.favicon_url]),Qe(()=>{r&&(document.title=r(n))},[n,r]);const h=Je(()=>({branding:n,loading:i,error:o}),[n,i,o]);/* @__PURE__ */
|
|
69
|
-
return ct(sr.Provider,{value:h,children:a})}function dr(){const e=nt(sr);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var ur=/* @__PURE__ */ct(qe,{name:"close",fallback:$e,strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function hr({items:e,onPick:t,onFiles:r,onRemove:a,onReorder:n,label:l,hint:i,error:s,required:o,className:c,accept:d="image/*",maxSizeBytes:u,maxFiles:h,fit:m="cover",thumbSize:p=96,placeholder:g,cta:f,acceptHint:b,showCover:x=!1,coverLabel:y,busy:v=!1,busyLabel:w,disabled:N=!1,readOnly:k=!1}){const $=Se().media,M=f??$.cta,C=y??$.cover,L=w??$.uploading,D=Ye(),[P,A]=Xe(null),S=N||v,j=!(!t&&!r||S||k),z=!!a&&!S&&!k,F=!!n&&!S&&!k,E=Zt(S),O=g??Gt(d,$),T=Le({accept:d,maxSizeBytes:u,maxFiles:h,acceptHint:b,multiple:!0,disabled:!j,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),B=T.dragOver,I=()=>{j&&(t?t():T.open())},R={width:p,height:p},W=j&&/* @__PURE__ */dt("button",{type:"button",onClick:()=>I(),"aria-label":$.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${E}`,style:R,children:[
|
|
70
|
-
/* @__PURE__ */ct(ar,{className:"h-5 w-5"}),
|
|
71
|
-
/* @__PURE__ */ct("span",{className:"text-xs font-medium text-gray-500",children:$.add})]}),K=j?/* @__PURE__ */dt("button",{type:"button",onClick:()=>I(),"aria-label":"string"==typeof O?O:$.upload,className:Xt(B,!1,E),style:{minHeight:p+32},children:[
|
|
72
|
-
/* @__PURE__ */ct("span",{className:"text-gray-400",children:/* @__PURE__ */ct(ar,{})}),
|
|
73
|
-
/* @__PURE__ */ct("span",{className:"px-3 text-xs text-gray-500",children:O}),
|
|
74
|
-
/* @__PURE__ */ct("span",{className:"text-sm font-medium text-blue-600",children:M}),b&&/* @__PURE__ */ct("span",{className:"text-xs text-gray-400",children:b})]}):/* @__PURE__ */ct("div",{className:"flex w-full items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-3 text-xs text-gray-400",style:{minHeight:p+32},children:$.empty});/* @__PURE__ */
|
|
75
|
-
return dt(It,{label:l,labelId:l?`${D}-label`:void 0,htmlFor:D,hint:i,error:s,required:o,className:c,children:[
|
|
76
|
-
/* @__PURE__ */dt("div",{id:D,role:"group","aria-labelledby":l?`${D}-label`:void 0,"aria-describedby":s?`${D}-error`:i?`${D}-hint`:void 0,"aria-busy":v||void 0,...T.zoneProps,className:"relative rounded-lg transition-colors",style:{...S?{opacity:.6}:{},...B?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?K:/* @__PURE__ */dt("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:er(t.url,d),i=Vt(t.url),s=x&&(t.cover??0===r);/* @__PURE__ */
|
|
77
|
-
return dt("div",{draggable:F||void 0,onDragStart:F?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),A(r)}:void 0,onDragEnd:F?()=>A(null):void 0,onDragOver:F?e=>{null!=P&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:F?e=>{null!=P&&(e.preventDefault(),e.stopPropagation(),P!==r&&n(P,r),A(null))}:void 0,tabIndex:F?0:void 0,"aria-label":F?$.reorder(i,r+1,e.length):void 0,onKeyDown:F?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),n(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),n(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",E,P===r?"opacity-50":""].join(" "),style:{...R,cursor:F?"move":void 0},children:[l?/* @__PURE__ */ct("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */ct("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),s&&/* @__PURE__ */ct("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__ */ct(Qt,{children:t.caption}),z&&/* @__PURE__ */ct("button",{type:"button",onClick:()=>a(t.id),"aria-label":$.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${E}`,style:{background:"var(--rosh-media-scrim-button)"},children:ur})]},t.id)}),W]}),v&&/* @__PURE__ */ct(Jt,{label:L})]}),!t&&r&&/* @__PURE__ */ct("input",{...T.inputProps}),
|
|
78
|
-
/* @__PURE__ */ct(Pe,{rejections:T.rejections})]})}var mr=e=>String(e).padStart(2,"0");function pr(e){return`${e.getFullYear()}-${mr(e.getMonth()+1)}-${mr(e.getDate())}`}function gr(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 fr=e=>`${e.getFullYear()}-${mr(e.getMonth()+1)}`;var br=()=>pr(/* @__PURE__ */new Date);var xr=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),yr=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),a))};function vr({value:e,endValue:t,mode:r="single",onSelect:a,min:n,max:l,month:i,defaultMonth:s,onMonthChange:o,weekStartsOn:c,quickJump:d=!0,"aria-label":u,className:h=""}){const m=gr(e),p=K(br,null),g=gr(p),f=Se().calendar,b=Ae(),x=Be(b),y=K(()=>Ie(b),0),v=c??y,w=()=>{if(!g)return null;const e=fr(g);return n&&e<n.slice(0,7)?n.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[N,k]=Xe(()=>s||(m?fr(m):w())),$=i??N??w(),M=null===$?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}($,g),[C,L]=Xe(()=>e??p),D=Ze(null),P=Ze(!1),[A,S]=Xe("days"),j=Je(()=>M?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),a=(r.getDay()-t+7)%7,n=new Date(r.getFullYear(),r.getMonth(),1-a);return Array.from({length:42},(e,t)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))}(M,v):[],[$,v]),z=e=>!!n&&e<n||!!l&&e>l,F=C??p,E=j.some(e=>pr(e)===F),O=M?j.find(e=>e.getMonth()===M.getMonth())??j[0]:null,T=E&&F?F:O?pr(O):"";if(Qe(()=>{P.current&&(P.current=!1,D.current?.querySelector('[data-active="true"]')?.focus())},[T,$]),!M)/* @__PURE__ */
|
|
79
|
-
return dt("div",{className:h,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
80
|
-
/* @__PURE__ */ct("div",{className:"mb-2 h-6"}),Array.from({length:7},(e,t)=>/* @__PURE__ */ct("div",{className:0===t?"py-1 text-xs":"py-1.5 min-h-11 sm:min-h-0 text-sm",children:" "},t))]});const B=e=>"years"===A?new Date(M.getFullYear()+12*e,M.getMonth(),1):"months"===A?new Date(M.getFullYear()+e,M.getMonth(),1):yr(M,e),I=e=>{const t=fr(e);void 0===i&&k(t),o?.(t)},R=u??x.monthYear(M.getFullYear(),M.getMonth());/* @__PURE__ */
|
|
81
|
-
return dt("div",{className:h,children:[
|
|
82
|
-
/* @__PURE__ */dt("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
83
|
-
/* @__PURE__ */ct("button",{type:"button","aria-label":"years"===A?f.previousYears:"months"===A?f.previousYear:f.previousMonth,onClick:()=>I(B(-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__ */ct(qe,{name:"chevron-left",fallback:Y,className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
|
|
84
|
-
/* @__PURE__ */ct("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */dt(ut,{children:["years"!==A&&/* @__PURE__ */ct("button",{type:"button","aria-label":f.chooseMonth(x.months[M.getMonth()]),onClick:()=>S(e=>"months"===e?"days":"months"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:x.months[M.getMonth()]}),
|
|
85
|
-
/* @__PURE__ */ct("button",{type:"button","aria-label":f.chooseYear(M.getFullYear()),onClick:()=>S(e=>"years"===e?"days":"years"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:M.getFullYear()})]}):/* @__PURE__ */ct("span",{children:x.monthYear(M.getFullYear(),M.getMonth())})}),
|
|
86
|
-
/* @__PURE__ */ct("button",{type:"button","aria-label":"years"===A?f.nextYears:"months"===A?f.nextYear:f.nextMonth,onClick:()=>I(B(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__ */ct(qe,{name:"chevron-right",fallback:G,className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===A&&/* @__PURE__ */ct("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__ */ct("button",{type:"button","aria-pressed":t===M.getMonth(),onClick:()=>{I(new Date(M.getFullYear(),t,1)),S("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===M.getMonth()?"bg-blue-600 font-semibold text-white":g&&t===g.getMonth()&&M.getFullYear()===g.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===A&&/* @__PURE__ */ct("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=M.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */ct("button",{type:"button","aria-pressed":e===M.getFullYear(),onClick:()=>{I(new Date(e,M.getMonth(),1)),S("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===M.getFullYear()?"bg-blue-600 font-semibold text-white":e===g?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
87
|
-
/* @__PURE__ */dt("div",{ref:D,role:"grid","aria-label":R,onKeyDown:e=>{const t=gr(T)??g??M,r={ArrowLeft:()=>xr(t,-1),ArrowRight:()=>xr(t,1),ArrowUp:()=>xr(t,-7),ArrowDown:()=>xr(t,7),Home:()=>xr(t,-(t.getDay()-v+7)%7),End:()=>xr(t,6-(t.getDay()-v+7)%7),PageUp:()=>yr(t,e.shiftKey?-12:-1),PageDown:()=>yr(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),n=r[e.key](),P.current=!0,L(pr(n)),void(fr(n)!==$&&I(n));var n;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),z(T)||a(T))},hidden:"days"!==A,children:[
|
|
88
|
-
/* @__PURE__ */ct("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=>
|
|
89
|
-
/* @__PURE__ */ct("div",{role:"columnheader","aria-label":x.weekdays[e],className:"py-1",children:/* @__PURE__ */ct("abbr",{title:x.weekdays[e],className:"no-underline",children:x.weekdaysShort[e]})},e))}),Array.from({length:6},(n,l)=>/* @__PURE__ */ct("div",{role:"row",className:"grid grid-cols-7 text-center text-sm",children:j.slice(7*l,7*l+7).map(n=>{const l=pr(n),i=n.getMonth()!==M.getMonth(),s=l===e||"range"===r&&l===t,o=(a=>!("range"!==r||!e||!t)&&a>e&&a<t)(l),c=z(l);/* @__PURE__ */
|
|
90
|
-
return ct("div",{role:"gridcell","aria-selected":s,children:/* @__PURE__ */ct("button",{type:"button","data-active":l===T,tabIndex:l===T?0:-1,disabled:c,"aria-label":x.longDate(n.getFullYear(),n.getMonth(),n.getDate()),"aria-current":l===p?"date":void 0,onClick:()=>{L(l),a(l)},className:["w-full rounded-md py-1.5 min-h-11 sm:min-h-0 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",c?"cursor-not-allowed text-gray-300":s?"bg-blue-600 font-semibold text-white":o?"bg-blue-100 text-blue-800":i?"text-gray-500 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100",l!==p||s?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),children:n.getDate()})},l)})},l))]})]})}var wr=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Nr=e=>`${e.getFullYear()}-${kr(e.getMonth()+1)}`,kr=e=>String(e).padStart(2,"0");function $r(e){return`${e.getFullYear()}-${kr(e.getMonth()+1)}-${kr(e.getDate())}`}function Mr(e,t){const r=t.getFullYear(),a=t.getMonth(),n=new Date(r,a,t.getDate()),l=new Date(r,a,0),i=e=>new Date(r,a-e,1);switch(e){case"last2Weeks":return{from:$r(new Date(r,a,t.getDate()-14)),to:$r(n)};case"lastMonth":return{from:$r(i(1)),to:$r(l)};case"last3Months":return{from:$r(i(3)),to:$r(l)};case"last6Months":return{from:$r(i(6)),to:$r(l)};case"last12Months":return{from:$r(i(12)),to:$r(l)}}}function Cr(e,t,r){const a=Nr(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function Lr(e){const[t,r,a]=e.split("-").map(Number);return new Date(t,r-1,a)}function Dr(e){const[t,r,a]=e.split("-");return t&&r&&a?`${a}/${r}/${t}`:e}var Pr=/* @__PURE__ */new Map;function Ar({from:e,to:t,onChange:r,formatDisplay:a,clearable:n,required:l=!1,name:i,id:s,"aria-labelledby":o,"aria-label":c,weekStartsOn:d,placeholder:u,fullWidth:h=!1,min:p,max:g}){const f=Se().dateRange,b=Ae(),x=a??(b?function(e){let t=Pr.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Pr.set(e,t));const r=t;return e=>{const[t,a,n]=e.split("-").map(Number);return t&&a&&n?r.format(new Date(Date.UTC(t,a-1,n))):e}}(b):Dr),y=u??f.placeholder,v=n??!l,[w,N]=Xe(!1),[k,$]=Xe(e),[M,C]=Xe(t),[L,D]=Xe(null),P=Ze(null),A=Ze(null),S=Ze(null),j=Ye(),z=Ye(),F=Ye(),[E,O]=Xe(!1),B=m(P,w,{preferredMaxWidth:520,preferredMaxHeight:E?720:560,popupRef:S}),K=Ze(null),H=Ze(null);W(()=>{const e=S.current;if(!w||!B||!e)return;const t=getComputedStyle(e),r=B.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(E)null!==H.current&&H.current<=r&&O(!1);else{const e=K.current?.offsetWidth??0;if(0===e)return;H.current=e,e>r+.5&&O(!0)}});const[_,q]=Xe(!1);W(()=>{const e=!!s&&(A.current?.labels?.length??0)>0;e!==_&&q(e)});const U=!!c||!!o||_,V=/* @__PURE__ */new Date,[Y,G]=Xe(()=>e?Nr(Lr(e)):Cr(V,p,g)),X=wr.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(Mr(e,V),p,g)),Z=e=>e?x(e):"";Qe(()=>{if(!w)return;const e=e=>{const t=e.target;P.current?.contains(t)||S.current?.contains(t)||N(!1)};document.addEventListener("mousedown",e);const t=I(()=>N(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[w]);const J=()=>{r("",""),N(!1)},Q=e&&t?`${Z(e)} — ${Z(t)}`:e?f.fromOnly(Z(e)):t?f.toOnly(Z(t)):"",te=Be(b),re=e=>{const t=gr(e);return t?te.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},ae=e&&t?f.range(re(e),re(t)):e?f.fromOnly(re(e)):t?f.toOnly(re(t)):y,ne=e=>E?"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"),le=/* @__PURE__ */dt(ut,{children:[X.map(e=>/* @__PURE__ */ct("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=Mr(e,V);$(t.from),C(t.to),D(e),G(t.from.slice(0,7))})(e),className:ne(e),children:f[e]},e)),
|
|
91
|
-
/* @__PURE__ */ct("button",{type:"button",onClick:()=>D("Custom"),className:ne("Custom"),children:f.custom})]}),ie=
|
|
92
|
-
/* @__PURE__ */ct(vr,{mode:"range",min:p,max:g,value:k||null,endValue:M||null,month:Y,onMonthChange:G,onSelect:e=>{D("Custom"),!k||k&&M?($(e),C("")):e<k?(C(k),$(e)):C(e)},weekStartsOn:d,"aria-label":f.dialog});/* @__PURE__ */
|
|
93
|
-
return dt("div",{className:"relative"+(h?" w-full":""),ref:P,children:[
|
|
94
|
-
/* @__PURE__ */dt("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:[
|
|
95
|
-
/* @__PURE__ */dt("button",{ref:A,type:"button",onClick:()=>{$(e),C(t),D(null),G(e?Nr(Lr(e)):Cr(V,p,g)),N(!0)},"aria-haspopup":"dialog","aria-expanded":w,id:s,"aria-label":c,"aria-labelledby":o,"aria-describedby":[U?z:void 0,l?F:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":w?j:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(h?" min-w-0 flex-1 justify-start":""),children:[
|
|
96
|
-
/* @__PURE__ */ct(qe,{name:"date",fallback:ee,className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
97
|
-
/* @__PURE__ */ct("span",{className:"truncate",children:Q||y})]}),v&&(e||t)&&/* @__PURE__ */ct("button",{type:"button",onClick:J,"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__ */ct("span",{id:z,className:"sr-only",children:ae}),l&&/* @__PURE__ */ct("span",{id:F,className:"sr-only",children:f.required}),i&&/* @__PURE__ */dt(ut,{children:[
|
|
98
|
-
/* @__PURE__ */ct("input",{type:"hidden",name:i.from,value:e}),
|
|
99
|
-
/* @__PURE__ */ct("input",{type:"hidden",name:i.to,value:t})]}),w&&ht(
|
|
100
|
-
/* @__PURE__ */dt("div",{ref:S,id:j,role:"dialog","aria-label":f.dialog,"data-layout":E?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:R.popup,left:B?.left,right:B?.right,top:B?.top,bottom:B?.bottom,width:E&&B?B.maxWidth:"max-content",maxWidth:B?.maxWidth,maxHeight:B?.maxHeight,overflowY:"auto",visibility:B?void 0:"hidden",...T()},children:[
|
|
101
|
-
/* @__PURE__ */dt("div",{className:E?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
|
|
102
|
-
/* @__PURE__ */dt("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
|
|
103
|
-
/* @__PURE__ */ct("span",{className:"text-xs font-medium text-gray-500",children:f.from}),
|
|
104
|
-
/* @__PURE__ */ct("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(k?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:k?Z(k):f.start})]}),!E&&/* @__PURE__ */ct("span",{className:"text-gray-300",children:"—"}),
|
|
105
|
-
/* @__PURE__ */dt("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
|
|
106
|
-
/* @__PURE__ */ct("span",{className:"text-xs font-medium text-gray-500",children:f.to}),
|
|
107
|
-
/* @__PURE__ */ct("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(M?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:M?Z(M):f.end})]})]}),E?/* @__PURE__ */dt(ut,{children:[X.length>0&&/* @__PURE__ */ct("div",{className:"mb-3 flex flex-wrap gap-1.5",children:le}),
|
|
108
|
-
/* @__PURE__ */ct("div",{className:"w-full",children:ie})]}):
|
|
109
|
-
/* @__PURE__ */dt("div",{ref:K,className:"flex w-max gap-4",children:[
|
|
110
|
-
/* @__PURE__ */ct("div",{className:"w-64",children:ie}),X.length>0&&/* @__PURE__ */ct("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:le})]}),
|
|
111
|
-
/* @__PURE__ */dt("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[v&&/* @__PURE__ */ct("button",{type:"button",onClick:J,className:"px-3 py-1.5 text-sm text-gray-500 hover:text-gray-700",children:f.clear}),
|
|
112
|
-
/* @__PURE__ */ct("button",{type:"button",onClick:()=>N(!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}),
|
|
113
|
-
/* @__PURE__ */ct("button",{type:"button",onClick:()=>{r(k,M),N(!1)},disabled:!k||!M,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 Sr=/^\d{2}:\d{2}(:\d{2})?$/,jr=e=>String(e).padStart(2,"0");function zr(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${jr(e.getHours())}:${jr(e.getMinutes())}`;return t?`${r}:${jr(e.getSeconds())}`:r}return Sr.test(e)?e:""}var Fr=Ve(function({value:e,onChange:t,min:r,max:a,invalid:n,size:l,className:i="",step:s,...o},c){const d=null!=s&&Number(s)<60,u=Ae();/* @__PURE__ */
|
|
114
|
-
return ct("input",{ref:c,type:"time",lang:u,step:s,"aria-invalid":n||void 0,value:zr(e,d),min:zr(r,d)||void 0,max:zr(a,d)||void 0,onChange:e=>t?.(Sr.test(e.target.value)?e.target.value:null),className:yt({invalid:n,size:l,className:i}),...o})}),Er=/^\d{4}-\d{2}-\d{2}$/,Or=/^(aria|data)-/,Tr=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function Br(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":$r(e);if(Er.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":$r(t)}function Ir(e){if(!Er.test(e))return null;const[t,r,a]=e.split("-").map(Number),n=new Date(t,r-1,a);return n.getMonth()===r-1&&n.getDate()===a?n:null}function Rr(e,t){const r=Ir(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var Wr=Ve(function({value:e,onChange:t,min:r,max:a,invalid:n,size:l,native:i,weekStartsOn:s,className:o="","aria-label":c,"aria-describedby":d,"aria-labelledby":u,id:h,name:p,disabled:g,placeholder:f,required:b,clearable:x,form:y,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:$,...M},C){const L=x??!b,D=Br(e),P=Br(r),A=Br(a),S=Se().datePicker,j=Ae(),z=Be(j),[F,E]=Xe(!1),O=Ze(null),T=Ze(null),K=Ze(null),H=Ye(),_=Ye(),q=Ye(),U=m(T,F,{popupRef:K}),[Y,G]=Xe(!1);W(()=>{const e=!!h&&(T.current?.labels?.length??0)>0;e!==Y&&G(e)});const X=!c&&(!!u||Y);if(Qe(()=>{if(!F)return;const e=e=>{const t=e.target;O.current?.contains(t)||K.current?.contains(t)||E(!1)};document.addEventListener("pointerdown",e,!0);const t=I(()=>E(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[F]),Qe(()=>{if(F)return B(e=>"Escape"===e.key&&(E(!1),T.current?.focus(),!0),()=>K.current)},[F]),i)/* @__PURE__ */
|
|
115
|
-
return ct("input",{ref:C,type:"date",lang:j,id:h,name:p,disabled:g,"aria-label":c,"aria-describedby":d,"aria-invalid":n||void 0,value:D,min:P||void 0,max:A||void 0,onChange:e=>t?.(Ir(e.target.value)),className:yt({invalid:n,size:l,className:o}),"aria-labelledby":u,required:b,form:y,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:$,...M});const Z=Object.fromEntries(Object.entries(M).filter(([e])=>Or.test(e)&&!Tr.has(e))),J=M["aria-required"],Q=!!b||!0===J||"true"===J,ee=[X?_:void 0,Q?q:void 0,d].filter(Boolean).join(" ")||void 0,te=$r(/* @__PURE__ */new Date),re=(!P||te>=P)&&(!A||te<=A),ae=f??S.placeholder;/* @__PURE__ */
|
|
116
|
-
return dt("div",{ref:O,className:"relative",children:[
|
|
117
|
-
/* @__PURE__ */ct("input",{ref:C,type:"hidden",name:p,form:y,value:D}),
|
|
118
|
-
/* @__PURE__ */dt("button",{ref:T,type:"button",...Z,id:h,disabled:g,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:$,"aria-haspopup":"dialog","aria-expanded":F,"aria-controls":F?H:void 0,"aria-labelledby":u,"aria-describedby":ee,"aria-label":c?`${c}${D?`, ${Rr(D,z)}`:""}`:void 0,onClick:()=>E(e=>!e),className:`${yt({invalid:n,size:l,className:o})} flex items-center justify-between text-left`,children:[
|
|
119
|
-
/* @__PURE__ */ct("span",{className:D?"text-gray-900":"text-gray-400",children:D?Rr(D,z):ae}),
|
|
120
|
-
/* @__PURE__ */ct(qe,{name:"date",fallback:V,className:"h-4 w-4 shrink-0 text-gray-400",strokeWidth:"1.75","aria-hidden":"true"})]}),X&&/* @__PURE__ */ct("span",{id:_,className:"sr-only",children:D?Rr(D,z):ae}),Q&&/* @__PURE__ */ct("span",{id:q,className:"sr-only",children:S.required}),F&&ht(
|
|
121
|
-
/* @__PURE__ */dt("div",{ref:K,id:H,role:"dialog","aria-label":c??S.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:[
|
|
122
|
-
/* @__PURE__ */ct(vr,{value:D||null,min:P||null,max:A||null,weekStartsOn:s,onSelect:e=>{E(!1),T.current?.focus(),t?.(Ir(e))}}),(L||re)&&/* @__PURE__ */dt("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[L&&/* @__PURE__ */ct("button",{type:"button",onClick:()=>{E(!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:S.clear}),re&&/* @__PURE__ */ct("button",{type:"button",onClick:()=>{E(!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:S.today})]})]}),document.body)]})}),Kr=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Hr=e=>String(e).padStart(2,"0");function _r(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Hr(t.getMonth()+1)}-${Hr(t.getDate())}T${Hr(t.getHours())}:${Hr(t.getMinutes())}`:Kr.test(e)?e:"";var t}var qr=Ve(function({value:e,onChange:t,min:r,max:a,invalid:n,size:l,className:i="",...s},o){const c=Ae();/* @__PURE__ */
|
|
123
|
-
return ct("input",{ref:o,type:"datetime-local",lang:c,"aria-invalid":n||void 0,value:_r(e),min:_r(r)||void 0,max:_r(a)||void 0,onChange:e=>t?.(function(e){if(!Kr.test(e))return null;const[t,r]=e.split("T"),[a,n,l]=t.split("-").map(Number),[i,s,o=0]=r.split(":").map(Number);if(i>23||s>59||o>59)return null;const c=new Date(a,n-1,l,i,s,o);return c.getMonth()===n-1&&c.getDate()===l?c:null}(e.target.value)),className:yt({invalid:n,size:l,className:i}),...s})});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 a=0;a<t.rangeCount&&!e;a++)e=t.getRangeAt(a).intersectsNode(r);if(!e)return null}const a=t.toString();if(!a.trim())return null;const n=document.createElement("div");for(let e=0;e<t.rangeCount;e++)n.appendChild(t.getRangeAt(e).cloneContents());return{text:a,html:n.innerHTML}}async function Vr(e,t){try{if(t&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}const r=r=>{r.clipboardData?.setData("text/plain",e),t&&r.clipboardData?.setData("text/html",t),r.preventDefault()},a=document.createElement("textarea");a.value=e,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.addEventListener("copy",r);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",r),a.remove()}}async function Yr(e,t,r){const a=await Vr(t,r),l=ze().copy;return a?n.success(l.copiedLabel(e)):n.error(l.failed),a}var Gr={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},Xr={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 Zr(){/* @__PURE__ */
|
|
124
|
-
return ct(qe,{name:"copy",fallback:be,className:"h-4 w-4","aria-hidden":"true"})}function Jr(){/* @__PURE__ */
|
|
125
|
-
return ct(qe,{name:"check",fallback:fe,className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function Qr({value:e,children:t,symbol:r,label:a,size:l="md",variant:i="bordered",hideCopyButton:s=!1,onCopy:o,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=Xe(!1),g=Ze(null),f=Se().copy;Qe(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=Ge(async()=>{await Vr(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),o?.(e)):n.error(f.failed)},[e,o,f]),{box:x,button:y}=Xr[l],v=!s;/* @__PURE__ */
|
|
126
|
-
return dt("div",{id:v?void 0:d,"aria-describedby":v?void 0:u,className:["inline-flex max-w-full items-center rounded-md",Gr[i],x,h].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
|
|
127
|
-
/* @__PURE__ */ct("span",{className:"min-w-0 font-mono text-gray-800 "+(c?"whitespace-pre-wrap break-all":"truncate"),title:c?void 0:e,children:t??e}),!s&&/* @__PURE__ */dt(ut,{children:[
|
|
128
|
-
/* @__PURE__ */ct(mt,{id:d,"aria-label":a?f.copyLabel(a):f.copy,"aria-describedby":u,onClick:b,className:`${y} text-gray-400`,children:/* @__PURE__ */ct(m?Jr:Zr,{})}),
|
|
129
|
-
/* @__PURE__ */ct("span",{"aria-live":"polite",className:"sr-only",children:m?f.copied:""})]})]})}var ea=2;function ta(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 ra(e){return e.slice(0,-1)}var aa=["1","2","3","4","5","6","7","8","9",".","0"];function na({value:e,onChange:t,onEnter:r,enterLabel:a,enterDisabled:n,className:l=""}){const i=Se().keypad,s=r=>{r!==e&&t(r)};/* @__PURE__ */
|
|
130
|
-
return dt("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[aa.map(t=>/* @__PURE__ */ct(g,{size:"touch-xl",variant:"secondary",onClick:()=>s(ta(e,t)),children:t},t)),
|
|
131
|
-
/* @__PURE__ */ct(g,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>s(ra(e)),children:"⌫"}),r&&/* @__PURE__ */ct(g,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:n,onClick:r,children:a??i.enter})]})}var la={md:"h-24 p-3",lg:"h-32 p-4"},ia=Ve(function({title:e,subtitle:t,size:r="lg",selected:a=!1,disabled:n,type:l="button",className:i="",...s},o){/* @__PURE__ */
|
|
132
|
-
return dt("button",{ref:o,type:l,disabled:n,"aria-pressed":a||void 0,className:["flex w-full flex-col justify-between rounded-xl border text-left transition-colors rosh-focus-ring","disabled:cursor-not-allowed disabled:opacity-50",a?"border-blue-600 bg-blue-50 ring-2 ring-blue-400/40":"border-gray-200 bg-white hover:bg-gray-50 focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",la[r],i].filter(Boolean).join(" "),...s,children:[
|
|
133
|
-
/* @__PURE__ */ct("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */ct("span",{className:"text-sm text-gray-500",children:t})]})}),sa={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},oa="bg-white text-gray-900 shadow-sm ring-1 ring-inset ring-[color:var(--ink-faint)] rosh-segmented-on",ca="text-gray-600 hover:text-gray-900";function da({value:e,onChange:t,options:r,name:a,size:n="md",block:l=!1,label:i,className:s="","aria-labelledby":o,"aria-describedby":c}){const d={"aria-label":o?void 0:i,"aria-labelledby":o,"aria-describedby":c},u=Ye(),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":""} ${s}`.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__ */
|
|
134
|
-
return ct("div",a?{role:"radiogroup",...d,className:h,children:r.map(r=>{const l=`${u}-${r.value}`,i=r.value===e,s=/* @__PURE__ */dt("label",{htmlFor:l,className:[p,"relative",sa[n],i?oa:ca,r.disabled?"cursor-not-allowed opacity-40":"cursor-pointer"].join(" "),children:[
|
|
135
|
-
/* @__PURE__ */ct("input",{id:l,type:"radio",name:a,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__ */ct("span",{id:`${l}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */ct(f,{content:r.title,className:m,children:s},r.value):s})}:{role:"group",...d,className:h,children:r.map(r=>{const a=r.value===e,l=/* @__PURE__ */dt("button",{type:"button","aria-pressed":a,disabled:r.disabled,onClick:()=>t(r.value),className:[p,sa[n],a?oa:ca,"disabled:cursor-not-allowed disabled:opacity-40"].join(" "),children:[r.icon,r.label]},r.value);return r.title?/* @__PURE__ */ct(f,{content:r.title,className:m,children:l},r.value):l})})}var ua={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},ha={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},ma={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},pa=Ve(function({checked:e,onChange:t,disabled:r=!1,size:a="md",label:n,hint:l,id:i,className:s="",disabledReason:o,disabledReasonId:c,...d},u){const h=Ye(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=o&&""!==o,b=f?`${m}-reason`:void 0,x=[p,g??b].filter(Boolean).join(" ")||void 0,y=/* @__PURE__ */ct("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",ua[a],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */ct("span",{className:["inline-block rounded-full bg-white shadow transition-transform",ha[a],e?ma[a]:"translate-x-0"].join(" ")})});return n||l||f?/* @__PURE__ */dt("span",{className:`flex items-start gap-3 ${s}`.trim(),children:[y,
|
|
136
|
-
/* @__PURE__ */dt("span",{className:"min-w-0",children:[n&&/* @__PURE__ */ct("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:n}),l&&/* @__PURE__ */ct("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */ct("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:o})]})]}):/* @__PURE__ */ct("span",{className:s,children:y})});function ga(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var fa=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function ba(e){const t=e.trim().replace(",",".");if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}function xa({dir:e,compact:t,label:r,disabled:a,onStep:n}){const l=Ze(n);l.current=n;const i=Ze({}),s=Ge(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);Qe(()=>s,[s]),Qe(()=>{a&&s()},[a,s]);const o=/* @__PURE__ */ct(qe,{name:e>0?"chevron-up":"chevron-down",fallback:e>0?X:Z,"aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),c={tabIndex:-1,"aria-label":r,disabled:a,onPointerDown:e=>{if(0!==e.button||a)return;e.preventDefault(),s();const t=e.shiftKey;l.current(t);const r=e.currentTarget.ownerDocument.defaultView??window;r.addEventListener("pointerup",s),i.current={off:()=>r.removeEventListener("pointerup",s),wait:setTimeout(()=>{i.current.every=setInterval(()=>l.current(t),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__PURE__ */ct("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:o}):/* @__PURE__ */ct(mt,{size:"sm",...c,children:o})}var ya=Ve(function({value:e,onChange:t,min:r,max:a,precision:n,step:l,shiftStep:i,disabled:s,readOnly:o,invalid:c,placeholder:d,size:u,prefix:h,suffix:m,id:p,name:g,className:f="",onBlur:b,steppers:x=!1,stepFrom:y,snap:v=!1,allowEmpty:w=!0,"aria-label":N,"aria-labelledby":k},$){const M=Se(),[C,L]=Xe(()=>fa(e,n)),D=Ze(C);D.current=C;const P=Ze(null),A=Ge(e=>{P.current=e,"function"==typeof $?$(e):$&&($.current=e)},[$]),S=Ze(e),j=Ze(e);j.current=e;const z=Boolean(s||o),F="compact"===x;Qe(()=>{ba(D.current)!==e&&L(fa(e,n))},[e,n]);const E=e=>{if(z)return;let i=(ba(D.current)??y??(d?ba(d):null)??0)+e;null!=r&&i<r&&(i=r),null!=a&&i>a&&(i=a);const s=n??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(s));const o=fa(i,n);D.current=o,L(o),t(i)},O=Ze(E);O.current=E;const[T,I]=Xe(!1);Qe(()=>{if(T&&!z)return B(e=>{if("Escape"!==e.key||document.activeElement!==P.current)return!1;const r=S.current;if(ba(D.current)===r)return!1;const a=fa(r,n);return D.current=a,L(a),j.current!==r&&t(r),!0})},[T,z,n,t]);const R=()=>{const e=ba(D.current);if(null==e){if(!w){const e=fa(j.current,n);return D.current=e,L(e),j.current}return D.current="",L(""),null!==j.current&&t(null),null}let i=e;const s=n??(v?Math.max(ga(l??1),ga(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!=a&&i>a&&(i=a),null!=s&&(i=Number(i.toFixed(s)));const o=fa(i,n);return D.current=o,L(o),i===e&&i===j.current||t(i),i},W=/* @__PURE__ */ct("input",{ref:A,id:p,name:g,type:"text",inputMode:0===n?"numeric":"decimal",value:C,disabled:s,readOnly:o,placeholder:d,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":a,"aria-valuetext":null==e?d||void 0:fa(e,n),"aria-invalid":c||void 0,"aria-label":N,"aria-labelledby":k,onChange:e=>(e=>{if(o)return;if(""!==e&&!/^-?\d*[.,]?\d*$/.test(e))return;L(e);const r=ba(e);(null!==r||w)&&t(r)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!z)return void(S.current=R());const t=l??1,r=i??10*t,a="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===a||z||(e.preventDefault(),E(a))},onFocus:()=>{S.current=j.current,I(!0)},onBlur:()=>{I(!1),R(),b?.()},className:yt({invalid:c,size:u,readOnly:o,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 K=ba(C);/* @__PURE__ */
|
|
137
|
-
return dt("div",{className:"relative",children:[h&&/* @__PURE__ */ct("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__ */ct("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__ */ct(xa,{dir:-1,compact:F,label:M.number.decrease,disabled:z||null!=r&&null!=K&&K<=r,onStep:e=>O.current(-(e?i??10*(l??1):l??1))}),t=/* @__PURE__ */ct(xa,{dir:1,compact:F,label:M.number.increase,disabled:z||null!=a&&null!=K&&K>=a,onStep:e=>O.current(e?i??10*(l??1):l??1)});/* @__PURE__ */
|
|
138
|
-
return dt("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]})})()]})}),va=(e,t,r)=>Math.min(r,Math.max(t,e));function wa(e,t,r,a){return Number(va(e,t,r).toFixed(a))}function Na({value:e,onChange:t,min:r,max:a,step:n=1,shiftStep:l,precision:i,inputMin:s,inputMax:o,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=Se(),N=Ye(),k=b??N,$=i??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(n),M=s??r,C=o??a,L=void 0!==u||void 0!==h,D=m??h,P=va(e??h??r,r,a),A=e=>f?f(e):"string"==typeof c?`${e.toFixed($)} ${c}`:void 0,S=null==e?u??(null!=h?A(h)??String(h):void 0):A(e);/* @__PURE__ */
|
|
139
|
-
return dt("div",{className:`flex items-center gap-3 ${v}`.trim(),children:[
|
|
140
|
-
/* @__PURE__ */ct("input",{id:k,type:"range",min:r,max:a,step:n,value:P,disabled:x,"aria-label":g?void 0:p,"aria-labelledby":g,"aria-valuetext":S,onKeyDown:i=>{const s="ArrowUp"===i.key||"ArrowRight"===i.key?1:"ArrowDown"===i.key||"ArrowLeft"===i.key?-1:0;if(!s||i.altKey||i.ctrlKey||i.metaKey)return;const o=i.shiftKey&&null!=l;if(!o&&!(null==e&&null!=D))return;i.preventDefault();t(wa((e??D??P)+s*(o?l??n:n),r,a,$))},onChange:e=>t(wa(Number(e.target.value),r,a,$)),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__ */ct("div",{className:"sm"===y?"w-16 shrink-0":"w-20 shrink-0",children:/* @__PURE__ */ct(ya,{value:e,onChange:e=>{null!=e?e<M||e>C||t(e):L&&t(null)},min:M,max:C,step:n,shiftStep:l,stepFrom:D,precision:$,snap:!0,allowEmpty:L,suffix:c,disabled:x,placeholder:u??(null!=h?h.toFixed($):void 0),size:"sm","aria-label":p?w.slider.value(p):void 0,"aria-labelledby":p?void 0:g})})]})}function ka({items:e,onChange:t,label:r,className:a="","aria-labelledby":n,"aria-describedby":l}){const i=Se().displayChips,s=Ye();/* @__PURE__ */
|
|
141
|
-
return ct("div",{role:"group","aria-label":n?void 0:r,"aria-labelledby":n,"aria-describedby":l,className:`flex flex-wrap gap-2 ${a}`.trim(),children:e.map((e,r)=>{const a=`${s}-${r}-state`,n=`${s}-${r}-reason`,l=Boolean(e.disabled)&&null!=e.disabledReason&&""!==e.disabledReason,o=/* @__PURE__ */dt("button",{type:"button","aria-pressed":e.shown,disabled:!(!e.disabled||l)||void 0,"aria-disabled":!!l||void 0,"aria-describedby":d(a,l?n:void 0),onClick:l?c:()=>t(e.id,!e.shown),className:"inline-flex h-6 shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(e.shown?"border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100":"border-gray-200 bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-900"),children:[
|
|
142
|
-
/* @__PURE__ */ct(qe,{name:e.shown?"eye":"eye-off",fallback:e.shown?te:re,className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),e.label]}),u=/* @__PURE__ */ct("span",{id:a,className:"sr-only",children:e.shown?i.shown:i.hidden});/* @__PURE__ */
|
|
143
|
-
return dt(lt,{children:[l?/* @__PURE__ */ct(h,{reason:e.disabledReason,id:n,children:o}):/* @__PURE__ */ct(f,{content:e.shown?i.shownHint:i.hiddenHint,describe:!1,className:"relative inline-flex",children:o}),u]},e.id)})})}var $a=/(^|[\s:])!?z-/;function Ma({trigger:e,children:t,title:r,description:a,"aria-label":n,align:l="start",side:i="bottom",open:s,defaultOpen:o=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:N="",triggerClassName:k,panelClassName:C=""}){const[L,P]=Xe(o),A=(s??L)&&!f,S=H(),j=Ze(null),z=Ze(null),F=Ze(null),E=Ze(null),O=Ye(),T=m??O,K=Ye(),_=Ye(),q=Ye(),U=Ze(null),V=Ze(!1),Y=Ze({openProp:s,onOpenChange:c});Y.current={openProp:s,onOpenChange:c};const G=Ge(e=>{void 0===Y.current.openProp&&P(e),Y.current.onOpenChange?.(e)},[]),X=Ge((e=!1)=>{V.current=e,G(!1)},[G]),Z=e=>{U.current=e.nativeEvent},J=Ge(()=>{const e=F.current,t=z.current;if(!e||!t)return;const r=t.getBoundingClientRect(),a=b(t),n=Math.max(0,a.right-a.left-2*x),s=e.style;s.left="0px",s.top="0px",s.maxWidth=`${n}px`,s.maxHeight="none",s.width=d?`${Math.min(r.width,n)}px`:"";const o={width:e.offsetWidth,height:e.offsetHeight},c=u??1/0,h=y({trigger:r,menu:{width:o.width,height:Math.min(o.height,c)},bounds:a,align:l,side:i}),m=Math.min(h.maxHeight,c);s.left=`${h.left}px`,s.top=`${h.top}px`,s.maxHeight=`${m}px`,s.overflowY=o.height>m?"auto":"",e.dataset.side=h.side,e.dataset.align=l},[l,i,d,u]);W(()=>{A&&S&&J()}),Qe(()=>{if(!A||!S)return;const e=v(()=>z.current,J),t=E.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>J());return r.observe(t),()=>{e(),r.disconnect()}},[A,S,J]),Qe(()=>{if(!A)return;const e=e=>{let t=null,r=0;const a=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(U.current===e)return!1;const t=e.target;return!(t&&(j.current?.contains(t)||F.current?.contains(t)))})(e)&&X(!0))},n=e=>{t=e,r=window.setTimeout(()=>a(e),0)},l=e=>a(e);return document.addEventListener(e,n,!0),window.addEventListener(e,l),()=>{window.clearTimeout(r),document.removeEventListener(e,n,!0),window.removeEventListener(e,l)}},t=e("pointerdown"),r=e("focusin"),a=I(()=>X()),n=B(e=>"Escape"===e.key&&(X(),z.current?.focus(),!0),()=>F.current);return()=>{t(),r(),a(),n()}},[A,X]),$(F,A&&S),W(()=>{if(!A||!S)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})}},[A,S]),Qe(()=>{if(!A||!S)return;const e=F.current;e&&(V.current=!1,(h?.current??M(e)[0]??e).focus({preventScroll:!0}))},[A,S]);const Q="function"==typeof t?t({close:()=>X()}):t,ee=r?{"aria-labelledby":_}:n?{"aria-label":n}:{"aria-labelledby":T};/* @__PURE__ */
|
|
144
|
-
return dt("div",{ref:j,className:`relative inline-flex ${N}`.trim(),children:[
|
|
145
|
-
/* @__PURE__ */ct("button",{ref:z,id:T,type:"button","aria-haspopup":"dialog","aria-expanded":A,"aria-controls":A&&S?K:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>A?X():G(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!A)return;const t=(()=>{const e=F.current;return e?M(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:k??w({variant:"secondary"}),children:e}),A&&S&&ht(
|
|
146
|
-
/* @__PURE__ */ct("div",{ref:F,id:K,role:"dialog",...ee,"aria-describedby":a?q:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:Z,onFocusCapture:Z,onKeyDown:e=>{const t=F.current,r=z.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const a=M(t),n=document.activeElement;if(e.shiftKey){if(a.length>0&&n!==a[0]&&n!==t)return;return e.preventDefault(),void r.focus({preventScroll:!0})}if(a.length>0&&n!==a[a.length-1])return;e.preventDefault();const l=D(r,t);X(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${C}`.trim(),style:$a.test(C)?void 0:{zIndex:R.popup},children:/* @__PURE__ */dt("div",{ref:E,children:[r&&/* @__PURE__ */ct("h2",{id:_,className:"text-sm font-semibold text-gray-900",children:r}),a&&/* @__PURE__ */ct("p",{id:q,className:"mt-1 text-sm text-gray-500",children:a}),r||a?/* @__PURE__ */ct("div",{className:"mt-3",children:Q}):Q]})}),document.body)]})}var Ca=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function La(e){const t=e.trim().replace(/^#/,"");if(!Ca.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var Da=e=>e.toUpperCase(),Pa=(e,t,r)=>Math.min(r,Math.max(t,e));function Aa(e){const t=La(e);if(!t)return{h:0,s:0,v:0};const r=parseInt(t.slice(1,3),16)/255,a=parseInt(t.slice(3,5),16)/255,n=parseInt(t.slice(5,7),16)/255,l=Math.max(r,a,n),i=l-Math.min(r,a,n);let s=0;return 0!==i&&(s=l===r?(a-n)/i%6*60:l===a?60*((n-r)/i+2):60*((r-a)/i+4)),{h:(s+360)%360,s:0===l?0:i/l,v:l}}function Sa({h:e,s:t,v:r}){const a=(e%360+360)%360,n=Pa(t,0,1),l=Pa(r,0,1),i=l*n,s=i*(1-Math.abs(a/60%2-1)),o=l-i,[c,d,u]=a<60?[i,s,0]:a<120?[s,i,0]:a<180?[0,i,s]:a<240?[0,s,i]:a<300?[s,0,i]:[i,0,s],h=e=>Math.round(255*(e+o)).toString(16).padStart(2,"0");return`#${h(c)}${h(d)}${h(u)}`}var ja=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>Sa({h:e%360,s:1,v:1})).join(", ")})`,za={sm:"h-5 w-5",md:"h-7 w-7",lg:"h-9 w-9"},Fa={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function Ea(e){return e?{background:e}:Fa}function Oa({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",za[e],r].filter(Boolean).join(" ")}var Ta=Ve(function({color:e,size:t="md",selected:r,className:a,type:n="button",...l},i){/* @__PURE__ */
|
|
147
|
-
return ct("button",{ref:i,type:n,"aria-pressed":r,className:Oa({size:t,selected:r,className:a}),...l,children:/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"absolute inset-0",style:Ea(e)})})}),Ba=(e,t,r)=>Math.min(r,Math.max(t,e)),Ia=e=>"string"==typeof e?{value:e}:e;var Ra={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function Wa({value:e,onChange:t,label:r,presets:a,clearable:n=!1,fallback:l,dragWrites:i="live",disabled:s=!1,onClose:o,id:c,className:d=""}){const u=Se().color,h=La(l??""),[m,p]=Xe(()=>Aa(e||h||"")),g=Ze(e);Qe(()=>{e!==g.current&&(g.current=e,e?p(Aa(e)):h&&p(Aa(h)))},[e]);const b=r=>{s||r===e||(g.current=r,t(r))},x=e=>{const t=La(e);t&&(p(Aa(t)),b(t))},y=e=>{p(e),b(Sa(e))},[v,w]=Xe(!1),N=Ze(m);N.current=m;const k=e=>({onPointerDown:t=>{if(s||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,N.current);"end"===i?(w(!0),p(r)):y(r)},onPointerMove:t=>{if(s||!(1&t.buttons))return;const r=e(t,N.current);"end"===i?p(r):y(r)},onPointerUp:t=>{"end"===i&&v&&(w(!1),y(e(t,N.current)))}}),$=k((e,t)=>{return{...t,...(r=e.clientX,a=e.clientY,n=e.currentTarget.getBoundingClientRect(),{s:n.width>0?Pa((r-n.left)/n.width,0,1):0,v:n.height>0?1-Pa((a-n.top)/n.height,0,1):0})};var r,a,n}),M=k((e,t)=>{return{...t,h:(r=e.clientX,a=e.currentTarget.getBoundingClientRect(),a.width>0?Math.min(359,360*Pa((r-a.left)/a.width,0,1)):0)};var r,a}),C=v?Sa(m):e,L=e=>`${Math.round(100*e)}%`,D=(a??[]).map(Ia),P=La(e);/* @__PURE__ */
|
|
148
|
-
return dt("div",{id:c,className:`flex w-56 flex-col gap-3 ${s?"opacity-60":""} ${d}`.trim(),onKeyDown:e=>{"Escape"===e.key&&o&&(e.preventDefault(),e.stopPropagation(),o())},children:[(D.length>0||n)&&/* @__PURE__ */dt("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-1.5",children:[n&&/* @__PURE__ */ct(f,{content:u.clear,children:/* @__PURE__ */ct(Ta,{color:"",size:"sm","aria-label":u.clear,selected:""===e,disabled:s,onClick:()=>{s||""===e||(g.current="",t(""))}})}),D.map(e=>{const t=La(e.value),r=e.label?`${e.label} · ${Da(t??e.value)}`:Da(t??e.value);/* @__PURE__ */
|
|
149
|
-
return ct(f,{content:r,children:/* @__PURE__ */ct(Ta,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===P,disabled:s,onClick:()=>x(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
150
|
-
/* @__PURE__ */ct("div",{role:"slider",tabIndex:s?-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":s||void 0,"data-color-square":"",onKeyDown:e=>{if(s)return;const t=function(e,t,r){const a=r?.1:.01,n={ArrowLeft:[-a,0],ArrowRight:[a,0],ArrowDown:[0,-a],ArrowUp:[0,a]}[t];return n?{...e,s:Ba(e.s+n[0],0,1),v:Ba(e.v+n[1],0,1)}:null}(m,e.key,e.shiftKey);t&&(e.preventDefault(),y(t))},...$,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:Sa({h:m.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */ct("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),...Ra}})}),
|
|
151
|
-
/* @__PURE__ */ct("div",{role:"slider",tabIndex:s?-1:0,"aria-label":u.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(m.h),"aria-orientation":"horizontal","aria-disabled":s||void 0,"data-color-hue":"",onKeyDown:e=>{if(s)return;const t=function(e,t,r){const a=r?10:1;switch(t){case"ArrowLeft":case"ArrowDown":return Ba(e-a,0,359);case"ArrowRight":case"ArrowUp":return Ba(e+a,0,359);case"PageDown":return Ba(e-10,0,359);case"PageUp":return Ba(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}))},...M,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:ja},children:/* @__PURE__ */ct("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:Sa({h:m.h,s:1,v:1}),...Ra}})}),
|
|
152
|
-
/* @__PURE__ */dt("div",{className:"flex items-center gap-2",children:[
|
|
153
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"relative h-7 w-7 shrink-0 overflow-hidden rounded-md border border-gray-300",style:Ea(C||(h??""))}),
|
|
154
|
-
/* @__PURE__ */ct(Ka,{value:C,placeholder:!e&&h?Da(h):void 0,onChange:x,label:u.hex(r),disabled:s})]})]})}function Ka({value:e,onChange:t,label:r,placeholder:a,disabled:n,id:l,className:i=""}){const[s,o]=Xe(null);/* @__PURE__ */
|
|
155
|
-
return ct("input",{id:l,type:"text",value:s??(e?Da(e):""),"aria-label":r,placeholder:a,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:n,onChange:r=>{o(r.target.value);const a=La(r.target.value);null!==a&&a!==e&&t(a)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),o(null))},onBlur:()=>o(null),className:yt({size:"sm",className:`min-w-0 flex-1 font-mono uppercase ${i}`.trim()})})}function Ha({value:e,onChange:t,label:r,presets:a,clearable:n,fallback:l,dragWrites:i,disabled:s,id:o,showHexInput:c=!1,size:d="md",align:u="start",open:h,onOpenChange:m,className:p=""}){const g=Se().color,f=Ye(),b=La(l??""),x=e||b||"",y=e?Da(e):b?Da(b):g.none;/* @__PURE__ */
|
|
156
|
-
return dt("div",{className:`inline-flex items-center gap-2 ${p}`.trim(),children:[
|
|
157
|
-
/* @__PURE__ */ct(Ma,{id:o,trigger:/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"absolute inset-0",style:Ea(x)}),triggerLabel:g.swatch(r,y),triggerClassName:Oa({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:s,children:/* @__PURE__ */ct(Wa,{id:f,value:e,onChange:t,label:r,presets:a,clearable:n,fallback:l,dragWrites:i,disabled:s})}),c&&
|
|
158
|
-
/* @__PURE__ */ct("div",{className:"w-24 flex-none",children:/* @__PURE__ */ct(Ka,{value:e,placeholder:!e&&b?Da(b):void 0,onChange:r=>{s||r===e||t(r)},label:g.hex(r),disabled:s})})]})}var _a="50% 50%",qa=1,Ua=10,Va=e=>e<0?0:e>100?100:Math.round(e);function Ya(e){const t=String(e??"").trim().split(/\s+/);if(2!==t.length)return{x:50,y:50};const r=e=>{const t=/^(-?\d+(?:\.\d+)?)%$/.exec(e);return t?Number(t[1]):null},a=r(t[0]),n=r(t[1]);return null===a||null===n?{x:50,y:50}:{x:Va(a),y:Va(n)}}function Ga(e,t){return`${Va(e)}% ${Va(t)}%`}function Xa(e,t,r=!1){const a=r?10:1,{x:n,y:l}=Ya(e);switch(t){case"ArrowLeft":return Ga(n-a,l);case"ArrowRight":return Ga(n+a,l);case"ArrowUp":return Ga(n,l-a);case"ArrowDown":return Ga(n,l+a);default:return null}}function Za(e,t,r){return e.width>0&&e.height>0?{x:Va((t-e.left)/e.width*100),y:Va((r-e.top)/e.height*100)}:{x:50,y:50}}var Ja={background:"color-mix(in srgb, var(--status-on-solid) 45%, transparent)"},Qa={borderColor:"var(--status-on-solid)",boxShadow:"0 0 0 1px var(--rosh-media-scrim-button), 0 1px 4px var(--rosh-media-scrim-button)"};function en({value:e,onChange:t,label:r,image:a,hint:n,emptyText:l,actions:i,disabled:s=!1,id:o,className:c=""}){const d=Se().imageFocus,u=Ye(),h=Ze(null),m=Ze(!1),{x:p,y:g}=Ya(e),f=Ga(p,g),b=r=>{r!==e&&t(r)},x=(e,t)=>{const r=h.current?.getBoundingClientRect();if(!r)return;const a=Za(r,e,t);b(Ga(a.x,a.y))},y=()=>{m.current=!1};if(!a)/* @__PURE__ */
|
|
159
|
-
return ct("div",{"data-image-focus":"",className:c||void 0,children:/* @__PURE__ */ct("p",{className:"text-xs text-gray-500",children:l??d.noImage})});const v=void 0===n,w=null!==n;/* @__PURE__ */
|
|
160
|
-
return dt("div",{"data-image-focus":"",className:`flex flex-col gap-2 ${c}`.trim(),children:[
|
|
161
|
-
/* @__PURE__ */ct("button",{id:o,type:"button","data-image-focus-picture":"",disabled:s,"aria-label":d.picture(r,f),"aria-describedby":u,onKeyDown:t=>{if(s||t.altKey||t.ctrlKey||t.metaKey)return;const r=Xa(e,t.key,t.shiftKey);null!==r&&(t.preventDefault(),b(r))},onPointerDown:e=>{s||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),m.current=!0,x(e.clientX,e.clientY))},onPointerMove:e=>{m.current&&!s&&x(e.clientX,e.clientY)},onPointerUp:y,onPointerCancel:y,onLostPointerCapture:y,className:["flex min-h-36 w-full touch-none items-center justify-center overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-0","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",s?"cursor-not-allowed opacity-60":"cursor-crosshair"].join(" "),children:/* @__PURE__ */dt("span",{ref:h,"data-image-focus-pane":"",className:"relative block max-w-full",children:[
|
|
162
|
-
/* @__PURE__ */ct("img",{src:a,alt:"",draggable:!1,className:"block h-auto max-h-36 w-auto max-w-full select-none object-contain"}),
|
|
163
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true","data-image-focus-cross":"h",className:"pointer-events-none absolute inset-x-0 h-px",style:{top:`${g}%`,...Ja}}),
|
|
164
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true","data-image-focus-cross":"v",className:"pointer-events-none absolute inset-y-0 w-px",style:{left:`${p}%`,...Ja}}),
|
|
165
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true","data-image-focus-dot":"",className:"pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2",style:{left:`${p}%`,top:`${g}%`,...Qa}})]})}),w||i?/* @__PURE__ */dt("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */ct("span",w?{id:v?u:void 0,className:"min-w-0 flex-1 text-xs text-gray-500",children:v?d.hint:n}:{className:"min-w-0 flex-1"}),i]}):null,!v&&/* @__PURE__ */ct("span",{id:u,className:"sr-only",children:d.hint})]})}function tn({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
166
|
-
return ct("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 rn(e){const{options:t,placeholder:r,emptyOptionLabel:a,className:n="",disabled:l,id:i,allowFreeText:s=!1,onSearchChange:o,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,[N,k]=Xe(!1),[$,M]=Xe(-1),C=Ye(),L=i??`${C}-input`,D=`${C}-listbox`,P=e=>`${C}-opt-${e}`,[A,S]=Xe(""),j=Se(),z=a??j.select.none,F=e=>{S(e),M(-1),o?.(e)},E=Ze(null),O=Ze(null),K=Ze(null),H=Ze(null),_=Ze(N);_.current=N;const q=Ze(!1),U=e=>{if(!_.current)return;_.current=!1;const t=A.trim();e&&s&&t&&(b?x.includes(t)||v([...x,t]):t!==y&&v([t])),k(!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 M(t);v([e.value]),U(!1)}},[Y,G]=Xe(null);W(()=>{if(!c||N)return void G(null);const e=H.current?.offsetWidth??0;G(e?e+(ee?32:8)+6:null)});const X=m(O,N,{matchTriggerWidth:!0}),Z=Je(()=>Lt(t),[t]),J=x.join("\0"),Q=Je(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of Z)x.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(s)for(const r of x)t.has(r)||e.push(r);return e.join(", ")},[Z,J,s]),ee=u&&w&&!l;Qe(()=>{if(!N)return;const e=e=>{const t=e.target;E.current?.contains(t)||K.current?.contains(t)||U(!0)};document.addEventListener("mousedown",e);const t=I(()=>U(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[N,s,A,J,e.onChange]),Qe(()=>{if(N)return B(e=>!("Escape"!==e.key||!_.current)&&(U(!1),O.current?.blur(),!0),()=>K.current)},[N]);const te=Je(()=>{const e=/* @__PURE__ */new Set;return Dt(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),re=Je(()=>{if(o)return te;const e=A.trim().toLowerCase();return e?Dt(te,t=>t.label.toLowerCase().includes(e)||(t.sublabel?.toLowerCase().includes(e)??!1)):te},[te,A,o]),ae=Je(()=>Lt(re),[re]);/* @__PURE__ */
|
|
167
|
-
return dt("div",{ref:E,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(E.current?.contains(t)||K.current?.contains(t))||q.current||document.activeElement!==O.current&&U(!0)},children:[
|
|
168
|
-
/* @__PURE__ */ct("input",{id:L,ref:O,type:"text",autoComplete:"off",role:"combobox","aria-expanded":N,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":N?D:void 0,"aria-activedescendant":N&&$>=0&&$<ae.length?P($):void 0,"aria-label":g?void 0:h,"aria-labelledby":g,"aria-describedby":f,value:N?A:Q,onChange:e=>{F(e.target.value),k(!0)},onFocus:()=>{l||(F(""),k(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(l)return;if(e.preventDefault(),!N)return void k(!0);if(0===ae.length)return;const t="ArrowDown"===e.key?1:-1;return void M(e=>$t(ae,e,t))}if("Enter"===e.key){e.preventDefault();const t=A.trim();N&&$>=0&&$<ae.length?V(ae[$],$):1!==ae.length||ae[0].disabled?s&&t&&(b?(x.includes(t)||v([...x,t]),F("")):(v([t]),U(!1),O.current?.blur())):V(ae[0],0)}else"Escape"===e.key?(U(!1),O.current?.blur()):"Tab"===e.key&&U(!0)},placeholder:r||z,className:`${bt} ${n} ${ee?"pr-8":""} ${l?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate`,style:Y?{paddingRight:Y}:void 0,disabled:l}),ee&&/* @__PURE__ */ct(tn,{ariaLabel:j.select.clear,onClear:()=>{v([]),U(!1)}}),c&&!N&&/* @__PURE__ */ct("div",{ref:H,className:`absolute top-1/2 -translate-y-1/2 ${ee?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:c}),N&&ht(
|
|
169
|
-
/* @__PURE__ */ct("div",{ref:K,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__ */ct("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__ */ct("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:j.select.noMatches}):Pt(re,(e,t)=>{const r=x.includes(e.value);/* @__PURE__ */
|
|
170
|
-
return dt("button",{id:P(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===$?"bg-gray-100":r?"bg-blue-50/50":""}`),children:[b&&/* @__PURE__ */ct(At,{selected:r}),
|
|
171
|
-
/* @__PURE__ */ct("span",{className:"min-w-0 flex-1 truncate",children:d?d(e,{selected:r,active:t===$}):e.label}),e.sublabel&&/* @__PURE__ */ct("span",{className:"min-w-0 max-w-[45%] shrink-0 truncate text-xs text-gray-400",children:e.sublabel})]},e.value)},C)})}),document.body)]})}var an=["http","https","mailto","tel"];function nn(e){if(""===e||/[\s\u0000-\u001f\u007f]/.test(e))return!1;const t=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!t||an.includes(t[1].toLowerCase())}function ln(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var sn="address",on={kindOf:()=>sn,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},cn=e=>nn(e.trim());function dn(e){const{value:t,kinds:r,rules:a=on,filtersFor:n,label:l,readOnly:i,placeholder:s,className:o=""}=e,c=void 0!==e.onApply,d=Se().link,u=a.isSafe??cn,h=Ye(),m=Ze(null),p=Ze(null),[f,b]=Xe({url:t}),x=c?f.url:t,[y,v]=Xe(!1),[w,N]=Xe(null),[k,$]=Xe(null),M=Ze(()=>{});M.current=c?e.onCancel:()=>{},Qe(()=>{if(c)return B(e=>{const t=m.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(M.current(),!0)},()=>m.current)},[c]),Qe(()=>{if(!c)return;const e=p.current;e?(e.focus(),e.select()):m.current?.querySelector("button, input")?.focus()},[]);const C=r??[{value:sn,label:d.address,target:{type:"text"}}],L=w&&w.against===x?w.kind:a.kindOf(x),D=C.filter(e=>!e.hideWhenEmpty||ln(e.target).length>0||e.value===L),P=D.find(e=>"text"===e.target.type),A=D.find(e=>e.value===L)??P??D[0];if(!A)return null;const S="text"!==A.target.type,j=S?a.targetOf(x):x,z=ln(A.target),F=z.find(e=>e.value===j),E=e=>({value:e,label:d.unavailable(e)}),O="select"===A.target.type&&j&&n?n(j):null,T=O?a.readFilter(x):null,I=T?O?.find(e=>e.param===T.param):void 0,R=k&&k.against===x?k.text:x,W=!S&&""!==R.trim()&&!u(R),K=W&&(!c||y),H=(t,r)=>{c?b({url:t,name:r}):void 0===r?e.onChange(t):e.onChange(t,r)},_=(e,t)=>{N(t=>t?{...t,against:e}:t),H(e,t)},q=e=>{if(!e)return _("");const t=z.find(t=>t.value===e);_(e,t?.label)},U=S?x:R.trim(),V=()=>{if(!c||!U)return;if(!S&&W)return void v(!0);const t=S&&f.url===U?f.name:void 0,r=e.onApply;void 0===t?r(U):r(U,t)},Y=(e,t)=>t&&!e.some(e=>e.value===t)?[E(t),...e]:[...e],G=(e,t,r,a,n)=>{const l=[];for(const e of r){const t=l[l.length-1],r={value:e.value,label:e.label};e.group?t&&"options"in t&&t.label===e.group?t.options.push(r):l.push({label:e.group,options:[r]}):l.push(r)}if(n){const n=r.some(e=>""===e.value);/* @__PURE__ */
|
|
172
|
-
return ct(rn,{"aria-label":e,value:t,options:l,disabled:i,clearable:n,placeholder:r.find(e=>""===e.value)?.label,onChange:a})}/* @__PURE__ */
|
|
173
|
-
return ct(Ft,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:a})};let X;if("text"===A.target.type)X=/* @__PURE__ */ct(vt,{ref:p,id:`${h}-address`,size:"sm",type:"text",invalid:K,"aria-label":d.address,"aria-describedby":K?`${h}-why`:void 0,placeholder:s??d.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:R,readOnly:i,onChange:e=>(e=>{v(!1);const t=e.trim();t?u(e)?($({text:e,against:t}),_(t)):$({text:e,against:x}):($({text:e,against:""}),_(""))})(e.target.value)});else{const e="groups"===A.target.type?A.target.groups.flatMap(e=>e.options.map(t=>({value:t.value,label:t.label,group:e.label}))):A.target.options.map(e=>({value:e.value,label:e.label})),t=[{value:"",label:A.target.placeholder},...Y(e,j)];X=G(A.label,j,t,q,e.length>10)}const Z=/* @__PURE__ */dt(ut,{children:[r&&G(d.linkType,A.value,D.map(e=>({value:e.value,label:e.label})),e=>{$(null),v(!1);const t=D.find(t=>t.value===e);if(!t||"text"===t.target.type)return void N({kind:e,against:x});const r=ln(t.target)[0];N({kind:e,against:r?r.value:""}),r?H(r.value,r.label):H("")},!1),X,O&&G(d.filter,T?.param??"",[{value:"",label:d.noFilter},...T&&!I?[E(T.param)]:[],...O.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return _(j,F?.label);const t=O?.find(t=>t.param===e),r=t?.values[0];r&&_(a.withFilter(j,{param:e,value:r.value}),r.label)},!1),O&&T&&G(d.value,T.value,Y((I?.values??[]).map(e=>({value:e.value,label:e.label})),T.value),e=>{if(!T)return;const t=I?.values.find(t=>t.value===e);_(a.withFilter(j,{param:T.param,value:e}),t?.label)},(I?.values.length??0)>10),K&&/* @__PURE__ */ct("p",{id:`${h}-why`,role:"alert",className:"text-[11px] leading-4 text-red-600",children:d.unsafe}),A.hint&&/* @__PURE__ */ct("p",{className:"text-[11px] leading-4 text-gray-400",children:A.hint}),O&&/* @__PURE__ */ct("p",{className:"text-[11px] leading-4 text-gray-400",children:d.filterHint})]});if(!c)/* @__PURE__ */
|
|
174
|
-
return ct("div",{ref:m,className:`flex min-w-0 flex-auto flex-col gap-2 ${o}`.trim(),role:l?"group":void 0,"aria-label":l,children:Z});const J=e.onRemove;/* @__PURE__ */
|
|
175
|
-
return dt("div",{ref:m,role:"dialog","aria-label":l??d.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${o}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),V())},children:[S?/* @__PURE__ */ct("span",{className:_t({inline:!0}),children:d.title}):/* @__PURE__ */ct("label",{htmlFor:`${h}-address`,className:_t({inline:!0}),children:d.title}),Z,
|
|
176
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between gap-2",children:[J?/* @__PURE__ */ct(g,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:J,children:d.remove}):null,
|
|
177
|
-
/* @__PURE__ */dt("span",{className:"ml-auto flex gap-1",children:[
|
|
178
|
-
/* @__PURE__ */ct(g,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>M.current(),children:d.cancel}),
|
|
179
|
-
/* @__PURE__ */ct(g,{variant:"primary",size:"sm","data-window-action":"apply",onClick:V,disabled:i||""===U,children:d.apply})]})]})]})}function un({label:e,text:t,onTextChange:r,link:a,onLinkChange:n,kinds:l,rules:i,filtersFor:s,textPlaceholder:o,readOnly:c,className:d=""}){const u=Se().link,[h,m]=Xe(!1),p=Ze(null),g=Ye(),f=()=>{m(!1),p.current?.focus()};/* @__PURE__ */
|
|
180
|
-
return dt("div",{className:`flex min-w-0 flex-auto flex-col ${d}`.trim(),children:[
|
|
181
|
-
/* @__PURE__ */ct(vt,{size:"sm",type:"text",className:"rounded-b-none","aria-label":u.text(e),placeholder:o,value:t,readOnly:c,onChange:e=>r(e.target.value)}),
|
|
182
|
-
/* @__PURE__ */dt("button",{ref:p,type:"button","aria-label":u.linkOf(e,a),"aria-expanded":h,"aria-controls":h?g:void 0,disabled:c,onClick:()=>m(e=>!e),className:`flex h-6 w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-gray-300 bg-gray-50 ${ft.sm} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
183
|
-
/* @__PURE__ */ct(qe,{name:"link",fallback:ae,strokeWidth:1.5,className:"h-4 w-4 shrink-0 text-gray-500"}),
|
|
184
|
-
/* @__PURE__ */ct("span",{className:"min-w-0 truncate "+(a?"text-blue-600":"text-gray-400"),children:a||u.addLink})]}),h&&/* @__PURE__ */ct("div",{id:g,className:"mt-2",children:/* @__PURE__ */ct(dn,{value:a,label:u.linkOf(e,a),kinds:l,rules:i,filtersFor:s,onApply:(e,t)=>{void 0===t?n(e):n(e,t),f()},onRemove:a?()=>{n(""),f()}:void 0,onCancel:f})})]})}var hn=Ve(function({files:e,onChange:t,accept:r,acceptHint:a,multiple:n=!0,maxSizeBytes:l,maxFiles:i,disabled:s=!1,label:o,hint:c,error:d,required:u,className:h=""},m){const p=Ye(),g=Se().files,f=Le({accept:r,acceptHint:a,maxSizeBytes:l,maxFiles:i,multiple:n,disabled:s,currentCount:e.length,onAccept:r=>t(n?[...e,...r]:r.slice(0,1))}),b=d?`${p}-error`:c?`${p}-hint`:void 0;/* @__PURE__ */
|
|
185
|
-
return dt(It,{label:o,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
|
|
186
|
-
/* @__PURE__ */dt("button",{ref:m,type:"button",id:p,disabled:s,onClick:f.open,"aria-invalid":!!d||void 0,"aria-required":u||void 0,"aria-describedby":b,...f.zoneProps,className:Xt(f.dragOver,s,`px-4 py-6 ${Zt(s)}`),children:[
|
|
187
|
-
/* @__PURE__ */dt("span",{children:[
|
|
188
|
-
/* @__PURE__ */ct("span",{className:"text-sm font-medium text-blue-600",children:n?g.chooseMany:g.chooseOne}),
|
|
189
|
-
/* @__PURE__ */ct("span",{className:"text-sm text-gray-500",children:` ${n?g.dragMany:g.dragOne}`})]}),a&&/* @__PURE__ */ct("span",{className:"text-xs text-gray-400",children:a})]}),
|
|
190
|
-
/* @__PURE__ */ct("input",{...f.inputProps}),e.length>0&&/* @__PURE__ */ct("ul",{className:"mt-2 flex flex-col gap-1",children:e.map((r,a)=>/* @__PURE__ */dt("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
|
|
191
|
-
/* @__PURE__ */ct("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:r.name,children:r.name}),
|
|
192
|
-
/* @__PURE__ */ct("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:De(r.size,g)}),
|
|
193
|
-
/* @__PURE__ */ct("button",{type:"button",disabled:s,onClick:()=>{f.clearRejections(),t(e.filter((e,t)=>t!==a))},"aria-label":g.remove(r.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */ct(rr,{})})]},`${r.name}-${a}`))}),
|
|
194
|
-
/* @__PURE__ */ct(Pe,{rejections:f.rejections})]})});function mn({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
195
|
-
return ct(qe,{name:"attach",fallback:ne,strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function pn({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
196
|
-
return ct(qe,{name:"page",fallback:xe,strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function gn({intake:e,dropLabel:t,className:r="",children:a}){const n=Se().files;/* @__PURE__ */
|
|
197
|
-
return dt("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,children:[a,
|
|
198
|
-
/* @__PURE__ */ct("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */ct("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??n.drop})]})}function fn({files:e,onRemove:t,disabled:r=!1,className:a=""}){const n=Se().files,l=Ze(/* @__PURE__ */new Map);Qe(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),Qe(()=>()=>{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__ */ct("ul",{className:`flex flex-wrap gap-1.5 ${a}`,children:e.map((e,a)=>{const l=i(e);/* @__PURE__ */
|
|
199
|
-
return dt("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__ */ct("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */ct("span",{className:"text-gray-400",children:/* @__PURE__ */ct(pn,{})}),
|
|
200
|
-
/* @__PURE__ */ct("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
|
|
201
|
-
/* @__PURE__ */ct("span",{className:"shrink-0 tabular-nums text-gray-400",children:De(e.size,n)}),t&&/* @__PURE__ */ct("button",{type:"button",disabled:r,onClick:()=>t(a),"aria-label":n.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__ */ct(rr,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${a}`)})})}function bn({onClick:e,count:t=0,variant:r="button",label:a,disabled:n=!1}){const l=Se().files,i=a??l.attach,s=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */dt("span",{className:"relative inline-flex",children:[
|
|
202
|
-
/* @__PURE__ */ct(mt,{"aria-label":s,onClick:e,disabled:n,size:"sm",children:/* @__PURE__ */ct(mn,{})}),t>0&&/* @__PURE__ */ct("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__ */ct(g,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:n,leftIcon:/* @__PURE__ */ct(mn,{}),children:s})}function xn({files:e,onChange:t,accept:r,maxSizeBytes:a,maxFiles:n,acceptHint:l,disabled:i=!1,dropLabel:s,attachLabel:o,trigger:c="button",actions:d,onReject:u,className:h="",children:m}){const p=Le({accept:r,maxSizeBytes:a,maxFiles:n,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),g=Ze([]);return Qe(()=>{u&&p.rejections.length>0&&p.rejections!==g.current&&(g.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */dt(gn,{intake:p,dropLabel:s,className:h,children:[m,
|
|
203
|
-
/* @__PURE__ */ct(fn,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
|
|
204
|
-
/* @__PURE__ */dt("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
205
|
-
/* @__PURE__ */ct(bn,{onClick:p.open,count:e.length,variant:c,label:o,disabled:i}),d]}),
|
|
206
|
-
/* @__PURE__ */ct(Pe,{rejections:p.rejections})]})}function yn({value:e,onChange:t,options:r=[],placeholder:a,allowFreeText:n=!1,invalid:l,disabled:i,id:s,className:o=""}){const[c,d]=Xe(!1),[u,h]=Xe(""),g=Se(),f=Ze(null),b=Ze(null),x=Ze(null),y=m(f,c),v=e=>r.find(t=>t.value===e)?.label??e,w=Je(()=>{const t=new Set(e),a=[],n=u.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),n&&!e.label.toLowerCase().includes(n)||a.push(e));return a},[r,e,u]),k=r=>{r&&!e.includes(r)?(t([...e,r]),h("")):h("")},$=r=>t(e.filter(e=>e!==r)),M=()=>{const e=u.trim();n&&e?k(e):h("")},C=Ze(()=>{});C.current=()=>{M(),d(!1)},Qe(()=>{if(!c)return;const e=e=>{const t=e.target;f.current?.contains(t)||x.current?.contains(t)||(M(),d(!1))};document.addEventListener("mousedown",e);const t=I(()=>C.current());return()=>{document.removeEventListener("mousedown",e),t()}});const L=r.length>0;/* @__PURE__ */
|
|
207
|
-
return dt("div",{ref:f,className:"relative",children:[
|
|
208
|
-
/* @__PURE__ */dt("div",{onMouseDown:e=>{i||e.target.closest("button")||(e.preventDefault(),b.current?.focus())},className:yt({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":""} ${o}`}),children:[e.map(e=>/* @__PURE__ */dt("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:[
|
|
209
|
-
/* @__PURE__ */ct("span",{className:"truncate",children:v(e)}),!i&&/* @__PURE__ */ct("button",{type:"button","aria-label":g.select.removeItem?.(v(e))??`${g.select.remove} ${v(e)}`,onClick:()=>$(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)),
|
|
210
|
-
/* @__PURE__ */ct("input",{id:s,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?a:void 0,onChange:e=>{h(e.target.value),d(!0)},onFocus:()=>{!i&&L&&d(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&n){t.preventDefault();const e=u.trim(),r=e?w.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())):[];1===r.length?k(r[0].value):M()}else"Backspace"===t.key&&""===u&&e.length>0?$(e[e.length-1]):"Escape"===t.key?(d(!1),h(""),b.current?.blur()):"Tab"===t.key&&(M(),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&&ht(
|
|
211
|
-
/* @__PURE__ */ct("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??N,width:"max-content",visibility:y?void 0:"hidden",...T()},children:/* @__PURE__ */ct("div",{className:"overflow-y-auto",style:{maxHeight:y?.maxHeight??p},children:0===w.length?/* @__PURE__ */ct("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__ */ct("button",{type:"button",onMouseDown:t=>{t.preventDefault(),k(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 vn={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"}},wn="text-base font-semibold text-gray-900";function Nn({children:e,header:t,description:r,footer:a,padded:n=!0,padding:l,headingLevel:i,headerActions:s,"aria-label":o,className:c="",bodyClassName:d="",style:u}){const h=vn[l??(n?"md":"none")],m=Ye(),p=Ye(),g=null!=t&&null!=r&&""!==r,f=null!=i&&null!=t,b=`h${i}`,x=f||null!=o&&""!==o,y=x?"section":"div",v=`rounded-(--radius-card) border border-gray-200 bg-white shadow-sm ${c}`.trim(),w=`border-b border-gray-100 ${h.edge} ${wn}`;/* @__PURE__ */
|
|
212
|
-
return dt(y,{className:v,style:u,...f?{"aria-labelledby":m}:x?{"aria-label":o}:{},...g&&x?{"aria-describedby":p}:{},children:[g?
|
|
213
|
-
/* @__PURE__ */dt("div",{className:`border-b border-gray-100 ${h.edge}`,children:[null!=s?/* @__PURE__ */dt("div",{className:`flex items-center justify-between gap-3 ${wn}`,children:[f?/* @__PURE__ */ct(b,{id:m,children:t}):/* @__PURE__ */ct("span",{children:t}),s]}):f?/* @__PURE__ */ct(b,{id:m,className:wn,children:t}):/* @__PURE__ */ct("div",{className:wn,children:t}),
|
|
214
|
-
/* @__PURE__ */ct("p",{id:p,className:"mt-0.5 text-xs text-gray-500",children:r})]}):null!=t&&(null!=s?
|
|
215
|
-
/* @__PURE__ */dt("div",{className:`${w} flex items-center justify-between gap-3`,children:[f?/* @__PURE__ */ct(b,{id:m,children:t}):/* @__PURE__ */ct("span",{children:t}),s]}):f?
|
|
216
|
-
/* @__PURE__ */ct(b,{id:m,className:w,children:t}):/* @__PURE__ */ct("div",{className:w,children:t})),
|
|
217
|
-
/* @__PURE__ */ct("div",{className:[h.body,d].filter(Boolean).join(" "),children:e}),a&&/* @__PURE__ */ct("div",{className:`border-t border-gray-100 ${h.edge}`,children:a})]})}function kn({label:e,value:t,icon:r,delta:a,className:n=""}){const l=Ae(),i="number"==typeof t&&l?Ee(t,l):t,s="up"===a?.direction?"text-green-600":"down"===a?.direction?"text-red-600":"text-gray-500",o="up"===a?.direction?"▲":"down"===a?.direction?"▼":"→";/* @__PURE__ */
|
|
218
|
-
return dt("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${n}`.trim(),children:[
|
|
219
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between",children:[
|
|
220
|
-
/* @__PURE__ */ct("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),r&&/* @__PURE__ */ct("span",{className:"text-gray-400",children:r})]}),
|
|
221
|
-
/* @__PURE__ */dt("div",{className:"mt-2 flex items-baseline gap-2",children:[
|
|
222
|
-
/* @__PURE__ */ct("span",{className:"text-2xl font-semibold text-gray-900",children:i}),a&&/* @__PURE__ */dt("span",{className:`text-xs font-medium ${s}`,children:[o," ",a.value]})]})]})}var $n={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:""},Mn={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},Cn={normal:"font-normal",medium:"font-medium",semibold:"font-semibold"};function Ln({children:e,tone:t="default",size:r="sm",weight:a="normal",truncate:n=!1,as:l="span",className:i="",...s}){/* @__PURE__ */
|
|
223
|
-
return ct(l,{className:[$n[t],Mn[r],Cn[a],n?"block truncate":"",i].filter(Boolean).join(" "),title:s.title??(n&&"string"==typeof e?e:void 0),htmlFor:s.htmlFor,children:e})}var Dn={1:"text-2xl font-semibold",2:"text-xl font-semibold",3:"text-lg font-semibold",4:"text-base font-semibold",5:"text-sm font-semibold"};function Pn({children:e,level:t=2,tone:r="default",className:a=""}){/* @__PURE__ */
|
|
224
|
-
return ct(`h${t}`,{className:[Dn[t],$n[r],a].filter(Boolean).join(" "),children:e})}function An({children:e,tone:t="secondary",size:r="sm",className:a=""}){/* @__PURE__ */
|
|
225
|
-
return ct("p",{className:[$n[t],Mn[r],"mb-2 last:mb-0",a].filter(Boolean).join(" "),children:e})}var Sn={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"},zn={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function Fn({children:e,gap:t=4,align:r,justify:a,className:n=""}){/* @__PURE__ */
|
|
226
|
-
return ct("div",{className:["flex flex-col",Sn[t],r?jn[r]:"",a?zn[a]:"",n].filter(Boolean).join(" "),children:e})}function En({children:e,gap:t=2,align:r="center",justify:a,wrap:n=!0,className:l=""}){/* @__PURE__ */
|
|
227
|
-
return ct("div",{className:["flex",n?"flex-wrap":"",Sn[t],jn[r],a?zn[a]:"",l].filter(Boolean).join(" "),children:e})}var On={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Tn={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"},Bn={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 In({children:e,cols:t=1,smCols:r,lgCols:a,gap:n=4,className:l=""}){/* @__PURE__ */
|
|
228
|
-
return ct("div",{className:["grid",On[t],r?Tn[r]:"",a?Bn[a]:"",Sn[n],l].filter(Boolean).join(" "),children:e})}var Rn={sm:"my-2",md:"my-4",lg:"my-6"};function Wn({orientation:e="horizontal",children:t,align:r="center",spacing:a="md",className:n=""}){const l=Ye();if("vertical"===e)/* @__PURE__ */
|
|
229
|
-
return ct("span",{role:"presentation",className:`inline-block h-full min-h-[1em] w-px shrink-0 self-stretch bg-gray-200 ${n}`.trim()});if(!t)/* @__PURE__ */
|
|
230
|
-
return ct("hr",{className:`border-0 border-t border-gray-200 ${Rn[a]} ${n}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",s="right"===r?"w-4 shrink-0":"flex-1";
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
return dt("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${Rn[a]} ${n}`.trim(),children:[
|
|
233
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true",className:`${i} border-t border-gray-200`}),
|
|
234
|
-
/* @__PURE__ */ct("span",{id:l,className:"shrink-0 text-xs font-medium text-gray-500",children:t}),
|
|
235
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true",className:`${s} border-t border-gray-200`})]})}var Kn=[2,4,8,12,16,20,24,32,40,48],Hn={iconGap:8,iconGapSm:4,controlXSm:8,controlX:12,controlXLg:16,cellX:12,label:4,toolbar:8,formRow:12,card:16,block:16,gutter:16,panelGroup:2,panelSub:4,panelLayer:8,panelRow:12,panelPad:16,panelPadNarrow:12,panelSetting:32},_n={sm:24,md:32,lg:40};function qn(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&Kn.includes(4*t)}var Un={text:"rounded",rect:"rounded-md",circle:"rounded-full"},Vn=e=>"number"==typeof e?`${e}px`:e;function Yn({variant:e="text",width:t,height:r,lines:a=1,className:n=""}){const l=`animate-pulse bg-gray-200 ${Un[e]} ${n}`.trim();if("circle"===e){const e=Vn(r??t)??"2.5rem";/* @__PURE__ */
|
|
236
|
-
return ct("span",{className:`inline-block ${l}`,style:{width:e,height:e},"aria-hidden":"true"})}const i={width:Vn(t)??"100%",height:Vn(r)??("text"===e?"1rem":"4rem")};/* @__PURE__ */
|
|
237
|
-
return ct("span","text"===e&&a>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:a},(e,t)=>/* @__PURE__ */ct("span",{className:`block ${l}`,style:{...i,width:t===a-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var Gn={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},Xn={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},Zn={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},Jn={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function Qn({items:e,columns:t=1,bordered:r=!1,size:a="md",title:n,className:l="",emptyText:i="—"}){const s="number"==typeof t?{base:t}:t,o=s.base??1,c=Math.max(o,s.sm??0,s.lg??0),d="sm"===a?"px-3 py-2":"px-4 py-3",u="sm"===a?"text-xs":"text-sm";/* @__PURE__ */
|
|
238
|
-
return dt("div",{className:[r?"rounded-lg border border-gray-200 bg-white":"",l].filter(Boolean).join(" "),children:[n&&/* @__PURE__ */ct("div",{className:`${d} ${r?"border-b border-gray-100":""} text-sm font-semibold text-gray-900`.trim(),children:n}),
|
|
239
|
-
/* @__PURE__ */ct("dl",{className:["grid",Gn[o],s.sm?Xn[s.sm]:"",s.lg?Zn[s.lg]:"",r?"":"gap-x-6 gap-y-3",r?"":"px-4 py-3"===d?"py-1":""].filter(Boolean).join(" "),children:e.map((e,t)=>/* @__PURE__ */dt("div",{className:[e.span?Jn[c]:"",r?`${d} border-b border-gray-100 last:border-b-0`:""].filter(Boolean).join(" "),children:[
|
|
240
|
-
/* @__PURE__ */ct("dt",{className:`${u} text-gray-500`,children:e.label}),
|
|
241
|
-
/* @__PURE__ */ct("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))})]})}var el={default:{pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},compact:{pad:"px-3 py-2",gap:"gap-3",text:"text-xs",bodyTop:"mt-2",bodyPad:"pt-2"}};function tl({label:e,value:t,description:r,children:a,controlId:n,unknownText:l="—",quiet:i=!1,size:s="default",divider:o=!0,className:c=""}){const d=el[s],u=void 0!==t||void 0===a,h=null==t||""===t,m=i?"text-gray-500":"text-gray-800",p=h?"text-gray-400":i?"text-gray-500":"text-gray-900",g=`${d.text} font-medium ${m}`,f=[o?"border-t border-gray-100 first:border-t-0":"",d.pad,c].filter(Boolean).join(" ");/* @__PURE__ */
|
|
242
|
-
return dt("div",{className:f,children:[
|
|
243
|
-
/* @__PURE__ */dt("div",{className:`flex items-center justify-between ${d.gap}`,children:[
|
|
244
|
-
/* @__PURE__ */dt("div",{className:"min-w-0 flex-1",children:[n?/* @__PURE__ */ct("label",{htmlFor:n,className:g,children:e}):/* @__PURE__ */ct("span",{className:g,children:e}),r&&/* @__PURE__ */ct("p",{className:"mt-0.5 text-xs text-gray-500",children:r})]}),u&&/* @__PURE__ */ct("div",{className:`shrink-0 ${d.text} ${p}`,children:h?l:t})]}),null!=a&&!1!==a&&/* @__PURE__ */ct("div",{className:`${d.bodyTop} border-t border-gray-100 ${d.bodyPad}`,children:a})]})}var rl={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function al({count:e=0,max:t=99,dot:r=!1,tone:a="danger",showZero:n=!1,children:l,className:i=""}){const s=r||e>0||0===e&&n,o=Ae(),c=e>t?`${Ee(t,o)}+`:Ee(e,o),d=l?"":i,u=s?/* @__PURE__ */ct("span",r?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${rl[a]} ${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 ${rl[a]} ${d}`.trim(),children:c}):null;return l?/* @__PURE__ */dt("span",{className:`relative inline-flex ${i}`.trim(),children:[l,u&&/* @__PURE__ */ct("span",{className:"absolute -right-1.5 -top-1.5 flex",children:u})]}):u}var nl={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},ll={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function il({title:e,value:t,precision:r,prefix:a,suffix:n,tone:l="default",size:i="md",className:s=""}){const o=Ae(),c="number"!=typeof t?t:null!=r?Oe(t,r,o):o?Ee(t,o):t;/* @__PURE__ */
|
|
245
|
-
return dt("div",{className:s,children:[e&&/* @__PURE__ */ct("div",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
246
|
-
/* @__PURE__ */dt("div",{className:`mt-1 flex items-baseline gap-1 ${ll[l]}`,children:[a&&/* @__PURE__ */ct("span",{className:"text-sm",children:a}),
|
|
247
|
-
/* @__PURE__ */ct("span",{className:`font-semibold tabular-nums ${nl[i]}`,children:c}),n&&/* @__PURE__ */ct("span",{className:"text-sm",children:n})]})]})}var sl={xs:24,sm:32,md:40,lg:56},ol={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function cl(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 dl({src:e,name:t,size:r="md",status:a,className:n=""}){const l=sl[r],i=Math.max(8,Math.round(.28*l)),[s,o]=Xe(!1);Qe(()=>{o(!1)},[e]);const c=Boolean(e)&&!s;
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
return dt("span",{className:`relative inline-flex shrink-0 ${n}`.trim(),style:{width:l,height:l},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[c?/* @__PURE__ */ct("img",{src:e,alt:"",onError:()=>o(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */ct("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:cl(t)}),a&&/* @__PURE__ */ct("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${ol[a]}`,style:{width:i,height:i}})]})}function ul({children:e,max:t,size:r="md",className:a=""}){const n=tt.toArray(e),l=t?n.slice(0,t):n,i=t?n.length-l.length:0,s=sl[r],o=Math.round(.3*s),c=Ae();/* @__PURE__ */
|
|
250
|
-
return dt("div",{className:`flex items-center ${a}`.trim(),children:[l.map((e,t)=>/* @__PURE__ */ct("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-o},children:e},t)),i>0&&/* @__PURE__ */dt("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:s,height:s,marginLeft:-o,fontSize:Math.round(.36*s)},children:["+",Ee(i,c)]})]})}var hl={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"}},ml={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 pl({tone:e}){const t={className:"h-5 w-5","aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
|
|
251
|
-
return ct(qe,{name:"check-circle",fallback:Ne,...t});case"warning":/* @__PURE__ */
|
|
252
|
-
return ct(qe,{name:"warning",fallback:we,...t});case"danger":/* @__PURE__ */
|
|
253
|
-
return ct(qe,{name:"close-circle",fallback:ve,...t});default:/* @__PURE__ */
|
|
254
|
-
return ct(qe,{name:"info",fallback:ye,...t})}}function gl({tone:e="info",emphasis:t="subtle",title:r,children:a,icon:n,action:l,onDismiss:i,sticky:s=!1,className:o=""}){const c=hl[e],d="solid"===t,u=Se().banner,h=d?ml[e]:c.box,m=s?"sticky top-0 z-30":"",p=/* @__PURE__ */dt(ut,{children:[r&&/* @__PURE__ */ct("div",{className:("font-semibold "+(d?"":"text-gray-900")).trim(),children:r}),a&&/* @__PURE__ */ct("div",{className:`${d?"":"text-gray-700"} ${r?"mt-0.5":""}`.trim(),children:a})]});/* @__PURE__ */
|
|
255
|
-
return dt("div",{role:"danger"===e?"alert":"status",className:`${m} flex items-start gap-3 rounded-lg border px-4 py-3 ${h} ${o}`.trim(),children:[
|
|
256
|
-
/* @__PURE__ */ct("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:n??/* @__PURE__ */ct(pl,{tone:e})}),null==l?/* @__PURE__ */ct("div",{className:"min-w-0 flex-1 text-sm",children:p}):
|
|
257
|
-
/* @__PURE__ */dt("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
|
|
258
|
-
/* @__PURE__ */ct("div",{className:"min-w-0 grow basis-48 text-sm",children:p}),
|
|
259
|
-
/* @__PURE__ */ct("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */ct("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__ */ct(qe,{name:"close",fallback:J,className:"h-4 w-4",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})}var fl=(e,t)=>`${e}-tab-${t}`,bl=(e,t)=>`${e}-panel-${t}`,xl={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 yl(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 vl({items:e,value:t,onChange:r,variant:a="underline",idPrefix:n,className:l="","aria-label":i,"aria-labelledby":s}){const o=Ze([]),c=(t,r)=>{for(let a=1;a<=e.length;a+=1){const n=((t+r*a)%e.length+e.length)%e.length;if(!e[n]?.disabled)return n}return null},d=t=>{const r=1===t?e.map((e,t)=>t):e.map((t,r)=>e.length-1-r);for(const t of r)if(!e[t]?.disabled)return t;return null};/* @__PURE__ */
|
|
260
|
-
return ct("div",{role:"tablist","aria-label":i,"aria-labelledby":s,onKeyDown:a=>{const n=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===a.key||"ArrowDown"===a.key)l=c(n,1);else if("ArrowLeft"===a.key||"ArrowUp"===a.key)l=c(n,-1);else if("Home"===a.key)l=d(1);else{if("End"!==a.key)return;l=d(-1)}a.preventDefault(),null!==l&&l!==n&&(r(e[l].id),o.current[l]?.focus())},className:`${xl[a]} ${l}`.trim(),children:e.map((e,l)=>{const i=e.id===t,s=/* @__PURE__ */dt("button",{ref:e=>{o.current[l]=e},type:"button",role:"tab",id:n?fl(n,e.id):void 0,"aria-controls":n?bl(n,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:yl(a,i),children:[e.icon&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e.icon}),e.label]},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */ct(f,{content:e.tooltip,children:s},e.id):s})})}var wl=()=>/* @__PURE__ */ct(qe,{name:"check",fallback:Me,className:"h-3.5 w-3.5","aria-hidden":"true"});function Nl({items:e,value:t,onChange:r,"aria-label":a,className:n=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
|
|
261
|
-
return ct("ol",{"aria-label":a,className:`grid items-start ${n}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,a)=>{const n=a<l?"complete":a===l?"current":"upcoming",i="complete"===n&&!!r,s=/* @__PURE__ */ct("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===n?"bg-blue-600 text-white":"","current"===n?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===n?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===n?/* @__PURE__ */ct(wl,{}):a+1}),o=/* @__PURE__ */dt("span",{className:"min-w-0 text-center",children:[
|
|
262
|
-
/* @__PURE__ */ct("span",{className:"block text-sm font-medium "+("upcoming"===n?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */ct("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
|
|
263
|
-
return dt("li",{"aria-current":"current"===n?"step":void 0,className:"relative flex min-w-0 justify-center",children:[a<e.length-1&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(a<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */dt("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-1.5 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[s,o]}):/* @__PURE__ */dt("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-1.5 px-2 text-center",children:[s,o]})]},t.id)})})}function kl({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:a,allowMultiple:n=!1,className:l=""}){const[i,s]=Xe(t),o=r??i;/* @__PURE__ */
|
|
264
|
-
return ct("div",{className:`divide-y divide-gray-100 overflow-hidden rounded-lg border border-gray-200 ${l}`.trim(),children:e.map(e=>{const t=o.includes(e.id);/* @__PURE__ */
|
|
265
|
-
return dt("div",{children:[
|
|
266
|
-
/* @__PURE__ */dt("button",{type:"button",disabled:e.disabled,"aria-expanded":t,onClick:()=>(e=>{const t=o.includes(e)?o.filter(t=>t!==e):n?[...o,e]:[e];void 0===r&&s(t),a?.(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:[
|
|
267
|
-
/* @__PURE__ */ct("span",{children:e.title}),
|
|
268
|
-
/* @__PURE__ */ct(qe,{name:"chevron-down",fallback:le,className:"h-4 w-4 shrink-0 text-gray-400 transition-transform "+(t?"rotate-180":""),strokeWidth:"2","aria-hidden":"true"})]}),t&&/* @__PURE__ */ct("div",{className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}var $l={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)]"},Ml={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 Cl(e,t="subtle"){return"solid"===t?Ml[e]:$l[e]}var Ll=et({}),Dl=et(void 0);function Pl(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Al({groups:e,labelFor:t,children:r}){/* @__PURE__ */
|
|
269
|
-
return ct(Ll.Provider,{value:e,children:/* @__PURE__ */ct(Dl.Provider,{value:t,children:r})})}function Sl(){const e=nt(Dl);return Ge(t=>e?.(t)??Pl(t),[e])}function jl({status:e,label:t,emphasis:r="subtle"}){const a=Cl(nt(Ll)[e]??"neutral",r),n=nt(Dl),l=t??n?.(e)??Pl(e);/* @__PURE__ */
|
|
270
|
-
return ct("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${a}`,children:l})}function zl({colorClass:e,tone:t,children:r,size:a="sm",capitalize:n=!1,closable:l=!1,onClose:i,closeLabel:s,className:o=""}){const c=e??$l[t??"neutral"],d="xs"===a?"px-2 py-0.5 text-[10px]":"md"===a?"px-2.5 py-0.5 text-xs":"px-2 py-0.5 text-xs",u=n?"capitalize":"",h=Se().badge,m=s??("string"==typeof r?h.removeItem(r):h.remove),p="xs"===a?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
271
|
-
return dt("span",{className:["inline-flex items-center rounded-full font-medium",d,u,c,o].filter(Boolean).join(" "),children:[r,l&&/* @__PURE__ */ct("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__ */ct(qe,{name:"close",fallback:ie,className:p,"aria-hidden":"true"})})]})}function Fl({title:e,message:t,description:r,hint:a,variant:n,frameless:l,icon:i,children:s}){const o=l?"none":n??"dashed",c="boolean"!=typeof i&&null!=i?i:null,d=!c&&(i??"card"!==o),u=Se().emptyState,h=t??(e?void 0:u.message),m=r??a;/* @__PURE__ */
|
|
272
|
-
return dt("div",{className:`flex flex-col items-center justify-center text-center ${"card"===o?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===o?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[c&&/* @__PURE__ */ct("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */ct(qe,{name:"inbox",fallback:se,className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",strokeWidth:1}),e&&/* @__PURE__ */ct("h3",{className:"text-sm font-medium text-gray-900",children:e}),h&&/* @__PURE__ */ct("p",{className:"text-sm text-gray-500 "+(e?"mt-2":""),children:h}),m&&/* @__PURE__ */ct("p",{className:"text-xs text-gray-400 mt-1",children:m}),s&&/* @__PURE__ */ct("div",{className:"mt-4",children:s})]})}function El({title:t,description:r,subtitle:a,actions:n,children:l,icon:i,breadcrumbs:s}){const o=r??a,c=n??l;/* @__PURE__ */
|
|
273
|
-
return dt("div",{className:"mb-6",children:[s&&s.length>0&&/* @__PURE__ */ct(e,{items:s,className:"mb-3"}),
|
|
274
|
-
/* @__PURE__ */dt("div",{className:"flex items-start justify-between gap-4",children:[
|
|
275
|
-
/* @__PURE__ */dt("div",{children:[
|
|
276
|
-
/* @__PURE__ */dt("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */ct("span",{className:"shrink-0 text-gray-400",children:i}),t]}),o&&/* @__PURE__ */ct("p",{className:"mt-1 text-sm text-gray-500",children:o})]}),c&&/* @__PURE__ */ct("div",{className:"flex items-center gap-2",children:c})]})]})}var Ol=["success","warning","danger"];function Tl(e){return"string"==typeof e&&Ol.includes(e)}function Bl(e,t,r){if(null==e||!Number.isFinite(e))return null;const a=Il(t),n=Il(r);return null==a&&null==n?null:null!=n&&e>=n?"danger":null!=a&&e>=a?"warning":"success"}function Il(e){return null!=e&&Number.isFinite(e)?e:null}var Rl={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 Wl=/* @__PURE__ */new Set;function Kl(e,t){if(null==e)return null;if(Tl(e))return Rl[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}`;Wl.has(r)||(Wl.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${Ol.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 Hl({at:e,title:t,className:r}){/* @__PURE__ */
|
|
277
|
-
return ct("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var _l=e=>Math.min(100,Math.max(0,e));function ql({label:e,value:t,max:r=100,warn:a,crit:n,severity:l,detail:i,formatValue:s,emptyLabel:o,size:c="sm",ariaLabel:d,className:u=""}){const h=Se().meter,m=Ae(),p=o??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var b,x;null==f&&(b=`MetricBar:max:${String(r)}`,x=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,Wl.has(b)||(Wl.add(b),console.error(x)));const y=Kl(l,"MetricBar"),v=null!=g?y??(null==(w=Bl(g,a,n))?null:Rl[w]):null;var w;const N=Il(a),k=Il(n),$=null!=g&&null!=f?_l(g/f*100):0,M=null!=g?(s??(e=>100===f?Te(e,1,m):Ee(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=N||null!=k),L="md"===c?"h-2":"h-1.5",D=null!=g&&null!=f,P=/* @__PURE__ */dt("div",{...D?{role:"meter","aria-label":d??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":f,"aria-valuenow":Math.min(f,Math.max(0,g)),"aria-valuetext":M}:{"aria-hidden":!0},className:D&&v?`relative mt-2 ${L} rounded-full bg-gray-200`:`relative mt-2 ${L} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[D&&
|
|
278
|
-
/* @__PURE__ */ct("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${$}%`}}),C&&null!=f&&null!=N&&/* @__PURE__ */ct(Hl,{at:_l(N/f*100),title:h.warningAt(N),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=k&&/* @__PURE__ */ct(Hl,{at:_l(k/f*100),title:h.criticalAt(k),className:"bg-gray-500"})]}),A=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
|
|
279
|
-
return dt("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */ct("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
280
|
-
/* @__PURE__ */dt("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
281
|
-
/* @__PURE__ */ct("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${A}`,children:M}),
|
|
282
|
-
/* @__PURE__ */ct("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:null!=g?i:p})]}),P]}:{className:u,children:[
|
|
283
|
-
/* @__PURE__ */dt("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */ct("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
284
|
-
/* @__PURE__ */ct("span",{className:`text-sm font-semibold tabular-nums ${A}`,children:M}),
|
|
285
|
-
/* @__PURE__ */ct("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:null!=g?i:p})]}),P]})}function Ul(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function Vl(e,t){const r=Ul(e);if(null==r)return"no-reading";const a=Ul(t);return null==a||0===a?"no-budget":r>a?"over":"within"}var Yl=e=>Math.min(100,Math.max(0,e));function Gl({label:e,elapsed:t,budget:r,grace:a,detail:n,formatDuration:l,emptyLabel:i,noBudgetLabel:s,size:o="sm",ariaLabel:c,className:d=""}){const u=Se().meter,h=Ae(),m=l??(e=>function(e,t=je.meter){const r=Math.round(e),a=Math.floor(r/3600),n=Math.floor(r%3600/60),l=r%60;return a>0?t.hoursMinutes(a,n):n>0?t.minutesSeconds(n,l):t.seconds(l)}(e,u)),p=i??u.noReading,g=s??u.noBudget,f=Ul(t),b=Ul(r),x=null!=b&&b>0?b:null,y=Ul(a)??0,v="over"===Vl(t,r),w=null!=x?x+y:null,N=null!=x&&null!=w?Yl(x/w*100):null,k=v&&y>0,$=null==w||null==f?0:v?k?N??0:0:Yl(f/w*100),M=k?N??0:0,C=v?k&&null!=w&&null!=f?Yl(f/w*100):100:0,L=Math.max(0,C-M),D=null!=f&&null!=x?f/x*100:null,P=null!=D?Te(Math.round(D),0,h):null!=f?m(f):"—",A=n??(null==f?p:null==x?g:`${m(f)} / ${m(x)}`),S="md"===o?"h-2":"h-1.5",j=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",z=null!=f&&null!=x&&null!=w?/* @__PURE__ */dt("div",{role:"meter","aria-label":c??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":w,"aria-valuenow":Math.min(w,f),"aria-valuetext":u.ofBudget(P),className:`relative mt-2 ${S} overflow-hidden rounded-full bg-gray-200`,children:[(!v||k)&&/* @__PURE__ */ct("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${$}%`}}),L>0&&/* @__PURE__ */ct("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${M}%`,width:`${L}%`}}),y>0&&null!=N&&/* @__PURE__ */ct("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${N}%`}})]}):null;/* @__PURE__ */
|
|
286
|
-
return dt("div","md"===o?{className:d,children:[null!=e&&/* @__PURE__ */ct("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
287
|
-
/* @__PURE__ */dt("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
288
|
-
/* @__PURE__ */ct("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${j}`,children:P}),
|
|
289
|
-
/* @__PURE__ */ct("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:A})]}),z]}:{className:d,children:[
|
|
290
|
-
/* @__PURE__ */dt("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */ct("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
291
|
-
/* @__PURE__ */ct("span",{className:`text-sm font-semibold tabular-nums ${j}`,children:P}),
|
|
292
|
-
/* @__PURE__ */ct("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:A})]}),z]})}var Xl=864e5;function Zl(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 Jl(e,t){return Re(new Date(e).toISOString().slice(0,10),{locale:t})}var Ql=(e,t)=>`${e}-fill-${t}`,ei=e=>`${e}-glow`,ti=e=>`${e}-reveal`,ri=e=>`${e}-ground`;function ai(e,t,r,a){return"solid"===r?a:`url(#${Ql(e,t)})`}function ni(e){return"solid"===e?void 0:"4 3"}function li({id:e,index:t,colour:r,variant:a,from:n,to:l}){const i=Ql(e,t);if("solid"===a)return null;if("gradient"===a||"gradient-reverse"===a){const e="gradient-reverse"===a;/* @__PURE__ */
|
|
293
|
-
return dt("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
|
|
294
|
-
/* @__PURE__ */ct("stop",{offset:"0%",stopColor:r,stopOpacity:e?l:n}),
|
|
295
|
-
/* @__PURE__ */ct("stop",{offset:"100%",stopColor:r,stopOpacity:e?n:l})]})}const s=/* @__PURE__ */ct("rect",{width:"100%",height:"100%",fill:r,fillOpacity:.45*n});return"duotone"===a?/* @__PURE__ */dt("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
|
|
296
|
-
/* @__PURE__ */ct("stop",{offset:"0%",stopColor:r,stopOpacity:n}),
|
|
297
|
-
/* @__PURE__ */ct("stop",{offset:"45%",stopColor:r,stopOpacity:n}),
|
|
298
|
-
/* @__PURE__ */ct("stop",{offset:"45%",stopColor:r,stopOpacity:.35*n}),
|
|
299
|
-
/* @__PURE__ */ct("stop",{offset:"100%",stopColor:r,stopOpacity:.35*n})]}):/* @__PURE__ */dt("pattern","striped"===a?{id:i,width:"10",height:"10",patternUnits:"userSpaceOnUse",patternTransform:"rotate(-45)",children:[s,
|
|
300
|
-
/* @__PURE__ */ct("rect",{width:"5",height:"10",fill:r,fillOpacity:.7})]}:"blocks"===a?{id:i,width:"10",height:"10",patternUnits:"userSpaceOnUse",children:[s,
|
|
301
|
-
/* @__PURE__ */ct("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8}),
|
|
302
|
-
/* @__PURE__ */ct("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8})]}:"dotted"===a?{id:i,width:"8",height:"8",patternUnits:"userSpaceOnUse",children:[s,
|
|
303
|
-
/* @__PURE__ */ct("circle",{cx:"2",cy:"2",r:"1.2",fill:r,fillOpacity:.85})]}:"lines"===a?{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",children:[s,
|
|
304
|
-
/* @__PURE__ */ct("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"1.5",strokeOpacity:.8})]}:{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:[s,
|
|
305
|
-
/* @__PURE__ */ct("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"2",strokeOpacity:.75})]})}function ii({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__ */
|
|
306
|
-
return ct("mask",{id:ti(e),maskUnits:"objectBoundingBox",maskContentUnits:"objectBoundingBox",children:/* @__PURE__ */ct("rect",{x:"0",y:"0",width:"1",height:"1",fill:"white",className:r})})}function si({id:e,fills:t=[],fadeFrom:r=.3,fadeTo:a=0,glow:n=!1,reveal:l=!1,background:i="none"}){/* @__PURE__ */
|
|
307
|
-
return dt("defs",{children:[t.map((t,n)=>/* @__PURE__ */ct(li,{id:e,index:n,colour:t.color,variant:t.variant??"gradient",from:r,to:a},n)),l&&/* @__PURE__ */ct(ii,{id:e,direction:l}),n&&/* @__PURE__ */dt("filter",{id:ei(e),x:"-40%",y:"-40%",width:"180%",height:"180%",children:[
|
|
308
|
-
/* @__PURE__ */ct("feGaussianBlur",{stdDeviation:"3.5",result:"blur"}),
|
|
309
|
-
/* @__PURE__ */dt("feMerge",{children:[
|
|
310
|
-
/* @__PURE__ */ct("feMergeNode",{in:"blur"}),
|
|
311
|
-
/* @__PURE__ */ct("feMergeNode",{in:"SourceGraphic"})]})]}),"none"!==i&&/* @__PURE__ */ct(oi,{id:ri(e),variant:i})]})}function oi({id:e,variant:t}){/* @__PURE__ */
|
|
312
|
-
return ct("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */ct("circle",{cx:"2",cy:"2",r:"1",fill:"currentColor"})}:"grid"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */ct("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__ */ct("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__ */ct("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__ */ct("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"currentColor",strokeWidth:"0.5"})})}var ci={rise:"rosh-viz-rise",grow:"rosh-viz-grow",sweep:"rosh-viz-sweep",march:"rosh-viz-march",fade:"rosh-viz-fade"},di=(e,t=60)=>({animationDelay:e*t+"ms"}),ui={receipt:/* @__PURE__ */dt(ut,{children:[
|
|
313
|
-
/* @__PURE__ */ct("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"}),
|
|
314
|
-
/* @__PURE__ */ct("path",{d:"M4.9 4.4h2.2M4.9 6.1h2.2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),check:/* @__PURE__ */ct("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__ */dt(ut,{children:[
|
|
315
|
-
/* @__PURE__ */ct("path",{d:"M3.5 1.9h3.4l2 2v6.2H3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
|
|
316
|
-
/* @__PURE__ */ct("path",{d:"M5.1 6.5h2.8M5.1 8.2h2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),flask:/* @__PURE__ */ct("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__ */dt(ut,{children:[
|
|
317
|
-
/* @__PURE__ */ct("path",{d:"M1.8 2.9h4.9v4.4H1.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
|
|
318
|
-
/* @__PURE__ */ct("path",{d:"M6.7 4.4h1.6l1.5 1.7v1.2H6.7z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
|
|
319
|
-
/* @__PURE__ */ct("circle",{cx:"3.5",cy:"8.7",r:"1",fill:"currentColor"}),
|
|
320
|
-
/* @__PURE__ */ct("circle",{cx:"8.4",cy:"8.7",r:"1",fill:"currentColor"})]}),flag:/* @__PURE__ */dt(ut,{children:[
|
|
321
|
-
/* @__PURE__ */ct("path",{d:"M3.8 1.7v8.6",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"}),
|
|
322
|
-
/* @__PURE__ */ct("path",{d:"M3.8 2.5h4.8L7.5 4.4l1.1 1.9H3.8z",fill:"currentColor"})]})};function hi({name:e}){/* @__PURE__ */
|
|
323
|
-
return ct("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:ui[e]})}function mi(){/* @__PURE__ */
|
|
324
|
-
return dt("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
|
|
325
|
-
/* @__PURE__ */ct("path",{d:"M4.2 2.2v11.6"}),
|
|
326
|
-
/* @__PURE__ */ct("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function pi(){/* @__PURE__ */
|
|
327
|
-
return ct("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */ct("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var gi=1e-6;function fi(e,t,r={}){const a=Number.isFinite(t)&&t>0?t:0,n=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(a<=0||n.length<2){const e=n[0]??0;return{anchorsMs:n,xs:n.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=n[n.length-1]-n[0],i=r.maxTimeShare??.3,s=Math.min(r.breakPx??48,a),o=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<n.length;e++){const t=n[e+1]-n[e];c.push(t),d.push(l>0?t/l*a:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,a-h*s);let p=0,g=0;for(let e=0;e<c.length;e++)u[e]||(p+=c[e],g+=1);const f=c.map((e,t)=>u[t]?s:0===g?0:p>0?m*e/p:m/g),b=function(e,t,r){const a=e.slice();let n=0;for(let e=0;e<a.length;e++)t[e]||a[e]>=r-gi||(n+=r-a[e],a[e]=r);if(n<=gi)return a;let l=0;for(let e=0;e<a.length;e++)!t[e]&&a[e]>r+gi&&(l+=a[e]-r);if(l<=gi)return a;const i=Math.min(n,l);for(let e=0;e<a.length;e++)t[e]||a[e]<=r+gi||(a[e]-=i*(a[e]-r)/l);return a}(f,u,o),x=b.reduce((e,t,r)=>u[r]?e:e+t,0),y=b.map((e,t)=>u[t]?e:x>0?e*m/x:e),v=[0];for(let e=0;e<y.length;e++)v.push(v[e]+y[e]);v[v.length-1]=a;const w=v.slice(0,-1).map((e,t)=>({fromMs:n[t],toMs:n[t+1],gapMs:c[t],fromPx:e,toPx:v[t+1],wantPx:d[t],clampedPx:f[t],px:v[t+1]-e,compressed:u[t]}));return{anchorsMs:n,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=n[0])return 0;if(e>=n[n.length-1])return a;for(let t=0;t+1<n.length;t++){if(e>n[t+1])continue;const r=n[t+1]-n[t],a=r>0?(e-n[t])/r:0;return v[t]+a*(v[t+1]-v[t])}return a},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),a);for(let e=0;e+1<n.length;e++){if(t>v[e+1]&&e+2<n.length)continue;const r=v[e+1]-v[e],a=r>0?(t-v[e])/r:0;return n[e]+a*(n[e+1]-n[e])}return n[n.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function bi(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var xi="mixed";function yi(e,t){return 5.6*Math.max(e.length,t.length)+8}var vi=(e,t,r)=>Math.min(Math.max(e,t),r),wi=e=>-(Math.cos(Math.PI*e)-1)/2;function Ni(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)*wi(t);return{px:r,ms:e.msByPx(r)}}var ki={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 $i(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var Mi=e=>5.6*e.length,Ci={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:{}},Li={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function Di(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:Ci[t].glyph??(r?"flag":void 0)}function Pi(e,t,r=!1){const a=Ci[e],n=["rosh-tl-node","rosh-tl-mark",`is-${t}`];a.diamond&&n.push("is-diamond"),r&&n.push("is-provisional");const l="current"===t?"var(--tl-accent)":a.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:n.join(" "),style:i}}function Ai(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var Si="undefined"==typeof document?Qe:ot;function ji(e,t){const[r,a]=Xe(0);return Si(()=>{const r=t?e.current:null;if(!r)return;const n=()=>{const e=r.getBoundingClientRect().width;e>0&&a(e)};if(n(),"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(n);return l.observe(r),()=>{l.disconnect()}},[e,t]),r}function zi(e,t,r){const a=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&a.set(e.x,Math.max(a.get(e.x)??0,e.widthPx));const n=[...a.keys()].sort((e,t)=>e-t);if(r<=0||n.length<2)return e;const l=Math.max(0,n[0]),i=Math.min(r,n[n.length-1]),s=i-l,o=[];for(let e=0;e+1<n.length;e++){const t=(a.get(n[e])??0)/2+(a.get(n[e+1])??0)/2+8;o.push(Math.max(28,t,n[e+1]-n[e]))}const c=o.reduce((e,t)=>e+t,0),d=Math.min(Math.max(c,s),.8*r);if(d<=s+.5)return e;const u=l,h=r-i,m=u+h,p=Math.max(0,r-d),g=m>0?p*u/m:0,f=g,b=g+d,x=o.map(e=>c>0?e*d/c:0),y=e=>{if(e<=l)return u>0?e*g/u:f;if(e>=i)return h>0?b+(e-i)*(r-b)/h:b;let t=f;for(let r=0;r+1<n.length;r++){if(e>n[r+1]){t+=x[r];continue}const a=n[r+1]-n[r];return t+(a>0?(e-n[r])/a*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<n.length;r++){if(!(e>t+x[r]))return n[r]+(x[r]>0?(e-t)/x[r]*(n[r+1]-n[r]):0);t+=x[r]}return i})(t)),inCut:e.inCut}}function Fi(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 Ei({marks:e,innerRef:t}){/* @__PURE__ */
|
|
328
|
-
return ct("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */dt("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
|
|
329
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-name",children:e.label}),
|
|
330
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function Oi({startMs:e,endMs:t,axis:r,geo:a,reveal:n}){const l=Se().timeline,i=Be(Ae()),s=a.ruler,o=[],c=[],d=r.gaps.filter(e=>e.compressed),u=new Date(e);u.setUTCDate(u.getUTCDate()+(8-u.getUTCDay())%7);for(let e=u.getTime();e<t;e+=7*Xl){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*Xl)-t<14||o.push(
|
|
331
|
-
/* @__PURE__ */ct("i",{className:"rosh-tl-tick is-week",style:{left:`${t}px`,top:`${s}px`,height:"3px"}},`wk-${e}`))}const h=d.map(e=>{const t=(e.fromPx+e.toPx)/2,r=Mi(l.days(Math.round(e.gapMs/Xl)))/2+6;return[t-r,t+r]}),m=(e,t)=>h.some(([r,a])=>e<a&&t>r);o.push(
|
|
332
|
-
/* @__PURE__ */ct("i",{"data-timeline-part":"start-tick",className:"rosh-tl-tick",style:{left:"0px",top:`${s}px`,height:"6px"}},"start"));const p=new Date(e);p.setUTCDate(1);let g=-1/0,f=!0;for(;p.getTime()<t;){const t=p.getTime();if(!(t<=e)&&!r.inCut(t)){const e=r.xByMs(t);if(o.push(
|
|
333
|
-
/* @__PURE__ */ct("i",{className:"rosh-tl-tick",style:{left:`${e}px`,top:`${s}px`,height:"6px"}},`mo-${t}`)),e-g>=72||f){const r=f||0===p.getUTCMonth()?i.shortMonthYear(p.getUTCFullYear(),p.getUTCMonth()):i.monthsShort[p.getUTCMonth()];m(e,e+Mi(r))||(c.push(
|
|
334
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-month"+(n?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${s+9}px`,...n?{animationDelay:"420ms"}:{}},children:r},`mon-${t}`)),g=e,f=!1)}}p.setUTCMonth(p.getUTCMonth()+1)}/* @__PURE__ */
|
|
335
|
-
return dt("div",{"aria-hidden":"true","data-timeline-part":"ruler",children:[o,c,d.map(e=>{const t=Math.max(1,Math.round(e.gapMs/Xl));/* @__PURE__ */
|
|
336
|
-
return dt("span",{"data-timeline-part":"break",className:"rosh-tl-rulercut"+(n?" rosh-tl-fade":""),style:{left:(e.fromPx+e.toPx)/2+"px",top:`${s}px`,...n?{animationDelay:"420ms"}:{}},children:[
|
|
337
|
-
/* @__PURE__ */dt("span",{className:"rosh-tl-cutglyph",children:[
|
|
338
|
-
/* @__PURE__ */ct("i",{}),
|
|
339
|
-
/* @__PURE__ */ct("i",{})]}),
|
|
340
|
-
/* @__PURE__ */ct("span",{children:l.days(t)})]},`cut-${e.fromMs}`)})]})}function Ti({pending:e,reveal:t}){const r=Se().timeline,[a,n]=Xe(!1),l=a?e:e.slice(0,2),i=e.length-l.length;/* @__PURE__ */
|
|
341
|
-
return dt("div",{className:"rosh-tl-pending","data-timeline-part":"pending",children:[
|
|
342
|
-
/* @__PURE__ */ct("p",{className:"rosh-tl-pending-head",children:r.notReached}),
|
|
343
|
-
/* @__PURE__ */ct("ol",{className:"rosh-tl-ghosts","aria-label":r.notReached,children:l.map((e,a)=>/* @__PURE__ */dt("li",{className:t?"rosh-tl-fade":void 0,style:t?{animationDelay:440+60*a+"ms"}:void 0,children:[
|
|
344
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"rosh-tl-node is-ghost"+(e.kind&&Ci[e.kind].diamond?" is-diamond":"")}),
|
|
345
|
-
/* @__PURE__ */dt("span",{children:[0===a&&/* @__PURE__ */ct("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */ct("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>n(!0),children:r.more(i)})]})}function Bi({marks:e,pending:t,currentKey:r,todayMs:a,reveal:n,ariaLabel:l,step:i,nodeProps:s,onKeyDown:o}){const c=Se().timeline,d=e.findIndex(e=>e.key===r),u=e.length>0&&null!==a?Math.round((a-e[e.length-1].ms)/Xl):0;/* @__PURE__ */
|
|
346
|
-
return dt("div",{"data-timeline-part":"vertical",children:[
|
|
347
|
-
/* @__PURE__ */ct("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:o,children:e.map((e,t)=>{const a=Pi(e.kind,e.role),l=d>=0&&t<d,{glyph:o}=e;/* @__PURE__ */
|
|
348
|
-
return dt("li",{className:n?"rosh-tl-fade":void 0,style:n?di(t,i):void 0,...e.key===r?{"aria-current":"step"}:{},children:[
|
|
349
|
-
/* @__PURE__ */ct("i",{"aria-hidden":"true",className:`rosh-tl-vline text-blue-600${l?" is-on":" is-dash"}${l&&n?" rosh-tl-drawy":""}`}),
|
|
350
|
-
/* @__PURE__ */dt("button",{...s(e),className:`${a.className}${n?" rosh-tl-pop":""}`,style:{...a.style,...n?di(t,i):{}},children:[o&&/* @__PURE__ */ct(hi,{name:o}),"current"===e.role&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(n?" is-on":"")})]}),
|
|
351
|
-
/* @__PURE__ */dt("span",{className:"rosh-tl-vrow","aria-hidden":"true",children:[
|
|
352
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-name",children:e.label}),
|
|
353
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-date",children:e.dateText})]})]},e.key)})}),u>0&&/* @__PURE__ */dt("p",{className:"rosh-tl-vgap","aria-hidden":"true",children:[
|
|
354
|
-
/* @__PURE__ */ct("i",{className:"rosh-tl-vline is-dash"}),
|
|
355
|
-
/* @__PURE__ */ct("span",{children:c.daysToToday(u)})]}),t.length>0&&/* @__PURE__ */ct(Ti,{pending:t,reveal:n})]})}function Ii({axis:e,geo:t,fillTo:r,reveal:a,trackPx:n,tweened:l=!1}){/* @__PURE__ */
|
|
356
|
-
return dt("div",{"aria-hidden":"true",children:[
|
|
357
|
-
/* @__PURE__ */ct("div",{className:"rosh-tl-rail bg-gray-200",style:{top:`${t.rail}px`,height:"6px",width:`${n}px`}}),null!==r&&/* @__PURE__ */ct("div",{"data-timeline-part":"fill",className:`rosh-tl-fill bg-blue-600${l?" is-tweened":""}${a?" rosh-tl-draw":""}`,style:{top:`${t.rail}px`,height:"6px",width:`${Math.max(0,Math.min(e.xByMs(r),n))}px`}}),e.gaps.filter(e=>e.compressed).map(e=>/* @__PURE__ */dt("div",{className:"rosh-tl-cut",style:{left:(e.fromPx+e.toPx)/2+"px",top:`${t.rail}px`,height:"6px"},children:[
|
|
358
|
-
/* @__PURE__ */ct("i",{}),
|
|
359
|
-
/* @__PURE__ */ct("i",{})]},`railcut-${e.fromMs}`))]})}function Ri({geo:e,caption:t,endCaption:r,around:a,reveal:n,trackPx:l}){const i=e.rail-13-4,s=n?" rosh-tl-fade":"",o=n?{animationDelay:"420ms"}:{};/* @__PURE__ */
|
|
360
|
-
return dt("div",{"aria-hidden":"true","data-timeline-part":"start",children:[
|
|
361
|
-
/* @__PURE__ */ct("i",{className:`rosh-tl-start${a?" is-around":""}${s}`,style:{left:"0px",top:`${e.rail+3}px`,...o}}),null!=t&&!1!==t&&/* @__PURE__ */ct("span",{className:`rosh-tl-edge${s}`,"data-timeline-part":"start-caption",style:{left:"0px",top:`${i}px`,...o},children:t}),null!=r&&!1!==r&&/* @__PURE__ */ct("span",{className:`rosh-tl-edge is-end${s}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...o},children:r})]})}function Wi({x:e,geo:t,trackPx:r,label:a,reveal:n}){const l=Se().timeline;/* @__PURE__ */
|
|
362
|
-
return dt("div",{"aria-hidden":"true","data-timeline-part":"today",children:[
|
|
363
|
-
/* @__PURE__ */ct("div",{className:"rosh-tl-todayline"+(n?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${t.laneA}px`,height:t.ruler+20-t.laneA+"px",...n?{animationDelay:"420ms"}:{}}}),
|
|
364
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-todaytag"+(n?" rosh-tl-fade":""),title:l.todayTitle(a),style:{left:`${bi(e,48,r)}px`,top:`${t.tag}px`,...n?{animationDelay:"420ms"}:{}},children:l.today})]})}function Ki({nodes:e,geo:t,reveal:r}){const a=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),n=[];let l=null;const i=()=>{l&&(n.push({x:(l.from+l.to)/2,text:l.first===l.last?l.first:`${l.first}–${l.last}`}),l=null)};for(const e of a){const t=e.first===e.last?e.first:`${e.first}–${e.last}`,r=Mi(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__ */ct("div",{"aria-hidden":"true","data-timeline-part":"captions",children:n.map(e=>/* @__PURE__ */ct("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 Hi({phase:e,geo:t,xOf:r}){const a=r(e.minMs),n=Math.max(r(e.maxMs)-a,4);/* @__PURE__ */
|
|
365
|
-
return dt("div",{"aria-hidden":"true","data-timeline-part":"phase",children:[
|
|
366
|
-
/* @__PURE__ */ct("div",{className:"rosh-tl-phase border-gray-300",style:{left:`${a}px`,width:`${n}px`,top:t.laneB+t.laneH-4+"px"}}),
|
|
367
|
-
/* @__PURE__ */dt("span",{className:"rosh-tl-phase-label text-gray-500",style:{left:`${a+n/2}px`,top:`${t.laneB+t.laneH+5}px`},children:[e.label," · parallel"]})]})}function _i({nodes:e,trackPx:t,geo:r,activeKey:a,hoveredKey:n,currentKey:l}){const i=Se().timeline,s=(e,t)=>null!==t&&(e.key===t||e.members.some(e=>e.key===t)),o=e.find(e=>e.key===n)??e.find(e=>s(e,a))??null;if(!o)return null;const c=o.mark,d=c?c.label:`×${o.members.length}`,u=c?c.dateText:function(e){const t=e[0].dateText,r=e[e.length-1].dateText;return t===r?t:`${t} – ${r}`}(o.members),h=c?c.widthPx:yi(d,u),m=c?.onOpen;/* @__PURE__ */
|
|
368
|
-
return dt("div",{"data-timeline-part":"label",className:`rosh-tl-label${o.key===n?" is-hot":""}${s(o,l)?" is-current":""}`,style:{left:`${bi(o.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */ct("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */ct("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
|
|
369
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function qi({groups:e,trackPx:t,geo:r,startMs:a,endMs:n,currentKey:l,hoveredKey:i,reveal:s,step:o,zoomedKey:c,popId:d,aimBubble:u,openCluster:h,setOpenCluster:m,previewCluster:p,setPreviewCluster:g,setZoomKey:f,startCaptionPx:b}){const x=[];e.forEach((e,t)=>{if("cluster"===e.type){const a=`cluster-${e.members[0].key}`,n=(r=e.members,`${(r[0]?.label??"").replace(/\s*v?\d+$/i,"").trim()||(r[0]?.label??"")} ×${r.length}`);if(x.push({key:a,group:e,text:n,x:e.members.reduce((e,t)=>e+t.baseX,0)/e.members.length,index:t,lane:-1,left:0,widthPx:Math.ceil(Mi(n))+28}),a===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,a,n={}){const l=t>0?t:0,i=a>0?a:1,s=n.gapPx??6,o=Math.max(1,n.laneCount??4),c=e.map((e,t)=>({item:e,index:t})).sort((e,t)=>(e.item.priority??0)-(t.item.priority??0)||e.item.ms-t.item.ms||e.index-t.index),d=Array.from({length:o},()=>[]),u=/* @__PURE__ */new Map;for(const{item:e}of c){const t=Math.max(0,e.widthPx);if(l<=0||t>l){u.set(e.key,-1);continue}const a=e.xPx??(e.ms-r)/i*l,n=Math.min(Math.max(a-t/2,0),l-t),c=n+t;let h=-1;for(let e=0;e<o;e++)if(d[e].every(e=>n>e.right+s||c+s<e.left)){d[e].push({left:n,right:c}),h=e;break}u.set(e.key,h)}return e.map(e=>({key:e.key,lane:u.get(e.key)??-1}))}([...b>0?[{key:"__rosh-tl-start__",ms:a,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,a,Math.max(n-a,Xl),{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=bi(e.x,e.widthPx,t);const w=x.find(e=>e.key===(h??p)),N=e=>0===e?r.laneA:r.laneB,k=e=>0===e?r.rail-4:r.rail+6+3;/* @__PURE__ */
|
|
370
|
-
return dt(ut,{children:[x.map(e=>{const t=Math.max(0,e.lane),a=Math.round(e.index*o+60);if("cluster"===e.group.type){const n=h===e.key,l=e.group.members.map(e=>e.x),i=()=>{g(null),n||f(null)};/* @__PURE__ */
|
|
371
|
-
return dt("div",{children:[
|
|
372
|
-
/* @__PURE__ */dt("button",{type:"button","data-timeline-part":"cluster",className:`rosh-tl-pill${Ci[e.group.kind]?.token?"":" text-blue-600"}${s?" rosh-tl-fade":""}`,"aria-expanded":n,"aria-controls":d,style:{left:`${e.left}px`,top:`${0===t?r.laneA+r.laneH-19:r.laneB}px`,color:Ci[e.group.kind]?.token,...s?{animationDelay:`${a}ms`}:{}},onMouseEnter:()=>{g(e.key),f(e.key)},onMouseLeave:i,onFocus:()=>{g(e.key),f(e.key)},onBlur:i,onClick:()=>{m(n?null:e.key),f(n?null:e.key)},children:[
|
|
373
|
-
/* @__PURE__ */ct("i",{"aria-hidden":"true"}),e.text]}),
|
|
374
|
-
/* @__PURE__ */ct("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:`${k(t)}px`}})]},e.key)}const n=e.group.mark;if(e.lane<0)return n.key===i?/* @__PURE__ */dt("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:[
|
|
375
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-name",children:n.label}),
|
|
376
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-date",children:n.dateText})]},e.key):null;const c=Math.abs(e.left+e.widthPx/2-n.x)<=8;/* @__PURE__ */
|
|
377
|
-
return dt("div",{children:[
|
|
378
|
-
/* @__PURE__ */dt("div",{"aria-hidden":"true","data-timeline-part":"label",className:`rosh-tl-label${0===t?" is-up":""}${n.key===l?" is-current":""}${n.key===i?" is-hot":""}${s?" rosh-tl-fade":""}`,style:{left:`${e.left}px`,top:`${N(t)}px`,width:`${e.widthPx}px`,height:`${r.laneH}px`,...s?{animationDelay:`${a}ms`}:{}},children:[
|
|
379
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-name",children:n.label}),
|
|
380
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-date",children:n.dateText})]}),!c&&/* @__PURE__ */ct("i",{"aria-hidden":"true",className:"rosh-tl-lead"+(s?" rosh-tl-fade":""),style:{left:`${Math.min(e.left+e.widthPx/2,n.x)}px`,width:`${Math.abs(e.left+e.widthPx/2-n.x)}px`,top:`${k(t)}px`,...s?{animationDelay:`${a}ms`}:{}}})]},e.key)}),w&&"cluster"===w.group.type&&/* @__PURE__ */dt("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:[
|
|
381
|
-
/* @__PURE__ */ct("p",{className:"rosh-tl-popover-head",children:w.text}),
|
|
382
|
-
/* @__PURE__ */ct("ol",{children:w.group.members.map(e=>/* @__PURE__ */dt("li",{children:[
|
|
383
|
-
/* @__PURE__ */ct("span",{children:e.label}),
|
|
384
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function Ui({thumb:e,value:t,snap:r,axis:a,geo:n,startMs:l,endMs:i,trackPx:s,layerRef:o,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=Se().timeline,p=Ae(),g=Ze(!1),f=c?c.px:a.xByMs(t),b=c?c.ms:t,x=Fi(e.stops),y=x?x.indexOf(t):-1,v=e=>{const r=o.current?.getBoundingClientRect();return r?a.msByPx(e-r.left):t},w=a=>{const n=r(a);n!==t&&e.onChange(n)},N=t=>{d?.(),g.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},k=t=>{g.current&&(g.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},$=e=>{if(!g.current)return;const t=v(e.clientX);w(t),h(function(e,t){if(!Number.isFinite(t))return null;const r=e.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms);for(let e=0;e+1<r.length;e++){const a=r[e],n=r[e+1];if(t<a.ms||t>n.ms)continue;const l=n.ms-a.ms;return{fromKey:a.key,toKey:n.key,t:l>0?vi((t-a.ms)/l,0,1):1,ms:t}}return null}(u,t))},M=e.valueText?e.valueText(b):Jl(b,p),C=Math.max(1,Math.round((i-l)/Xl));/* @__PURE__ */
|
|
385
|
-
return dt(ut,{children:[
|
|
386
|
-
/* @__PURE__ */ct("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:n.rail-9+"px",height:"24px"},onPointerDown:e=>{N(e),w(v(e.clientX))},onPointerMove:$,onPointerUp:k,onPointerCancel:k}),
|
|
387
|
-
/* @__PURE__ */ct("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${bi(f,88,s)+44}px`,top:`${n.tag}px`},children:e.chip?e.chip(b):Jl(b,p)}),
|
|
388
|
-
/* @__PURE__ */ct("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)/Xl),"aria-valuetext":M,style:{left:`${f}px`,top:`${n.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,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 a=(e.shiftKey?7:1)*Xl;return"ArrowRight"===r||"ArrowUp"===r?t+a:"ArrowLeft"===r||"ArrowDown"===r?t-a:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function Vi(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Yi({startMs:e,endMs:t,axis:r="linear",items:a,markers:n=[],pending:l=[],fillToMs:i,todayMs:s,labels:o="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:x=!0,ariaLabel:y,highlightKeys:v=null,onHoverChange:w,endMark:N=null}){const k="none"===o,$=_(Date.now,null),M=_($i,!1),C=s??$,L=Ze(null),D=Se().timeline,P=Ae(),A=e=>Jl(e,P),S=Ze(null),j=Ze(null),z=Ze(null),F=Ze(/* @__PURE__ */new Map),E=Ze(void 0),O=Ze(void 0),T=Ze(null),[I,R]=Xe({}),[W,K]=Xe(null),[H,q]=Xe(null),[U,V]=Xe(null),[Y,G]=Xe(null),[X,Z]=Xe(null),[J,Q]=Xe(null),ee=Ye(),te=Ye(),re=ji(L,!0),ae=re>0?re-(l.length>0&&!k?176:0):0,ne=ae>0&&ae-20<320,le=ji(S,!ne),ie=le>0?le:600,se=ki[o],oe=k&&l.length>0,ce=oe?Math.max(0,ie-36):ie,de=r=>r>=e-Xl&&r<=t+Xl,ue=a.filter(e=>Number.isFinite(e.ms)&&de(e.ms)).slice().sort((e,t)=>e.ms-t.ms),he="spread"===r?n.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],me=fi([e,...[...ue.map(e=>e.ms),...he].filter(r=>r>e&&r<t),t],ce,"compressed"===(pe=r)?{}:"spread"===pe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var pe;const ge=me.xByMs,fe=ue.filter(e=>!e.provisional),be=g??(fe.length>0?fe[fe.length-1].key:null),xe=ue.map((e,t)=>{const r=e.date??A(e.ms),a=(e.priority??0)>0||"report"===e.kind,n=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?Li[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:ge(e.ms),baseX:ge(e.ms),kind:n,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Di(e,n,0===t&&"default"===n),role:e.key===be?"current":a?"dot":"key",widthPx:k?Math.max(16,Mi(e.caption??"")+6):I[e.key]||yi(e.label,r),collapsible:a,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),ye=n.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&de(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,a=A(t);return{key:r,ms:t,x:ge(t),baseX:ge(t),kind:e.kind,label:e.label,dateText:a,detail:e.detail,preview:e.preview,glyph:e.glyph??Ci[e.kind].glyph,role:"key",widthPx:I[r]||yi(e.label,a),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),ve=oe?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Xl,x:ie,baseX:ie,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}]})():[],we=k&&N&&!oe?[{key:N.key,ms:t,x:ce,baseX:ce,kind:"default",label:N.label,dateText:N.dateText??A(t),detail:N.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Ne=[...xe,...ye,...ve,...we].sort((e,t)=>e.x-t.x||e.ms-t.ms),ke=m?.start??D.start(A(e)),$e=null==ke||!1===ke?0:"string"==typeof ke?Math.ceil(Mi(ke)):96,Me="lanes"===o?function(e,t={}){const r=t.minPitchPx??40,a=[];let n=0;for(;n<e.length;){const t=e[n];if(!t.collapsible){a.push({type:"item",mark:t}),n+=1;continue}let l=n+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(n,l),s=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const a=i[t-1],n=Math.max(r,Math.max(e.widthPx,a.widthPx)+8);return e.x-a.x<n});if(i.length>=3||s)a.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)a.push({type:"item",mark:e});n=l}return a}(Ne):[],Ce=function(e,t=16){const r=[];let a=0;for(;a<e.length;){let n=a+1;for(;n<e.length&&e[n].x-e[n-1].x<t;)n+=1;if(n-a===1)r.push({type:"item",mark:e[a]});else{const t=e.slice(a,n),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:xi,members:t})}a=n}return r}(Ne),Le=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,De=/* @__PURE__ */new Map;for(const e of Ce)if("cluster"===e.type)for(const t of e.members)De.set(t.key,Le(e));const Pe=U??Y??X,je=Me.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Pe)??Ce.find(e=>"cluster"===e.type&&Le(e)===Pe),ze=e=>({x:e.baseX,widthPx:e.widthPx}),Fe=je&&"cluster"===je.type?je.members.map(ze):f?Ne.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(ze):[],Ee=Fe.length>1?zi(me,Fe,ce):me,Oe=Ee!==me;if(Oe)for(const e of Ne)e.isCap||(e.x=Ee.xByMs(e.ms));const Te=Ne.some(e=>e.x<14),Be=Oe&&je?Pe:null,Ie=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Re=ne?Ne.map(Ie):Ce.flatMap(e=>{if("item"===e.type)return[Ie(e.mark)];const t=Le(e);if(t===Be&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ie);var r;const a=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:a.reduce((e,t)=>e+t,0)/a.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),We=/* @__PURE__ */new Map;for(const e of Re)for(const t of e.members)We.set(t.key,e.key);const Ke=Ce.find(e=>"cluster"===e.type&&Le(e)===Be),He=Ke&&"cluster"===Ke.type?{from:Math.min(...Ke.members.map(e=>e.x))-16,to:Math.max(...Ke.members.map(e=>e.x))+16}:null,_e=Ze(Be),[qe,Ue]=Xe(!1);Qe(()=>{if(_e.current===Be)return;_e.current=Be,Ue(!0);const e=setTimeout(()=>Ue(!1),240);return()=>clearTimeout(e)},[Be]);const Ve=Ne.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Si(()=>{const e=j.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,a=r.getBoundingClientRect().width;e&&a>0&&(t[e]=a)}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)},[Ve]);const Je=`${o}|${r}|${Ne.map(e=>`${e.key}@${e.ms}`).join("|")}`,[et,tt]=Xe(Je),rt=x&&et===Je;Qe(()=>{et!==Je&&tt(Je)},[et,Je]);const at=Math.min(28,340/Math.max(1,Ne.length-1)),nt=Fi(u?.stops),lt=r=>{const a=Math.min(Math.max(r,e),t);if(!nt)return a;let n=nt[0];for(const e of nt)Math.abs(e-a)<Math.abs(n-a)&&(n=e);return n},it=u?lt(u.valueMs):null,st=h&&u?xe.filter(e=>!nt||nt.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ot=function(e,t,r={}){const a=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,n=Math.max(0,r.dwellMs??700)/a,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const s=l[t],o=l[t+1],c=e.xByMs(s.ms),d=e.xByMs(o.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:vi(350*u/100,450,1400)/a;i.push({fromKey:s.key,toKey:o.key,fromMs:s.ms,toMs:o.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:n,msByPx:e.msByPx})}return i}(Ee,st,{speed:h?.speed,reducedMotion:M}),[ht,mt]=Xe(null),pt=Ze(null),gt=Ze({segments:ot,value:it,playback:h});Qe(()=>{gt.current={segments:ot,value:it,playback:h}});const ft=Ze(null),bt=Ge(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=Ge(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!h?.playing&&!!u;Qe(()=>{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,a=0;const n=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},n(Ni(t,0))):xt()},s=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const a=e[t.index];if(!a)return{cursor:null,at:null,arrived:null,progress:null};const n=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-n;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:Ni(a,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:Ni(a,0),arrived:null,progress:null}}const l=a.durationMs>0?Math.min(1,t.t+n/a.durationMs):1,i=Ni(a,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:a.fromKey,toKey:a.toKey,t:wi(l),ms:i.ms}};const s=e[t.index+1];return{cursor:s?{index:t.index+1,phase:"rest",t:0,restLeftMs:s.dwellMs,sinceMs:r}:null,at:i,arrived:{key:a.toKey,ms:a.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&n(i.at),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(),a=requestAnimationFrame(s)):xt()};return l(),a=requestAnimationFrame(s),()=>{cancelAnimationFrame(a),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[yt,xt,bt]);const vt=xe.filter(e=>!e.provisional),wt=u?ht?ht.ms:it:void 0!==i?i:vt.length>0?null===C?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,C):null,Nt=new Set(v??[]),kt=Ne.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=Ge(()=>{clearTimeout(E.current),clearTimeout(O.current),K(null),q(null),V(null),G(null),Z(null)},[]);Qe(()=>()=>{clearTimeout(E.current),clearTimeout(O.current)},[]),Qe(()=>{const e=T.current;e&&(T.current=null,F.current.get(e)?.focus())});const Ct=null!==H||null!==U||null!==Y||null!==X;Qe(()=>{if(Ct)return B(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=Ge((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let a=r>0?Math.max(r,Math.min(t,ie-r)):t;const n=e.parentElement;if(r>0&&n){const t=b(e),l=n.getBoundingClientRect().left,i=t.left+8+r-l,s=t.right-8-r-l;i<=s&&(a=Math.max(i,Math.min(a,s)))}e.style.left=`${a}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-a)}px`)},[ie]),Dt=Re.find(e=>e.key===H)??null,Pt=Dt?Dt.x:0;Si(()=>{Lt(z.current,Pt)},[Lt,H,Pt]);const At=it??void 0,St=Ze(null);Qe(()=>{if(void 0===At)return;const e=Ee.xByMs(At),t=St.current;if(St.current=e,null===t||e<=t)return;const r=[];for(const a of Ne){if(a.x<=t||a.x>e)continue;const n=F.current.get(We.get(a.key)??a.key);n&&(n.classList.add("is-hit"),r.push(setTimeout(()=>n.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[At]);const jt=Re.map(e=>e.key),zt=be?We.get(be)??null:null,Ft=J&&jt.includes(J)?J:zt&&jt.includes(zt)?zt:jt[0],Et=e=>{const t=jt.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?jt.length-1:-1;r<0||r>jt.length-1||(e.preventDefault(),Q(jt[r]),F.current.get(jt[r])?.focus())},Ot=()=>clearTimeout(O.current),Tt=e=>{Ot(),Z(e)},Bt=()=>{clearTimeout(O.current),O.current=setTimeout(()=>Z(null),260)},It=e=>{Be&&De.get(e)===Be?Ot():(Ot(),Z(null))},Rt=e=>{clearTimeout(E.current),K(e),q(e),w?.((e=>{const t=Re.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{K(t=>t===e?null:t),clearTimeout(E.current),E.current=setTimeout(()=>q(t=>t===e?null:t),160),w?.(null)},Kt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Ai(e),"aria-describedby":H===e.key?ee:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{It(e.key),Rt(e.key)},onMouseLeave:()=>{Bt(),Wt(e.key)},onFocus:()=>{It(e.key),Rt(e.key),Q(e.key)},onBlur:()=>{Bt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),Ht=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(Ai))),"aria-describedby":H===e.key?ee: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:()=>{Bt(),Wt(e.key)},onFocus:()=>{Ot(),Rt(e.key),Q(e.key)},onBlur:()=>{Bt(),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];Q(r.key),T.current=r.key}};var t,r},_t="lanes"!==o||Ne.length>1;if(ne)/* @__PURE__ */
|
|
389
|
-
return ct("div",{ref:L,children:/* @__PURE__ */ct(Bi,{marks:Ne.filter(e=>!e.isCap),pending:l,currentKey:be,todayMs:C,reveal:rt,ariaLabel:y,step:at,nodeProps:Kt,onKeyDown:Et})});const qt=(e,t)=>null==e||!1===e?null:/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:se.rail-3+"px"},children:e});/* @__PURE__ */
|
|
390
|
-
return dt("div",{ref:L,className:"rosh-tl-body"+(l.length>0&&!k?"":" is-solo"),children:[
|
|
391
|
-
/* @__PURE__ */dt("div",{className:"flex items-stretch gap-3",children:[k&&qt(ke,!1),
|
|
392
|
-
/* @__PURE__ */ct("div",{className:"rosh-tl-stage",style:{height:`${Vi(se,_t,p.length>0&&!k)}px`},children:/* @__PURE__ */dt("div",{ref:S,className:`rosh-tl-layer${qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!He)return;const t=S.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=He.from&&r<=He.to?Ot():Bt()},onMouseLeave:Bt,children:[!k&&/* @__PURE__ */ct(Ei,{marks:Ne,innerRef:j}),
|
|
393
|
-
/* @__PURE__ */ct(Ii,{axis:Ee,geo:se,fillTo:wt,reveal:rt,trackPx:ce,tweened:!!u}),oe&&
|
|
394
|
-
/* @__PURE__ */ct("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${ce}px`,width:ie-ce+"px",top:se.rail+3-1+"px"}}),$t&&/* @__PURE__ */ct("div",{"aria-hidden":"true",className:"rosh-tl-band","data-timeline-part":"highlight",style:{left:$t.from-10+"px",width:$t.to-$t.from+20+"px",top:se.rail-7+"px",height:"20px"}}),
|
|
395
|
-
/* @__PURE__ */ct(Oi,{startMs:e,endMs:t,axis:Ee,geo:se,reveal:rt}),
|
|
396
|
-
/* @__PURE__ */ct(Ri,{geo:se,caption:k?null:ke,endCaption:k?null:m?.end,around:Te,reveal:rt,trackPx:ie}),k&&/* @__PURE__ */ct(Ki,{nodes:Re,geo:se,reveal:rt}),null!==C&&C>e&&C<=t+Xl&&/* @__PURE__ */ct(Wi,{x:Ee.xByMs(Math.min(C,t)),geo:se,trackPx:ie,label:A(C),reveal:rt}),!k&&p.map(e=>/* @__PURE__ */ct(Hi,{phase:e,geo:se,xOf:Ee.xByMs},e.key)),
|
|
397
|
-
/* @__PURE__ */ct("ol",{className:"rosh-tl-nodes","aria-label":y,onKeyDown:Et,children:Re.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),a=`${se.rail+3}px`,n=rt?di(t,at):{},l=(e=>!!$t&&e.x>=$t.from-.5&&e.x<=$t.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
|
|
398
|
-
return ct("li",{children:/* @__PURE__ */ct("button",{...Kt(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${rt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:a,...n}})},e.key);if(!e.mark){const t=e.kind===xi,i=Pi(t?"default":e.kind,"key"),s=t?void 0:Ci[e.kind]?.glyph;/* @__PURE__ */
|
|
399
|
-
return dt("li",{...r(be)?{"aria-current":"step"}:{},children:[
|
|
400
|
-
/* @__PURE__ */dt("button",{...Ht(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(c)?" is-active":""}${l}${rt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:a,...n},children:[s&&/* @__PURE__ */ct(hi,{name:s}),t&&/* @__PURE__ */dt("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */dt("i",{"aria-hidden":"true",className:"rosh-tl-count"+(rt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:a},children:["×",e.members.length]})]},e.key)}const i=e.mark,s=Pi(i.kind,i.role,i.provisional),{glyph:o}=i;/* @__PURE__ */
|
|
401
|
-
return ct("li",{...i.key===be?{"aria-current":"step"}:{},children:/* @__PURE__ */dt("button",{...Kt(i),className:`${s.className}${i.key===c?" is-active":""}${l}${rt?" rosh-tl-pop":""}`,style:{...s.style,left:`${i.x}px`,top:a,...n},children:[o&&/* @__PURE__ */ct(hi,{name:o}),"current"===i.role&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(rt?" is-on":"")})]})},i.key)})}),"lanes"===o?/* @__PURE__ */ct(qi,{groups:Me,trackPx:ie,geo:se,startMs:e,endMs:t,currentKey:be,hoveredKey:W,reveal:rt,step:at,zoomedKey:Be,popId:te,aimBubble:Lt,startCaptionPx:$e,openCluster:U,setOpenCluster:V,previewCluster:Y,setPreviewCluster:G,setZoomKey:Z}):"active"===o?/* @__PURE__ */ct(_i,{nodes:Re,trackPx:ie,geo:se,activeKey:c,hoveredKey:W,currentKey:be}):null,Dt&&/* @__PURE__ */ct("div",{ref:z,id:ee,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${se.rail+6+6}px`},onMouseEnter:()=>{Ot(),Rt(Dt.key)},onMouseLeave:()=>{Bt(),Wt(Dt.key)},onFocus:()=>{Ot(),Rt(Dt.key)},onBlur:()=>{Bt(),Wt(Dt.key)},children:Dt.mark?/* @__PURE__ */dt(ut,{children:[
|
|
402
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-name",children:Dt.mark.label}),
|
|
403
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-date",children:Dt.mark.dateText}),Dt.mark.preview?/* @__PURE__ */ct("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:Dt.mark.preview}):Dt.mark.detail&&/* @__PURE__ */ct("span",{className:"rosh-tl-detail",children:Dt.mark.detail}),(Dt.mark.onOpen??Dt.mark.onClick)&&/* @__PURE__ */ct("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})]}):
|
|
404
|
-
/* @__PURE__ */dt("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
|
|
405
|
-
/* @__PURE__ */dt("p",{className:"rosh-tl-popover-head",children:["×",Dt.members.length]}),
|
|
406
|
-
/* @__PURE__ */ct("ol",{children:Dt.members.map(e=>/* @__PURE__ */dt("li",{children:[
|
|
407
|
-
/* @__PURE__ */dt("p",{className:"rosh-tl-foldrow",children:[
|
|
408
|
-
/* @__PURE__ */ct("span",{children:e.label}),
|
|
409
|
-
/* @__PURE__ */ct("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */ct("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */ct("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),u&&null!==it&&
|
|
410
|
-
/* @__PURE__ */ct(Ui,{thumb:u,value:it,snap:lt,axis:Ee,geo:se,startMs:e,endMs:t,trackPx:ie,layerRef:S,glide:ht,onScrub:h?xt:void 0,nodes:st,onProgress:bt})]})}),k&&qt(m?.end,!0)]}),l.length>0&&!k&&/* @__PURE__ */ct(Ti,{pending:l,reveal:rt})]})}function Gi({icon:e,heading:t,subject:r,meta:a=[],actions:n,footer:l,children:i}){const s=[...r?[/* @__PURE__ */ct("b",{children:r},"subject")]:[],...a.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
|
|
411
|
-
return dt("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
|
|
412
|
-
/* @__PURE__ */dt("div",{className:"rosh-tl-head",children:[
|
|
413
|
-
/* @__PURE__ */dt("div",{className:"rosh-tl-head-main",children:[e&&/* @__PURE__ */ct("span",{className:"rosh-tl-ico text-gray-500","aria-hidden":"true",children:e}),
|
|
414
|
-
/* @__PURE__ */ct("h4",{className:"rosh-tl-title text-gray-800",children:t}),s.length>0&&/* @__PURE__ */ct("p",{className:"rosh-tl-meta text-gray-500",children:s.map((e,t)=>
|
|
415
|
-
/* @__PURE__ */dt(lt,{children:[t>0&&/* @__PURE__ */ct("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),n&&/* @__PURE__ */ct("span",{className:"rosh-tl-head-actions",children:n})]}),i,l&&/* @__PURE__ */ct("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Xi({title:e,heading:t,subject:r,milestones:a,summary:n,endDate:l,phaseLabels:i,variant:s="card",edgeCaptions:o,highlightKeys:c=null,onHoverChange:d}){const u=_(Date.now,null),h=[],m=[],p=Se().timeline,g=Ae();for(const e of a){const t=Zl(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=Zl(l??null);let b,x,y=!0;0===h.length?(x=f??u??0,b=x-30*Xl,y=null!==f||null!==u):(b=h[0].ms,x=f??h[h.length-1].ms,x-b<Xl&&(x=b+Xl));const v=h.length>0?Math.max(0,Math.round((x-b)/Xl)):0,w=n??(v>0?p.duration(v):void 0),N=[h.length>0?p.started(Jl(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,a.length):void 0],k=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),$={};for(const e of h)e.phase&&($[e.phase]=$[e.phase]||[]).push(e.ms);const M=Object.entries($).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),C="rail"===s,L=y&&/* @__PURE__ */ct("div",{className:"select-none",children:/* @__PURE__ */ct(Yi,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:k,pending:m,phases:M,startMs:b,endMs:x,todayMs:u??void 0,edgeCaptions:o,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
|
|
416
|
-
return ct("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */ct(Gi,{icon:/* @__PURE__ */ct(mi,{}),heading:t??e,subject:r,meta:N,children:L})})}var Zi=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),Ji=[{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 Qi(e){if(e.order_qty<=0)return 0;let t=0;for(const r of Ji)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function es(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Qi(t),0)/t.length}function ts(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:a,poStatus:n,poNumber:l="",currentReportId:i,currentReportDate:s,msPerDayOfPlayback:o=500,markers:c=[]}=e,[d,u]=Xe(null),h=Se().production;Qe(()=>{s?u(new Date(s).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=Xe(!1),g=Ze(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};Qe(()=>()=>f(),[]),Qe(()=>{f()},[i]);const b=t.map(e=>Zl(e.date)).filter(e=>null!=e),x=_(Date.now,null)??Math.max(0,...b,...c.map(e=>Zl(e.date)??0),Zl(r??null)??0,Zl(a??null)??0),y=b.length?Math.min(...b):x,v=b.length?Math.max(...b):x,w=Zl(r??null)??y,N=Zl(a??null)??0,k=Zi.has((n||"").toLowerCase()),$=c.reduce((e,t)=>{const r=Zl(t.date);return null!=r&&r>e?r:e},0),M=(()=>{const e=[N,v,$,w+Xl];return k||e.push(x),Math.max(...e)})(),C=Math.max(1,Math.round((M-w)/Xl)),L=Zl(s??null)??v??w,D=Math.min(Math.max(d??L,w),M),P=t.find(e=>{const t=Zl(e.date);return null!=t&&t<=D})??null;let A=null;for(let e=t.length-1;e>=0;e--){const r=Zl(t[e].date);if(null!=r&&r>D){A=t[e];break}}const S=(()=>{if(P||!A||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:a??null,created_by_name:"",notes:""}})(),j=P??S,z=P?Zl(P.date):S?w:null,F=A?Zl(A.date):null,E=!!(j&&A&&null!=z&&null!=F&&D>z&&D<F);let O,T;if(E&&null!=z&&null!=F){const e=(D-z)/Math.max(F-z,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of j?.items??[])r[e.part_number]=e;const a={};for(const e of A?.items??[])a[e.part_number]=e;const n=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(a)])).map((e,n)=>{const l=r[e]??{},i=a[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${n}`,part_number:e,description:l.description??i.description??"",order_qty:s(l.order_qty??i.order_qty??0),casting:t(s(l.casting),s(i.casting)),cnc:t(s(l.cnc),s(i.cnc)),painting:t(s(l.painting),s(i.painting)),packing:t(s(l.packing),s(i.packing)),finished_goods:t(s(l.finished_goods),s(i.finished_goods)),stock_qty:t(s(l.stock_qty),s(i.stock_qty))}}),l=Zl(j?.est_completion_date),i=Zl(A?.est_completion_date);let s;s=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):j?.est_completion_date||A?.est_completion_date||null,O={id:`interp-${D}`,progress_number:h.estimated,date:new Date(D).toISOString().slice(0,10),created_by_name:"",est_completion_date:s,items:n,notes:""},T=j}else if(O=j??t[t.length-1]??null,O){const e=t.findIndex(e=>e.id===O.id);T=e>=0&&e<t.length-1?t[e+1]:null}else T=null;const B={};for(const e of T?.items??[])B[e.part_number]=e;const I=!(!i||O?.id===i),R=i?Math.min(Zl(s??null)??M,M):M,W=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:M,totalLeadDays:C,scrubMs:D,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),s&&u(new Date(s).getTime())},scrubbedAway:I,beforeAnchor:j,nextAfter:A,displayed:O,prevReport:T,prevByPN:B,isInterpolated:E,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=a=>{const n=a-e;if(e=a,t+=n/o*Xl,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:Zl(a??null)}}function rs({startMs:e,endMs:t,reports:r,markers:a,valueMs:n,activeId:l,onChange:i,onPickReport:s,onOpenReport:o,onOpenMarker:c,onDragStart:d,renderReportPreview:u,reportLabel:h,playback:m,edgeCaptions:p,bare:g=!1,endMark:f=null}){const b=Se().production,x=Ae(),y=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),v=y.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:h(e),preview:e.preview??u?.(e),onOpen:o?()=>o(e.id):void 0})),w=new Map(y.map(({report:e,ms:t})=>[e.id,t])),N=y.map(({ms:e})=>e),k=c?a.map(e=>({...e,onOpen:c})):a;/* @__PURE__ */
|
|
417
|
-
return ct("div",{className:"select-none",children:/* @__PURE__ */ct(Yi,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:k,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),s(e)},playback:m,edgeCaptions:p,thumb:{valueMs:n,onChange:i,onDragStart:d,stops:N,ariaLabel:b.scrub,valueText:e=>{const t=(e=>y.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${Jl(e,x)}`:Jl(e,x)}},ariaLabel:b.label(Jl(e,x),Jl(t,x))})})}function as({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:a,renderReportPreview:n,onScrubProgress:l,heading:i,edgeCaptions:s,reportLabel:o=e=>e.progress_number,resetLabel:c,variant:d="card",onPlayStart:u}){const{reports:h,markers:m,poNumber:p,startMs:g,endMs:f,totalLeadDays:b,scrubMs:x,setScrubMs:y,displayed:v,scrubbedAway:w,resetToCurrent:N,currentReportId:k,currentReportProgressNumber:$,estCompletionMs:M}=e,C=function(e,t,r){const[a,n]=Xe(!1),l=Ze(!1);return{playing:a,toggle:()=>{a?n(!1):0!==e.length&&(r?.(),l.current||(l.current=!0,t(e[0])),n(!0))},stop:()=>{l.current=!1,n(!1)}}}(h.map(e=>Zl(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),y,u),L=Se().production,D=Ae(),P=i??L.heading,A=e=>Jl(e,D);if(0===h.length&&0===m.length)return null;const S=m.filter(e=>"shipment"===e.kind),j=m.filter(e=>"inspection"===e.kind),z=m.filter(e=>"invoice"===e.kind),F=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),E=v?es(v):0,O=h.find(e=>e.id===k),T=O?o(O):$,B=
|
|
418
|
-
/* @__PURE__ */dt("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__ */ct(qe,{name:"pause",fallback:oe,"aria-hidden":"true"}):/* @__PURE__ */ct(qe,{name:"play",fallback:ce,"aria-hidden":"true"}),
|
|
419
|
-
/* @__PURE__ */ct("span",{children:C.playing?L.pause:L.play})]}),I=w&&(c??T)?/* @__PURE__ */ct("button",{type:"button",onClick:()=>{C.stop(),N()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(T))}):null,[R,W]=Fe(L.showing),K=e=>/* @__PURE__ */ct("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */dt(ut,{children:[e&&R,
|
|
420
|
-
/* @__PURE__ */ct("b",{className:"font-medium",children:o(v)}),e&&W,
|
|
421
|
-
/* @__PURE__ */dt("span",{className:"text-gray-500",children:[" · ",A(new Date(v.date).getTime())," · ",L.overall(Math.round(E))," · ",L.inStock(F)]})]}):/* @__PURE__ */ct("span",{className:"text-gray-500",children:L.noReport})});if("rail"===d){const e=null!=M&&M>=f&&f>g,i=e?{key:"__estimate__",label:L.estimatedCompletion,dateText:A(M)}:null;/* @__PURE__ */
|
|
422
|
-
return dt("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
423
|
-
/* @__PURE__ */ct(rs,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:a,renderReportPreview:n,reportLabel:o,edgeCaptions:{start:s?.start??L.start,end:s?.end??(e?L.estDone:void 0)},onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}}),
|
|
424
|
-
/* @__PURE__ */dt("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[B,I,K(!1)]})]})}/* @__PURE__ */
|
|
425
|
-
return ct("div",{className:"shrink-0",children:/* @__PURE__ */ct(Gi,{icon:/* @__PURE__ */ct(pi,{}),heading:P,subject:p,meta:[`${A(g)} → ${A(f)}`,L.leadTime(b)],actions:/* @__PURE__ */dt(ut,{children:[I,B]}),footer:/* @__PURE__ */dt(ut,{children:[K(!0),
|
|
426
|
-
/* @__PURE__ */dt("div",{className:"rosh-tl-legend",children:[h.length>0&&/* @__PURE__ */dt("span",{className:"border-gray-200 text-gray-500",children:[
|
|
427
|
-
/* @__PURE__ */ct("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),S.length>0&&/* @__PURE__ */dt("span",{className:"border-gray-200 text-gray-500",children:[
|
|
428
|
-
/* @__PURE__ */ct("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */ct(hi,{name:"truck"})}),L.shipment]}),j.length>0&&/* @__PURE__ */dt("span",{className:"border-gray-200 text-gray-500",children:[
|
|
429
|
-
/* @__PURE__ */ct("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */ct(hi,{name:"flask"})}),L.inspection]}),z.length>0&&/* @__PURE__ */dt("span",{className:"border-gray-200 text-gray-500",children:[
|
|
430
|
-
/* @__PURE__ */ct("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */ct(hi,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */ct(rs,{startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:a,renderReportPreview:n,reportLabel:o,edgeCaptions:s,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}})})})}var ns=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function ls({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:a,qtyField:n="instruction",showNewIndicator:l=!1,getInstructionQty:i=e=>e.quantity,getActualQty:s=e=>e.actual_qty,isFilled:o,isNew:c=e=>Boolean(e._isNew),className:d,style:u}){const h=Se().containers,m=o?e.filter(o):e,p=e=>ns(i(e)),g=e=>ns(s(e)),f=m.some(e=>null!=s(e)&&g(e)>0),b=e=>f?p(e):"actual"===n?s(e)??i(e)??0:i(e)??0,x=m.reduce((e,t)=>e+ns(b(t)),0),y=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+ns(b(t)),0),w=m.reduce((e,t)=>e+p(t),0),N=m.reduce((e,t)=>e+g(t),0),k=e=>t?.(e)??0,$=r??(e=>k(e)*p(e)),M=a??(e=>k(e)*g(e)),C=m.reduce((e,t)=>e+$(t),0),L=m.reduce((e,t)=>e+M(t),0),D=f?Math.max(C,L):"actual"===n&&L||C,P=D<=34.65?"20ft":"40ft",A="20ft"===P?33:67,S=D>0?Math.max(1,Math.ceil(D/A)):0,j=S*A,z=D>0&&D>=.95*j&&D<=1.1*j;if(0===m.length)return null;const F=(e,t)=>A>0?Math.max(0,Math.min((e-t*A)/A*100,100)):0;/* @__PURE__ */
|
|
431
|
-
return dt("div",{className:`mt-2 px-1 space-y-2 ${d??""}`.trim(),style:u,children:[
|
|
432
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
|
|
433
|
-
/* @__PURE__ */dt("span",{children:[`${h.items(m.length)} · ${h.pieces(x)}`,f&&w!==N&&/* @__PURE__ */ct("span",{className:"ml-1 text-gray-400",children:h.split(w,N)})]}),l&&y>0&&/* @__PURE__ */dt("span",{className:"flex items-center gap-1 text-green-600",children:[
|
|
434
|
-
/* @__PURE__ */ct("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(y,v)]})]}),D>0?/* @__PURE__ */dt("div",{className:"space-y-1.5",children:[Array.from({length:S}).map((e,t)=>{const r=F(C,t),a=F(L,t),n=f,l=Math.max(r,a),i=Math.min(r,a),s=r>=a,o=n?s?"bg-blue-500":"bg-green-500":"bg-blue-500",c=n?s?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
|
|
435
|
-
return dt("div",{className:"flex items-center gap-2",children:[
|
|
436
|
-
/* @__PURE__ */ct("span",{className:"text-[10px] text-gray-400 w-8 shrink-0",children:P}),
|
|
437
|
-
/* @__PURE__ */dt("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
|
|
438
|
-
/* @__PURE__ */ct("div",{className:`absolute inset-y-0 left-0 ${o} transition-all`,style:{width:`${l}%`}}),n&&i>0&&/* @__PURE__ */ct("div",{className:`absolute inset-y-0 left-0 ${c} transition-all`,style:{width:`${i}%`}})]}),
|
|
439
|
-
/* @__PURE__ */ct("span",{className:"text-[10px] text-gray-500 w-16 text-right",children:n?h.fill(Math.min(L-t*A,A),A):h.fill(Math.min(C-t*A,A),A)})]},`bar-${t}`)}),
|
|
440
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between text-xs pt-0.5",children:[
|
|
441
|
-
/* @__PURE__ */dt("span",{className:"text-gray-500 inline-flex items-center gap-1",children:[h.total,f?/* @__PURE__ */dt(ut,{children:[
|
|
442
|
-
/* @__PURE__ */dt("span",{className:"inline-flex items-center gap-1 text-blue-700",children:[
|
|
443
|
-
/* @__PURE__ */ct("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500"}),h.instructed(C)]}),
|
|
444
|
-
/* @__PURE__ */ct("span",{className:"text-gray-400",children:"/"}),
|
|
445
|
-
/* @__PURE__ */dt("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
|
|
446
|
-
/* @__PURE__ */ct("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),h.loaded(L)]})]}):/* @__PURE__ */ct("b",{className:"text-gray-700",children:h.volume(D)})]}),
|
|
447
|
-
/* @__PURE__ */dt("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",S," × ",P]})]})]}):/* @__PURE__ */ct("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var is=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,ss=e=>nn(e.trim());function os(e){const t=[];let r,a=0,n=0;for(is.lastIndex=0;null!==(r=is.exec(e));)r.index>a&&t.push(e.slice(a,r.index)),void 0!==r[1]?t.push(
|
|
448
|
-
/* @__PURE__ */dt("span",{className:"text-gray-400",children:["[",r[1],"]"]},n++)):void 0!==r[3]?t.push(
|
|
449
|
-
/* @__PURE__ */ct("a",{href:ss(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},n++)):void 0!==r[5]?t.push(
|
|
450
|
-
/* @__PURE__ */ct("strong",{className:"font-semibold text-gray-900",children:r[5]},n++)):void 0!==r[6]?t.push(
|
|
451
|
-
/* @__PURE__ */ct("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},n++)):void 0!==r[7]&&t.push(/* @__PURE__ */ct("em",{children:r[7]},n++)),a=is.lastIndex;return a<e.length&&t.push(e.slice(a)),t}function cs({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),r=Se().markdown;/* @__PURE__ */
|
|
452
|
-
return dt("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:[
|
|
453
|
-
/* @__PURE__ */ct(qe,{name:"camera",fallback:Ce,className:"mt-0.5 h-4 w-4 shrink-0 text-gray-400","aria-hidden":"true"}),
|
|
454
|
-
/* @__PURE__ */dt("span",{className:"text-xs text-gray-500",children:[
|
|
455
|
-
/* @__PURE__ */ct("span",{className:"font-medium text-gray-600",children:`${r.screenshot} — `}),t]})]})}function ds(e,t){const r=[];for(const a of e){const e=t.exec(a);e?r.push(e[1]):r.length&&(r[r.length-1]+=" "+a.trim())}return r}var us=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function hs(e,t){const r=e.split("\n"),a=r[0],n=/^(#{2,4})\s+(.*)$/.exec(a);if(n&&1===r.length){const e=n[1].length;/* @__PURE__ */
|
|
456
|
-
return ct(`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:os(n[2])},t)}if(1===r.length&&/^---+$/.test(a))/* @__PURE__ */
|
|
457
|
-
return ct("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=us(e[0]),a=e.slice(2).map(us);/* @__PURE__ */
|
|
458
|
-
return ct("div",{className:"my-1 overflow-x-auto rounded-lg border border-gray-200",children:/* @__PURE__ */dt("table",{className:"w-full border-collapse text-sm",children:[
|
|
459
|
-
/* @__PURE__ */ct("thead",{children:/* @__PURE__ */ct("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */ct("th",{className:"border-b border-gray-200 px-3 py-1.5 text-left font-semibold text-gray-700",children:os(e)},t))})}),
|
|
460
|
-
/* @__PURE__ */ct("tbody",{children:a.map((e,t)=>/* @__PURE__ */ct("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */ct("td",{className:"border-t border-gray-100 px-3 py-1.5 align-top text-gray-700",children:os(e)},t))},t))})]})},t)}(r,t);if(/^>\s?/.test(a)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
|
|
461
|
-
return ct("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:os(e)},t)}const l=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(a);if(l&&1===r.length)/* @__PURE__ */
|
|
462
|
-
return ct(cs,{alt:l[1]},t);if(/^[-*]\s+/.test(a)){const e=ds(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
|
|
463
|
-
return ct("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */ct("li",{children:os(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(a);if(i){const e=ds(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
|
|
464
|
-
return ct("ol",{start:Number(i[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */ct("li",{className:"pl-1",children:os(e)},t))},t)}/* @__PURE__ */
|
|
465
|
-
return ct("p",{children:os(r.join(" "))},t)}var ms=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/;function ps(e){const t=e.replace(/\r\n/g,"\n").split("\n"),r=[];let a=[];const n=()=>{for(const e of a.join("\n").split(/\n{2,}/)){const t=e.replace(/\s+$/,"");""!==t.trim()&&r.push({text:t})}a=[]};for(let e=0;e<t.length;e+=1){const l=ms.exec(t[e]);if(!(null!==l&&!("`"===l[2][0]&&l[3].includes("`")))){a.push(t[e]);continue}n();const[,i,s,o]=l,c=[];for(e+=1;e<t.length;e+=1){const r=ms.exec(t[e]);if(null!==r&&r[2][0]===s[0]&&r[2].length>=s.length&&""===r[3])break;c.push(i?t[e].replace(new RegExp(`^ {0,${i.length}}`),""):t[e])}r.push({fence:{lang:o.split(/[ \t]/)[0],code:c.join("\n")}})}return n(),r}function gs({children:e,className:t}){/* @__PURE__ */
|
|
466
|
-
return ct("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:ps(e??"").map((e,t)=>"fence"in e?function({lang:e,code:t},r){/* @__PURE__ */
|
|
467
|
-
return ct("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__ */ct("code",{children:t})},r)}(e.fence,t):hs(e.text,t))})}var fs=({open:e})=>/* @__PURE__ */ct(qe,{name:"chevron-right",fallback:ke,className:"h-3.5 w-3.5 shrink-0 text-gray-400 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function bs({docs:e,loading:t=!1,categoryOrder:r,canEdit:a=!1,onNew:n,onEdit:l,renderBody:i,emptyMessage:s}){const o=Se(),[c,d]=Xe(""),[u,h]=Xe(null),[m,p]=Xe({}),g=c.trim().toLowerCase(),f=Je(()=>{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 a=new Map(r.map((e,t)=>[e,t]));return[...t.values()].sort((e,t)=>(a.get(e.key)??1/0)-(a.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=Je(()=>f.map(e=>({...e,docs:e.docs.filter(b)})).filter(e=>e.docs.length>0),[f,g]),y=Je(()=>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__ */
|
|
468
|
-
return dt("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
469
|
-
/* @__PURE__ */dt("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
470
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
471
|
-
/* @__PURE__ */ct("h2",{className:"text-sm font-semibold text-gray-900",children:o.help.title}),a&&n&&/* @__PURE__ */ct("button",{type:"button",onClick:n,className:"text-xs text-blue-600 hover:underline",children:o.help.newArticle})]}),
|
|
472
|
-
/* @__PURE__ */ct("div",{className:"px-2.5 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */dt("div",{className:"relative",children:[
|
|
473
|
-
/* @__PURE__ */ct(qe,{name:"search",fallback:de,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400","aria-hidden":"true"}),
|
|
474
|
-
/* @__PURE__ */ct("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:o.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)]"})]})}),
|
|
475
|
-
/* @__PURE__ */ct("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */ct("p",{className:"px-3 py-6 text-center text-xs text-gray-400",children:o.help.loading}):0===x.length?/* @__PURE__ */ct("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:g?o.help.noResults:s??o.help.empty}):x.map(e=>{const t=w(e.key);/* @__PURE__ */
|
|
476
|
-
return dt("div",{className:"py-0.5",children:[
|
|
477
|
-
/* @__PURE__ */dt("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:[
|
|
478
|
-
/* @__PURE__ */ct(fs,{open:t}),
|
|
479
|
-
/* @__PURE__ */ct("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=v?.slug===e.slug;/* @__PURE__ */
|
|
480
|
-
return dt("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:[
|
|
481
|
-
/* @__PURE__ */ct("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */ct("span",{className:"ml-auto shrink-0 text-[10px] text-amber-600",children:o.help.draft})]},e.slug)})]},e.key)})})]}),
|
|
482
|
-
/* @__PURE__ */ct("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:v?/* @__PURE__ */dt(ut,{children:[
|
|
483
|
-
/* @__PURE__ */dt("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
484
|
-
/* @__PURE__ */dt("div",{className:"min-w-0",children:[
|
|
485
|
-
/* @__PURE__ */ct("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:v.title}),
|
|
486
|
-
/* @__PURE__ */dt("p",{className:"text-xs text-gray-500 mt-0.5",children:[v.category_label,!1===v.is_published&&/* @__PURE__ */dt("span",{className:"ml-2 text-amber-600",children:["· ",o.help.draft]})]})]}),a&&l&&/* @__PURE__ */ct("button",{type:"button",onClick:()=>l(v),className:"shrink-0 text-sm text-blue-600 hover:underline",children:o.help.edit})]}),
|
|
487
|
-
/* @__PURE__ */ct("div",{className:"flex-1 overflow-auto px-5 py-4",children:i?i(v):v.body?/* @__PURE__ */ct(gs,{children:v.body}):/* @__PURE__ */ct("p",{className:"text-sm text-gray-500 italic",children:o.help.noBody})})]}):/* @__PURE__ */ct("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:/* @__PURE__ */ct("p",{className:"text-sm text-gray-500",children:t?o.help.loading:o.help.pickArticle})})})]})}var xs={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 ys({children:e,onClick:t,variant:r="primary",hotkey:a,disabled:n=!1,type:l="button",title:s,className:o=""}){const c=i(a??"");/* @__PURE__ */
|
|
488
|
-
return dt("button",{type:l,onClick:t,disabled:n,title:s,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 ${xs[r]} ${o}`,children:[e,a&&/* @__PURE__ */ct("kbd",{className:"kbd-submit rounded border px-1.5 py-0.5 text-[10px] font-medium",children:c})]})}function vs(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 ws({children:e,count:t}){return null==t?/* @__PURE__ */ct("p",{className:"px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */dt("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:[
|
|
489
|
-
/* @__PURE__ */ct("span",{className:"min-w-0 truncate",children:e}),
|
|
490
|
-
/* @__PURE__ */ct("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function Ns(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 ks({label:e,count:t,active:r,onClick:a,icon:n,trailing:l,severity:i,depth:s=0}){const o=Kl(i,"SidebarNavItem"),c=Se().severity,d=o?(h=c,(u=o).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */dt(ut,{children:[null!=n&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4 "+(r?"text-blue-600":"text-gray-400"),children:n}),o&&
|
|
491
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true",title:d,className:`shrink-0 h-1.5 w-1.5 rounded-full ${o.fill}`}),
|
|
492
|
-
/* @__PURE__ */ct("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),o&&/* @__PURE__ */ct("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */ct("span",{className:vs(r),children:t}),null!=l&&/* @__PURE__ */ct("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
|
|
493
|
-
return ct("button",1===s?{type:"button",onClick:a,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */ct("span",{className:Ns(r),children:m})}:{type:"button",onClick:a,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 $s({label:e,count:t,children:r,defaultExpanded:a=!0,storageKey:n}){const l=Ye(),[i,s]=q(()=>{if(n){let e=null;try{e=window.localStorage.getItem(n)}catch{}if("1"===e||"0"===e)return"1"===e}return a},a),o=!i&&tt.toArray(r).some(e=>rt(e)&&!0===e.props.active);/* @__PURE__ */
|
|
494
|
-
return dt("div",{children:[
|
|
495
|
-
/* @__PURE__ */dt("button",{type:"button",onClick:()=>{const e=!i;if(s(e),n)try{window.localStorage.setItem(n,e?"1":"0")}catch{}},"aria-expanded":i,"aria-controls":l,className:"flex w-full items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm font-medium text-left "+(o?"bg-blue-50 text-blue-700":"text-gray-800 hover:bg-gray-100"),children:[
|
|
496
|
-
/* @__PURE__ */ct("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
497
|
-
/* @__PURE__ */ct(qe,{name:"chevron-down",fallback:Z,className:"mr-auto ml-0.5 size-3 shrink-0 text-gray-400 transition-transform "+(i?"":"-rotate-90"),strokeWidth:2.6,"aria-hidden":"true"}),null!=t&&t>0&&/* @__PURE__ */ct("span",{className:vs(o),children:t})]}),
|
|
498
|
-
/* @__PURE__ */ct("div",{id:l,role:"group","aria-label":e,hidden:!i,children:r})]})}function Ms({items:e,activeKey:t,onSelect:r,brand:a,actions:n,className:l}){/* @__PURE__ */
|
|
499
|
-
return dt("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[a&&/* @__PURE__ */ct("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:a}),
|
|
500
|
-
/* @__PURE__ */ct("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const a=e.key===t;/* @__PURE__ */
|
|
501
|
-
return dt("button",{type:"button",disabled:e.disabled,"aria-current":a?"page":void 0,onClick:()=>!e.disabled&&r?.(e.key),className:"relative inline-flex items-center gap-1.5 px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40 "+(a?"text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.icon&&/* @__PURE__ */ct("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
502
|
-
/* @__PURE__ */ct("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */ct("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-1.5 text-[11px] font-semibold leading-5 text-gray-600",children:e.badge}),a&&/* @__PURE__ */ct("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),n&&/* @__PURE__ */ct("div",{className:"ml-auto flex items-center gap-2",children:n})]})}var Cs=/(^|[\s:])!?z-/,Ls=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function Ds({trigger:e,items:t,align:r="end",side:a="bottom","aria-label":n,className:l="",triggerClassName:i,menuClassName:s="",minWidth:o=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=Xe(!1),[g,f]=Xe(-1),x=Ze(null),w=Ze(null),N=Ze(null),k=Ze({text:"",at:0}),$=Ye(),M=Ye(),C=u??M,L=Ge(e=>{p(!1),e&&w.current?.focus()},[]),D=(e,r)=>{const a=t.length;for(let n=0;n<a;n+=1){const l=((e+r*n)%a+a)%a;if(Ls(t[l]))return l}return-1},A=()=>N.current?.closest("[data-popup-menu-tree]")??null;Qe(()=>{if(!m)return;const e=e=>{const t=e.target;x.current?.contains(t)||A()?.contains(t)||L(!1)};document.addEventListener("pointerdown",e,!0);const t=I(()=>L(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,L]);const S=Ge(()=>{const e=A(),t=w.current;if(!e||!t)return;const n=e.style;n.left="0px",n.top="0px",n.maxWidth="none",n.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=y({trigger:t.getBoundingClientRect(),menu:l,bounds:b(t),align:r,side:a});n.left=`${i.left}px`,n.top=`${i.top}px`,n.maxWidth=`${i.maxWidth}px`,n.maxHeight=`${i.maxHeight}px`,n.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,a]);W(()=>{m&&S()}),Qe(()=>{if(m)return v(()=>w.current,S)},[m,S]),Qe(()=>{if(!m)return;const e=N.current,r=Ls(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),Qe(()=>{if(m)return B(e=>"Escape"===e.key&&(L(!0),!0),()=>N.current)},[m,L]);const O=e=>{f(e),p(!0)},T=e=>{e.disabled||(L(!0),e.onSelect())},K=c??"a",H=(e,t)=>({"data-dropdown-index":e,tabIndex:e===g?0:-1,onMouseEnter:()=>{t.disabled||f(e)}}),_=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
|
|
503
|
-
return ct("div",{role:"separator",children:/* @__PURE__ */ct(j,{})},e.key);if("label"===e.type)/* @__PURE__ */
|
|
504
|
-
return ct("div",{id:`${$}-label-${t}`,children:/* @__PURE__ */ct(z,{children:e.label})},e.key);if("checkbox"===e.type){const r=F(!1,e.disabled,"");/* @__PURE__ */
|
|
505
|
-
return dt("button",{type:"button",role:"menuitemcheckbox","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>(e=>{e.disabled||e.onSelect()})(e),...H(t,e),children:[
|
|
506
|
-
/* @__PURE__ */ct(E,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=F(!1,e.disabled,"");/* @__PURE__ */
|
|
507
|
-
return dt("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>T(e),...H(t,e),children:[
|
|
508
|
-
/* @__PURE__ */ct(E,{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__ */dt("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...H(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */dt(K,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>L(!0),...H(t,e),children:[e.icon,e.label]},e.key)}const r=F(e.danger,e.disabled,"");/* @__PURE__ */
|
|
509
|
-
return dt("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>T(e),...H(t,e),children:[e.icon,e.label]},e.key)},q={...Cs.test(s)?{}:{zIndex:R.popup},minWidth:o};/* @__PURE__ */
|
|
510
|
-
return dt("div",{ref:x,className:`relative inline-flex ${l}`.trim(),children:[
|
|
511
|
-
/* @__PURE__ */ct("button",{ref:w,id:C,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?$:void 0,"aria-label":n,"aria-describedby":h,disabled:d,onClick:()=>m?L(!1):O(D(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),O(D(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),O(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&&
|
|
512
|
-
/* @__PURE__ */ct(P,{portal:!0,className:s,style:q,children:/* @__PURE__ */ct("div",{ref:N,id:$,role:"menu","aria-orientation":"vertical","aria-label":n,"aria-labelledby":n?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(),a=e.key.toLowerCase(),n=r-k.current.at<500?k.current.text+a:a;k.current={text:n,at:r};const l=[...n].every(e=>e===n[0]),i=l?n[0]:n,s=l?g+1:Math.max(g,0),o=N.current,c=t.length;for(let r=0;r<c;r+=1){const a=((s+r)%c+c)%c;if(Ls(t[a])&&(o?.querySelector(`[data-dropdown-index="${a}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void f(a)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const a=t[r];if("radio"!==a.type&&"checkbox"!==a.type){e.push(_(a,r)),r+=1;continue}const n=a.type,l=r,i=[];for(;r<t.length&&t[r].type===n;)i.push(_(t[r],r)),r+=1;const s="label"===t[l-1]?.type?`${$}-label-${l-1}`:void 0;e.push(/* @__PURE__ */ct("div",{role:"group","aria-labelledby":s,children:i},`group:${a.key}`))}return e})()})})]})}function Ps(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function As({at:e,onClose:t,children:r,owner:a,"aria-label":n,minWidth:l=180,className:i="",autoFocus:s=!0}){const o=Ze(null),[c,d]=Xe(null),u=Ze(t);u.current=t,W(()=>{const t=o.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},n=k({point:e,menu:r,bounds:b(a??null)});d(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:r.height>n.maxHeight})},[e.x,e.y,a]);const h=Ze(null),m=Ze(!1);Qe(()=>(h.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!o.current?.contains(e)||h.current?.focus?.({preventScroll:!0})}),[]),Qe(()=>{c&&!m.current&&s&&(m.current=!0,Ps(o.current)[0]?.focus({preventScroll:!0}))},[c,s]),Qe(()=>{if(s)return;const e=e=>{if(o.current?.contains(document.activeElement))return;const t=Ps(o.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)},[s]),Qe(()=>B(e=>"Escape"===e.key&&(u.current(),!0),()=>o.current),[]),Qe(()=>{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=Ge(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void u.current();const t=Ps(o.current);if(0===t.length)return;const r=t.indexOf(document.activeElement),a="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;a<0||(e.preventDefault(),t[a].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__ */
|
|
513
|
-
return ct(P,{portal:!0,minWidth:l,style:g,onClose:t,className:i,children:/* @__PURE__ */ct(A.Provider,{value:!0,children:/* @__PURE__ */ct("div",{ref:o,role:"menu","aria-label":n,"data-context-menu":"",onKeyDown:p,children:r})})})}function Ss(){const[e,t]=Xe(null),r=Ge(()=>t(null),[]),a=Ge((e,r)=>{const a="nativeEvent"in e?e.nativeEvent:e;if(S(a))return!1;e.preventDefault();const n=e.target instanceof Element?e.target:null;let{clientX:l,clientY:i}=e;if(0===l&&0===i&&n){const e=n.getBoundingClientRect();l=e.left,i=e.bottom}return t({x:l,y:i,data:r,owner:n}),!0},[]),n=Ge(e=>{a(e,void 0)},[a]);return{open:a,onContextMenu:n,close:r,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:r}}}var js="Alt+ArrowUp Alt+ArrowDown";function zs(e){return!e.altKey||e.ctrlKey||e.metaKey?null:"ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":null}var Fs=/* @__PURE__ */dt("svg",{"aria-hidden":"true",viewBox:"0 0 8 14",fill:"currentColor",className:"h-3.5 w-2",children:[
|
|
514
|
-
/* @__PURE__ */ct("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
515
|
-
/* @__PURE__ */ct("circle",{cx:"6",cy:"3",r:"1.1"}),
|
|
516
|
-
/* @__PURE__ */ct("circle",{cx:"2",cy:"7",r:"1.1"}),
|
|
517
|
-
/* @__PURE__ */ct("circle",{cx:"6",cy:"7",r:"1.1"}),
|
|
518
|
-
/* @__PURE__ */ct("circle",{cx:"2",cy:"11",r:"1.1"}),
|
|
519
|
-
/* @__PURE__ */ct("circle",{cx:"6",cy:"11",r:"1.1"})]});function Es({hint:e,dragging:t,revealClassName:r,marker:a}){const n=Se().tree;/* @__PURE__ */
|
|
520
|
-
return ct(f,{content:e??n.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__ */ct("span",{"aria-hidden":"true",[`data-${a}-grip`]:"",className:"flex h-4 w-2 items-center justify-center text-gray-400",children:Fs})})}function Os({id:e}){/* @__PURE__ */
|
|
521
|
-
return ct("span",{id:e,hidden:!0,children:Se().tree.moveHint})}var Ts='[role="treeitem"]';function Bs(e){return[...e.querySelectorAll(Ts)].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 Is({"aria-label":e,"aria-labelledby":t,children:r,className:a="",rootProps:n}){const l=Ze(null);W(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(Ts)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??Bs(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=Ge(e=>{n?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(Ts);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=Bs(t),i=a.indexOf(r),s=Number(r.getAttribute("aria-level")??"1"),o=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(Ts))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":o(a[i+1]);break;case"ArrowUp":o(a[i-1]);break;case"Home":o(a[0]);break;case"End":o(a[a.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=a[i+1];t&&Number(t.getAttribute("aria-level")??"1")>s?o(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){o(a[e]);break}}},[n]);/* @__PURE__ */
|
|
522
|
-
return ct("div",{...n,ref:l,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${a}`.trim(),children:r})}function Rs({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
523
|
-
return ct("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 Ws({children:e}){/* @__PURE__ */
|
|
524
|
-
return ct("div",{role:"presentation",className:"px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e})}var Ks={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function Hs({label:e,level:t=1,icon:r,preview:a,selected:n=!1,expanded:l,onToggle:i,onSelect:s,muted:o=!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,N=Ye(),k=[y?.["aria-describedby"],x?N:void 0].filter(Boolean).join(" ")||void 0,$=n?"bg-blue-50 text-blue-700":"into"===p?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
|
|
525
|
-
return dt("div",{...y,role:"treeitem","aria-level":t,"aria-selected":n,"aria-expanded":w?l:void 0,tabIndex:n?0:-1,"aria-keyshortcuts":y?.["aria-keyshortcuts"]??(x?js:void 0),"aria-describedby":k,"data-drop":p,"data-draggable":f||void 0,onKeyDown:e=>{if(y?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=zs(e);t&&x?(e.preventDefault(),x(t)):"Enter"!==e.key&&" "!==e.key||!s?("ArrowRight"===e.key&&w&&!l&&i||"ArrowLeft"===e.key&&w&&l&&i)&&(e.preventDefault(),i()):(e.preventDefault(),s())},onClick:e=>{y?.onClick?.(e),e.defaultPrevented||s?.()},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)]",$,"into"===p?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",g?"opacity-40":"",v].filter(Boolean).join(" "),children:["before"===p&&/* @__PURE__ */ct("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__ */ct("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&&
|
|
526
|
-
/* @__PURE__ */ct(Es,{marker:"tree",hint:b,dragging:g,revealClassName:"group-hover/treerow:opacity-100 group-focus-visible/treerow:opacity-100"}),
|
|
527
|
-
/* @__PURE__ */ct("span",w?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),i?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:(M=!!l,/* @__PURE__ */ct(qe,{name:"chevron-right",fallback:G,"aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(M?"rotate-90":"")}))}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=r&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(n?"text-blue-600":"text-gray-500"),children:r}),
|
|
528
|
-
/* @__PURE__ */dt("span",{className:"relative flex min-w-0 flex-1 items-center gap-1.5",children:[m??/* @__PURE__ */dt("span",{className:`min-w-0 truncate ${n?"font-semibold":"font-medium"} ${o?"text-gray-400 line-through":""}`,children:[e,null!=a&&/* @__PURE__ */ct("span",{className:"ml-2 font-normal text-gray-500",children:a})]}),null!=c&&!1!==c&&/* @__PURE__ */ct("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__ */ct("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(u||o?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:d})]}),null!=d&&h&&
|
|
529
|
-
/* @__PURE__ */dt("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:Ks,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(u||o||n?"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:[
|
|
530
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
531
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
532
|
-
/* @__PURE__ */ct("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:d})]}),x&&/* @__PURE__ */ct(Os,{id:N})]});var M}function _s({onAdd:e,label:t,drop:r=!1,slotProps:a}){const n=Se().tree,l=r?n.dropHere:t??n.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__ */
|
|
533
|
-
return ct("div",{...a,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */dt("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:[
|
|
534
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */ct("span",{className:i,children:l})})}function qs({onInsert:e,label:t,drop:r=!1,seamProps:a}){const n=Se().tree,l=t??n.insertHere,i=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
|
|
535
|
-
return dt("div",{...a,role:"presentation","data-tree-seam":"","data-drop":r||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
|
|
536
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
537
|
-
/* @__PURE__ */ct("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__ */ct(f,{content:l,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */ct("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__ */ct(qe,{name:"add",fallback:ue,"aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}var Us=et("compact");function Vs({"aria-label":e,"aria-labelledby":t,children:r,spacing:a="compact",className:n="",rootProps:l}){/* @__PURE__ */
|
|
538
|
-
return ct(Us.Provider,{value:a,children:/* @__PURE__ */ct("div",{...l,role:"list","aria-label":t?void 0:e,"aria-labelledby":t,"data-sortable-list":a,className:`flex min-w-0 flex-col ${"comfortable"===a?"gap-2":"gap-1"} ${n}`.trim(),children:r})})}function Ys({children:e,actions:t,below:r,active:a=!1,flat:n=!1,draggable:l=!1,dragHint:i,dragging:s=!1,drop:o,onMove:c,rowProps:d,rowRef:u,className:h=""}){const m=nt(Us),p=Ze(null),g=Ye(),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__ */
|
|
539
|
-
return dt("div",{role:"listitem","data-list-item":"","data-drop":o,className:"relative flex min-w-0 flex-col",children:[o&&/* @__PURE__ */ct("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"})[o]}`}),
|
|
540
|
-
/* @__PURE__ */dt("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":a||void 0,"data-draggable":l||void 0,"aria-keyshortcuts":d?.["aria-keyshortcuts"]??(c?js:void 0),"aria-describedby":f,onKeyDown:e=>{if(d?.onKeyDown?.(e),e.defaultPrevented||!c)return;const t=zs(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",a?"bg-gray-100":n?"":"hover:bg-gray-100",s?"opacity-40":"",h].filter(Boolean).join(" "),children:[l&&/* @__PURE__ */ct(Es,{marker:"list",hint:i,dragging:s,revealClassName:"group-hover/listrow:opacity-100 group-focus-within/listrow:opacity-100"}),
|
|
541
|
-
/* @__PURE__ */ct("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__ */ct("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:t}),c&&/* @__PURE__ */ct(Os,{id:g})]}),null!=r&&!1!==r&&/* @__PURE__ */ct("div",{"data-list-below":"",children:r})]})}var Gs=et({labels:"none",shown:"none"}),Xs="button[data-icon-rail-button]:not([disabled])";function Zs(e,t,r){const a=getComputedStyle(e),n=(parseFloat(a.paddingLeft)||0)+(parseFloat(a.paddingRight)||0)+(parseFloat(a.borderLeftWidth)||0)+(parseFloat(a.borderRightWidth)||0),l="horizontal"===t?(parseFloat(a.columnGap)||0)*Math.max(0,r-1):0,i=e.parentElement;let s=1/0;if(i){const e=getComputedStyle(i);s=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:n+l,room:s}}function Js({"aria-label":e,orientation:t="vertical",children:r,className:a="",labels:n="none",labelsFit:l=!1,onLabelsShown:i}){const s=Ze(null),o="none"!==n&&l,[c,d]=Xe(null),u="none"===n?"none":o?c??"none":"all",h=Ze(()=>{});h.current=()=>{const e=s.current;if(!e||!o)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const r=getComputedStyle(e),a=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),n=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(n,a+l),worded:"below"===t?Math.max(n,a+Math.max(l,i)):Math.max(n,a+l+6+i),active:"true"===e.getAttribute("aria-pressed")}})}(e,n);d(function({buttons:e,orientation:t,chrome:r,room:a}){if(0===e.length)return"none";const n=a=>{const n=e.map(e=>a(e)?e.worded:e.bare);return r+("horizontal"===t?n.reduce((e,t)=>e+t,0):Math.max(...n))};return n(()=>!0)<=a+.5?"all":e.some(e=>e.active)&&n(e=>e.active)<=a+.5?"chosen":"none"}({buttons:r,orientation:t,...Zs(e,t,r.length)}))},W(()=>{h.current()}),Qe(()=>{const e=s.current?.parentElement;if(!o||!e)return;let t=!0;const r=()=>{t&&h.current()},a="undefined"==typeof ResizeObserver?void 0:ResizeObserver,n=a?new a(r):null;return n?.observe(e),document.fonts?.ready.then(r,()=>{}),()=>{t=!1,n?.disconnect()}},[o]);const m=Ze(null),p=Ze(i);p.current=i,Qe(()=>{o&&null!==c&&m.current!==c&&(m.current=c,p.current?.(c))},[o,c]),W(()=>{const e=s.current;if(!e)return;const t=[...e.querySelectorAll(Xs)];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__ */
|
|
542
|
-
return ct("div",{ref:s,role:"toolbar","aria-label":e,"aria-orientation":t,"data-orientation":t,onKeyDown:e=>{const r=s.current;if(!r)return;const a=[...r.querySelectorAll(Xs)],n=a.indexOf(e.target);if(n<0)return;const l="vertical"===t?"ArrowUp":"ArrowLeft",i="vertical"===t?"ArrowDown":"ArrowRight",o=e.key===i?(n+1)%a.length:e.key===l?(n-1+a.length)%a.length:"Home"===e.key?0:"End"===e.key?a.length-1:-1;if(!(o<0)){e.preventDefault();for(const e of a)e.tabIndex=e===a[o]?0:-1;a[o].focus()}},"data-labels":"none"===n?void 0:n,"data-labels-shown":"none"===n?void 0:u,className:`flex gap-1 ${"vertical"===t?"flex-col items-center":"flex-row items-center"} ${a}`.trim(),children:/* @__PURE__ */ct(Gs.Provider,{value:{labels:n,shown:u},children:r})})}function Qs({label:e,icon:t,active:r,disabled:a,onClick:n,badge:l,tooltipSide:i="right",className:s=""}){const o=!0===r,{labels:c,shown:d}=nt(Gs),u=void 0===l||!1===l||0===l?t:/* @__PURE__ */ct(al,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:t}),h="none"!==c,m=h&&("all"===d||"chosen"===d&&o),p=/* @__PURE__ */ct("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof r?r:void 0,disabled:a,onClick:a?void 0:n,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",o?"bg-blue-50 text-blue-700":"text-gray-600 hover:bg-gray-100 hover:text-gray-900",s].filter(Boolean).join(" "),children:h?/* @__PURE__ */dt(ut,{children:[
|
|
543
|
-
/* @__PURE__ */ct("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:u}),
|
|
544
|
-
/* @__PURE__ */ct("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__ */
|
|
545
|
-
return ct(f,{content:e,side:i,children:p})}var eo=6e4;function to({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[a,n]=Xe(null);return Qe(()=>{if(!e||null!==a)return;let l=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const r=t.includes("?")?"&":"?",a=await fetch(`${t}${r}t=${Date.now()}`,{cache:"no-store"});if(!a.ok)return;const i=await a.json(),s=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&s&&s!==e&&n(s)}catch{}};i();const s=setInterval(()=>{i()},r),o=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",o),()=>{l=!0,clearInterval(s),document.removeEventListener("visibilitychange",o)}},[e,t,r,a]),a}function ro({currentVersion:e,versionUrl:t,pollMs:r,message:a,onRefresh:n,className:l=""}){const i=to({currentVersion:e,versionUrl:t,pollMs:r}),s=Se();if(null===i)return null;const o=n??(()=>window.location.reload());/* @__PURE__ */
|
|
546
|
-
return ct("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__ */dt(gl,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */ct(g,{type:"button",variant:"primary",size:"md",onClick:o,children:s.update.refreshNow}),children:[
|
|
547
|
-
/* @__PURE__ */ct("span",{className:"font-medium",children:a??s.update.available}),
|
|
548
|
-
/* @__PURE__ */dt("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var ao={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},no={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function lo({onClose:e}){const t=Se().dialog;/* @__PURE__ */
|
|
549
|
-
return ct("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__ */ct(qe,{name:"close",fallback:J,className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function io({open:e,onClose:t,side:r="right",size:a="md",title:n,description:l,footer:i,children:s,blocking:o=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=Ze(null),g=Ye(),f=Ye(),b=Ye();if(O(e),C(p,e,c),L(e),Qe(()=>{if(e)return B(()=>(o||t(),!0),()=>p.current)},[e,o,t]),!e)return null;const x="bottom"===r,y=x?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
|
|
550
|
-
return dt("div",{className:"fixed inset-0",style:{zIndex:R.overlay},role:"presentation",children:[
|
|
551
|
-
/* @__PURE__ */ct("div",{className:"fixed inset-0 bg-black/30",onClick:o?void 0:t,"aria-hidden":"true"}),
|
|
552
|
-
/* @__PURE__ */dt("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":n?b:u,"aria-label":n||u?void 0:d,"aria-describedby":h??(l?f:s?g:void 0),style:y,className:["fixed flex flex-col bg-white shadow-xl",x?"":`w-full max-w-full ${ao[a]}`,no[r],x?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[n?/* @__PURE__ */dt("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
553
|
-
/* @__PURE__ */dt("div",{className:"min-w-0",children:[
|
|
554
|
-
/* @__PURE__ */ct("h2",{id:b,className:"text-base font-semibold text-gray-900",children:n}),l&&/* @__PURE__ */ct("p",{id:f,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!o&&/* @__PURE__ */ct(lo,{onClose:t})]}):!o&&/* @__PURE__ */ct("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */ct(lo,{onClose:t})}),
|
|
555
|
-
/* @__PURE__ */dt("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!n&&/* @__PURE__ */ct("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(o?"":"pr-8")).trim(),children:l}),s]}),i&&/* @__PURE__ */ct("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function so({items:e,columns:t,columnOf:r,getId:a,onMove:n,renderCard:l,onCardClick:i,sortInColumn:s,isLoading:o=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=Se().kanban,f=Ae(),b=c??g.loading,x=h??g.dropHere,y=p??g.addItem,[v,w]=Xe(null),[N,k]=Xe(null),$=Je(()=>{const a={};for(const e of t)a[e.value]=[];for(const t of e)(a[r(t)]??=[]).push(t);if(s)for(const e of Object.keys(a))a[e].sort(s);return a},[e,t,r,s]),M=()=>{w(null),k(null)},C=Ze(null),L=Ze(/* @__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 a=e.dataset.kanbanCard,n=e.getBoundingClientRect();t.set(a,n);const l=L.current.get(a);if(l){const t=l.left-n.left,a=l.top-n.top;(t||a)&&r.push([e,t,a])}}),L.current=t,r.length){for(const[e,t,a]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${a}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})})}},[$,v]);return o?/* @__PURE__ */ct("div",{className:"text-sm text-gray-500 p-4",children:b}):0!==e.length||u?/* @__PURE__ */ct("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */ct("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=$[e.value]??[],r=null!==N&&N.col===e.value,s=null!==v?t.findIndex(e=>a(e)===v):-1,o=r&&(-1===s||N.index!==s&&N.index!==s+1)?N.index:-1;/* @__PURE__ */
|
|
556
|
-
return dt("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&&N&&N.col===e){const t=($[e]??[]).findIndex(e=>a(e)===v),r=-1!==t;if(!r||N.index!==t&&N.index!==t+1){const a=r&&N.index>t?N.index-1:N.index;n(v,e,a)}}M()})(e.value)},children:[
|
|
557
|
-
/* @__PURE__ */dt("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:[
|
|
558
|
-
/* @__PURE__ */dt("span",{className:"flex items-center gap-2",children:[
|
|
559
|
-
/* @__PURE__ */ct("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
|
|
560
|
-
/* @__PURE__ */ct("span",{className:"text-xs opacity-70",children:Ee(t.length,f)})]}),
|
|
561
|
-
/* @__PURE__ */dt("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>k(r=>r&&r.col===e.value&&r.index===t.length?r:{col:e.value,index:t.length}),children:[t.map((r,n)=>{const s=a(r),c=s===v;/* @__PURE__ */
|
|
562
|
-
return dt(lt,{children:[o===n&&/* @__PURE__ */ct("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
|
|
563
|
-
/* @__PURE__ */ct("div",{"data-kanban-card":s,draggable:!0,onDragStart:e=>{w(s);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:r=>{r.stopPropagation();const l=null!==v?t.findIndex(e=>a(e)===v):-1,i=-1!==l&&l<n?n+1:n;k(t=>t&&t.col===e.value&&t.index===i?t:{col:e.value,index:i})},onDragEnd:M,onClick:i?()=>i(r):void 0,style:null===v?void 0:{opacity:c?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(i?"cursor-pointer":""),children:l(r)})]},s)}),t.length>0&&o===t.length&&/* @__PURE__ */ct("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===t.length&&/* @__PURE__ */ct("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__ */ct("div",{className:"p-2 pt-0",children:/* @__PURE__ */dt("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:[
|
|
564
|
-
/* @__PURE__ */ct("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),y]})})]},e.value)})})}):/* @__PURE__ */ct(ut,{children:d??/* @__PURE__ */ct("div",{className:"text-sm text-gray-500 p-4",children:g.empty})})}var oo="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 co({page:e,pageCount:t,onPageChange:r,siblingCount:a=1,showEdges:n=!1,className:l=""}){const i=Se().pagination,s=Ae();if(t<=1)return null;const o=function(e,t,r){const a=/* @__PURE__ */new Set([1,t]);for(let n=e-r;n<=e+r;n++)n>=1&&n<=t&&a.add(n);const n=[...a].sort((e,t)=>e-t),l=[];let i=0;for(const e of n)i&&e-i>1&&l.push("…"),l.push(e),i=e;return l}(e,t,a),c=a=>{a>=1&&a<=t&&a!==e&&r(a)};/* @__PURE__ */
|
|
565
|
-
return dt("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[n&&/* @__PURE__ */ct("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${oo} text-gray-600 hover:bg-gray-100`,children:"«"}),
|
|
566
|
-
/* @__PURE__ */ct("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${oo} text-gray-600 hover:bg-gray-100`,children:"‹"}),o.map((t,r)=>"…"===t?/* @__PURE__ */ct("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */ct("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${oo} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:Ee(t,s)},t)),
|
|
567
|
-
/* @__PURE__ */ct("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${oo} text-gray-600 hover:bg-gray-100`,children:"›"}),n&&/* @__PURE__ */ct("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${oo} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function uo(e){const t={};if(!e)return t;for(const[r,a]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof a&&"number"!=typeof a&&"boolean"!=typeof a||(t[r]=a);return t}var ho=e=>Array.isArray(e.columns),mo=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",po="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",go={sm:"px-2 py-1.5",md:"px-3 py-2"},fo={left:"text-left",right:"text-right",center:"text-center"};function bo({direction:e}){/* @__PURE__ */
|
|
568
|
-
return dt("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
569
|
-
/* @__PURE__ */ct("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */ct("path",{d:"M4 0L8 5H0z"})}),
|
|
570
|
-
/* @__PURE__ */ct("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */ct("path",{d:"M4 5L0 0h8z"})})]})}function xo({columns:e,data:t,rowKey:r,sort:a=null,onSortChange:n,pagination:l,caption:i,loading:s=!1,bordered:o=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:g,emptyText:f,selection:b,footer:x,virtualized:y,stackOnNarrow:v=!1,stackBelow:w,className:N=""}){const k=Se(),$=f??k.table.empty,M=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!y,L=C?e:e.flatMap(e=>{if(!ho(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),D=e=>C?{role:e}:{},P=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[A,S]=Xe(0),j=y?.overscan??6,z=y?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/y.rowHeight)-j);S(e=>e===t?e:t)}:void 0,F=y?Math.ceil(y.height/y.rowHeight)+2*j:t.length,E=y?Math.min(A,Math.max(0,t.length-F)):0,O=Math.min(t.length,E+F),T=y?E*y.rowHeight:0,B=y?(t.length-O)*y.rowHeight:0,I=Ze(null),[R,K]=Xe(0);W(()=>{if(!y)return;const e=I.current?.offsetHeight??0;K(t=>t===e?t:e)});const H=e=>e.sortField??e.key,_=e=>a&&a.field===H(e)?a.direction:null,q=L.flatMap(e=>ho(e)?e.columns:[e]),U=L.some(ho),V=/* @__PURE__ */new Map;if(C)for(const e of L)if(ho(e))for(const t of e.columns)V.set(t,P(e.title,e.label));const Y=e=>{const t=P(e.title,e.label),r=V.get(e);return t&&r?`${r} · ${t}`:t},G=new Set(b?.selected??[]),X=b?t.map((e,t)=>M(e,t)):[],Z=X.length>0&&X.every(e=>G.has(e)),J=X.some(e=>G.has(e)),Q=b?36:0,ee=q.length+(b?1:0),te=q.some(e=>"left"===e.fixed),re=C&&!b&&q.some(e=>e.cardCorner),ae=g??"a",ne=`${go[c]} ${"sm"===c?"text-xs":"text-sm"}`,le=(e,t,r,a=0)=>{const l=_(e),i=fo[e.align??(e.numeric?"right":"left")],s="left"===e.fixed,o=!(!e.sortable||!n);/* @__PURE__ */
|
|
571
|
-
return ct("th",{scope:"col",...D("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===l?"ascending":"desc"===l?"descending":o?"none":void 0,style:{width:e.width,...s?{left:(se[t]??0)+Q}:{},...y?{top:a}:{}},className:[ne,i,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs",s?y?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":y?"sticky z-10 bg-gray-50":"",C&&o?"rosh-dt-sort":"",C?mo(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:o?/* @__PURE__ */dt("button",{type:"button",onClick:()=>(e=>{if(!n)return;const t=H(e),r=_(e),a=e.sortFirst??"asc";n(null===r?{field:t,direction:a}:r===a?{field:t,direction:"asc"===a?"desc":"asc"}:null)})(e),"data-group":C?V.get(e):void 0,className:`inline-flex items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[e.title,
|
|
572
|
-
/* @__PURE__ */ct(bo,{direction:l})]}):e.title},e.key)};let ie=0;const se=q.map(e=>{if("left"!==e.fixed)return null;const t=ie;return ie+=e.width??0,t}),oe=/* @__PURE__ */dt(ut,{children:[
|
|
573
|
-
/* @__PURE__ */dt("div",{onScroll:z,style:y?{maxHeight:y.height}:void 0,className:`relative overflow-x-auto ${y?"overflow-y-auto":""} ${o?"rounded-lg border border-gray-200":""}${C?" rosh-dt-scroll":""}`.trim(),children:[s&&
|
|
574
|
-
/* @__PURE__ */dt("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
575
|
-
/* @__PURE__ */ct("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-gray-200 border-t-blue-600"}),
|
|
576
|
-
/* @__PURE__ */ct("span",{className:"sr-only",children:k.table.loading})]}),
|
|
577
|
-
/* @__PURE__ */dt("table",{...D("table"),className:(C?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */ct("caption",{className:"sr-only",children:i}),
|
|
578
|
-
/* @__PURE__ */dt("thead",{...D("rowgroup"),className:C?"rosh-dt-head":void 0,children:[
|
|
579
|
-
/* @__PURE__ */dt("tr",{ref:I,...D("row"),className:"border-b border-gray-200 bg-gray-50",children:[b&&/* @__PURE__ */ct("th",{scope:"col",...D("columnheader"),rowSpan:U?2:void 0,style:{width:36,...y?{top:0}:{}},className:[ne,te||y?"sticky z-20 bg-gray-50":"",te?"left-0":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */ct(Ot,{"aria-label":k.table.selectAll,checked:Z,indeterminate:J&&!Z,onChange:()=>{if(!b)return;const e=new Set(X);b.onChange(Z?b.selected.filter(t=>!e.has(t)):[...b.selected,...X.filter(e=>!G.has(e))])}})}),L.map((e,t)=>ho(e)?/* @__PURE__ */ct("th",{scope:"colgroup",...D("columnheader"),colSpan:e.columns.length,style:y?{top:0}:void 0,className:[ne,"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}`):le(e,q.indexOf(e),U?2:1))]}),U&&/* @__PURE__ */ct("tr",{...D("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>ho(e)?e.columns:[]).map(e=>le(e,q.indexOf(e),1,R))})]}),
|
|
580
|
-
/* @__PURE__ */ct("tbody",{...D("rowgroup"),className:C?"rosh-dt-body":void 0,children:0!==t.length||s?/* @__PURE__ */dt(ut,{children:[T>0&&/* @__PURE__ */ct("tr",{"aria-hidden":"true",children:/* @__PURE__ */ct("td",{colSpan:ee,style:{height:T,padding:0,border:0}})}),t.slice(E,O).map((e,t)=>{const r=E+t,a=h?.(e,r),n=!!a?.current,l=m?.(e,r),i=void 0===l&&p?()=>p(e,r):void 0,s=void 0!==l||void 0!==i;let o=!1;const c=(e,t)=>{if(o=!0,!s)return e;const r=[po,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),a=n?"true":void 0;return void 0!==l?/* @__PURE__ */ct(ae,{href:l,className:r,"aria-current":a,children:e}):/* @__PURE__ */ct("button",{type:"button",onClick:i,className:r,"aria-current":a,children:e})},d=q.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(s&&!o){const e=q.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=q.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const g=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
581
|
-
return dt("tr",{...uo(a),...D("row"),style:y?{height:y.rowHeight}:void 0,onClick:a?.onClick,onMouseEnter:a?.onMouseEnter,onMouseLeave:a?.onMouseLeave,onFocus:g(a?.onFocus),onBlur:g(a?.onBlur),"aria-current":n&&!s?"true":void 0,...a?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a.onClick?.()))}}:{},className:[C?b?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",C&&re?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",a?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",s?"rosh-dt-linked hover:bg-gray-50":"",n?"rosh-dt-current":"",u?.(e,r)??"",a?.className??""].filter(Boolean).join(" "),children:[b&&(()=>{const t=M(e,r);/* @__PURE__ */
|
|
582
|
-
return ct("td",{...D("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[ne,te?"sticky left-0 z-10 bg-white":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */ct(Ot,{"aria-label":k.table.selectRow,checked:G.has(t),onChange:()=>(e=>{b&&b.onChange(G.has(e)?b.selected.filter(t=>t!==e):[...b.selected,e])})(t)})})})(),q.map((e,t)=>{const r="left"===e.fixed,a=d[t],n=re&&!!e.cardCorner,l=C&&!n&&"wide"!==e.only;/* @__PURE__ */
|
|
583
|
-
return ct("td",{...D("cell"),"data-label":l?Y(e):void 0,style:r?{left:(se[t]??0)+Q}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",C?mo(e):"",ne,fo[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?
|
|
584
|
-
/* @__PURE__ */ct("span",{className:e.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:a}):a},e.key)})]},M(e,r))}),B>0&&/* @__PURE__ */ct("tr",{"aria-hidden":"true",children:/* @__PURE__ */ct("td",{colSpan:ee,style:{height:B,padding:0,border:0}})})]}):/* @__PURE__ */ct("tr",{...D("row"),className:C?"rosh-dt-empty":void 0,children:/* @__PURE__ */ct("td",{...D("cell"),colSpan:ee,className:`${ne} py-10 text-center text-gray-500`,children:$})})})]}),x]}),l&&l.pageCount>1&&/* @__PURE__ */ct("div",{className:C?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */ct(co,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
|
|
585
|
-
return ct("div",C?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${N}`.trim(),children:/* @__PURE__ */ct("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */ct("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:oe})})}:{className:`rosh-dt-stack ${N}`.trim(),children:oe}:{className:N,children:oe})}function yo({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:a,label:n,isFetchingMore:l,extra:i}){const s=Se().list,o=a??r,c=r>=o,d=t>0?s.selectedNotShown(e,t):e>0?s.selected(e):"";/* @__PURE__ */
|
|
586
|
-
return dt(ut,{children:[i,d?`${d} — `:"",c?null!=a?s.allLoaded(o,n):s.count(o,n):s.loadedOf(r,o,n),l?` · ${s.loadingMore}`:""]})}function vo({title:e,message:t,onRetry:r,variant:a="dashed"}){const n=Se().list;/* @__PURE__ */
|
|
587
|
-
return dt("div",{className:`flex flex-col items-center justify-center text-center ${"card"===a?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===a?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
|
|
588
|
-
/* @__PURE__ */ct(qe,{name:"warning",fallback:he,className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
|
|
589
|
-
/* @__PURE__ */ct("h3",{className:"text-sm font-medium text-gray-900",children:e??n.loadError}),
|
|
590
|
-
/* @__PURE__ */ct("p",{className:"text-sm text-gray-500 mt-2",children:t??n.loadErrorMessage}),r&&/* @__PURE__ */ct("div",{className:"mt-4",children:/* @__PURE__ */ct(g,{variant:"secondary",size:"sm",onClick:r,children:n.retry})})]})}function wo({data:e,width:t=120,height:r=32,stroke:a="currentColor",fill:n,strokeWidth:l=1.5,showDots:i=!1,className:s,style:o}){if(0===e.length)return null;const c=Math.max(...e),d=Math.min(...e),u=c-d||1,h=l+(i?2:0),m=e=>r-h-(e-d)/u*(r-2*h),p=1===e.length?[[0,r/2],[t,r/2]]:e.map((r,a)=>[a*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__ */
|
|
591
|
-
return dt("svg",{className:s,style:o,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[n&&/* @__PURE__ */ct("path",{d:f,fill:n,stroke:"none"}),
|
|
592
|
-
/* @__PURE__ */ct("path",{d:g,fill:"none",stroke:a,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */ct("circle",{cx:e,cy:t,r:l+.5,fill:a},r))]})}function No({data:e,labels:t,height:r=120,color:a="currentColor",colors:n,max:l,gap:i=6,className:s,style:o}){const c=Ae();if(0===e.length)return null;const d=l??(Math.max(...e,0)||1);/* @__PURE__ */
|
|
593
|
-
return dt("div",{className:s,style:o,children:[
|
|
594
|
-
/* @__PURE__ */ct("div",{className:"flex items-end",style:{height:r,gap:i},children:e.map((e,r)=>/* @__PURE__ */ct("div",{className:"flex flex-1 flex-col justify-end",style:{height:"100%"},children:/* @__PURE__ */ct("div",{className:"w-full rounded-t",style:{height:`${Math.max(0,e/d*100)}%`,minHeight:e>0?2:0,backgroundColor:n?.[r]??a},title:null!=t?.[r]?`${t[r]}: ${Ee(e,c)}`:Ee(e,c)})},r))}),t&&/* @__PURE__ */ct("div",{className:"mt-1 flex",style:{gap:i},children:t.map((e,t)=>/* @__PURE__ */ct("div",{className:"flex-1 truncate text-center text-[10px] text-gray-400",children:e},t))})]})}var ko=["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 $o({segments:e,size:t=120,thickness:r=16,centerLabel:a,className:n,style:l}){const i=e.reduce((e,t)=>e+Math.max(0,t.value),0)||1,s=(t-r)/2,o=t/2,c=2*Math.PI*s;let d=0;/* @__PURE__ */
|
|
595
|
-
return dt("div",{className:`relative inline-flex items-center justify-center ${n??""}`.trim(),style:{width:t,height:t,...l},children:[
|
|
596
|
-
/* @__PURE__ */dt("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-hidden":"true",style:{transform:"rotate(-90deg)"},children:[
|
|
597
|
-
/* @__PURE__ */ct("circle",{cx:o,cy:o,r:s,fill:"none",stroke:"var(--rosh-donut-track)",strokeWidth:r}),e.map((e,t)=>{const a=Math.max(0,e.value)/i*c,n=/* @__PURE__ */ct("circle",{cx:o,cy:o,r:s,fill:"none",stroke:e.color??ko[t%ko.length],strokeWidth:r,strokeDasharray:`${a} ${c-a}`,strokeDashoffset:-d},t);return d+=a,n})]}),null!=a&&/* @__PURE__ */ct("div",{className:"absolute text-center text-sm font-semibold text-gray-900",children:a})]})}var Mo=(e,t)=>Number.isInteger(e)?Ee(e,t):Oe(e,1,t);function Co({series:e,labels:t,height:r=160,strokeWidth:a=2,showDots:n=!1,max:l,min:i,showScale:s=!1,showLegend:o=!1,className:c,style:d}){const u=Ae(),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__ */
|
|
598
|
-
return dt("div",{className:c,style:d,children:[o&&h.some(e=>e.label)&&/* @__PURE__ */ct("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__ */dt("span",{className:"flex items-center gap-1 text-xs text-gray-500",children:[
|
|
599
|
-
/* @__PURE__ */ct("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:b(e)}}),e.label]},t))}),
|
|
600
|
-
/* @__PURE__ */dt("div",{className:"flex",children:[s&&/* @__PURE__ */dt("div",{className:"flex flex-col justify-between pr-1.5 text-right text-[10px] leading-none text-gray-400",style:{height:r},children:[
|
|
601
|
-
/* @__PURE__ */ct("span",{children:Mo(p,u)}),
|
|
602
|
-
/* @__PURE__ */ct("span",{children:Mo(g+f/2,u)}),
|
|
603
|
-
/* @__PURE__ */ct("span",{children:Mo(g,u)})]}),
|
|
604
|
-
/* @__PURE__ */dt("svg",{className:"min-w-0 flex-1",width:"100%",height:r,viewBox:"0 0 100 100",preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[s&&[0,50,100].map(e=>/* @__PURE__ */ct("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((a,n)=>[100*n/(e.length-1),100-(a-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__ */
|
|
605
|
-
return dt("g",{children:[e.fill&&/* @__PURE__ */ct("path",{d:`${i} L100,100 L0,100 Z`,fill:e.fill,stroke:"none"}),
|
|
606
|
-
/* @__PURE__ */ct("path",{d:i,fill:"none",stroke:b(e),strokeWidth:a,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"}),n&&e.data.length>1&&l.map(([r,n],l)=>/* @__PURE__ */ct("path",{d:`M${r.toFixed(2)},${n.toFixed(2)} h0.01`,stroke:b(e),strokeWidth:2.5*a,strokeLinecap:"round",vectorEffect:"non-scaling-stroke",children:/* @__PURE__ */ct("title",{children:`${null!=t?.[l]?`${t[l]}: `:""}${e.label?`${e.label} `:""}${Ee(e.data[l],u)}`})},l))]},r)})]})]}),t&&/* @__PURE__ */ct("div",{className:"mt-1 flex justify-between "+(s?"pl-6":""),children:t.map((e,t)=>/* @__PURE__ */ct("div",{className:"truncate text-[10px] text-gray-400",children:e},t))})]})}var Lo={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},Do=[12,18,14,22,19,27,24,31,28,35,30,38],Po=["J","F","M","A","M","J","J","A","S","O","N","D"],Ao=[{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 So(){/* @__PURE__ */
|
|
607
|
-
return ct(Al,{groups:Lo,children:/* @__PURE__ */ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */dt("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
608
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between gap-4",children:[
|
|
609
|
-
/* @__PURE__ */dt("div",{children:[
|
|
610
|
-
/* @__PURE__ */ct("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
|
|
611
|
-
/* @__PURE__ */ct("p",{className:"text-sm text-gray-500",children:"Overview of your store this month"})]}),
|
|
612
|
-
/* @__PURE__ */dt("div",{className:"flex items-center gap-2",children:[
|
|
613
|
-
/* @__PURE__ */ct(g,{variant:"secondary",size:"sm",children:"Export"}),
|
|
614
|
-
/* @__PURE__ */ct(g,{size:"sm",children:"New report"})]})]}),
|
|
615
|
-
/* @__PURE__ */dt("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
|
|
616
|
-
/* @__PURE__ */ct(kn,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
|
|
617
|
-
/* @__PURE__ */ct(kn,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
|
|
618
|
-
/* @__PURE__ */ct(kn,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
|
|
619
|
-
/* @__PURE__ */ct(kn,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
|
|
620
|
-
/* @__PURE__ */dt("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[
|
|
621
|
-
/* @__PURE__ */ct(Nn,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */ct("div",{className:"text-blue-600",children:/* @__PURE__ */ct(No,{data:Do,labels:Po,height:160})})}),
|
|
622
|
-
/* @__PURE__ */ct(Nn,{header:"Traffic sources",children:/* @__PURE__ */dt("div",{className:"flex items-center gap-4",children:[
|
|
623
|
-
/* @__PURE__ */ct($o,{size:120,segments:[{label:"Direct",value:45},{label:"Search",value:30},{label:"Social",value:15},{label:"Email",value:10}],centerLabel:/* @__PURE__ */ct("span",{className:"text-gray-900",children:"100%"})}),
|
|
624
|
-
/* @__PURE__ */dt("ul",{className:"space-y-1.5 text-sm text-gray-600",children:[
|
|
625
|
-
/* @__PURE__ */dt("li",{className:"flex items-center gap-2",children:[
|
|
626
|
-
/* @__PURE__ */ct(jo,{c:ko[0]}),"Direct · 45%"]}),
|
|
627
|
-
/* @__PURE__ */dt("li",{className:"flex items-center gap-2",children:[
|
|
628
|
-
/* @__PURE__ */ct(jo,{c:ko[1]}),"Search · 30%"]}),
|
|
629
|
-
/* @__PURE__ */dt("li",{className:"flex items-center gap-2",children:[
|
|
630
|
-
/* @__PURE__ */ct(jo,{c:ko[2]}),"Social · 15%"]}),
|
|
631
|
-
/* @__PURE__ */dt("li",{className:"flex items-center gap-2",children:[
|
|
632
|
-
/* @__PURE__ */ct(jo,{c:ko[3]}),"Email · 10%"]})]})]})})]}),
|
|
633
|
-
/* @__PURE__ */ct(Nn,{header:"Recent orders",padded:!1,children:/* @__PURE__ */dt("table",{className:"w-full text-sm",children:[
|
|
634
|
-
/* @__PURE__ */ct("thead",{children:/* @__PURE__ */dt("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
|
|
635
|
-
/* @__PURE__ */ct("th",{className:"px-4 py-2 font-medium",children:"Order"}),
|
|
636
|
-
/* @__PURE__ */ct("th",{className:"px-4 py-2 font-medium",children:"Customer"}),
|
|
637
|
-
/* @__PURE__ */ct("th",{className:"px-4 py-2 font-medium",children:"Total"}),
|
|
638
|
-
/* @__PURE__ */ct("th",{className:"px-4 py-2 font-medium",children:"Status"})]})}),
|
|
639
|
-
/* @__PURE__ */ct("tbody",{className:"divide-y divide-gray-100",children:Ao.map(e=>/* @__PURE__ */dt("tr",{className:"text-gray-700",children:[
|
|
640
|
-
/* @__PURE__ */ct("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:e.id}),
|
|
641
|
-
/* @__PURE__ */ct("td",{className:"px-4 py-2",children:/* @__PURE__ */dt("span",{className:"flex items-center gap-2",children:[
|
|
642
|
-
/* @__PURE__ */ct(dl,{size:"xs",name:e.customer}),e.customer]})}),
|
|
643
|
-
/* @__PURE__ */ct("td",{className:"px-4 py-2",children:e.total}),
|
|
644
|
-
/* @__PURE__ */ct("td",{className:"px-4 py-2",children:/* @__PURE__ */ct(jl,{status:e.status})})]},e.id))})]})}),
|
|
645
|
-
/* @__PURE__ */dt("p",{className:"flex items-center gap-2 text-xs text-gray-400",children:[
|
|
646
|
-
/* @__PURE__ */ct("span",{className:"text-emerald-600",children:/* @__PURE__ */ct(wo,{data:Do,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}function jo({c:e}){/* @__PURE__ */
|
|
647
|
-
return ct("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:e}})}var zo={active:"success",invited:"queued",suspended:"danger",pending:"pending"},Fo=[{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 Eo(){const[e,t]=Xe(1),[r,a]=Xe(""),[n,l]=Xe("");/* @__PURE__ */
|
|
648
|
-
return ct(Al,{groups:zo,children:/* @__PURE__ */ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */dt("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
649
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between gap-4",children:[
|
|
650
|
-
/* @__PURE__ */ct("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
|
|
651
|
-
/* @__PURE__ */ct(g,{size:"sm",children:"Invite member"})]}),
|
|
652
|
-
/* @__PURE__ */dt(Nn,{padded:!1,children:[
|
|
653
|
-
/* @__PURE__ */dt("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
|
|
654
|
-
/* @__PURE__ */ct("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */ct(vt,{value:n,onChange:e=>l(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */ct(Oo,{})})}),
|
|
655
|
-
/* @__PURE__ */ct("div",{className:"w-40",children:/* @__PURE__ */ct(Ft,{value:r,onChange:a,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
|
|
656
|
-
/* @__PURE__ */ct(g,{variant:"secondary",size:"sm",children:"Filter"})]}),
|
|
657
|
-
/* @__PURE__ */dt("table",{className:"w-full text-sm",children:[
|
|
658
|
-
/* @__PURE__ */ct("thead",{children:/* @__PURE__ */dt("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
|
|
659
|
-
/* @__PURE__ */ct("th",{className:"px-4 py-2 font-medium",children:"Name"}),
|
|
660
|
-
/* @__PURE__ */ct("th",{className:"px-4 py-2 font-medium",children:"Role"}),
|
|
661
|
-
/* @__PURE__ */ct("th",{className:"px-4 py-2 font-medium",children:"Status"}),
|
|
662
|
-
/* @__PURE__ */ct("th",{className:"px-4 py-2 font-medium text-right",children:"Actions"})]})}),
|
|
663
|
-
/* @__PURE__ */ct("tbody",{className:"divide-y divide-gray-100",children:Fo.map(e=>/* @__PURE__ */dt("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
|
|
664
|
-
/* @__PURE__ */dt("td",{className:"px-4 py-2.5",children:[
|
|
665
|
-
/* @__PURE__ */ct("div",{className:"font-medium text-gray-900",children:e.name}),
|
|
666
|
-
/* @__PURE__ */ct("div",{className:"text-xs text-gray-400",children:e.email})]}),
|
|
667
|
-
/* @__PURE__ */ct("td",{className:"px-4 py-2.5",children:e.role}),
|
|
668
|
-
/* @__PURE__ */ct("td",{className:"px-4 py-2.5",children:/* @__PURE__ */ct(jl,{status:e.status})}),
|
|
669
|
-
/* @__PURE__ */ct("td",{className:"px-4 py-2.5 text-right",children:/* @__PURE__ */ct(g,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
|
|
670
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
|
|
671
|
-
/* @__PURE__ */ct("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
|
|
672
|
-
/* @__PURE__ */ct(co,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function Oo(){/* @__PURE__ */
|
|
673
|
-
return ct(qe,{name:"search",fallback:me,className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}function To(){const[e,t]=Xe("pro"),[r,a]=Xe(!0),[n,l]=Xe("us");/* @__PURE__ */
|
|
674
|
-
return ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */dt("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
|
|
675
|
-
/* @__PURE__ */dt("div",{children:[
|
|
676
|
-
/* @__PURE__ */ct("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
677
|
-
/* @__PURE__ */ct("p",{className:"text-sm text-gray-500",children:"Update your profile and preferences."})]}),
|
|
678
|
-
/* @__PURE__ */ct(Nn,{header:"Profile",children:/* @__PURE__ */dt("div",{className:"space-y-4",children:[
|
|
679
|
-
/* @__PURE__ */dt("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
680
|
-
/* @__PURE__ */ct(It,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */ct(vt,{id:"fn",defaultValue:"Alice"})}),
|
|
681
|
-
/* @__PURE__ */ct(It,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */ct(vt,{id:"ln",defaultValue:"Nguyen"})})]}),
|
|
682
|
-
/* @__PURE__ */ct(It,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */ct(vt,{id:"email",type:"email",defaultValue:"alice@acme.co"})}),
|
|
683
|
-
/* @__PURE__ */ct(It,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */ct(wt,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
|
|
684
|
-
/* @__PURE__ */ct(Nn,{header:"Preferences",children:/* @__PURE__ */dt("div",{className:"space-y-4",children:[
|
|
685
|
-
/* @__PURE__ */dt("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
686
|
-
/* @__PURE__ */ct(It,{label:"Country",htmlFor:"country",children:/* @__PURE__ */ct(Ft,{value:n,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
|
|
687
|
-
/* @__PURE__ */ct(It,{label:"Plan",children:/* @__PURE__ */dt("div",{className:"space-y-1.5 pt-1",children:[
|
|
688
|
-
/* @__PURE__ */ct(Bt,{name:"plan",checked:"free"===e,onChange:()=>t("free"),label:"Free"}),
|
|
689
|
-
/* @__PURE__ */ct(Bt,{name:"plan",checked:"pro"===e,onChange:()=>t("pro"),label:"Pro"}),
|
|
690
|
-
/* @__PURE__ */ct(Bt,{name:"plan",checked:"team"===e,onChange:()=>t("team"),label:"Team"})]})})]}),
|
|
691
|
-
/* @__PURE__ */ct(Ot,{checked:r,onChange:a,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
|
|
692
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-end gap-2",children:[
|
|
693
|
-
/* @__PURE__ */ct(g,{variant:"secondary",children:"Cancel"}),
|
|
694
|
-
/* @__PURE__ */ct(g,{type:"submit",children:"Save changes"})]})]})})}var Bo=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function Io(){const[e,t]=Xe(!0),[r,a]=Xe("us"),n=Bo.reduce((e,t)=>e+t.qty*t.price,0),l=n+9;/* @__PURE__ */
|
|
695
|
-
return ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */dt("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
696
|
-
/* @__PURE__ */ct("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
697
|
-
/* @__PURE__ */dt("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
698
|
-
/* @__PURE__ */dt("form",{className:"space-y-5 lg:col-span-2",onSubmit:e=>e.preventDefault(),children:[
|
|
699
|
-
/* @__PURE__ */ct(Nn,{header:"Contact",children:/* @__PURE__ */ct("div",{className:"space-y-4",children:/* @__PURE__ */ct(It,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */ct(vt,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
|
|
700
|
-
/* @__PURE__ */ct(Nn,{header:"Shipping address",children:/* @__PURE__ */dt("div",{className:"space-y-4",children:[
|
|
701
|
-
/* @__PURE__ */dt("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
702
|
-
/* @__PURE__ */ct(It,{label:"First name",required:!0,children:/* @__PURE__ */ct(vt,{placeholder:"Alice"})}),
|
|
703
|
-
/* @__PURE__ */ct(It,{label:"Last name",required:!0,children:/* @__PURE__ */ct(vt,{placeholder:"Nguyen"})})]}),
|
|
704
|
-
/* @__PURE__ */ct(It,{label:"Address",required:!0,children:/* @__PURE__ */ct(vt,{placeholder:"123 Market St"})}),
|
|
705
|
-
/* @__PURE__ */dt("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[
|
|
706
|
-
/* @__PURE__ */ct(It,{label:"City",children:/* @__PURE__ */ct(vt,{placeholder:"San Francisco"})}),
|
|
707
|
-
/* @__PURE__ */ct(It,{label:"ZIP",children:/* @__PURE__ */ct(vt,{placeholder:"94103"})}),
|
|
708
|
-
/* @__PURE__ */ct(It,{label:"Country",children:/* @__PURE__ */ct(Ft,{value:r,onChange:a,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
|
|
709
|
-
/* @__PURE__ */ct(Ot,{checked:e,onChange:t,label:"Billing address same as shipping"})]})}),
|
|
710
|
-
/* @__PURE__ */ct(Nn,{header:"Payment",children:/* @__PURE__ */dt("div",{className:"space-y-4",children:[
|
|
711
|
-
/* @__PURE__ */ct(It,{label:"Card number",required:!0,children:/* @__PURE__ */ct(vt,{placeholder:"1234 5678 9012 3456"})}),
|
|
712
|
-
/* @__PURE__ */dt("div",{className:"grid grid-cols-2 gap-4",children:[
|
|
713
|
-
/* @__PURE__ */ct(It,{label:"Expiry",required:!0,children:/* @__PURE__ */ct(vt,{placeholder:"MM / YY"})}),
|
|
714
|
-
/* @__PURE__ */ct(It,{label:"CVC",required:!0,children:/* @__PURE__ */ct(vt,{placeholder:"123"})})]})]})})]}),
|
|
715
|
-
/* @__PURE__ */dt("div",{className:"space-y-4",children:[
|
|
716
|
-
/* @__PURE__ */dt(Nn,{header:"Order summary",children:[
|
|
717
|
-
/* @__PURE__ */ct("ul",{className:"space-y-2 text-sm",children:Bo.map(e=>/* @__PURE__ */dt("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
|
|
718
|
-
/* @__PURE__ */dt("span",{children:[e.name," ",
|
|
719
|
-
/* @__PURE__ */dt("span",{className:"text-gray-400",children:["×",e.qty]})]}),
|
|
720
|
-
/* @__PURE__ */dt("span",{children:["$",e.qty*e.price]})]},e.name))}),
|
|
721
|
-
/* @__PURE__ */dt("div",{className:"mt-3 space-y-1.5 border-t border-gray-100 pt-3 text-sm text-gray-600",children:[
|
|
722
|
-
/* @__PURE__ */dt("div",{className:"flex justify-between",children:[
|
|
723
|
-
/* @__PURE__ */ct("span",{children:"Subtotal"}),
|
|
724
|
-
/* @__PURE__ */dt("span",{children:["$",n]})]}),
|
|
725
|
-
/* @__PURE__ */dt("div",{className:"flex justify-between",children:[
|
|
726
|
-
/* @__PURE__ */ct("span",{children:"Shipping"}),
|
|
727
|
-
/* @__PURE__ */dt("span",{children:["$",9]})]}),
|
|
728
|
-
/* @__PURE__ */dt("div",{className:"flex justify-between text-base font-semibold text-gray-900",children:[
|
|
729
|
-
/* @__PURE__ */ct("span",{children:"Total"}),
|
|
730
|
-
/* @__PURE__ */dt("span",{children:["$",l]})]})]}),
|
|
731
|
-
/* @__PURE__ */dt(g,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
|
|
732
|
-
/* @__PURE__ */ct(gl,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var Ro=[{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"}],Wo=[{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 Ko(){const[e,r]=Xe(1),a=Wo.find(t=>t.id===e)??Wo[0];/* @__PURE__ */
|
|
733
|
-
return ct("div",{className:"h-full",children:/* @__PURE__ */ct(t,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */dt("div",{className:"flex h-full flex-col p-2",children:[
|
|
734
|
-
/* @__PURE__ */ct(g,{block:!0,className:"mb-2",children:"Compose"}),Ro.map((e,t)=>/* @__PURE__ */dt("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:[
|
|
735
|
-
/* @__PURE__ */ct("span",{children:e.label}),null!=e.count&&/* @__PURE__ */ct("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */dt("div",{className:"flex h-full",children:[
|
|
736
|
-
/* @__PURE__ */ct("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:Wo.map(t=>/* @__PURE__ */dt("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:[
|
|
737
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between gap-2",children:[
|
|
738
|
-
/* @__PURE__ */ct("span",{className:"truncate text-sm "+(t.unread?"font-semibold text-gray-900":"text-gray-700"),children:t.from}),
|
|
739
|
-
/* @__PURE__ */ct("span",{className:"shrink-0 text-[11px] text-gray-400",children:t.time})]}),
|
|
740
|
-
/* @__PURE__ */ct("div",{className:"truncate text-sm "+(t.unread?"text-gray-800":"text-gray-600"),children:t.subject}),
|
|
741
|
-
/* @__PURE__ */ct("div",{className:"truncate text-xs text-gray-400",children:t.preview})]},t.id))}),
|
|
742
|
-
/* @__PURE__ */dt("div",{className:"flex min-w-0 flex-1 flex-col overflow-auto",children:[
|
|
743
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between gap-3 border-b border-gray-200 p-4",children:[
|
|
744
|
-
/* @__PURE__ */ct("h2",{className:"truncate text-base font-semibold text-gray-900",children:a.subject}),
|
|
745
|
-
/* @__PURE__ */dt("div",{className:"flex shrink-0 gap-1.5",children:[
|
|
746
|
-
/* @__PURE__ */ct(g,{variant:"ghost",size:"sm",children:"Archive"}),
|
|
747
|
-
/* @__PURE__ */ct(g,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
|
|
748
|
-
/* @__PURE__ */dt("div",{className:"flex items-center gap-3 border-b border-gray-100 p-4",children:[
|
|
749
|
-
/* @__PURE__ */ct(dl,{name:a.from}),
|
|
750
|
-
/* @__PURE__ */dt("div",{className:"min-w-0",children:[
|
|
751
|
-
/* @__PURE__ */ct("div",{className:"text-sm font-medium text-gray-900",children:a.from}),
|
|
752
|
-
/* @__PURE__ */dt("div",{className:"text-xs text-gray-400",children:["to me · ",a.time]})]})]}),
|
|
753
|
-
/* @__PURE__ */dt("div",{className:"space-y-3 p-4 text-sm leading-relaxed text-gray-700",children:[
|
|
754
|
-
/* @__PURE__ */ct("p",{children:"Hi,"}),
|
|
755
|
-
/* @__PURE__ */dt("p",{children:[a.preview," The full details are attached — happy to walk through anything on a quick call."]}),
|
|
756
|
-
/* @__PURE__ */dt("p",{children:["Best,",
|
|
757
|
-
/* @__PURE__ */ct("br",{}),a.from]})]})]})]})})})}var Ho=[{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"}],_o=[{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 qo(){const[e,r]=Xe(1),a=Ho.find(t=>t.id===e)??Ho[0];/* @__PURE__ */
|
|
758
|
-
return ct("div",{className:"h-full",children:/* @__PURE__ */ct(t,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */ct("div",{className:"h-full overflow-auto",children:Ho.map(t=>/* @__PURE__ */dt("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:[
|
|
759
|
-
/* @__PURE__ */ct(dl,{name:t.name,status:t.status}),
|
|
760
|
-
/* @__PURE__ */dt("div",{className:"min-w-0 flex-1",children:[
|
|
761
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between gap-2",children:[
|
|
762
|
-
/* @__PURE__ */ct("span",{className:"truncate text-sm font-medium text-gray-900",children:t.name}),
|
|
763
|
-
/* @__PURE__ */ct("span",{className:"shrink-0 text-[11px] text-gray-400",children:t.time})]}),
|
|
764
|
-
/* @__PURE__ */ct("div",{className:"truncate text-xs text-gray-500",children:t.last})]})]},t.id))}),children:/* @__PURE__ */dt("div",{className:"flex h-full flex-col",children:[
|
|
765
|
-
/* @__PURE__ */dt("div",{className:"flex items-center gap-3 border-b border-gray-200 p-3",children:[
|
|
766
|
-
/* @__PURE__ */ct(dl,{name:a.name,status:a.status,size:"sm"}),
|
|
767
|
-
/* @__PURE__ */dt("div",{children:[
|
|
768
|
-
/* @__PURE__ */ct("div",{className:"text-sm font-medium text-gray-900",children:a.name}),
|
|
769
|
-
/* @__PURE__ */ct("div",{className:"text-xs text-gray-400 capitalize",children:a.status})]})]}),
|
|
770
|
-
/* @__PURE__ */ct("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:_o.map((e,t)=>/* @__PURE__ */ct("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */ct("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))}),
|
|
771
|
-
/* @__PURE__ */dt("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
|
|
772
|
-
/* @__PURE__ */ct("div",{className:"flex-1",children:/* @__PURE__ */ct(vt,{placeholder:"Type a message…"})}),
|
|
773
|
-
/* @__PURE__ */ct(g,{type:"submit",children:"Send"})]})]})})})}var Uo={featured:"success",new:"active",draft:"draft"},Vo=["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 Yo(){const[e,t]=Xe("all"),r="all"===e?Vo:Vo.filter(t=>t.tag===e);/* @__PURE__ */
|
|
774
|
-
return ct(Al,{groups:Uo,children:/* @__PURE__ */ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */dt("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
775
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between gap-4",children:[
|
|
776
|
-
/* @__PURE__ */ct("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
|
|
777
|
-
/* @__PURE__ */ct(g,{size:"sm",children:"Upload"})]}),
|
|
778
|
-
/* @__PURE__ */ct(vl,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
|
|
779
|
-
/* @__PURE__ */ct("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */dt(Nn,{padded:!1,className:"overflow-hidden",children:[
|
|
780
|
-
/* @__PURE__ */ct("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */ct("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */ct(jl,{status:e.tag})})}),
|
|
781
|
-
/* @__PURE__ */dt("div",{className:"flex items-center justify-between gap-2 p-3",children:[
|
|
782
|
-
/* @__PURE__ */ct("span",{className:"truncate text-sm font-medium text-gray-900",children:e.title}),
|
|
783
|
-
/* @__PURE__ */ct("span",{className:"text-xs text-gray-400",children:"2.4 MB"})]})]},e.id))})]})})})}var Go={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 Xo({mode:e="login"}){const[t,r]=Xe(!0),a=Go[e];/* @__PURE__ */
|
|
784
|
-
return ct("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */dt("div",{className:"w-full max-w-sm",children:[
|
|
785
|
-
/* @__PURE__ */dt("div",{className:"mb-6 text-center",children:[
|
|
786
|
-
/* @__PURE__ */ct("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"}),
|
|
787
|
-
/* @__PURE__ */ct("h1",{className:"text-lg font-semibold text-gray-900",children:a.title}),
|
|
788
|
-
/* @__PURE__ */ct("p",{className:"text-sm text-gray-500",children:a.subtitle})]}),
|
|
789
|
-
/* @__PURE__ */ct(Nn,{children:/* @__PURE__ */dt("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===e&&/* @__PURE__ */ct(It,{label:"Name",htmlFor:"au-name",children:/* @__PURE__ */ct(vt,{id:"au-name",placeholder:"Alice Nguyen"})}),
|
|
790
|
-
/* @__PURE__ */ct(It,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */ct(vt,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */ct(It,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */ct(vt,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */dt("div",{className:"flex items-center justify-between",children:[
|
|
791
|
-
/* @__PURE__ */ct(Ot,{checked:t,onChange:r,label:"Remember me"}),
|
|
792
|
-
/* @__PURE__ */ct("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
|
|
793
|
-
/* @__PURE__ */ct(g,{type:"submit",block:!0,children:a.cta})]})}),
|
|
794
|
-
/* @__PURE__ */ct("p",{className:"mt-4 text-center text-sm text-gray-500",children:/* @__PURE__ */dt(ut,"register"===e?{children:["Already have an account? ",
|
|
795
|
-
/* @__PURE__ */ct("a",{href:"#",className:"text-blue-600 hover:underline",children:"Sign in"})]}:{children:["New here? ",
|
|
796
|
-
/* @__PURE__ */ct("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var Zo={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 Jo({code:e=404,actions:t}){const r=Zo[e](Se().errors);/* @__PURE__ */
|
|
797
|
-
return dt("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
|
|
798
|
-
/* @__PURE__ */ct("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:e}),
|
|
799
|
-
/* @__PURE__ */ct("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:r.title}),
|
|
800
|
-
/* @__PURE__ */ct("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */ct("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function Qo({pick:e}){/* @__PURE__ */
|
|
801
|
-
return ct(ut,{children:e(Se().errors)})}var ec=class extends it{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):
|
|
802
|
-
/* @__PURE__ */dt("div",{className:"flex h-full flex-col",children:[
|
|
803
|
-
/* @__PURE__ */ct("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */ct(Jo,{code:500,actions:/* @__PURE__ */dt(ut,{children:[
|
|
804
|
-
/* @__PURE__ */ct(g,{onClick:this.reset,children:/* @__PURE__ */ct(Qo,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */dt("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
|
|
805
|
-
/* @__PURE__ */ct("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */ct(Qo,{pick:e=>e.details})}),
|
|
806
|
-
/* @__PURE__ */ct("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 tc(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function rc(e){const t=tc();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function ac(){return tc()?.matches??!1}function nc(){return!1}function lc(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,a=parseInt(e.slice(5,7),16)/255,n=Math.max(t,r,a),l=Math.min(t,r,a);let i=0,s=0;const o=(n+l)/2;if(n!==l){const e=n-l;s=o>.5?e/(2-n-l):e/(n+l),i=n===t?((r-a)/e+(r<a?6:0))/6:n===r?((a-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*s,100*o]}function ic(e,t,r){r/=100;const a=(t/=100)*Math.min(r,1-r),n=t=>{const n=(t+e/30)%12;return r-a*Math.max(Math.min(n-3,9-n,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(n(0))}${l(n(8))}${l(n(4))}`}function sc(e){const t=e||"system";return"system"===t?ac()?"dark":"light":t}function oc(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,a,n]=lc(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",ic(r,a,Math.max(n-10,5))),t.style.setProperty("--accent-500",ic(r,a,Math.min(n+10,95))),t.style.setProperty("--accent-400",ic(r,a,Math.min(n+20,95))),t.style.setProperty("--accent-300",ic(r,Math.min(a+10,100),Math.min(n+30,92))),t.style.setProperty("--accent-200",ic(r,Math.min(a+15,100),Math.min(n+38,94))),t.style.setProperty("--accent-100",ic(r,Math.min(a+20,100),Math.min(n+42,96))),t.style.setProperty("--accent-50",ic(r,Math.min(a+20,100),Math.min(n+46,98)))}else t.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(e=>t.style.removeProperty(e))}function cc(e,t,r,a,n){const l=document.documentElement;if(e){const e=e=>`${parseInt(e.slice(1,3),16)} ${parseInt(e.slice(3,5),16)} ${parseInt(e.slice(5,7),16)}`;if(t&&l.style.setProperty("--custom-bg-color",t),r&&(l.style.setProperty("--window-header-rgb",e(r)),l.style.setProperty("--window-footer-rgb",e(r))),a&&l.style.setProperty("--window-content-rgb",e(a)),n){l.style.setProperty("--custom-button-color",n);const[e,t,r]=lc(n);l.style.setProperty("--custom-button-hover",ic(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var dc=["square","soft","round"];function uc(e){return"square"===e||"round"===e?e:"soft"}function hc(e){const t=uc(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function mc(e){const t="string"==typeof e&&e?e:null;Ue(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function pc(e){"corners"in e&&hc(e.corners),"icon_set"in e&&mc(e.icon_set),document.documentElement.setAttribute("data-theme",sc(e.theme)),oc(e.accent_color??null),cc(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 gc(){const{prefs:e}=s(),t=st(rc,ac,nc),r=e.theme||"system",a=e.accent_color||null,n=e.custom_bg_color||null,l=e.custom_title_color||null,i=e.custom_window_color||null,o=e.custom_button_color||null,c=uc(e.corners),d="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,u="system"===r?t?"dark":"light":r;return Qe(()=>(document.documentElement.setAttribute("data-theme",u),()=>document.documentElement.removeAttribute("data-theme")),[u]),Qe(()=>(hc(c),()=>document.documentElement.removeAttribute("data-corners")),[c]),Qe(()=>(mc(d),()=>mc(null)),[d]),Qe(()=>{oc(a)},[a]),Qe(()=>{cc(a,n,l,i,o)},[a,n,l,i,o]),{theme:r,resolved:u,corners:c,iconSet:d}}function fc(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 bc({size:e="sm",className:t=""}){const{language:r,languages:n,setLanguage:l}=a(),i=Se().language;return n.length<2?null:/* @__PURE__ */dt("span",{className:`inline-flex items-center gap-1.5 text-gray-500 ${t}`.trim(),children:[
|
|
807
|
-
/* @__PURE__ */ct(qe,{name:"globe",fallback:pe,"aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
|
|
808
|
-
/* @__PURE__ */ct("span",{className:"block",style:{width:`${fc(n.map(e=>e.name))}em`},children:/* @__PURE__ */ct(Ft,{size:e,touchSize:e,"aria-label":i.title,value:r,onChange:e=>{l(e)},options:n.map(({tag:e,name:t})=>({value:e,label:t,lang:e}))})})]})}function xc({description:e,className:t=""}){const{language:r,languages:n,setLanguage:l}=a(),i=Se().language;return n.length<2?null:/* @__PURE__ */dt("div",{className:`space-y-4 ${t}`.trim(),children:[
|
|
809
|
-
/* @__PURE__ */dt("div",{children:[
|
|
810
|
-
/* @__PURE__ */ct("h3",{className:"text-sm font-semibold text-gray-900",children:i.title}),
|
|
811
|
-
/* @__PURE__ */ct("p",{className:"mt-0.5 text-sm text-gray-500",children:e??i.description})]}),
|
|
812
|
-
/* @__PURE__ */ct(Wt,{name:"shell-language",value:r,onChange:e=>{l(e)},hint:i.reloadNote,options:n.map(({tag:e,name:t})=>({value:e,label:/* @__PURE__ */ct("span",{lang:e,children:t})}))})]})}function yc({label:e="Not available"}){/* @__PURE__ */
|
|
813
|
-
return ct("span",{className:"text-gray-400",role:"img","aria-label":e,children:We})}function vc({value:e,precise:t,locale:r,className:a}){const n=Ae(),l=Ke(e);if(!l)/* @__PURE__ */return ct(yc,{});const i="string"==typeof e?e:l.toISOString();/* @__PURE__ */
|
|
814
|
-
return ct("time",{dateTime:i,title:_e(i,{locale:r??n}),className:a,children:He(l,{precise:t,locale:r??n})})}function wc(e,t=300){const[r,a]=Xe(e);return Qe(()=>{const r=setTimeout(()=>a(e),t);return()=>clearTimeout(r)},[e,t]),r}function Nc(e,t){Qe(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var kc=8,$c=["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)"],Mc={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},Cc={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function Lc(e){return $c[e]??Cc.muted}function Dc(e,t,r){return t||(r?Mc[r]:Lc(e))}function Pc(e,t){const[r,a]=e,n=a-r,l=e=>0===n?t.from:t.from+(e-r)/n*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,a)=>r+n*a/(e-1)),l}function Ac(e,t,r=0){const a=e>0?(t.to-t.from)/e:0,n=a*r,l=e=>t.from+e*a+n/2;return l.bandwidth=Math.max(0,a-n),l.center=e=>t.from+e*a+a/2,l.end=e=>t.from+(e+1)*a-n/2,l.count=e,l}function Sc(e,t){const r=[...e].sort((e,t)=>e-t),a=Math.max(0,r.length-1),n=e=>0===a?t.from:t.from+e/a*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return n(t);const l=r.findIndex(t=>t>=e);return n(-1===l?a:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function jc(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 zc(e,t){const r=Math.max(e[0],e[1]),a=Math.min(e[0],e[1]),n=r>0?r:0,l=a>0?a:n>0?10**(Math.ceil(Math.log10(n))-3):0,i=Math.log10(l),s=n>0&&l>0?Math.log10(n)-i:0,o=e=>{if(s<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/s*(t.to-t.from)};return o.domain=[l,n],o.range=t,o.ticks=e=>{if(e<2||s<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(n)),a=[];for(let e=t;e<=r;e+=1)a.push(10**e);return 0===a.length?[l,n]:(Math.log10(a[0])-i>.15&&a.unshift(l),Math.log10(n)-Math.log10(a[a.length-1])>.15&&a.push(n),a)},o}function Fc(e,t=0){const r=e>0?2*Math.PI/e:0,a=e=>-Math.PI/2+e*r+t/2;return a.step=Math.max(0,r-t),a.center=e=>-Math.PI/2+e*r+r/2,a.count=e,a}function Ec(e,t){const[r,a]=e,n=Math.sqrt(Math.max(0,a))-Math.sqrt(Math.max(0,r));return e=>{if(0===n)return t.to;const a=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/n;return t.from+Math.min(1,Math.max(0,a))*(t.to-t.from)}}function Oc(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const a=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),n=e[e.length-1];for(const t of r){if(t<e[0]||t>n)continue;const r=t===n?a.length-1:a.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(a[r].count+=1)}return a}const a=t;if(0===r.length||a<1)return[];const n=Math.min(...r),l=(Math.max(...r)-n)/a||1,i=Array.from({length:a},(e,t)=>({from:n+t*l,to:n+(t+1)*l,count:0}));for(const e of r){i[Math.min(a-1,Math.floor((e-n)/l))].count+=1}return i}var Tc=e=>e.toFixed(2);function Bc(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Tc(e)},${Tc(t)}`).join(" ")}function Ic(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Tc(e.start)},${Tc(e.y)}`,t+=` L${Tc(e.end)},${Tc(e.y)}`}),t}function Rc(e){if(e.length<3)return Bc(e);const t=e.length,r=[],a=[];for(let n=0;n<t-1;n+=1){const t=e[n+1][0]-e[n][0];r.push(t),a.push(0===t?0:(e[n+1][1]-e[n][1])/t)}const n=[a[0]];for(let e=1;e<t-1;e+=1)n.push(a[e-1]*a[e]<=0?0:(a[e-1]+a[e])/2);n.push(a[t-2]);for(let e=0;e<t-1;e+=1){if(0===a[e]){n[e]=0,n[e+1]=0;continue}const t=n[e]/a[e],r=n[e+1]/a[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);n[e]=i*t*a[e],n[e+1]=i*r*a[e]}}let l=`M${Tc(e[0][0])},${Tc(e[0][1])}`;for(let a=0;a<t-1;a+=1){const t=r[a]/3;l+=` C${Tc(e[a][0]+t)},${Tc(e[a][1]+n[a]*t)} ${Tc(e[a+1][0]-t)},${Tc(e[a+1][1]-n[a+1]*t)} ${Tc(e[a+1][0])},${Tc(e[a+1][1])}`}return l}function Wc(e,t=0){if(e.length<3)return Bc(e);const r=e.map(e=>e[1]),a=Math.min(...r),n=Math.max(...r),l=e=>Math.min(n,Math.max(a,e)),i=(1-t)/6;let s=`M${Tc(e[0][0])},${Tc(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],a=e[t],n=e[t+1],o=e[t+2]??n,c=a[0]+(n[0]-r[0])*i,d=l(a[1]+(n[1]-r[1])*i),u=n[0]-(o[0]-a[0])*i,h=l(n[1]-(o[1]-a[1])*i);s+=` C${Tc(c)},${Tc(d)} ${Tc(u)},${Tc(h)} ${Tc(n[0])},${Tc(n[1])}`}return s}function Kc(e){if(e.length<2)return Bc(e);let t=`M${Tc(e[0][0])},${Tc(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[a,n]=e[r-1],[l,i]=e[r],s=(a+l)/2;t+=` C${Tc(s)},${Tc(n)} ${Tc(s)},${Tc(i)} ${Tc(l)},${Tc(i)}`}return t}function Hc(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Tc(e[0][0])},${Tc(e[0][1])}`:"monotone"===t?Rc(e):"spline"===t?Wc(e,r):"bump"===t?Kc(e):Bc(e)}function _c(e,t,r){if(0===t.length)return"";const a=t[0],n=t[t.length-1];return`${e} L${Tc(n[0])},${Tc(r)} L${Tc(a[0])},${Tc(r)} Z`}function qc(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Tc(e)},${Tc(t)}`).join(" L")} Z`}function Uc(e,t,r,a,n=-Math.PI/2){return Array.from({length:a},(l,i)=>{const s=n+2*i*Math.PI/a;return[e+r*Math.cos(s),t+r*Math.sin(s)]})}function Vc(e,t,r,a,n,l){const i=l-n;if(Math.abs(i)>=2*Math.PI){const l=n+Math.PI;return`${Vc(e,t,r,a,n,l)} ${Vc(e,t,r,a,l,n+2*Math.PI)}`}const s=Math.abs(i)>Math.PI?1:0,o=(r,a)=>[e+r*Math.cos(a),t+r*Math.sin(a)],[c,d]=o(a,n),[u,h]=o(a,l);if(r<=0)return`M${Tc(e)},${Tc(t)} L${Tc(c)},${Tc(d)} A${Tc(a)},${Tc(a)} 0 ${s} 1 ${Tc(u)},${Tc(h)} Z`;const[m,p]=o(r,l),[g,f]=o(r,n);return`M${Tc(c)},${Tc(d)} A${Tc(a)},${Tc(a)} 0 ${s} 1 ${Tc(u)},${Tc(h)} L${Tc(m)},${Tc(p)} A${Tc(r)},${Tc(r)} 0 ${s} 0 ${Tc(g)},${Tc(f)} Z`}function Yc(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const a=Math.max(...e),n=Math.min(...e),l=t*t,i=r*r;return Math.max(i*a/l,l/(i*n))}function Gc(e,t,r,a){const n=a?r.height:r.width,l=n>0?t/n:0;let i=0;return{tiles:e.map(e=>{const s=t>0?e.value/t*n:0,o=a?{...e,x:r.x,y:r.y+i,width:l,height:s}:{...e,x:r.x+i,y:r.y,width:s,height:l};return i+=s,o}),rest:a?{x:r.x+l,y:r.y,width:r.width-l,height:r.height}:{x:r.x,y:r.y+l,width:r.width,height:r.height-l}}}function Xc(e,t,r){const a=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===a.length||t<=0||r<=0)return[];const n=a.reduce((e,t)=>e+t.value,0),l=t*r,i=[];let s={x:0,y:0,width:t,height:r},o=[],c=0,d=[...a.map(e=>({...e,value:e.value/n*l}))];for(;d.length>0;){const e=d[0],t=Math.min(s.width,s.height),r=s.width>=s.height,a=Yc(o.map(e=>e.value),c,t),n=Yc([...o.map(e=>e.value),e.value],c+e.value,t);if(0===o.length||n<=a)o.push(e),c+=e.value,d=d.slice(1);else{const e=Gc(o,c,s,r);i.push(...e.tiles),s=e.rest,o=[],c=0}}o.length>0&&i.push(...Gc(o,c,s,s.width>=s.height).tiles);const u=new Map(e.map(e=>[e.key,e.value]));return i.map(e=>({...e,value:u.get(e.key)??e.value}))}var Zc=et({highlighted:null,setHighlighted:()=>{}});function Jc({children:e}){const[t,r]=Xe(null),a=Je(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
|
|
815
|
-
return ct(Zc.Provider,{value:a,children:e})}function Qc(){return nt(Zc)}function ed(e,t,r=.22){return null===t?null:t===e?1:r}function td(e,t="none"){if("none"===t||0===e.length)return null;if("last"===t){for(let t=e.length-1;t>=0;t-=1)if("number"==typeof e[t]&&Number.isFinite(e[t]))return t;return null}let r=null;return e.forEach((a,n)=>{if("number"!=typeof a||!Number.isFinite(a))return;if(null===r)return void(r=n);const l=e[r];("max"===t?a>l:a<l)&&(r=n)}),r}function rd(e,t=720){const[r,a]=Xe(t);return Qe(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&a(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function ad({rows:e,max:t,formatValue:r,emphasisKey:a,highlight:n="none",emphasisTone:l,barHeight:i=12,rowGap:s=30,animate:o=!0,className:c,emptyLabel:d}){const u=Se().charts,h=Ae(),m=r??(e=>Ee(e,h)),p=d??u.nothingToRank;if(0===e.length)/* @__PURE__ */
|
|
816
|
-
return ct("p",{className:`text-sm text-gray-500 ${c??""}`,children:p});const g=td(e.map(e=>e.value),n),f=a??(null===g?void 0:e[g]?.key),b=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),x=Lc(0);/* @__PURE__ */
|
|
817
|
-
return ct("ol",{className:`m-0 list-none p-0 ${c??""}`,style:{display:"grid",rowGap:`${Math.max(4,s-i)}px`},children:e.map((e,t)=>{const r=e.key===f,a=r?l?Mc[l]:Lc(1):f?Cc.muted:x,n=Number.isFinite(e.value)?e.value:null,s=null!==n&&b>0?Math.max(0,Math.min(1,n/b)):0;/* @__PURE__ */
|
|
818
|
-
return dt("li",{className:"grid gap-1",children:[
|
|
819
|
-
/* @__PURE__ */dt("div",{className:"flex items-baseline justify-between gap-3",children:[
|
|
820
|
-
/* @__PURE__ */dt("span",{className:"truncate font-mono text-xs text-gray-600 "+(r?"font-semibold":""),title:e.label,children:[e.label,r&&/* @__PURE__ */ct("span",{className:"sr-only",children:` ${u.emphasised}`})]}),
|
|
821
|
-
/* @__PURE__ */ct("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-gray-700",style:r?{color:a}:void 0,children:null===n?"—":m(n)})]}),
|
|
822
|
-
/* @__PURE__ */ct("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */ct("div",{className:`rounded-sm ${o?ci.grow:""}`,style:{width:`${(100*s).toFixed(2)}%`,height:i,backgroundColor:a,minWidth:s>0?2:0,...o?di(t):{}}})})]},e.key)})})}var nd=e=>Math.max(0,Math.min(1,e));function ld({value:e,segments:t,objective:r,label:a,detail:n,formatValue:l,tone:i,className:s,unavailableLabel:o}){const c=Se().charts,d=Ae(),u=l??(e=>Te(100*e,1,d)),h=o??c.notEnough;if(null==e||!Number.isFinite(e))/* @__PURE__ */
|
|
823
|
-
return dt("div",{className:s,children:[a&&/* @__PURE__ */ct("p",{className:"text-sm font-medium text-gray-700",children:a}),
|
|
824
|
-
/* @__PURE__ */ct("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=nd(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=Mc[g],b=[t?.length?t.map(e=>`${e.label} ${u(e.value)}`).join(" · "):"",n??"",null!=r?(p?c.objectiveMet:c.objectiveMissed)(u(r)):""].filter(Boolean).join(" · ");/* @__PURE__ */
|
|
825
|
-
return dt("div",{className:s,children:[
|
|
826
|
-
/* @__PURE__ */dt("div",{className:"mb-1.5 flex items-baseline justify-between gap-3",children:[
|
|
827
|
-
/* @__PURE__ */ct("span",{className:"text-sm font-medium text-gray-700",children:a}),
|
|
828
|
-
/* @__PURE__ */ct("span",{className:"text-sm font-semibold tabular-nums",style:{color:f},children:u(e)})]}),
|
|
829
|
-
/* @__PURE__ */dt("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":a,children:[
|
|
830
|
-
/* @__PURE__ */ct("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */ct("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*nd(e.value)).toFixed(2)}%`,backgroundColor:Mc[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__ */ct("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*nd(r)).toFixed(2)}%`,height:20,backgroundColor:Cc.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */ct("p",{className:"mt-1.5 text-xs text-gray-500",children:b})]})}var id={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function sd({label:e,value:t,unit:r,delta:a,deltaTone:n,trend:l,trendTone:i,footnote:s,className:o}){const c=Se().charts,d=Ae(),u=null==a?null:a>0?"up":a<0?"down":"flat",h=n?Mc[n]:void 0,m=i?Mc[i]:Dc(0);/* @__PURE__ */
|
|
831
|
-
return dt("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${o??""}`,children:[
|
|
832
|
-
/* @__PURE__ */ct("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
833
|
-
/* @__PURE__ */dt("span",{className:"flex items-baseline gap-1.5",children:[
|
|
834
|
-
/* @__PURE__ */ct("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:t}),r&&/* @__PURE__ */ct("span",{className:"text-sm font-medium text-gray-500",children:r})]}),u&&/* @__PURE__ */dt("span",{className:"text-xs font-medium",style:h?{color:h}:void 0,children:[
|
|
835
|
-
/* @__PURE__ */ct("span",{"aria-hidden":"true",children:id[u].glyph})," ",Ee(Math.abs(a),d),
|
|
836
|
-
/* @__PURE__ */dt("span",{className:"sr-only",children:[" ",c[id[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */ct(wo,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-1.5 w-full"}),s&&/* @__PURE__ */ct("span",{className:"mt-1 text-xs text-gray-500",children:s})]})}function od({height:e=220,width:t=720,variant:r="area",bars:a=9,label:n,className:l}){const i=Se().charts,s=n??i.loading,o=`${Ye()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
|
|
837
|
-
return ct("div",{className:l,children:/* @__PURE__ */dt("svg",{width:"100%",height:e,viewBox:`0 0 ${t} ${e}`,role:"img","aria-label":s,"aria-busy":"true",children:[
|
|
838
|
-
/* @__PURE__ */ct("defs",{children:/* @__PURE__ */dt("linearGradient",{id:o,x1:"0",y1:"0",x2:"1",y2:"0",children:[
|
|
839
|
-
/* @__PURE__ */ct("stop",{offset:"0%",stopColor:Cc.surface,stopOpacity:"0"}),
|
|
840
|
-
/* @__PURE__ */ct("stop",{offset:"45%",stopColor:Cc.surface,stopOpacity:"0.55"}),
|
|
841
|
-
/* @__PURE__ */ct("stop",{offset:"55%",stopColor:Cc.surface,stopOpacity:"0.55"}),
|
|
842
|
-
/* @__PURE__ */ct("stop",{offset:"100%",stopColor:Cc.surface,stopOpacity:"0"})]})}),Array.from({length:5},(e,t)=>{const r=u+(h-u)*t/4;/* @__PURE__ */
|
|
843
|
-
return ct("line",{x1:c,y1:r,x2:d,y2:r,stroke:Cc.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */ct("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:Cc.grid},`t${t}`)),"bars"===r?Array.from({length:a},(e,t)=>{const r=(d-c)/a,n=.35+.4*Math.abs(Math.sin(1.1*(t+1))),l=(h-u)*n;/* @__PURE__ */
|
|
844
|
-
return ct("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:Cc.grid},t)}):/* @__PURE__ */ct("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:Cc.grid}),
|
|
845
|
-
/* @__PURE__ */ct("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${o})`})]})})}function cd({shape:e,colour:t}){const r="shrink-0";switch(e){case"circle":/* @__PURE__ */
|
|
846
|
-
return ct("span",{className:`${r} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:t}});case"circle-outline":/* @__PURE__ */
|
|
847
|
-
return ct("span",{className:`${r} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:t}});case"rounded-square-outline":/* @__PURE__ */
|
|
848
|
-
return ct("span",{className:`${r} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:t}});case"square":/* @__PURE__ */
|
|
849
|
-
return ct("span",{className:`${r} h-2.5 w-2.5`,style:{backgroundColor:t}});case"bar":/* @__PURE__ */
|
|
850
|
-
return ct("span",{className:`${r} h-1 w-4 rounded-full`,style:{backgroundColor:t}});case"bar-vertical":/* @__PURE__ */
|
|
851
|
-
return ct("span",{className:`${r} h-3.5 w-1 rounded-full`,style:{backgroundColor:t}});default:/* @__PURE__ */
|
|
852
|
-
return ct("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function dd({entries:e,interactive:t,fallbackSwatch:r}){const{highlighted:a,setHighlighted:n}=Qc();/* @__PURE__ */
|
|
853
|
-
return ct("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!==a&&a!==e.key,s=/* @__PURE__ */dt(ut,{children:[
|
|
854
|
-
/* @__PURE__ */ct(cd,{shape:e.swatch??r,colour:Dc(l,e.color,e.tone)}),e.label]});/* @__PURE__ */
|
|
855
|
-
return ct("li",{className:"list-none",children:t?/* @__PURE__ */ct("button",{type:"button",onMouseEnter:()=>n(e.key),onMouseLeave:()=>n(null),onFocus:()=>n(e.key),onBlur:()=>n(null),className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(i?"opacity-40":""),children:s}):/* @__PURE__ */ct("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:s})},e.key)})})}function ud({title:e,subtitle:t,legend:r,table:a,tableLabel:n,busy:l=!1,loading:i=!1,skeletonVariant:s="area",skeletonHeight:o,interactiveLegend:c=!0,legendSwatch:d="rounded-square",actions:u,children:h,className:m}){const p=Se().charts;/* @__PURE__ */
|
|
856
|
-
return ct(Jc,{children:/* @__PURE__ */dt("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:[
|
|
857
|
-
/* @__PURE__ */dt("header",{className:"flex items-start justify-between gap-4",children:[
|
|
858
|
-
/* @__PURE__ */dt("div",{className:"min-w-0",children:[
|
|
859
|
-
/* @__PURE__ */ct("h3",{className:"truncate text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */ct("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),u&&/* @__PURE__ */ct("div",{className:"shrink-0",children:u})]}),i?/* @__PURE__ */ct(od,{variant:s,height:o}):/* @__PURE__ */ct("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:h}),!i&&r&&r.length>1&&/* @__PURE__ */ct(dd,{entries:r,interactive:c,fallbackSwatch:d}),!i&&a&&/* @__PURE__ */dt("details",{className:"border-t border-gray-100 pt-3",children:[
|
|
860
|
-
/* @__PURE__ */ct("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:n??p.showTable}),
|
|
861
|
-
/* @__PURE__ */ct("div",{className:"mt-3 overflow-x-auto",style:{color:Cc.label},children:a})]})]})})}function hd({variant:e="solid",title:t,rows:r,footnote:a,emphasisKey:n,className:l}){const i="glass"===e;/* @__PURE__ */
|
|
862
|
-
return dt("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__ */ct("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
|
|
863
|
-
/* @__PURE__ */ct("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:r.map(e=>/* @__PURE__ */dt("li",{className:"flex items-center gap-2.5",style:n&&e.key!==n?{opacity:.45}:void 0,children:[
|
|
864
|
-
/* @__PURE__ */ct("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??Cc.muted}}),
|
|
865
|
-
/* @__PURE__ */ct("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
|
|
866
|
-
/* @__PURE__ */ct("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),a&&/* @__PURE__ */ct("p",{className:"mt-2 text-[11px] text-gray-500",children:a})]})}function md({cx:e,cy:t,color:r,variant:a="default",pulse:n=!1,title:l}){const i="border"===a?3:"colored-border"===a?1.5:0,s="border"===a?3:3.5;/* @__PURE__ */
|
|
867
|
-
return dt("g",{children:[n&&/* @__PURE__ */ct("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:s,fill:r,fillOpacity:.45}),"border"===a&&/* @__PURE__ */ct("circle",{cx:e,cy:t,r:s+i,fill:Cc.surface}),
|
|
868
|
-
/* @__PURE__ */ct("circle",{cx:e,cy:t,r:s,fill:"colored-border"===a?Cc.surface:r,stroke:"colored-border"===a?r:void 0,strokeWidth:"colored-border"===a?i:void 0,children:l&&/* @__PURE__ */ct("title",{children:l})})]})}function pd({labels:e,data:t,range:r,onRangeChange:a,height:n=46,width:l=720,color:i,className:s}){const o=Se().charts,c=Ze(null),d=e.length-1,[u,h]=r,m=i??Dc(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=>n-e/b*(n-6),y=[];e.forEach((e,r)=>{if(!g(t[r]))return;const a=y[y.length-1];a&&a.to===r-1?a.to=r:y.push({from:r,to:r})});const v=y.map(e=>{const r=[];for(let a=e.from;a<=e.to;a+=1)r.push(`${a===e.from?"M":"L"}${p(a).toFixed(2)},${x(t[a]).toFixed(2)}`);return`${r.join(" ")} L${p(e.to).toFixed(2)},${n} L${p(e.from).toFixed(2)},${n} Z`}).join(" "),w=(e,t)=>{const r=Math.max(0,Math.min(d,t));a("from"===e?[Math.min(r,h-1),h]:[u,Math.max(r,u+1)])},N=e=>t=>{const r=t.shiftKey?5:1,a="from"===e?u:h;"ArrowLeft"===t.key&&(t.preventDefault(),w(e,a-r)),"ArrowRight"===t.key&&(t.preventDefault(),w(e,a+r)),"Home"===t.key&&(t.preventDefault(),w(e,0)),"End"===t.key&&(t.preventDefault(),w(e,d))},k=Ze(null),$=e=>t=>{k.current=e,t.currentTarget.setPointerCapture(t.pointerId)},M=e=>t=>{k.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=>()=>{k.current===e&&(k.current=null)},L=t=>{const r="from"===t?u:h;/* @__PURE__ */
|
|
869
|
-
return ct("rect",{x:p(r)-4.5,y:0,width:9,height:n,rx:3,fill:m,className:"cursor-ew-resize rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",tabIndex:0,role:"slider","aria-label":"from"===t?o.windowStart:o.windowEnd,"aria-valuemin":0,"aria-valuemax":d,"aria-valuenow":r,"aria-valuetext":e[r],style:{touchAction:"none"},onKeyDown:N(t),onPointerDown:$(t),onPointerMove:M(t),onPointerUp:C(t),onPointerCancel:C(t)},t)};/* @__PURE__ */
|
|
870
|
-
return ct("div",{className:s,children:/* @__PURE__ */dt("svg",{ref:c,width:"100%",height:n,viewBox:`0 0 ${l} ${n}`,role:"group","aria-label":o.window(e[u],e[h],e.length),children:[
|
|
871
|
-
/* @__PURE__ */ct("path",{d:v,fill:Cc.grid}),
|
|
872
|
-
/* @__PURE__ */ct("rect",{x:0,y:0,width:p(u),height:n,fill:Cc.surface,fillOpacity:.72}),
|
|
873
|
-
/* @__PURE__ */ct("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:n,fill:Cc.surface,fillOpacity:.72}),
|
|
874
|
-
/* @__PURE__ */ct("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:n,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}function gd(e,t,r){const a=(t/2+8).toFixed(1),n=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${a}px), calc(100% - 184px))`;var t};return e<=r/2?{left:n(e)}:{right:n(r-e)}}function fd({labels:e,values:t,height:r=220,width:a,bandPadding:n=.24,min:l,max:i,yTickCount:s=4,formatValue:o,yAxisLabel:c,xTickAnchor:d="center",children:u,tooltip:h,ariaLabel:m,className:p,emptyLabel:g}){const f=Se().charts,b=Ae(),x=o??(e=>Ee(e,b)),y=g??f.noData,v=Ze(null),w=rd(v),N=a??w,[k,$]=Xe(null),M=Ye();if(Qe(()=>{if(null!==k)return B(e=>"Escape"===e.key&&($(null),!0))},[k]),0===e.length)/* @__PURE__ */
|
|
875
|
-
return ct("div",{className:p,ref:v,children:/* @__PURE__ */ct("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,N-C.right),P=C.top,A=r-C.bottom,S=t.filter(Number.isFinite),j=l??Math.min(0,...S),z=Pc([j,i??jc(Math.max(...S,0))],{from:A,to:P}),F=Ac(e.length,{from:L,to:D},n),E=z.ticks(s+1),O=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor(N/84))));/* @__PURE__ */
|
|
876
|
-
return dt("div",{className:`relative ${p??""}`,ref:v,children:[
|
|
877
|
-
/* @__PURE__ */dt("svg",{width:"100%",height:r,viewBox:`0 0 ${N} ${r}`,role:"img","aria-label":m,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>$(null),onBlur:()=>$(null),onKeyDown:t=>{if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;$(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
|
|
878
|
-
/* @__PURE__ */ct("defs",{children:/* @__PURE__ */ct("clipPath",{id:M,children:/* @__PURE__ */ct("rect",{x:L,y:P,width:D-L,height:A-P})})}),E.map(e=>/* @__PURE__ */ct("line",{x1:L,y1:z(e),x2:D,y2:z(e),stroke:Cc.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
879
|
-
/* @__PURE__ */ct("line",{x1:L,y1:z(Math.max(j,0)),x2:D,y2:z(Math.max(j,0)),stroke:Cc.axis,strokeWidth:1,shapeRendering:"crispEdges"}),E.map(e=>/* @__PURE__ */ct("text",{x:L-8,y:z(e)+4,textAnchor:"end",fontSize:11,fill:Cc.label,style:{fontVariantNumeric:"tabular-nums"},children:x(e)},`t${e}`)),c&&/* @__PURE__ */ct("text",{x:14,y:(P+A)/2,transform:`rotate(-90 14 ${(P+A)/2})`,textAnchor:"middle",fontSize:11,fill:Cc.label,children:c}),
|
|
880
|
-
/* @__PURE__ */ct("g",{clipPath:`url(#${M})`,children:u({x:F,y:z,left:L,right:D,top:P,bottom:A,width:N,height:r,clipId:M,active:k})}),e.map((e,t)=>t%O===0?/* @__PURE__ */ct("text",{x:"start"===d?F(t):F.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Cc.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */ct("rect",{x:F.center(r)-(D-L)/e.length/2,y:P,width:(D-L)/e.length,height:A-P,fill:"transparent",onMouseEnter:()=>$(r)},`h${r}`))]}),h&&null!==k&&
|
|
881
|
-
/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 z-10",style:gd(F.center(k),F.bandwidth,N),children:h(k)})]})}var bd=12,xd=16,yd=26,vd=52,wd=e=>"number"==typeof e&&Number.isFinite(e);function Nd({series:e,labels:t,height:r=200,stacked:a=!1,stackMode:n="value",levels:l,curve:i="linear",tension:s=0,max:o,yTickCount:c=4,formatValue:d,yAxisLabel:u,referenceLines:h,labelEndpoints:m=!1,dots:p,dotVariant:g="border",pulse:f=!1,brush:b=!1,range:x,onRangeChange:y,loading:v=!1,animate:w=!0,reveal:N="left-to-right",fillVariant:k="gradient",gridStyle:$="solid",width:M,className:C,emptyLabel:L}){const D=Se().charts,P=Ae(),A=d??(e=>Ee(e,P)),S=L??D.noData,j=Ze(null),z=rd(j),F=M??z,[E,O]=Xe(null),[T,I]=Xe(null),{highlighted:R}=Qc(),W=Ye();if(Qe(()=>{if(null!==E)return B(e=>"Escape"===e.key&&(O(null),!0))},[E]),v)/* @__PURE__ */
|
|
882
|
-
return ct("div",{className:C,ref:j,children:/* @__PURE__ */ct(od,{height:r,width:M??z})});const K=t,H=x??T??[0,Math.max(0,K.length-1)],[_,q]=H,U=e=>b?e.slice(_,q+1):e,V=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(wd)).map(e=>({...e,data:U(e.data)}));if(t=U(K),0===V.length||0===t.length)/* @__PURE__ */
|
|
883
|
-
return ct("div",{className:C,ref:j,children:/* @__PURE__ */ct("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:S})});const Y={left:vd,right:Math.max(vd+1,F-xd),top:bd,bottom:r-yd},G=Ac(t.length,{from:Y.left,to:Y.right}),X=t.map((e,t)=>V.reduce((e,r)=>e+(wd(r.data[t])?r.data[t]:0),0)),Z=(e,t)=>X[t]>0?e/X[t]:null,J=[];if(a){let e=t.map(()=>0);for(const t of V)e=e.map((e,r)=>e+(wd(t.data[r])?t.data[r]:0)),J.push("percent"===n?e.map((e,t)=>Z(e,t)):[...e])}const Q=l&&l.length>0?Sc(l,{from:Y.bottom,to:Y.top}):null,ee=a?(J.at(-1)??[]).filter(wd):V.flatMap(e=>e.data.filter(wd)),te=Pc([0,a&&"percent"===n?1:o??jc(Math.max(...ee,0))],{from:Y.bottom,to:Y.top}),re=e=>Q?Q(e):te(e),ae=a&&"percent"===n?e=>Te(Math.round(100*e),0,P):A,ne=Q?Q.levels.map(e=>({value:e,y:Q(e)})):te.ticks(c+1).map(e=>({value:e,y:te(e)})),le=e=>r=>{r.preventDefault(),O(r=>{const a=(r??0)+e;return Math.min(t.length-1,Math.max(0,a))})},ie=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(F/96))));/* @__PURE__ */
|
|
884
|
-
return dt("div",{className:`relative ${C??""}`,ref:j,children:[
|
|
885
|
-
/* @__PURE__ */dt("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:()=>O(null),onBlur:()=>O(null),onKeyDown:e=>{"ArrowRight"===e.key&&le(1)(e),"ArrowLeft"===e.key&&le(-1)(e)},children:[
|
|
886
|
-
/* @__PURE__ */ct("defs",{children:/* @__PURE__ */ct("clipPath",{id:W,children:/* @__PURE__ */ct("rect",{x:Y.left,y:Y.top,width:Y.right-Y.left,height:Y.bottom-Y.top})})}),
|
|
887
|
-
/* @__PURE__ */ct(si,{id:W,fills:V.map((e,t)=>({color:Dc(e.slot,e.color,e.tone),variant:e.fillVariant??k})),fadeFrom:a?.42:.3,reveal:!!w&&N}),ne.map(e=>/* @__PURE__ */ct("line",{x1:Y.left,y1:e.y,x2:Y.right,y2:e.y,stroke:Cc.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===$?"3 3":void 0},`grid-${e.value}`)),
|
|
888
|
-
/* @__PURE__ */ct("line",{x1:Y.left,y1:Y.bottom,x2:Y.right,y2:Y.bottom,stroke:Cc.axis,strokeWidth:1,shapeRendering:"crispEdges"}),ne.map(e=>/* @__PURE__ */ct("text",{x:Y.left-8,y:e.y+4,textAnchor:"end",fontSize:11,fill:Cc.label,style:{fontVariantNumeric:"tabular-nums"},children:ae(e.value)},`ytick-${e.value}`)),u&&/* @__PURE__ */ct("text",{x:12,y:(Y.top+Y.bottom)/2,transform:`rotate(-90 12 ${(Y.top+Y.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:Cc.label,children:u}),
|
|
889
|
-
/* @__PURE__ */ct("g",{clipPath:`url(#${W})`,mask:w&&N?`url(#${ti(W)})`:void 0,children:V.map((e,r)=>{const n=Dc(e.slot,e.color,e.tone),l=e.mode??(a?"area":"line"),o=ed(e.key,R);if("step"===l){const r=t.map((t,r)=>({start:G(r),end:G.end(r),value:e.data[r]})).filter(e=>wd(e.value)).map(e=>({start:e.start,end:e.end,y:re(e.value)}));/* @__PURE__ */
|
|
890
|
-
return ct("path",{d:Ic(r),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:o??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,n)=>{const l=a?J[r]?.[n]:e.data[n];return wd(l)?[G.center(n),re(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*G.bandwidth);/* @__PURE__ */
|
|
891
|
-
return ct("g",{opacity:o??void 0,className:"rosh-viz-mark",children:t.map((t,i)=>{const s=a?J[r]?.[i]:e.data[i];if(!wd(s))return null;const o=re(s);/* @__PURE__ */
|
|
892
|
-
return ct("rect",{x:G.center(i)-l/2,y:o,width:l,height:Math.max(0,Y.bottom-o),rx:2,fill:n,fillOpacity:.35,className:w?ci.rise:void 0,style:w?di(i,26):void 0},i)})},e.key)}const d=Hc(c,i,s),u=a&&r>0?t.map((e,t)=>[G.center(t),re(J[r-1]?.[t]??0)-2]):null,h=u?qc(d,u):_c(d,c,Y.bottom);/* @__PURE__ */
|
|
893
|
-
return dt("g",{opacity:o??void 0,className:"rosh-viz-mark",children:[("area"===l||a)&&
|
|
894
|
-
/* @__PURE__ */ct("path",{d:h,fill:ai(W,r,e.fillVariant??k,n),stroke:"none"}),
|
|
895
|
-
/* @__PURE__ */ct("path",{d:d,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:ni(e.stroke??(e.forecast?"animated-dashed":"solid")),className:w&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?ci.march:void 0})]},e.key)})}),h?.map((e,t)=>{const r=e.color??Mc[e.tone??"critical"],a=re(e.value);/* @__PURE__ */
|
|
896
|
-
return dt("g",{children:[
|
|
897
|
-
/* @__PURE__ */ct("line",{x1:Y.left,y1:a,x2:Y.right,y2:a,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */ct("text",{x:Y.right-4,y:a-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 n=p??(m?"last":"none"),l=Dc(e.slot,e.color,e.tone),i=[...e.data].map(wd).lastIndexOf(!0),s="all"===n?t.map((e,t)=>t).filter(t=>wd(a?J[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
|
|
898
|
-
return dt("g",{children:[s.map(n=>{const s=a?J[r]?.[n]:e.data[n];return wd(s)?/* @__PURE__ */ct(md,{cx:G.center(n),cy:re(s),color:l,variant:g,pulse:f&&n===i,title:`${t[n]}: ${e.label} ${A(s)}`},n):null}),m&&i>=0&&wd(a?J[r]?.[i]:e.data[i])&&/* @__PURE__ */ct("text",{x:G.center(i)-10,y:re(a?J[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:Cc.label,style:{fontVariantNumeric:"tabular-nums"},children:A(a?J[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%ie===0?/* @__PURE__ */ct("text",{x:G.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Cc.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==E&&/* @__PURE__ */ct("line",{x1:G.center(E),y1:Y.top,x2:G.center(E),y2:Y.bottom,stroke:Cc.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */ct("rect",{x:G(t),y:Y.top,width:Math.max(1,G.bandwidth),height:Y.bottom-Y.top,fill:"transparent",onMouseEnter:()=>O(t)},`hit-${t}`))]}),b&&K.length>2&&/* @__PURE__ */ct(pd,{className:"mt-1",labels:K,width:F,data:e[0]?.data??[],range:H,onRangeChange:e=>{y?y(e):I(e)}}),null!==E&&
|
|
899
|
-
/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 z-10",style:gd(G.center(E),G.bandwidth,F),children:/* @__PURE__ */ct(hd,{title:t[E],rows:V.map((e,t)=>({key:e.key,label:e.label,color:Dc(e.slot,e.color,e.tone),value:wd(e.data[E])?a&&"percent"===n?`${Te(100*(Z(e.data[E],E)??0),1,P)} · ${A(e.data[E])}`:A(e.data[E]):void 0})),footnote:a&&"percent"===n?D.inBucket(A(X[E])):void 0})})]})}function kd({series:e,labels:t,stacked:r=!1,stackMode:a="value",height:n=220,width:l,max:i,formatValue:s,yAxisLabel:o,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:b="none"}){const x=Ye(),{highlighted:y}=Qc(),v=Se().charts,w=Ae(),N=s??(e=>Ee(e,w));if(h)/* @__PURE__ */return ct(od,{height:n,width:l,variant:"bars",className:c});const k=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),$=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},M=t.map((e,t)=>k.reduce((e,r)=>e+$(r,t),0)),C=t.map((e,t)=>k.reduce((e,r)=>e+Math.max(0,$(r,t)),0)),L=t.map((e,t)=>k.reduce((e,r)=>e+Math.min(0,$(r,t)),0)),D=r&&"percent"===a,P=(e,t)=>M[t]>0?e/M[t]:null,A=D?[1]:r?[...C,...L]:k.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
|
|
900
|
-
return ct(fd,{labels:t,values:A,height:n,width:l,max:D?1:i,formatValue:D?e=>Te(Math.round(100*e),0,w):N,yAxisLabel:o,className:c,emptyLabel:d,ariaLabel:v.acrossCategories(k.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */ct(hd,{title:t[e],rows:k.map(t=>({key:t.key,label:t.label,color:Dc(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?D?`${Te(100*(P(t.data[e],e)??0),1,w)} · ${N(t.data[e])}`:N(t.data[e]):void 0})),footnote:D?v.inCategory(N(M[e])):void 0}),children:({x:e,y:a,bottom:n,active:l})=>{const i=f?t.indexOf(f):-1,s=td(r?M:k[0]?.data??[],b),o=l??(i>=0?i:s);/* @__PURE__ */
|
|
901
|
-
return dt("g",{children:[
|
|
902
|
-
/* @__PURE__ */ct(si,{id:x,glow:p}),t.map((t,n)=>{const l=e.bandwidth/(r?1:Math.max(1,k.length));let i=0,s=0;const c=a(Math.min(a.domain[1],Math.max(a.domain[0],0)));return k.map((t,d)=>{const h=t.data[n];if(!Number.isFinite(h))return null;const f=D?P(h,n):h;if(null===f)return null;const b=Dc(t.slot,t.color,t.tone),v=r?e(n):e(n)+d*l;let w,N,$=!0;if(r){const e=f>=0?i:s,t=e+f;f>=0?i=t:s=t,w=a(Math.max(e,t)),N=a(Math.min(e,t)),$=0===e}else w=Math.min(a(f),c),N=Math.max(a(f),c);const M=Math.max(0,N-w-(r&&!$?2:0)),C=null===o||o===n,L=C?b:g?Cc.muted:b,A=ed(t.key,y);/* @__PURE__ */
|
|
903
|
-
return ct("rect",{x:v,y:w,width:Math.max(1,l),height:M,rx:u,fill:L,fillOpacity:A??(C?1:g?.32:.45),filter:p&&o===n?`url(#${ei(x)})`:void 0,className:"rosh-viz-mark"+(m?` ${ci.rise}`:""),style:m?di(n*(r?1:k.length)+d,26):void 0},`${t.key}-${n}`)})}),null!==l&&!g&&/* @__PURE__ */ct("line",{x1:e.center(l),y1:a(a.domain[1]),x2:e.center(l),y2:n,stroke:Cc.axis,strokeWidth:1})]})}})}var $d=3;function Md({series:e,height:t=260,width:r,xLabel:a,yLabel:n,formatX:l,formatY:i,xDomain:s,yDomain:o,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=Se().charts,g=Ae(),f=l??(e=>Ee(e,g)),b=i??(e=>Ee(e,g)),x=m??p.noObservations,y=Ze(null),v=rd(y),w=r??v,N=Ye(),[k,$]=Xe(null);Qe(()=>{if(null!==k)return B(e=>"Escape"===e.key&&($(null),!0))},[k]);const M=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.filter(e=>e.points.length>0).slice(0,3),L=s||o?C.map(e=>({...e,points:e.points.filter(e=>M(e.x,s)&&M(e.y,o))})).filter(e=>e.points.length>0):C,D=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
|
|
904
|
-
return ct("div",{className:h,ref:y,children:/* @__PURE__ */ct("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:x})});const P=L.flatMap(e=>e.points),A=P.some(e=>null!=e.size),S=14,j=20,z=34,F=52,E=Math.max(F+1,w-j),O=(e,t,r,a)=>{const n=e.filter(e=>e>0),l="log"===r?n.length>0?Math.min(...n):0:Math.min(0,...e),i=t??[l,jc(Math.max(...e))];return"log"===r?zc(i,a):Pc(i,a)},T=O(P.map(e=>e.x),s,c,{from:F,to:E}),I=O(P.map(e=>e.y),o,d,{from:t-z,to:S}),R=Ec([0,Math.max(...P.map(e=>e.size??1))],{from:u[0],to:u[1]}),W=k?L[k.s]:void 0,K=k&&W?W.points[k.i]:void 0,H=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
|
|
905
|
-
return dt("div",{className:`relative ${h??""}`,ref:y,children:[
|
|
906
|
-
/* @__PURE__ */dt("svg",{width:"100%",height:t,viewBox:`0 0 ${w} ${t}`,role:"img","aria-label":p.scatter(L.map(e=>e.label),n??p.yAxis,a??p.xAxis)+(D>0?`. ${p.outsideRange(D)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>$(null),onBlur:()=>$(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=k?H.findIndex(e=>e.s===k.s&&e.i===k.i):0;$(H[Math.min(H.length-1,Math.max(0,r+t))])},children:[
|
|
907
|
-
/* @__PURE__ */ct("defs",{children:/* @__PURE__ */ct("clipPath",{id:N,children:/* @__PURE__ */ct("rect",{x:F-u[1],y:S-u[1],width:E-F+2*u[1],height:t-z-S+2*u[1]})})}),I.ticks(5).map(e=>/* @__PURE__ */dt("g",{children:[
|
|
908
|
-
/* @__PURE__ */ct("line",{x1:F,y1:I(e),x2:E,y2:I(e),stroke:Cc.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
909
|
-
/* @__PURE__ */ct("text",{x:F-8,y:I(e)+4,textAnchor:"end",fontSize:11,fill:Cc.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),T.ticks(5).map(e=>/* @__PURE__ */ct("text",{x:T(e),y:t-12,textAnchor:"middle",fontSize:11,fill:Cc.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),a&&/* @__PURE__ */ct("text",{x:(F+E)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:Cc.label,children:a}),n&&/* @__PURE__ */ct("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:Cc.label,children:n}),
|
|
910
|
-
/* @__PURE__ */ct("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=Dc(t,e.color,e.tone);return e.points.map((a,n)=>/* @__PURE__ */ct("circle",{cx:T(a.x),cy:I(a.y),r:A?R(a.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:Cc.surface,strokeWidth:2,onMouseEnter:()=>$({s:t,i:n})},`${e.key}-${n}`))})})]}),k&&W&&K&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ct(hd,{title:K.label??W.label,rows:[{key:"x",label:a??p.xAxis,color:Dc(k.s,W.color,W.tone),value:f(K.x)},{key:"y",label:n??p.yAxis,color:Dc(k.s,W.color,W.tone),value:b(K.y)},...null!=K.size?[{key:"size",label:p.size,color:Cc.muted,value:Ee(K.size,g)}]:[]],footnote:K.label?W.label:void 0})})]})}function Cd({rows:e,labels:t,variant:r="area",curve:a="linear",height:n=220,width:l,max:i,min:s,formatValue:o,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=Se().charts,b=Ae(),x=o??(e=>Ee(e,b)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=Dc(0,d,u);/* @__PURE__ */
|
|
911
|
-
return ct(fd,{labels:t,values:v,height:n,width:l,max:i,min:s,formatValue:x,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(y,t.length),tooltip:r=>/* @__PURE__ */ct(hd,{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:n,active:l})=>"bar"===r?/* @__PURE__ */ct("g",{children:e.map((e,r)=>/* @__PURE__ */ct("rect",{x:t(r),y:n(e.high),width:Math.max(1,t.bandwidth),height:Math.max(1,n(e.low)-n(e.high)),rx:g,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */dt("g",{children:[(()=>{const r=e.map((e,r)=>[t.center(r),n(e.high)]),l=e.map((e,r)=>[t.center(r),n(e.low)]);/* @__PURE__ */
|
|
912
|
-
return dt(ut,{children:[
|
|
913
|
-
/* @__PURE__ */ct("path",{d:qc(Hc(r,a),l),fill:w,fillOpacity:.2,stroke:"none"}),
|
|
914
|
-
/* @__PURE__ */ct("path",{d:Hc(r,a),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
|
|
915
|
-
/* @__PURE__ */ct("path",{d:Hc(l,a),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */ct("line",{x1:t.center(l),y1:n(e[l].high),x2:t.center(l),y2:n(e[l].low),stroke:Cc.axis,strokeWidth:1})]})})}function Ld({steps:e,height:t=240,width:r,formatValue:a,yAxisLabel:n,className:l,emptyLabel:i,radius:s=3,connectors:o=!0}){const c=Se().charts,d=Ae(),u=a??(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__ */
|
|
916
|
-
return ct(fd,{labels:e.map(e=>e.label),values:p,height:t,width:r,formatValue:u,yAxisLabel:n,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?Mc.neutral:t.value>=0?Mc.good:Mc.critical;/* @__PURE__ */
|
|
917
|
-
return ct(hd,{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:Mc.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */dt("g",{children:[o&&m.slice(0,-1).map((r,a)=>
|
|
918
|
-
/* @__PURE__ */ct("line",{x1:e.end(a),y1:t(r.to),x2:e(a+1),y2:t(r.to),stroke:Cc.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${a}`)),m.map((a,n)=>{const l=a.total?Mc.neutral:a.value>=0?Mc.good:Mc.critical,i=Math.min(t(a.from),t(a.to)),o=Math.max(1,Math.abs(t(a.to)-t(a.from)));/* @__PURE__ */
|
|
919
|
-
return ct("rect",{x:e(n),y:i,width:Math.max(1,e.bandwidth),height:o,rx:s,fill:l,fillOpacity:null===r||r===n?1:.45},n)})]})})}function Dd({values:e,bins:t=10,precomputed:r,height:a=220,width:n,color:l,tone:i,formatBound:s,formatCount:o,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=Se().charts,p=Ae(),g=s??(e=>Number.isInteger(e)?Ee(e,p):Oe(e,1,p)),f=o??(e=>Ee(e,p)),b=c??m.countAxis,x=d??m.distribution,y=r??Oc(e??[],t),v=Dc(0,l,i),w=y.map(e=>g(e.from)),N=y.map(e=>e.count);/* @__PURE__ */
|
|
920
|
-
return ct(fd,{labels:w,values:N,height:a,width:n,bandPadding:0,xTickAnchor:"start",formatValue:f,yAxisLabel:b,className:u,emptyLabel:h,ariaLabel:m.histogram(x,y.length,(e??[]).length),tooltip:e=>/* @__PURE__ */ct(hd,{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:a})=>/* @__PURE__ */ct("g",{children:y.map((n,l)=>/* @__PURE__ */ct("rect",{x:e(l)+.5,y:t(n.count),width:Math.max(1,e.bandwidth-1),height:Math.max(0,r-t(n.count)),fill:v,fillOpacity:null===a||a===l?.85:.42},l))})})}function Pd({boxes:e,height:t=240,width:r,color:a,tone:n,formatValue:l,yAxisLabel:i,label:s,className:o,emptyLabel:c}){const d=Se().charts,u=Ae(),h=l??(e=>Ee(e,u)),m=s??d.distribution,p=Dc(0,a,n),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
|
|
921
|
-
return ct(fd,{labels:e.map(e=>e.label),values:g,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:o,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
|
|
922
|
-
return ct(hd,{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:a})=>/* @__PURE__ */ct("g",{children:e.map((e,n)=>{const l=t.center(n),i=Math.max(6,t.bandwidth);/* @__PURE__ */
|
|
923
|
-
return dt("g",{opacity:null!==a&&a!==n?.45:1,children:[
|
|
924
|
-
/* @__PURE__ */ct("line",{x1:l,y1:r(e.max),x2:l,y2:r(e.q3),stroke:p,strokeWidth:1.5}),
|
|
925
|
-
/* @__PURE__ */ct("line",{x1:l,y1:r(e.q1),x2:l,y2:r(e.min),stroke:p,strokeWidth:1.5}),
|
|
926
|
-
/* @__PURE__ */ct("line",{x1:l-i/4,y1:r(e.max),x2:l+i/4,y2:r(e.max),stroke:p,strokeWidth:1.5}),
|
|
927
|
-
/* @__PURE__ */ct("line",{x1:l-i/4,y1:r(e.min),x2:l+i/4,y2:r(e.min),stroke:p,strokeWidth:1.5}),
|
|
928
|
-
/* @__PURE__ */ct("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}),
|
|
929
|
-
/* @__PURE__ */ct("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__ */ct("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:Cc.surface,strokeWidth:1.5},t))]},n)})})})}function Ad({candles:e,variant:t="candle",height:r=260,width:a,formatValue:n,yAxisLabel:l,label:i,className:s,emptyLabel:o}){const c=Se().charts,d=Ae(),u=n??(e=>Number.isInteger(e)?Ee(e,d):Oe(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__ */
|
|
930
|
-
return ct(fd,{labels:e.map(e=>e.label),values:m,height:r,width:a,min:p-f,max:g+f,bandPadding:.42,formatValue:u,yAxisLabel:l,className:s,emptyLabel:o,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],a=r.close>=r.open,n=a?Mc.good:Mc.critical;/* @__PURE__ */
|
|
931
|
-
return ct(hd,{title:r.label,rows:[{key:"open",label:c.open,color:n,value:u(r.open)},{key:"high",label:c.high,color:n,value:u(r.high)},{key:"low",label:c.low,color:n,value:u(r.low)},{key:"close",label:c.close,color:n,value:u(r.close)}],emphasisKey:"close",footnote:a?c.closedAbove:c.closedBelow})},children:({x:r,y:a,active:n})=>/* @__PURE__ */ct("g",{children:e.map((e,l)=>{const i=e.close>=e.open,s=i?Mc.good:Mc.critical,o=r.center(l),c=Math.max(3,r.bandwidth),d=null!==n&&n!==l,u=a(Math.max(e.open,e.close)),h=Math.max(1,Math.abs(a(e.close)-a(e.open)));/* @__PURE__ */
|
|
932
|
-
return dt("g",{opacity:d?.45:1,children:[
|
|
933
|
-
/* @__PURE__ */ct("line",{x1:o,y1:a(e.high),x2:o,y2:a(e.low),stroke:s,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */ct("rect",{x:o-c/2,y:u,width:c,height:h,rx:1,fill:i?s:"transparent",fillOpacity:i?.85:1,stroke:s,strokeWidth:1.5}):/* @__PURE__ */dt(ut,{children:[
|
|
934
|
-
/* @__PURE__ */ct("line",{x1:o-c/2,y1:a(e.open),x2:o,y2:a(e.open),stroke:s,strokeWidth:2}),
|
|
935
|
-
/* @__PURE__ */ct("line",{x1:o,y1:a(e.close),x2:o+c/2,y2:a(e.close),stroke:s,strokeWidth:2})]})]},l)})})})}function Sd({rows:e,columns:t,cells:r,height:a,width:n,color:l,max:i,formatValue:s,label:o,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=Se().charts,p=Ae(),g=s??(e=>Ee(e,p)),f=o??m.intensity,b=d??m.noActivity,x=Ze(null),y=rd(x),v=n??y,w=Ye(),[N,k]=Xe(null);if(Qe(()=>{if(null!==N)return B(e=>"Escape"===e.key&&(k(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
|
|
936
|
-
return ct("div",{className:c,ref:x,children:/* @__PURE__ */ct("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const $=l??Dc(0),M=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=a??L+26+26,P=Math.max(2,(Math.max(97,v)-C)/t.length),A=e=>{const t=M>0?Math.max(0,Math.min(1,e/M)):0;return`color-mix(in oklab, ${$} ${(8+92*t).toFixed(1)}%, ${Cc.surface})`};/* @__PURE__ */
|
|
937
|
-
return dt("div",{className:`relative ${c??""}`,ref:x,children:[
|
|
938
|
-
/* @__PURE__ */dt("svg",{width:"100%",height:D,viewBox:`0 0 ${v} ${D}`,role:"img","aria-label":m.heatmap(f,e.length,t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>k(null),onBlur:()=>k(null),onKeyDown:r=>{const a="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,n="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===a&&0===n||(r.preventDefault(),k(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+a)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+n))})))},children:[
|
|
939
|
-
/* @__PURE__ */ct("defs",{children:/* @__PURE__ */dt("linearGradient",{id:w,x1:"0",x2:"1",children:[
|
|
940
|
-
/* @__PURE__ */ct("stop",{offset:"0",stopColor:A(0)}),
|
|
941
|
-
/* @__PURE__ */ct("stop",{offset:"1",stopColor:A(M)})]})}),e.map((e,t)=>/* @__PURE__ */ct("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:Cc.label,children:e},`r${t}`)),e.map((e,a)=>t.map((t,n)=>{const l=r[a]?.[n]??0,i=N&&(N.r!==a||N.c!==n);/* @__PURE__ */
|
|
942
|
-
return ct("rect",{x:C+n*P+u/2,y:26*a+u/2,width:Math.max(1,P-u),height:26-u,rx:h,fill:A(l),opacity:i?.55:1,onMouseEnter:()=>k({r:a,c:n}),children:/* @__PURE__ */ct("title",{children:`${e} · ${t}: ${g(l)}`})},`${a}-${n}`)})),t.map((e,r)=>r%Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor((v-C)/56))))===0?/* @__PURE__ */ct("text",{x:C+r*P+P/2,y:L+15,textAnchor:"middle",fontSize:11,fill:Cc.label,children:e},`c${r}`):null),
|
|
943
|
-
/* @__PURE__ */ct("rect",{x:C,y:L+26,width:Math.min(180,Math.max(40,v-C)),height:8,rx:4,fill:`url(#${w})`}),
|
|
944
|
-
/* @__PURE__ */ct("text",{x:C,y:L+48,fontSize:10.5,fill:Cc.label,children:"0"}),
|
|
945
|
-
/* @__PURE__ */ct("text",{x:C+Math.min(180,Math.max(40,v-C)),y:L+48,textAnchor:"end",fontSize:10.5,fill:Cc.label,style:{fontVariantNumeric:"tabular-nums"},children:g(M)})]}),N&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */ct(hd,{title:`${e[N.r]} · ${t[N.c]}`,rows:[{key:"v",label:f,color:$,value:null==r[N.r]?.[N.c]?void 0:g(r[N.r][N.c])}]})})]})}function jd({caption:e,head:t,rows:r}){/* @__PURE__ */
|
|
946
|
-
return dt("table",{className:"sr-only",children:[
|
|
947
|
-
/* @__PURE__ */ct("caption",{children:e}),
|
|
948
|
-
/* @__PURE__ */ct("thead",{children:/* @__PURE__ */ct("tr",{children:t.map(e=>/* @__PURE__ */ct("th",{scope:"col",children:e},e))})}),
|
|
949
|
-
/* @__PURE__ */ct("tbody",{children:r.map((e,t)=>/* @__PURE__ */ct("tr",{children:e.map((e,t)=>/* @__PURE__ */ct("td",{children:e},t))},t))})]})}var zd=3,Fd=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function Ed({axes:e,series:t,size:r=300,mode:a="area",grid:n="polygon",rings:l=4,formatValue:i,animate:s=!0,className:o,emptyLabel:c}){const d=Se().charts,u=Ae(),h=i??(e=>Ee(e,u)),m=c??d.nothingToCompare,p=Ye(),[g,f]=Xe(null),{highlighted:b}=Qc(),x=t.slice(0,3);if(e.length<3||0===x.length)/* @__PURE__ */
|
|
950
|
-
return ct("p",{className:`text-sm text-gray-500 ${o??""}`,children:m});const y=r/2,v=r/2,w=r/2-46,N=Fc(e.length),k=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))),$=(e,t)=>{const r=Math.max(0,Math.min(1,t/k[e])),a=N.center(e)-N.step/2;return[y+w*r*Math.cos(a),v+w*r*Math.sin(a)]},M=(e,t)=>null!==g?g!==e:null!==b&&b!==t,C=null!==g?x[g]:void 0;/* @__PURE__ */
|
|
951
|
-
return dt("div",{className:`relative ${o??""}`,children:[
|
|
952
|
-
/* @__PURE__ */dt("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
|
|
953
|
-
/* @__PURE__ */ct("title",{id:p,children:d.acrossMeasures(x.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const a=w*(r+1)/l;return"circle"===n?/* @__PURE__ */ct("circle",{cx:y,cy:v,r:a,fill:"none",stroke:Cc.grid,strokeWidth:1},r):/* @__PURE__ */ct("path",{d:Fd(Uc(y,v,a,e.length)),fill:"none",stroke:Cc.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,a]=$(t,k[t]);/* @__PURE__ */
|
|
954
|
-
return dt("g",{children:[
|
|
955
|
-
/* @__PURE__ */ct("line",{x1:y,y1:v,x2:r,y2:a,stroke:Cc.grid,strokeWidth:1}),
|
|
956
|
-
/* @__PURE__ */ct("text",{x:y+(w+18)*Math.cos(N.center(t)-N.step/2),y:v+(w+18)*Math.sin(N.center(t)-N.step/2)+4,textAnchor:"middle",fontSize:11,fill:Cc.label,children:e.label})]},e.key)}),
|
|
957
|
-
/* @__PURE__ */ct(si,{id:p,reveal:!!s&&"center-out"}),x.map((t,r)=>{const n=Dc(r,t.color,t.tone),l=e.map((e,r)=>$(r,t.values[r]??0));/* @__PURE__ */
|
|
958
|
-
return dt("g",{opacity:M(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:s?`url(#${ti(p)})`:void 0,children:["area"===a&&/* @__PURE__ */ct("path",{d:Fd(l),fill:n,fillOpacity:.18,stroke:"none"}),
|
|
959
|
-
/* @__PURE__ */ct("path",{d:Fd(l),fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */ct("circle",{cx:e,cy:t,r:3.5,fill:n,stroke:Cc.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ct(hd,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:Dc(g,C.color,C.tone),value:h(C.values[t]??0)}))})}),
|
|
960
|
-
/* @__PURE__ */ct("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__ */dt("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
961
|
-
/* @__PURE__ */ct("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Dc(t,e.color,e.tone)}}),
|
|
962
|
-
/* @__PURE__ */ct("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
963
|
-
/* @__PURE__ */ct(jd,{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 Od({segments:e,variant:t="pie",size:r=280,innerRadius:a,padAngle:n=.012,maxSegments:l=6,otherLabel:i,formatValue:s,centerLabel:o,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=Se().charts,g=Ae(),f=s??(e=>Ee(e,g)),b=i??p.other,x=m??p.nothingToBreakDown,y=Ye(),[v,w]=Xe(null),{highlighted:N}=Qc(),k=e.filter(e=>e.value>0);if(0===k.length)/* @__PURE__ */return ct("p",{className:`text-sm text-gray-500 ${h??""}`,children:x});const $=[...k].sort((e,t)=>t.value-e.value),M=$.slice(0,l),C=$.slice(l),L=C.length>0?[...M,{key:"__other__",label:b,value:C.reduce((e,t)=>e+t.value,0)}]:M,D=L.reduce((e,t)=>e+t.value,0),P=r/2,A=r/2,S=r/2-12,j=a??("ring"===t?.58*S:0),z=Fc(L.length,n),F=Math.max(...L.map(e=>e.value)),E=e=>j+(S-j)*Math.sqrt(Math.max(0,e)/F);let O=-Math.PI/2;const T=(()=>{if("outside"!==d)return[];let e=-Math.PI/2;const r=L.map((r,a)=>{const l="rose"===t?Fc(L.length,n).step:r.value/D*Math.PI*2,i="rose"===t?Fc(L.length,n).center(a):e+l/2;e+=l;const s="rose"===t?E(r.value):S;return{key:r.key,label:r.label,share:r.value/D,right:Math.cos(i)>=0,anchor:[P+s*Math.cos(i),A+s*Math.sin(i)],y:A+(s+14)*Math.sin(i),index:a}}).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})(),B=(e,t)=>null!==v?v!==e:null!==N&&N!==t,I=null!==v?L[v]:void 0;/* @__PURE__ */
|
|
964
|
-
return dt("div",{className:`relative ${h??""}`,children:[
|
|
965
|
-
/* @__PURE__ */dt("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":y,onMouseLeave:()=>w(null),children:[
|
|
966
|
-
/* @__PURE__ */ct("title",{id:y,children:p.breakdown(f(D),L.length)}),L.map((e,r)=>{const a=Dc(r,e.color,e.tone),l="rose"===t?z(r):O,i="rose"===t?z.step:e.value/D*Math.PI*2-n;"rose"!==t&&(O+=e.value/D*Math.PI*2);const s=l+Math.max(.001,i),o="rose"===t?E(e.value):S;/* @__PURE__ */
|
|
967
|
-
return ct("path",{d:Vc(P,A,j,o,l,s),fill:a,fillOpacity:B(r,e.key)?.4:1,stroke:Cc.surface,strokeWidth:1,className:c?ci.sweep:void 0,style:c?di(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),T.map(e=>{const t=e.right?r-6:6,a=e.right?r-58:58;/* @__PURE__ */
|
|
968
|
-
return dt("g",{children:[
|
|
969
|
-
/* @__PURE__ */ct("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${a},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:Cc.grid,strokeWidth:1}),
|
|
970
|
-
/* @__PURE__ */ct("text",{x:t,y:e.y-2,fontSize:10.5,fill:Cc.label,textAnchor:e.right?"end":"start",children:e.label}),
|
|
971
|
-
/* @__PURE__ */ct("text",{x:t,y:e.y+10,fontSize:10.5,fontWeight:600,fill:Cc.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:Te(100*e.share,1,g)})]},`lbl-${e.key}`)}),o&&j>0&&/* @__PURE__ */ct("text",{x:P,y:A+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:Cc.label,children:o})]}),I&&null!==v&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ct(hd,{title:I.label,rows:[{key:"value",label:p.value,color:Dc(v,I.color,I.tone),value:f(I.value)},{key:"share",label:p.share,color:Cc.muted,value:Te(I.value/D*100,1,g)}]})}),
|
|
972
|
-
/* @__PURE__ */ct("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__ */dt("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
973
|
-
/* @__PURE__ */ct("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Dc(t,e.color,e.tone)}}),
|
|
974
|
-
/* @__PURE__ */ct("span",{className:"flex-1 truncate",children:e.label}),
|
|
975
|
-
/* @__PURE__ */ct("span",{className:"tabular-nums text-gray-800",children:Te(e.value/D*100,1,g)})]},e.key))})]})}var Td=300*Math.PI/180;function Bd({rows:e,variant:t="track",size:r=300,max:a,formatValue:n,animate:l=!0,className:i,emptyLabel:s,trackGap:o=6}){const c=Se().charts,d=Ae(),u=n??(e=>Ee(e,d)),h=s??c.nothingToPlot,m=Ye(),[p,g]=Xe(null),{highlighted:f}=Qc();if(0===e.length)/* @__PURE__ */return ct("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const b=r/2,x=r/2,y=r/2-10,v=a??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(y-.16*r)/e.length):0,N=Math.max(1,Math.floor((y-.16*r)/w||1)),k="track"===t?e.slice(0,N):e,$=Math.min(o,Math.max(1,w-2)),M=Fc(k.length,.03),C=null!==p?k[p]:void 0;/* @__PURE__ */
|
|
976
|
-
return dt("div",{className:`relative ${i??""}`,children:[
|
|
977
|
-
/* @__PURE__ */dt("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
|
|
978
|
-
/* @__PURE__ */ct("title",{id:m,children:"track"===t?c.radialTrack(k.length):c.radialCycle(k.length)}),k.map((e,a)=>{const n=Dc(a,e.color,e.tone),i=Math.max(0,Math.min(1,e.value/v)),s=((e,t)=>null!==p?p!==e:null!==f&&f!==t)(a,e.key);if("track"===t){const t=y-a*w,r=t-w+$,o=-Math.PI/2;/* @__PURE__ */
|
|
979
|
-
return dt("g",{opacity:s?.4:1,onMouseEnter:()=>g(a),className:l?ci.sweep:void 0,style:l?di(a,70):void 0,children:[
|
|
980
|
-
/* @__PURE__ */ct("path",{d:Vc(b,x,r,t,o,o+Td),fill:Cc.grid}),
|
|
981
|
-
/* @__PURE__ */ct("path",{d:Vc(b,x,r,t,o,o+Td*i),fill:n})]},e.key)}const o=.14*r;/* @__PURE__ */
|
|
982
|
-
return ct("g",{opacity:s?.4:1,onMouseEnter:()=>g(a),children:/* @__PURE__ */ct("path",{d:Vc(b,x,o,o+(y-o)*i,M(a),M(a)+M.step),fill:n})},e.key)})]}),C&&null!==p&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ct(hd,{title:C.label,rows:[{key:"value",label:c.value,color:Dc(p,C.color,C.tone),value:u(C.value)}]})}),
|
|
983
|
-
/* @__PURE__ */ct("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__ */dt("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
984
|
-
/* @__PURE__ */ct("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Dc(t,e.color,e.tone)}}),
|
|
985
|
-
/* @__PURE__ */ct("span",{className:"flex-1 truncate",children:e.label}),
|
|
986
|
-
/* @__PURE__ */ct("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function Id({stages:e,shape:t="funnel",height:r,width:a=560,gap:n=4,formatValue:l,color:i,className:s,emptyLabel:o}){const c=Se().charts,d=Ae(),u=l??(e=>Ee(e,d)),h=o??c.noStages,m=Ye(),[p,g]=Xe(null),{highlighted:f}=Qc();if(0===e.length)/* @__PURE__ */return ct("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const b=i??Dc(0),x=r??54*e.length,y=Math.max(...e.map(e=>e.value),1),v=168,w=a-v,N=e=>w*Math.max(0,e/y)/2,k=v+w/2,$=t=>46+t/Math.max(1,e.length-1)*54,M=e=>`color-mix(in oklab, ${b} ${$(e).toFixed(0)}%, ${Cc.surface})`,C=e=>$(e)>=55?Cc.surface:Cc.label,L=(e,t)=>null!==p?p!==e:null!==f&&f!==t,D=null!==p?e[p]:void 0;/* @__PURE__ */
|
|
987
|
-
return dt("div",{className:`relative ${s??""}`,children:[
|
|
988
|
-
/* @__PURE__ */dt("svg",{width:"100%",height:x,viewBox:`0 0 ${a} ${x}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
|
|
989
|
-
/* @__PURE__ */ct("title",{id:m,children:c.funnel(e.length,u(e[0].value),u(e[e.length-1].value))}),e.map((r,a)=>{const l=a*x/e.length+n/2,i=(a+1)*x/e.length-n/2,s=N(r.value),o="cone"===t?N(e[a+1]?.value??r.value):s,c=e[a-1]?.value,h=null!=c&&c>0?100*(1-r.value/c):null;/* @__PURE__ */
|
|
990
|
-
return dt("g",{opacity:L(a,r.key)?.45:1,onMouseEnter:()=>g(a),children:[
|
|
991
|
-
/* @__PURE__ */ct("path",{d:`M${k-s},${l} L${k+s},${l} L${k+o},${i} L${k-o},${i} Z`,fill:M(a)}),
|
|
992
|
-
/* @__PURE__ */ct("text",{x:154,y:(l+i)/2-2,textAnchor:"end",fontSize:12,fill:Cc.label,children:r.label}),
|
|
993
|
-
/* @__PURE__ */dt("text",{x:154,y:(l+i)/2+14,textAnchor:"end",fontSize:11,fill:Cc.muted,style:{fontVariantNumeric:"tabular-nums"},children:[u(r.value),null!=h?` · −${Te(h,1,d)}`:""]}),
|
|
994
|
-
/* @__PURE__ */ct("text",{x:k,y:(l+i)/2+4,textAnchor:"middle",fontSize:11.5,fontWeight:600,fill:C(a),style:{fontVariantNumeric:"tabular-nums"},children:Te(r.value/(e[0].value||1)*100,0,d)})]},r.key)})]}),D&&null!==p&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ct(hd,{title:D.label,rows:[{key:"value",label:c.count,color:M(p),value:u(D.value)},{key:"share",label:c.ofFirstStage,color:Cc.muted,value:Te(D.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:Mc.critical,value:`−${Te(100*(1-D.value/e[p-1].value),1,d)}`}]:[]]})})]})}function Rd({items:e,height:t=320,width:r,gap:a=2,radius:n=3,formatValue:l,color:i,className:s,emptyLabel:o}){const c=Se().charts,d=Ae(),u=l??(e=>Ee(e,d)),h=o??c.nothingToBreakDown,m=Ze(null),p=rd(m),g=r??p,[f,b]=Xe(null),{highlighted:x}=Qc(),y=Xc(e,g,t);if(0===y.length)/* @__PURE__ */
|
|
995
|
-
return ct("div",{className:s,ref:m,children:/* @__PURE__ */ct("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??Dc(0),w=Math.max(...y.map(e=>e.value),1),N=e=>34+e/w*62,k=e=>`color-mix(in oklab, ${v} ${N(e).toFixed(0)}%, ${Cc.surface})`,$=e=>N(e)>=55?Cc.surface:Cc.label,M=f??x,C=f?y.find(e=>e.key===f):void 0;/* @__PURE__ */
|
|
996
|
-
return dt("div",{className:`relative ${s??""}`,ref:m,children:[
|
|
997
|
-
/* @__PURE__ */ct("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-a),r=Math.max(0,e.height-a),l=t>6.2*e.label.length+12&&r>30,i=l&&r>44;/* @__PURE__ */
|
|
998
|
-
return dt("g",{opacity:M&&M!==e.key?.55:1,onMouseEnter:()=>b(e.key),children:[
|
|
999
|
-
/* @__PURE__ */ct("rect",{x:e.x+a/2,y:e.y+a/2,width:t,height:r,rx:n,fill:k(e.value)}),l&&/* @__PURE__ */ct("text",{x:e.x+a/2+8,y:e.y+a/2+18,fontSize:11.5,fontWeight:600,fill:$(e.value),children:e.label}),i&&/* @__PURE__ */ct("text",{x:e.x+a/2+8,y:e.y+a/2+34,fontSize:11,fill:$(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ct(hd,{title:C.label,rows:[{key:"value",label:c.value,color:k(C.value),value:u(C.value)}]})}),
|
|
1000
|
-
/* @__PURE__ */ct(jd,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function Wd(e,t,r,a,n,l,i,s){if(a>=8)return;const o=e.reduce((e,t)=>e+Kd(t,8-a),0);if(o<=0)return;let c=t;e.forEach((e,t)=>{const d=Kd(e,8-a),u=d/o*r,h=`${i}/${e.key}`,m=0===a?t:n,p=0===a?e.key:l;s.push({id:h,label:e.label,value:d,depth:a,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&Wd(e.children,c,u,a+1,m,p,h,s),c+=u})}function Kd(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+Kd(r,t-1),0):Math.max(0,e.value??0)}function Hd({nodes:e,size:t=320,innerRadius:r=44,ringGap:a=2,formatValue:n,centerLabel:l,className:i,emptyLabel:s}){const o=Se().charts,c=Ae(),d=n??(e=>Ee(e,c)),u=s??o.nothingToBreakDown,[h,m]=Xe(null),{highlighted:p}=Qc(),g=[];if(Wd(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return ct("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, ${Dc(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${Cc.surface})`,N=e=>null!==h?e.id===h:null===p||e.branchKey===p,k=h?g.find(e=>e.id===h):void 0,$=e=>Te(e.value/v*100,1,c);/* @__PURE__ */
|
|
1001
|
-
return dt("div",{className:`relative ${i??""}`,children:[
|
|
1002
|
-
/* @__PURE__ */dt("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":o.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */ct("path",{d:Vc(b,x,r+e.depth*y+a/2,r+(e.depth+1)*y-a/2,e.start,e.end),fill:w(e),fillOpacity:N(e)?1:.45,stroke:Cc.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */ct("text",{x:b,y:x+5,textAnchor:"middle",fontSize:15,fontWeight:600,fill:Cc.label,children:l})]}),k&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ct(hd,{title:k.label,rows:[{key:"value",label:o.value,color:w(k),value:d(k.value)},{key:"share",label:o.share,color:Cc.muted,value:$(k)}]})}),
|
|
1003
|
-
/* @__PURE__ */ct(jd,{caption:o.sunburst(d(v),f),head:[o.tableLevel,o.tableItem,o.value,o.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),$(e)])})]})}function _d({nodes:e,links:t,height:r=320,width:a,nodeWidth:n=14,nodePadding:l=12,formatValue:i,className:s,emptyLabel:o}){const c=Se().charts,d=Ae(),u=i??(e=>Ee(e,d)),h=o??c.noFlows,m=Ze(null),p=rd(m),g=a??p,[f,b]=Xe(null),{highlighted:x}=Qc();if(0===e.length||0===t.length)/* @__PURE__ */
|
|
1004
|
-
return ct("div",{className:s,ref:m,children:/* @__PURE__ */ct("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-n-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),a=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,a,e.value??0)]})),N=/* @__PURE__ */new Map;for(const t of e)N.set(t.depth,[...N.get(t.depth)??[],t]);const k=Math.max(...[...N.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),$=r-20,M=k>0?($-l*(Math.max(...[...N.values()].map(e=>e.length))-1))/k:0,C=/* @__PURE__ */new Map;for(const[e,t]of N){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*M)),a=r.reduce((e,t)=>e+t,0)+l*(t.length-1),n=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=a>$&&n>0?Math.max(0,1-(a-$)/n):1;let s=10;t.forEach((t,a)=>{const n=2+Math.max(0,r[a]-2)*i;C.set(t.key,{x:v(e),y:s,h:n,index:a}),s+=n+l})}const L=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,P=/* @__PURE__ */new Map,A=(e,t)=>e.from===t||e.to===t,S="link"===f?.kind?t[f.index]:void 0,j="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
|
|
1005
|
-
return dt("div",{className:`relative ${s??""}`,ref:m,children:[
|
|
1006
|
-
/* @__PURE__ */dt("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),a=C.get(e.to);if(!r||!a)return null;const l=Math.max(1,e.value*M),i=r.y+(L.get(e.from)??0)+l/2,s=a.y+(D.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),D.set(e.to,(D.get(e.to)??0)+l);const o=r.x+n,c=a.x,d=Dc(r.index,e.color),u=`${e.from}→${e.to}`,h=P.get(u)??0;P.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:A(e,f.key):null!==x?A(e,x):null)(e,t);/* @__PURE__ */
|
|
1007
|
-
return ct("path",{d:Kc([[o,i],[c,s]]),fill:"none",stroke:d,strokeWidth:l,strokeOpacity:null===m||m?.42:.12,onMouseEnter:()=>b({kind:"link",index:t})},h?`${u}#${h}`:u)}),e.map(e=>{const r=C.get(e.key);if(!r)return null;const a=r.x>g/2,l=(i=e.key,f?"node"===f.kind?f.key===i:A(t[f.index],i):null!==x?x===i:null);var i;/* @__PURE__ */
|
|
1008
|
-
return dt("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>b({kind:"node",key:e.key}),children:[
|
|
1009
|
-
/* @__PURE__ */ct("rect",{x:r.x,y:r.y,width:n,height:r.h,rx:2,fill:Dc(r.index,e.color,e.tone)}),
|
|
1010
|
-
/* @__PURE__ */ct("text",{x:a?r.x-8:r.x+n+8,y:r.y+r.h/2+4,textAnchor:a?"end":"start",fontSize:11,fill:Cc.label,children:e.label})]},e.key)})]}),S&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ct(hd,{title:`${S.from} → ${S.to}`,rows:[{key:"value",label:c.flow,color:Dc(C.get(S.from)?.index??0,S.color),value:u(S.value)}]})}),j&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ct(hd,{title:j.label,rows:[{key:"value",label:c.throughput,color:Dc(C.get(j.key)?.index??0,j.color,j.tone),value:u(w.get(j.key)??0)}]})}),
|
|
1011
|
-
/* @__PURE__ */ct(jd,{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 qd({labels:e,matrix:t,size:r=340,maxNodes:a=8,padAngle:n=.04,arcWidth:l=12,formatValue:i,className:s,emptyLabel:o}){const c=Se().charts,d=Ae(),u=i??(e=>Ee(e,d)),h=o??c.noFlows,[m,p]=Xe(null),{highlighted:g}=Qc(),f=(e,r)=>{const a=t[e]?.[r];return"number"==typeof a&&Number.isFinite(a)?a:0},b=e.map((t,r)=>e.reduce((e,t,a)=>e+f(r,a)+f(a,r),0)),x=e.map((e,t)=>t).sort((e,t)=>b[t]-b[e]).slice(0,a),y=x.reduce((e,t)=>e+b[t],0);if(y<=0)/* @__PURE__ */return ct("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const v=r/2,w=r/2,N=r/2-44,k=N-l,$=n*x.length,M=/* @__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+n});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 a=M.get(e),n=r/Math.max(1,b[e])*(a.end-a.start),l=L.get(e)??0;L.set(e,l+n),D.push({from:e,to:t,value:r,a:a.start+l+n/2,b:M.get(t).start+(M.get(t).end-M.get(t).start)/2})}const P=(e,t)=>[v+t*Math.cos(e),w+t*Math.sin(e)],A="arc"===m?.kind?m.index:void 0,S="ribbon"===m?.kind?D[m.index]:void 0;/* @__PURE__ */
|
|
1012
|
-
return dt("div",{className:`relative ${s??""}`,children:[
|
|
1013
|
-
/* @__PURE__ */dt("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,a)=>{const[n,l]=P(t.a,k),[i,s]=P(t.b,k),o=Dc(M.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,a);/* @__PURE__ */
|
|
1014
|
-
return ct("path",{d:`M${n},${l} Q${v},${w} ${i},${s}`,fill:"none",stroke:o,strokeWidth:Math.max(1,t.value/y*r*.9),strokeOpacity:null===c||c?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:a})},`${e[t.from]}→${e[t.to]}`)}),x.map(t=>{const r=M.get(t),a=(r.start+r.end)/2,[n,l]=P(a,N+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__ */
|
|
1015
|
-
return dt("g",{onMouseEnter:()=>p({kind:"arc",index:t}),children:[
|
|
1016
|
-
/* @__PURE__ */ct("path",{d:Vc(v,w,k,N,r.start,r.end),fill:Dc(r.slot),fillOpacity:null===i||i?1:.45}),
|
|
1017
|
-
/* @__PURE__ */ct("text",{x:n,y:l+4,fontSize:11,fill:Cc.label,textAnchor:Math.cos(a)>.15?"start":Math.cos(a)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==A&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ct(hd,{title:e[A],rows:[{key:"total",label:c.totalFlow,color:Dc(M.get(A).slot),value:u(b[A])}]})}),S&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */ct(hd,{title:`${e[S.from]} → ${e[S.to]}`,rows:[{key:"value",label:c.flow,color:Dc(M.get(S.from).slot),value:u(S.value)}]})}),
|
|
1018
|
-
/* @__PURE__ */ct(jd,{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{eo as APP_UPDATE_POLL_MS,kl as Accordion,ro as AppUpdateBanner,bn as AttachButton,gn as AttachmentDropZone,fn as AttachmentList,Xo as AuthScreen,dl as Avatar,ul as AvatarGroup,gl as Banner,No as BarChart,Pd as BoxPlotChart,lr as BrandAssetEditor,Gl as BudgetBar,Cc as CHART_INK,_n as CONTROL_HEIGHTS,dc as CORNERS,vr as Calendar,Ad as CandlestickChart,Nn as Card,fd as CartesianPlot,pd as ChartBrush,si as ChartDefs,md as ChartDot,ud as ChartFrame,Jc as ChartHighlightProvider,od as ChartSkeleton,hd as ChartTooltip,qo as ChatTemplate,Ot as Checkbox_default,Io as CheckoutTemplate,qd as ChordChart,Ha as ColorPicker,Wa as ColorPickerPanel,Ta as ColorSwatch,zl as ColoredBadge,kd as ColumnChart,xn as ComposerAttachments,ls as ContainerFillChart,As as ContextMenu,al as CountBadge,Xl as DAY_MS,So as DashboardTemplate,xo as DataTable,Eo as DataTablePage,Wr as DatePicker_default,Ar as DateRangePicker,qr as DateTimePicker_default,Qn as DescriptionList,ka as DisplayChips,Wn as Divider,$o as DonutChart,io as Drawer,Ds as DropdownMenu,Ko as EmailTemplate,Fl as EmptyState,yc as EmptyValue,ec as ErrorBoundary,Jo as ErrorPage,_a as FOCAL_DEFAULT,Ua as FOCAL_NUDGE_COARSE,qa as FOCAL_NUDGE_STEP,hn as FilePicker_default,Kt as FormErrorSummary,It as FormField,To as FormLayoutPage,Id as FunnelChart,$l as GROUP_COLORS,Ml as GROUP_COLORS_SOLID,Yo as GalleryTemplate,In as Grid,Sd as HeatmapChart,bs as HelpCenter,Ka as HexInput,Dd as HistogramChart,bt as INPUT_BASE,ft as INPUT_SIZES,mt as IconButton_default,Js as IconRail,Qs as IconRailButton,en as ImageFocusPoint,En as Inline,ya as InputNumber_default,vt as Input_default,so as Kanban,qt as Label,xc as LanguagePanel,bc as LanguageSelect,Co as LineChart,dn as LinkPicker,yo as ListFooter,vo as ListLoadError,Ys as ListRow,ea as MAX_FRACTION_DIGITS,ci as MOTION,gs as Markdown,nr as MediaUploadField,hr as MediaUploadGrid,ld as Meter,ql as MetricBar,Xi as MilestoneTimeline,St as NativeSelect,na as NumericKeypad,Zi as POST_PRODUCTION_STATUSES,El as PageHeader,co as Pagination,mn as PaperclipGlyph,An as Paragraph,Od as PieChart,Ma as Popover,cr as PortalBrandingProvider,as as ProductionTimeline,zd as RADAR_SERIES_CAP,Ed as RadarChart,Bd as RadialBarChart,Wt as RadioGroup,Bt as Radio_default,Cd as RangeChart,ad as RankedBars,$d as SCATTER_SERIES_CAP,kc as SERIES_SLOT_COUNT,$c as SERIES_VARS,Hn as SPACING_ROLES,Kn as SPACING_SCALE,Ji as STAGES,Mc as STATUS_VARS,_d as SankeyChart,Md as ScatterChart,rn as SearchableSelect,da as Segmented,Ft as Select_default,tl as SettingRow,ys as SidebarActionButton,ws as SidebarGroupLabel,$s as SidebarNavGroup,ks as SidebarNavItem,Yn as Skeleton,Na as Slider,Qr as Snippet,Vs as SortableList,wo as Sparkline,Fn as Stack,kn as StatCard,sd as StatTile,il as Statistic,jl as StatusBadge,Al as StatusBadgeProvider,Nl as Stepper,Hd as SunburstChart,pa as Switch_default,vl as Tabs,yn as TagInput,Ln as Text,un as TextLinkField,wt as Textarea_default,ia as TileButton_default,vc as TimeAgo,Fr as TimePicker_default,Nd as TimeSeriesChart,Yi as TimelineTrack,Pn as Title,Ms as TopNav,Is as Tree,_s as TreeEmptySlot,Rs as TreeGroup,Ws as TreeGroupLabel,Hs as TreeRow,qs as TreeSeam,Rd as TreemapChart,Ld as WaterfallChart,Fc as angleScale,ta as appendKey,hc as applyCorners,mc as applyIconSet,pc as applyThemePrefs,Vc as arcPath,qc as areaBetween,_c as areaFrom,td as autoHighlightIndex,ra as backspace,Ac as bandScale,Oc as binValues,Vl as budgetState,Kc as bumpPath,Qi as calcOverall,es as calcReportOverall,Ea as colorFill,Oa as colorSwatchClasses,Yr as copyToClipboard,Hc as curvePath,ni as dashFor,ai as fillFor,Ql as fillId,Nt as firstEnabledIndex,Jl as fmtSliderDate,Za as focalFromRect,Ga as formatFocal,gr as fromKey,ei as glowId,ri as groundId,Cl as groupColors,Aa as hexToHsv,ed as highlightOpacity,Sa as hsvToHex,yt as inputClasses,nn as isSafeLinkHref,Tl as isSeverityTone,qn as isSpacingStep,_t as labelClasses,Sc as ladderScale,fc as languageSelectWidth,kt as lastEnabledIndex,Bc as linearPath,Pc as linearScale,zc as logScale,ti as maskId,Mt as matchTypeahead,Vt as mediaFileName,Rc as monotonePath,$t as nextEnabledIndex,jc as niceMax,Xa as nudgeFocal,Ya as parseFocal,La as parseHexColor,Uc as polygonPoints,Ec as radiusScale,uc as resolveCorners,ir as resolvePortalBrandAsset,Dc as resolveSeriesColor,sc as resolveTheme,Ur as selectionAt,Lc as seriesColor,Bl as severityOf,Wc as splinePath,Xc as squarify,di as stagger,Ic as stepPath,fl as tabButtonId,bl as tabPanelId,Zl as toDayMs,$r as toISODate,pr as toKey,to as useAppUpdate,Nc as useClickOutside,Ss as useContextMenu,wc as useDebouncedValue,Qc as useHighlight,rd as usePlotWidth,dr as usePortalBranding,ts as useProductionTimeline,Sl as useStatusLabel,gc as useTheme};
|