efficient-shell 4.175.0 → 4.177.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -1
- package/dist/{Browser-PZIVSYLM.js → Browser-MFFTBGEB.js} +14 -14
- package/dist/{Calculator-6BJVESFN.js → Calculator-AGQQYMMZ.js} +18 -18
- package/dist/{CurrencyConverter-4RZZ5STO.js → CurrencyConverter-KZPE7ZCC.js} +4 -4
- package/dist/{Documents-ERSFDOCV.js → Documents-ZD227WZC.js} +11 -11
- package/dist/{Files-3J2DW6ET.js → Files-BLGT4RLF.js} +27 -27
- package/dist/{Notepad-MVMFJE2F.js → Notepad-LUK2IFHD.js} +9 -9
- package/dist/{PomodoroTimer-D6VQJICB.js → PomodoroTimer-LHPV6QXG.js} +25 -25
- package/dist/{Preview-VIHMVC7B.js → Preview-5CALO6PW.js} +12 -12
- package/dist/{Sidebar-2BZJ2MEI.js → Sidebar-4GIZSTD5.js} +25 -25
- package/dist/{Spreadsheet-KTB6JLBV.js → Spreadsheet-F3VBCPHF.js} +14 -14
- package/dist/{Stock-KRPM6NSB.js → Stock-XSDFN7U2.js} +1 -1
- package/dist/{Weather-HRH4JHTF.js → Weather-7YDUDMCO.js} +11 -11
- package/dist/{WorldClock-OUSV52XM.js → WorldClock-Q2JHBKLS.js} +4 -4
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-VRLHUZSC.js → chunk-4PCIZFDR.js} +1 -1
- package/dist/chunk-7H6Q5TNN.js +27 -0
- package/dist/{chunk-PGVUO7GB.js → chunk-AA4TMQOS.js} +3 -3
- package/dist/{chunk-TMQEH7WA.js → chunk-AI6HQ55O.js} +1 -1
- package/dist/{chunk-6BZCJQCT.js → chunk-AZO5NPB4.js} +125 -125
- package/dist/chunk-MFXG5BWL.js +1 -0
- package/dist/{chunk-D3UQLWIZ.js → chunk-N6BJG6AL.js} +8 -8
- package/dist/{chunk-EXXHI5DO.js → chunk-OGXU7QFW.js} +2 -2
- package/dist/{chunk-JOOXVX4A.js → chunk-PE6MTNFO.js} +1 -1
- package/dist/{chunk-KG4NRNFS.js → chunk-Q7UGGJ5X.js} +1 -1
- package/dist/{chunk-GCO3A63X.js → chunk-TZ2BPFCT.js} +52 -52
- package/dist/i18n/index.d.ts +78 -0
- package/dist/i18n/index.js +2 -0
- package/dist/{index-DIaav9a1.d.ts → index-BS_HzJCc.d.ts} +27 -927
- package/dist/index.d.ts +3 -2
- package/dist/index.js +89 -89
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/strings-C3kt6WTH.d.ts +924 -0
- package/dist/ui/index.d.ts +2 -1
- package/dist/ui/index.js +1 -1
- package/package.json +16 -1
- package/dist/chunk-7LAPNAKS.js +0 -1
- package/dist/chunk-FEK5ELXS.js +0 -27
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-LCTSBQBJ.js";import{BrandMark as t}from"./chunk-
|
|
2
|
-
/* @__PURE__ */De("input",{ref:o,"aria-invalid":e||void 0,readOnly:l,className:
|
|
3
|
-
return De("textarea",{ref:s,"aria-invalid":e||void 0,rows:a,onInput:c,readOnly:i,className:
|
|
1
|
+
import{Breadcrumbs as e}from"./chunk-LCTSBQBJ.js";import{BrandMark as t}from"./chunk-7H6Q5TNN.js";import{SidebarLayout as r}from"./chunk-PE6MTNFO.js";import{useShellLanguage as n}from"./chunk-KDHXRJIX.js";import{toast_default as a}from"./chunk-L3U2R7DH.js";import{useIsMobile as l,useShortcutLabel as i,useShellPrefs as o}from"./chunk-YJRC6IKD.js";import{isAriaDisabled as s,swallowPress as c,describedByWith as d,iconButtonClasses as u,OffWithReason as h,useDropdownPosition as m,MENU_MAX_HEIGHT as p,Button_default as g,Tooltip as f,popupBounds as b,VIEWPORT_MARGIN as x,placeMenu as y,followAnchor as v,buttonClasses as w,POPUP_MAX_WIDTH as k,placeAtPoint as N}from"./chunk-OGXU7QFW.js";import{useTabLayer as M,focusableIn as $,useFocusTrap as C,useScrollLock as L,stopAfter as D}from"./chunk-XJYXKO7K.js";import{PopupMenu as j,MenuSemanticsContext as A,leavesContextMenuAlone as P,PopupMenuDivider as S,PopupMenuLabel as z,itemLook as F,MenuCheckMark as B}from"./chunk-AA4TMQOS.js";import{useDismissPopupsOnOpen as E}from"./chunk-AFYQTVZO.js";import{glassStyle as T}from"./chunk-HZZNJHRH.js";import{registerModalEscapeInterceptor as I,onOverlayOpen as O,Z_LAYERS as R}from"./chunk-X4FJ54PP.js";import{useBrowserLayoutEffect as W,useBrowserValue as H,useHydrated as K,useBrowserValueOnce as _,useBrowserState as q}from"./chunk-D65T4H6J.js";import{useFileIntake as U,humanSize as V,FileIntakeAlert as Y}from"./chunk-REXHKIIJ.js";import{useShellLocale as Z,useShellStrings as G,DEFAULT_SHELL_STRINGS as X,currentShellStrings as J,formatPlain as Q,formatFixed as ee,formatPercent as te,splitAround as re}from"./chunk-3YTHR7IC.js";import{calendarNames as ne,firstDayOfWeek as ae,formatDate as le,EMPTY_VALUE as ie,toInstant as oe,timeAgo as se,formatDateTime as ce}from"./chunk-W32SKK3D.js";import{setIconSet as de,Icon as ue}from"./chunk-YKZHOXI4.js";import{forwardRef as he,useId as me,useCallback as pe,useState as ge,useRef as fe,useMemo as be,useEffect as xe,createContext as ye,Children as ve,isValidElement as we,cloneElement as ke,useContext as Ne,Fragment as Me,Component as $e,useSyncExternalStore as Ce,useLayoutEffect as Le}from"react";import{jsx as De,jsxs as je,Fragment as Ae}from"react/jsx-runtime";import{createPortal as Pe}from"react-dom";var Se=he(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",pressed:l,disabledReason:i,disabled:o,onClick:m,"aria-disabled":p,"aria-describedby":g,...f},b){const x=me(),y=(Boolean(o)||s(p))&&null!=i&&""!==i,v=y||s(p),w=/* @__PURE__ */De("button",{ref:b,type:n,className:u({variant:t,size:r,pressed:l??(!0===f["aria-pressed"]||"true"===f["aria-pressed"]),className:a}),...f,disabled:y?void 0:o,"aria-disabled":!!v||p,"aria-describedby":d(g,y?x:void 0),onClick:v?c:m,children:e});return y?/* @__PURE__ */De(h,{reason:i,id:x,children:w}):w}),ze="block w-full rounded-(--radius-control) border border-gray-300 bg-white",Fe="text-gray-800 placeholder:text-gray-400 shadow-sm focus:border-blue-400 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]",Be={sm:"px-2.5 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-3.5 py-2 text-base",touch:"h-14 px-4 text-base"},Ee=`${ze} ${Be.md} ${Fe}`,Te="disabled:cursor-not-allowed disabled:opacity-60";function Ie(e){return[e?.readOnly?`block w-full rounded-(--radius-control) border border-gray-300 bg-gray-50 ${Be[e.size??"md"]} ${Fe}`:e?.size&&"md"!==e.size?`${ze} ${Be[e.size]} ${Fe}`:Ee,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",Te,e?.className??""].filter(Boolean).join(" ")}var Oe=he(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",readOnly:l,...i},o){const s=`${t?"pl-9":""} ${r?"pr-9":""}`.trim(),c=
|
|
2
|
+
/* @__PURE__ */De("input",{ref:o,"aria-invalid":e||void 0,readOnly:l,className:Ie({invalid:e,size:n,readOnly:l,className:[s,a].filter(Boolean).join(" ")}),...i});return t||r?/* @__PURE__ */je("div",{className:"relative",children:[t&&/* @__PURE__ */De("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:t}),c,r&&/* @__PURE__ */De("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):c}),Re=he(function({invalid:e,autoGrow:t,className:r="",onInput:n,rows:a=3,size:l,readOnly:i,...o},s){const c=pe(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}n?.(e)},[t,n]);/* @__PURE__ */
|
|
3
|
+
return De("textarea",{ref:s,"aria-invalid":e||void 0,rows:a,onInput:c,readOnly:i,className:Ie({invalid:e,size:l,readOnly:i,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...o})});function We(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function He(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Ke(e,t,r){let n=t+r;for(;n>=0&&n<e.length;){if(!e[n].disabled)return n;n+=r}return t>=0&&t<e.length&&!e[t].disabled?t:r>0?We(e):He(e)}function _e(e,t,r){const n=t.toLowerCase(),a=e.length;if(!n||0===a)return-1;for(let t=1;t<=a;t++){const l=((r+t)%a+a)%a,i=e[l];if(!i.disabled&&i.label.toLowerCase().startsWith(n))return l}return-1}var qe=e=>Array.isArray(e.options);function Ue(e){const t=[];for(const r of e)qe(r)?t.push(...r.options):t.push(r);return t}function Ve(e,t){const r=[];for(const n of e){if(!qe(n)){t(n)&&r.push(n);continue}const e=n.options.filter(t);e.length&&r.push({...n,options:e})}return r}function Ye(e,t,r,n=""){const a=[];let l=0;return e.forEach((e,i)=>{if(!qe(e))return a.push(t(e,l)),void(l+=1);const o=`${r}-group-${i}`,s=l;l+=e.options.length,a.push(
|
|
4
4
|
/* @__PURE__ */je("div",{role:"group","aria-labelledby":o,children:[
|
|
5
5
|
/* @__PURE__ */De("div",{id:o,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${n}`.trim(),children:e.label}),e.options.map((e,r)=>t(e,s+r))]},o))}),a}function Ze({selected:e}){/* @__PURE__ */
|
|
6
6
|
return De("svg",{"aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(e?"":"invisible"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})}var Ge=he(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:i,touchSize:o,renderOption:s,renderValue:c,readOnly:d,multiple:u,...h},m){const p=t;/* @__PURE__ */
|
|
7
|
-
return je("select",{ref:m,value:e,multiple:u||void 0,onChange:e=>p(u?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":a||void 0,className:
|
|
7
|
+
return je("select",{ref:m,value:e,multiple:u||void 0,onChange:e=>p(u?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":a||void 0,className:Ie({invalid:a,size:i,className:`pr-8 ${l}`.trim()}),...h,children:[void 0!==n&&!u&&/* @__PURE__ */De("option",{value:"",disabled:!0,children:n}),
|
|
8
8
|
/* @__PURE__ */De(Xe,{items:r})]})});function Xe({items:e}){const t=e=>/* @__PURE__ */De("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
9
|
-
return De(Ae,{children:e.map((e,r)=>(e=>qe(e))(e)?/* @__PURE__ */De("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var Je=he(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:i,disabled:o,size:s,touchSize:c,title:d,multiple:u,renderOption:h,renderValue:g,readOnly:f=!1,"aria-describedby":b,"aria-label":x,"aria-labelledby":y,...v},w){const[k,N]=ge(!1),[M,$]=ge(-1),C=fe(null),L=fe(null),D=fe(null),j=fe(k);j.current=k;const A=fe({buffer:"",timer:null}),
|
|
10
|
-
return je("div",{id:
|
|
9
|
+
return De(Ae,{children:e.map((e,r)=>(e=>qe(e))(e)?/* @__PURE__ */De("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var Je=he(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:i,disabled:o,size:s,touchSize:c,title:d,multiple:u,renderOption:h,renderValue:g,readOnly:f=!1,"aria-describedby":b,"aria-label":x,"aria-labelledby":y,...v},w){const[k,N]=ge(!1),[M,$]=ge(-1),C=fe(null),L=fe(null),D=fe(null),j=fe(k);j.current=k;const A=fe({buffer:"",timer:null}),P=me(),S=`${P}-listbox`,z=i??`${P}-trigger`,F=e=>`${P}-opt-${e}`,B=be(()=>Ue(r),[r]),E=u?e:[],W=t,H=m(L,k,{matchTriggerWidth:!0}),K=u?B.findIndex(e=>E.includes(e.value)):B.findIndex(t=>t.value===e),_=u?B.filter(e=>E.includes(e.value)).map(e=>e.label).join(", ")||void 0:K>=0?B[K].label:void 0,q=!u&&K>=0?B[K].lang:void 0,U=u?B.filter(e=>E.includes(e.value)):K>=0?[B[K]]:[],V=g&&U.length?g(U):void 0,Y=pe((e=!0)=>{N(!1),$(-1),e&&L.current?.focus()},[]),Z=pe(()=>{o||f||($(K>=0?K:We(B)),N(!0))},[o,f,B,K]),G=pe(t=>{const r=B[t];if(r&&!r.disabled){if(u){const n=e;return W(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void $(t)}W(r.value),Y()}},[B,u,e,W,Y]);xe(()=>{if(!k)return;return I(e=>!("Escape"!==e.key||!j.current)&&(Y(),!0),()=>D.current)},[k,Y]),xe(()=>{if(!k)return;const e=e=>{const t=e.target;C.current?.contains(t)||D.current?.contains(t)||Y(!1)};document.addEventListener("pointerdown",e);const t=O(()=>Y(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[k,Y]),xe(()=>{!k||M<0||D.current?.querySelector(`#${CSS.escape(F(M))}`)?.scrollIntoView({block:"nearest"})});const X=pe(e=>{const t=A.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=k?M:K,n=_e(B,t.buffer,r);n<0||(k?$(n):u?($(n),N(!0)):G(n))},[k,M,K,B,G,u]),J=k?Ye(r,(t,r)=>{const n=(a=t.value,u?E.includes(a):e===a);var a;const l=r===M;/* @__PURE__ */
|
|
10
|
+
return je("div",{id:F(r),role:"option",lang:t.description||h?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||$(r)},onClick:()=>G(r),className:`mx-1 cursor-pointer truncate rounded-lg px-3 py-1.5 text-sm${u?" flex items-center gap-2":""}\n ${t.disabled?"cursor-not-allowed text-gray-400":l?"bg-blue-50 text-blue-700":n?"font-medium text-blue-600":"text-gray-700"}`,children:[u&&/* @__PURE__ */De(Ze,{selected:n}),h?/* @__PURE__ */De("span",{className:"block min-w-0 flex-1 truncate",children:h(t,{selected:n,active:l})}):u?/* @__PURE__ */je("span",{className:"block min-w-0 flex-1",children:[
|
|
11
11
|
/* @__PURE__ */De("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */De("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.description?
|
|
12
12
|
/* @__PURE__ */je(Ae,{children:[
|
|
13
13
|
/* @__PURE__ */De("span",{lang:t.lang,className:"block truncate",children:t.label}),
|
|
14
|
-
/* @__PURE__ */De("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},
|
|
14
|
+
/* @__PURE__ */De("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},P,"mx-1"):null;/* @__PURE__ */
|
|
15
15
|
return je("div",{ref:C,className:"relative",children:[
|
|
16
|
-
/* @__PURE__ */De("button",{ref:L,id:
|
|
16
|
+
/* @__PURE__ */De("button",{ref:L,id:z,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":k?S:void 0,"aria-activedescendant":k&&M>=0?F(M):void 0,"aria-invalid":a||void 0,"aria-describedby":b,"aria-label":x,"aria-labelledby":y,title:d,disabled:o,"aria-readonly":f||void 0,onClick:()=>k?Y():Z(),onKeyDown:e=>{if(!o&&!f)switch(e.key){case"ArrowDown":return e.preventDefault(),void(k?$(e=>Ke(B,e,1)):Z());case"ArrowUp":return e.preventDefault(),void(k?$(e=>Ke(B,e,-1)):Z());case"Home":return void(k&&(e.preventDefault(),$(We(B))));case"End":return void(k&&(e.preventDefault(),$(He(B))));case"Enter":return void(k&&(e.preventDefault(),G(M)));case" ":return e.preventDefault(),void(k?G(M):Z());case"Escape":return void(k&&(e.preventDefault(),e.stopPropagation(),Y()));case"Tab":return void(k&&Y(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),X(e.key))}},className:Ie({invalid:a,size:s,readOnly:f,className:`${f?"":"pr-8 "}text-left ${l}`.trim()}),children:void 0!==V?
|
|
17
17
|
/* @__PURE__ */je("span",{className:"relative block min-w-0 truncate",children:[
|
|
18
18
|
/* @__PURE__ */De("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-1.5 truncate",children:V}),
|
|
19
|
-
/* @__PURE__ */De("span",{lang:
|
|
20
|
-
/* @__PURE__ */je("select",{ref:w,value:e,multiple:u||void 0,onChange:e=>
|
|
19
|
+
/* @__PURE__ */De("span",{lang:q,className:"sr-only",children:_})]}):/* @__PURE__ */De("span",{lang:q,className:"block truncate "+(void 0===_?"text-gray-400":""),children:_??n??" "})}),!f&&/* @__PURE__ */De("svg",{"aria-hidden":"true",className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9l3.75-3.75L15.75 9M8.25 15l3.75 3.75L15.75 15"})}),
|
|
20
|
+
/* @__PURE__ */je("select",{ref:w,value:e,multiple:u||void 0,onChange:e=>W(u?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:o,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...v,children:[void 0!==n&&!u&&/* @__PURE__ */De("option",{value:"",disabled:!0,children:n}),
|
|
21
21
|
/* @__PURE__ */De(Xe,{items:r})]}),k&&Pe(
|
|
22
|
-
/* @__PURE__ */De("div",{ref:D,id:
|
|
22
|
+
/* @__PURE__ */De("div",{ref:D,id:S,role:"listbox","aria-labelledby":y??(x?void 0:z),"aria-label":y?void 0:x,"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:J}),document.body)]})}),Qe=he(function({touchSize:e="touch",...t},r){return l()&&!t.readOnly?/* @__PURE__ */De(Ge,{ref:r,...t,size:e}):/* @__PURE__ */De(Je,{ref:r,...t})});function et(e,t,r,n){const a=me(),l=!!e&&!!t,i=l?`${a}-label`:void 0,o=l?`${a}-description`:void 0;return{labelId:i,descriptionId:o,labelledBy:r??i,describedBy:[n,o].filter(Boolean).join(" ")||void 0}}var tt=he(function({checked:e,onChange:t,indeterminate:r=!1,label:n,description:a,disabled:l,className:i="","aria-labelledby":o,"aria-describedby":s,...c},d){const u=fe(null),h=et(n,a,o,s);xe(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=pe(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */De("input",{ref:m,type:"checkbox",checked:e,disabled:l,onChange:e=>t(e.target.checked),className:`h-4 w-4 shrink-0 rounded border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 ${r}`.trim(),"aria-labelledby":h.labelledBy,"aria-describedby":h.describedBy,...c});return n||a?/* @__PURE__ */je("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
|
|
23
23
|
/* @__PURE__ */je("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */De("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */De("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),rt="h-4 w-4 shrink-0 border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60",nt=he(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":o,...s},c){const d=et(r,n,i,o);return r||n?/* @__PURE__ */je("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
|
|
24
24
|
/* @__PURE__ */De("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${rt} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s}),
|
|
25
25
|
/* @__PURE__ */je("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */De("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */De("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */De("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${rt} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s})});function at({label:e,htmlFor:t,labelId:r,hint:n,error:a,required:l,className:i="",children:o}){const s=t?a?`${t}-error`:n?`${t}-hint`:void 0:void 0,c=1===ve.count(o)?ve.only(o):null,d=we(c)?c:null,u={};d&&(s&&(u["aria-describedby"]=[d.props["aria-describedby"],s].filter(Boolean).join(" ")),a&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0));const h=d&&Object.keys(u).length>0?ke(d,u):o;/* @__PURE__ */
|
|
@@ -41,15 +41,15 @@ return De("svg",{className:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColo
|
|
|
41
41
|
return je("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
|
|
42
42
|
/* @__PURE__ */De("path",{d:"M12 15V4"}),
|
|
43
43
|
/* @__PURE__ */De("path",{d:"M8 8l4-4 4 4"}),
|
|
44
|
-
/* @__PURE__ */De("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function Nt({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:s,accept:c="image/*",maxSizeBytes:d,fit:u="cover",height:h=112,placeholder:m,cta:p,acceptHint:f,showFilename:b=!0,allowReplace:x=!0,allowRemove:y=!0,replaceLabel:v,removeLabel:w,busy:k=!1,busyLabel:N,disabled:M=!1}){const $=G().media,C=p??$.cta,L=v??$.replace,D=w??$.remove,j=N??$.uploading,A=me(),P=fe(null),[S,z]=ge(null);xe(()=>()=>{P.current&&URL.revokeObjectURL(P.current)},[]);const F=M||k,B=!!e&&(yt(e,c)||e===S),E=m??pt(c,$),
|
|
45
|
-
/* @__PURE__ */je("div",{...
|
|
44
|
+
/* @__PURE__ */De("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function Nt({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:s,accept:c="image/*",maxSizeBytes:d,fit:u="cover",height:h=112,placeholder:m,cta:p,acceptHint:f,showFilename:b=!0,allowReplace:x=!0,allowRemove:y=!0,replaceLabel:v,removeLabel:w,busy:k=!1,busyLabel:N,disabled:M=!1}){const $=G().media,C=p??$.cta,L=v??$.replace,D=w??$.remove,j=N??$.uploading,A=me(),P=fe(null),[S,z]=ge(null);xe(()=>()=>{P.current&&URL.revokeObjectURL(P.current)},[]);const F=M||k,B=!!e&&(yt(e,c)||e===S),E=m??pt(c,$),T=e=>{r?r(e):n?n(e):(e=>{P.current&&URL.revokeObjectURL(P.current);const r=URL.createObjectURL(e);P.current=r,z(e.type.startsWith("video/")?r:null),t(r)})(e)},I=U({accept:c,maxSizeBytes:d,acceptHint:f,multiple:!1,disabled:F,onAccept:([e])=>T(e)}),{dragOver:O}=I,R=()=>{F||(r?r():I.open())},W=e?ht(e):"",H=/* @__PURE__ */je("div",{children:[
|
|
45
|
+
/* @__PURE__ */je("div",{...I.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",O?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[B?/* @__PURE__ */De("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":W||void 0,className:"h-full w-full",style:{objectFit:u}}):/* @__PURE__ */De("img",{src:e??void 0,alt:W,className:"h-full w-full",style:{objectFit:u}}),b&&e&&/* @__PURE__ */De(xt,{children:W}),k&&/* @__PURE__ */De(bt,{label:j,rounded:"rounded-md"})]}),!M&&(x||y)&&/* @__PURE__ */je("div",{className:"mt-2 flex gap-2",children:[x&&/* @__PURE__ */De(g,{id:A,variant:"secondary",size:"sm",onClick:()=>R(),disabled:k,children:L}),y&&/* @__PURE__ */De(g,{variant:"ghost",size:"sm",onClick:()=>{P.current&&(URL.revokeObjectURL(P.current),P.current=null),z(null),t("")},disabled:k,children:D})]})]}),K=/* @__PURE__ */De("button",{type:"button",id:A,onClick:()=>R(),disabled:F,"aria-label":"string"==typeof E?E:$.upload,"aria-busy":k||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${A}-error`:l?`${A}-hint`:void 0,...I.zoneProps,className:gt(O,F,ft(F)),style:{minHeight:h},children:k?/* @__PURE__ */je("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
|
|
46
46
|
/* @__PURE__ */De(vt,{}),
|
|
47
47
|
/* @__PURE__ */De("span",{className:"text-xs font-medium text-gray-500",children:j})]}):/* @__PURE__ */je(Ae,{children:[
|
|
48
48
|
/* @__PURE__ */De("span",{className:"text-gray-400",children:/* @__PURE__ */De(kt,{})}),
|
|
49
49
|
/* @__PURE__ */De("span",{className:"px-3 text-xs text-gray-500",children:E}),
|
|
50
50
|
/* @__PURE__ */De("span",{className:"text-sm font-medium text-blue-600",children:C}),f&&/* @__PURE__ */De("span",{className:"text-xs text-gray-400",children:f})]})});/* @__PURE__ */
|
|
51
|
-
return je(at,{label:a,htmlFor:A,hint:l,error:i,required:o,className:s,children:[e?H:K,!r&&/* @__PURE__ */De("input",{...
|
|
52
|
-
/* @__PURE__ */De(Y,{rejections:
|
|
51
|
+
return je(at,{label:a,htmlFor:A,hint:l,error:i,required:o,className:s,children:[e?H:K,!r&&/* @__PURE__ */De("input",{...I.inputProps}),
|
|
52
|
+
/* @__PURE__ */De(Y,{rejections:I.rejections})]})}function Mt({committedUrl:e,committedHasAlpha:r=null,committedIsLight:n=null,fallbackUrl:a,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:o,assetName:s,onSave:c,onRemove:d,accept:u="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:h="PNG · ICO · SVG · JPG · WEBP",maxBytes:m=5242880,previews:p=[],disabled:f=!1}){const b=fe(null),[x,y]=ge(null),[v,w]=ge(""),[k,N]=ge(""),[M,$]=ge(!1),[C,L]=ge(!1),D=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(s),j=G().brandAsset,A=v||e||a||"",P=x?null:e?r:l,S=x?null:e?n:i;xe(()=>()=>{b.current&&URL.revokeObjectURL(b.current)},[]);const z=()=>{b.current&&(URL.revokeObjectURL(b.current),b.current=null)};/* @__PURE__ */
|
|
53
53
|
return je("section",{"aria-label":j.region(s,o),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
54
54
|
/* @__PURE__ */je("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
55
55
|
/* @__PURE__ */De(Nt,{value:A,onChange:()=>{},onFile:e=>{if(f)return;z();const t=URL.createObjectURL(e);b.current=t,y(e),w(t),N("")},label:s,hint:k||j.usedFor(o),error:k||void 0,accept:u,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:M||C,disabled:f}),
|
|
@@ -69,61 +69,61 @@ return je("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-whit
|
|
|
69
69
|
/* @__PURE__ */De("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??o}),e.url&&/* @__PURE__ */De("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
|
|
70
70
|
/* @__PURE__ */De("div",{className:"mt-1.5 text-sm font-medium text-blue-700",children:e.title??o}),e.description&&/* @__PURE__ */De("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */je("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:[r,
|
|
71
71
|
/* @__PURE__ */De("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function $t(e,t={}){return t.preferSquare&&e.logo_square_url?{src:e.logo_square_url,hasAlpha:e.logo_square_has_alpha,isLight:e.logo_square_is_light,adaptive:!0}:"dark"===t.surface&&e.logo_on_dark_url?{src:e.logo_on_dark_url,hasAlpha:null,isLight:null,adaptive:!1}:{src:e.logo_url,hasAlpha:e.logo_has_alpha,isLight:e.logo_is_light,adaptive:!0}}var Ct=ye(null);function Lt(e){const t=document.head.querySelector('link[data-portal-branding="favicon"]');if(!e)return void t?.remove();const r=t??document.createElement("link");r.rel="icon",r.href=e,r.dataset.portalBranding="favicon",t||document.head.appendChild(r)}function Dt({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=ge(t),[i,o]=ge(!0),[s,c]=ge(null),d=fe(e),u=fe(t);d.current=e,u.current=t,xe(()=>{const e=new AbortController;let t=!0;return l(u.current),o(!0),c(null),d.current(e.signal).then(e=>{t&&(l(e),o(!1))},e=>{t&&(c(e instanceof Error?e:new Error("Could not load portal branding.")),o(!1))}),()=>{t=!1,e.abort()}},[]),xe(()=>(Lt(a.favicon_url),()=>Lt(null)),[a.favicon_url]),xe(()=>{r&&(document.title=r(a))},[a,r]);const h=be(()=>({branding:a,loading:i,error:s}),[a,i,s]);/* @__PURE__ */
|
|
72
|
-
return De(Ct.Provider,{value:h,children:n})}function jt(){const e=Ne(Ct);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var At=/* @__PURE__ */De("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */De("path",{d:"M6 6l12 12M18 6L6 18"})});function Pt({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,label:l,hint:i,error:o,required:s,className:c,accept:d="image/*",maxSizeBytes:u,maxFiles:h,fit:m="cover",thumbSize:p=96,placeholder:g,cta:f,acceptHint:b,showCover:x=!1,coverLabel:y,busy:v=!1,busyLabel:w,disabled:k=!1,readOnly:N=!1}){const M=G().media,$=f??M.cta,C=y??M.cover,L=w??M.uploading,D=me(),[j,A]=ge(null),P=k||v,S=!(!t&&!r||P||N),z=!!n&&!P&&!N,F=!!a&&!P&&!N,B=ft(P),E=g??pt(d,M),
|
|
72
|
+
return De(Ct.Provider,{value:h,children:n})}function jt(){const e=Ne(Ct);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var At=/* @__PURE__ */De("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */De("path",{d:"M6 6l12 12M18 6L6 18"})});function Pt({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,label:l,hint:i,error:o,required:s,className:c,accept:d="image/*",maxSizeBytes:u,maxFiles:h,fit:m="cover",thumbSize:p=96,placeholder:g,cta:f,acceptHint:b,showCover:x=!1,coverLabel:y,busy:v=!1,busyLabel:w,disabled:k=!1,readOnly:N=!1}){const M=G().media,$=f??M.cta,C=y??M.cover,L=w??M.uploading,D=me(),[j,A]=ge(null),P=k||v,S=!(!t&&!r||P||N),z=!!n&&!P&&!N,F=!!a&&!P&&!N,B=ft(P),E=g??pt(d,M),T=U({accept:d,maxSizeBytes:u,maxFiles:h,acceptHint:b,multiple:!0,disabled:!S,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),I=T.dragOver,O=()=>{S&&(t?t():T.open())},R={width:p,height:p},W=S&&/* @__PURE__ */je("button",{type:"button",onClick:()=>O(),"aria-label":M.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${B}`,style:R,children:[
|
|
73
73
|
/* @__PURE__ */De(kt,{className:"h-5 w-5"}),
|
|
74
|
-
/* @__PURE__ */De("span",{className:"text-xs font-medium text-gray-500",children:M.add})]}),H=S?/* @__PURE__ */je("button",{type:"button",onClick:()=>O(),"aria-label":"string"==typeof E?E:M.upload,className:gt(
|
|
74
|
+
/* @__PURE__ */De("span",{className:"text-xs font-medium text-gray-500",children:M.add})]}),H=S?/* @__PURE__ */je("button",{type:"button",onClick:()=>O(),"aria-label":"string"==typeof E?E:M.upload,className:gt(I,!1,B),style:{minHeight:p+32},children:[
|
|
75
75
|
/* @__PURE__ */De("span",{className:"text-gray-400",children:/* @__PURE__ */De(kt,{})}),
|
|
76
76
|
/* @__PURE__ */De("span",{className:"px-3 text-xs text-gray-500",children:E}),
|
|
77
77
|
/* @__PURE__ */De("span",{className:"text-sm font-medium text-blue-600",children:$}),b&&/* @__PURE__ */De("span",{className:"text-xs text-gray-400",children:b})]}):/* @__PURE__ */De("div",{className:"flex w-full items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-3 text-xs text-gray-400",style:{minHeight:p+32},children:M.empty});/* @__PURE__ */
|
|
78
78
|
return je(at,{label:l,labelId:l?`${D}-label`:void 0,htmlFor:D,hint:i,error:o,required:s,className:c,children:[
|
|
79
|
-
/* @__PURE__ */je("div",{id:D,role:"group","aria-labelledby":l?`${D}-label`:void 0,"aria-describedby":o?`${D}-error`:i?`${D}-hint`:void 0,"aria-busy":v||void 0,...
|
|
80
|
-
return je("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!=j&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:F?e=>{null!=j&&(e.preventDefault(),e.stopPropagation(),j!==r&&a(j,r),A(null))}:void 0,tabIndex:F?0:void 0,"aria-label":F?M.reorder(i,r+1,e.length):void 0,onKeyDown:F?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",B,j===r?"opacity-50":""].join(" "),style:{...R,cursor:F?"move":void 0},children:[l?/* @__PURE__ */De("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */De("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),o&&/* @__PURE__ */De("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-1.5 py-0.5 text-xs font-medium text-white",children:C}),null!=t.caption&&/* @__PURE__ */De(xt,{children:t.caption}),z&&/* @__PURE__ */De("button",{type:"button",onClick:()=>n(t.id),"aria-label":M.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${B}`,style:{background:"var(--rosh-media-scrim-button)"},children:At})]},t.id)}),W]}),v&&/* @__PURE__ */De(bt,{label:L})]}),!t&&r&&/* @__PURE__ */De("input",{...
|
|
81
|
-
/* @__PURE__ */De(Y,{rejections:
|
|
79
|
+
/* @__PURE__ */je("div",{id:D,role:"group","aria-labelledby":l?`${D}-label`:void 0,"aria-describedby":o?`${D}-error`:i?`${D}-hint`:void 0,"aria-busy":v||void 0,...T.zoneProps,className:"relative rounded-lg transition-colors",style:{...P?{opacity:.6}:{},...I?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?H:/* @__PURE__ */je("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:yt(t.url,d),i=ht(t.url),o=x&&(t.cover??0===r);/* @__PURE__ */
|
|
80
|
+
return je("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!=j&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:F?e=>{null!=j&&(e.preventDefault(),e.stopPropagation(),j!==r&&a(j,r),A(null))}:void 0,tabIndex:F?0:void 0,"aria-label":F?M.reorder(i,r+1,e.length):void 0,onKeyDown:F?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",B,j===r?"opacity-50":""].join(" "),style:{...R,cursor:F?"move":void 0},children:[l?/* @__PURE__ */De("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */De("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),o&&/* @__PURE__ */De("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-1.5 py-0.5 text-xs font-medium text-white",children:C}),null!=t.caption&&/* @__PURE__ */De(xt,{children:t.caption}),z&&/* @__PURE__ */De("button",{type:"button",onClick:()=>n(t.id),"aria-label":M.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${B}`,style:{background:"var(--rosh-media-scrim-button)"},children:At})]},t.id)}),W]}),v&&/* @__PURE__ */De(bt,{label:L})]}),!t&&r&&/* @__PURE__ */De("input",{...T.inputProps}),
|
|
81
|
+
/* @__PURE__ */De(Y,{rejections:T.rejections})]})}var St=e=>String(e).padStart(2,"0");function zt(e){return`${e.getFullYear()}-${St(e.getMonth()+1)}-${St(e.getDate())}`}function Ft(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var Bt=e=>`${e.getFullYear()}-${St(e.getMonth()+1)}`;var Et=()=>zt(/* @__PURE__ */new Date);var Tt=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),It=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),n=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),n))};function Ot({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:o,onMonthChange:s,weekStartsOn:c,quickJump:d=!0,"aria-label":u,className:h=""}){const m=Ft(e),p=H(Et,null),g=Ft(p),f=G().calendar,b=Z(),x=ne(b),y=H(()=>ae(b),0),v=c??y,w=()=>{if(!g)return null;const e=Bt(g);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[k,N]=ge(()=>o||(m?Bt(m):w())),M=i??k??w(),$=null===M?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(M,g),[C,L]=ge(()=>e??p),D=fe(null),j=fe(!1),[A,P]=ge("days"),S=be(()=>$?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),n=(r.getDay()-t+7)%7,a=new Date(r.getFullYear(),r.getMonth(),1-n);return Array.from({length:42},(e,t)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+t))}($,v):[],[M,v]),z=e=>!!a&&e<a||!!l&&e>l,F=C??p,B=S.some(e=>zt(e)===F),E=$?S.find(e=>e.getMonth()===$.getMonth())??S[0]:null,T=B&&F?F:E?zt(E):"";if(xe(()=>{j.current&&(j.current=!1,D.current?.querySelector('[data-active="true"]')?.focus())},[T,M]),!$)/* @__PURE__ */
|
|
82
82
|
return je("div",{className:h,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
83
|
-
/* @__PURE__ */De("div",{className:"mb-2 h-6"}),Array.from({length:7},(e,t)=>/* @__PURE__ */De("div",{className:0===t?"py-1 text-xs":"py-1.5 min-h-11 sm:min-h-0 text-sm",children:" "},t))]});const
|
|
83
|
+
/* @__PURE__ */De("div",{className:"mb-2 h-6"}),Array.from({length:7},(e,t)=>/* @__PURE__ */De("div",{className:0===t?"py-1 text-xs":"py-1.5 min-h-11 sm:min-h-0 text-sm",children:" "},t))]});const I=e=>"years"===A?new Date($.getFullYear()+12*e,$.getMonth(),1):"months"===A?new Date($.getFullYear()+e,$.getMonth(),1):It($,e),O=e=>{const t=Bt(e);void 0===i&&N(t),s?.(t)},R=u??x.monthYear($.getFullYear(),$.getMonth());/* @__PURE__ */
|
|
84
84
|
return je("div",{className:h,children:[
|
|
85
85
|
/* @__PURE__ */je("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
86
|
-
/* @__PURE__ */De("button",{type:"button","aria-label":"years"===A?f.previousYears:"months"===A?f.previousYear:f.previousMonth,onClick:()=>
|
|
86
|
+
/* @__PURE__ */De("button",{type:"button","aria-label":"years"===A?f.previousYears:"months"===A?f.previousYear:f.previousMonth,onClick:()=>O(I(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */De("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),
|
|
87
87
|
/* @__PURE__ */De("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */je(Ae,{children:["years"!==A&&/* @__PURE__ */De("button",{type:"button","aria-label":f.chooseMonth(x.months[$.getMonth()]),onClick:()=>P(e=>"months"===e?"days":"months"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:x.months[$.getMonth()]}),
|
|
88
88
|
/* @__PURE__ */De("button",{type:"button","aria-label":f.chooseYear($.getFullYear()),onClick:()=>P(e=>"years"===e?"days":"years"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:$.getFullYear()})]}):/* @__PURE__ */De("span",{children:x.monthYear($.getFullYear(),$.getMonth())})}),
|
|
89
|
-
/* @__PURE__ */De("button",{type:"button","aria-label":"years"===A?f.nextYears:"months"===A?f.nextYear:f.nextMonth,onClick:()=>
|
|
90
|
-
/* @__PURE__ */je("div",{ref:D,role:"grid","aria-label":
|
|
89
|
+
/* @__PURE__ */De("button",{type:"button","aria-label":"years"===A?f.nextYears:"months"===A?f.nextYear:f.nextMonth,onClick:()=>O(I(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */De("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})})]}),"months"===A&&/* @__PURE__ */De("div",{role:"group","aria-label":f.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:x.monthsShort.map((e,t)=>/* @__PURE__ */De("button",{type:"button","aria-pressed":t===$.getMonth(),onClick:()=>{O(new Date($.getFullYear(),t,1)),P("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===$.getMonth()?"bg-blue-600 font-semibold text-white":g&&t===g.getMonth()&&$.getFullYear()===g.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===A&&/* @__PURE__ */De("div",{role:"group","aria-label":f.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=$.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */De("button",{type:"button","aria-pressed":e===$.getFullYear(),onClick:()=>{O(new Date(e,$.getMonth(),1)),P("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===$.getFullYear()?"bg-blue-600 font-semibold text-white":e===g?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
90
|
+
/* @__PURE__ */je("div",{ref:D,role:"grid","aria-label":R,onKeyDown:e=>{const t=Ft(T)??g??$,r={ArrowLeft:()=>Tt(t,-1),ArrowRight:()=>Tt(t,1),ArrowUp:()=>Tt(t,-7),ArrowDown:()=>Tt(t,7),Home:()=>Tt(t,-(t.getDay()-v+7)%7),End:()=>Tt(t,6-(t.getDay()-v+7)%7),PageUp:()=>It(t,e.shiftKey?-12:-1),PageDown:()=>It(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),j.current=!0,L(zt(a)),void(Bt(a)!==M&&O(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),z(T)||n(T))},hidden:"days"!==A,children:[
|
|
91
91
|
/* @__PURE__ */De("div",{role:"row",className:"grid grid-cols-7 text-center text-xs font-medium text-gray-500",children:Array.from({length:7},(e,t)=>(t+v)%7).map(e=>
|
|
92
|
-
/* @__PURE__ */De("div",{role:"columnheader","aria-label":x.weekdays[e],className:"py-1",children:/* @__PURE__ */De("abbr",{title:x.weekdays[e],className:"no-underline",children:x.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */De("div",{role:"row",className:"grid grid-cols-7 text-center text-sm",children:S.slice(7*l,7*l+7).map(a=>{const l=zt(a),i=a.getMonth()!==$.getMonth(),o=l===e||"range"===r&&l===t,s=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=
|
|
93
|
-
return De("div",{role:"gridcell","aria-selected":o,children:/* @__PURE__ */De("button",{type:"button","data-active":l===T,tabIndex:l===T?0:-1,disabled:c,"aria-label":x.longDate(a.getFullYear(),a.getMonth(),a.getDate()),"aria-current":l===p?"date":void 0,onClick:()=>{L(l),n(l)},className:["w-full rounded-md py-1.5 min-h-11 sm:min-h-0 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",c?"cursor-not-allowed text-gray-300":o?"bg-blue-600 font-semibold text-white":s?"bg-blue-100 text-blue-800":i?"text-gray-500 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100",l!==p||o?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),children:a.getDate()})},l)})},l))]})]})}var Rt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Wt=e=>`${e.getFullYear()}-${Ht(e.getMonth()+1)}`,Ht=e=>String(e).padStart(2,"0");function Kt(e){return`${e.getFullYear()}-${Ht(e.getMonth()+1)}-${Ht(e.getDate())}`}function _t(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),l=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:Kt(new Date(r,n,t.getDate()-14)),to:Kt(a)};case"lastMonth":return{from:Kt(i(1)),to:Kt(l)};case"last3Months":return{from:Kt(i(3)),to:Kt(l)};case"last6Months":return{from:Kt(i(6)),to:Kt(l)};case"last12Months":return{from:Kt(i(12)),to:Kt(l)}}}function qt(e,t,r){const n=Wt(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Ut(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function Vt(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Yt=/* @__PURE__ */new Map;function Zt({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:o,"aria-labelledby":s,"aria-label":c,weekStartsOn:d,placeholder:u,fullWidth:h=!1,min:p,max:g}){const f=G().dateRange,b=Z(),x=n??(b?function(e){let t=Yt.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Yt.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(b):Vt),y=u??f.placeholder,v=a??!l,[w,k]=ge(!1),[N,M]=ge(e),[$,C]=ge(t),[L,D]=ge(null),j=fe(null),A=fe(null),
|
|
92
|
+
/* @__PURE__ */De("div",{role:"columnheader","aria-label":x.weekdays[e],className:"py-1",children:/* @__PURE__ */De("abbr",{title:x.weekdays[e],className:"no-underline",children:x.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */De("div",{role:"row",className:"grid grid-cols-7 text-center text-sm",children:S.slice(7*l,7*l+7).map(a=>{const l=zt(a),i=a.getMonth()!==$.getMonth(),o=l===e||"range"===r&&l===t,s=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=z(l);/* @__PURE__ */
|
|
93
|
+
return De("div",{role:"gridcell","aria-selected":o,children:/* @__PURE__ */De("button",{type:"button","data-active":l===T,tabIndex:l===T?0:-1,disabled:c,"aria-label":x.longDate(a.getFullYear(),a.getMonth(),a.getDate()),"aria-current":l===p?"date":void 0,onClick:()=>{L(l),n(l)},className:["w-full rounded-md py-1.5 min-h-11 sm:min-h-0 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",c?"cursor-not-allowed text-gray-300":o?"bg-blue-600 font-semibold text-white":s?"bg-blue-100 text-blue-800":i?"text-gray-500 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100",l!==p||o?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),children:a.getDate()})},l)})},l))]})]})}var Rt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Wt=e=>`${e.getFullYear()}-${Ht(e.getMonth()+1)}`,Ht=e=>String(e).padStart(2,"0");function Kt(e){return`${e.getFullYear()}-${Ht(e.getMonth()+1)}-${Ht(e.getDate())}`}function _t(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),l=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:Kt(new Date(r,n,t.getDate()-14)),to:Kt(a)};case"lastMonth":return{from:Kt(i(1)),to:Kt(l)};case"last3Months":return{from:Kt(i(3)),to:Kt(l)};case"last6Months":return{from:Kt(i(6)),to:Kt(l)};case"last12Months":return{from:Kt(i(12)),to:Kt(l)}}}function qt(e,t,r){const n=Wt(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Ut(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function Vt(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Yt=/* @__PURE__ */new Map;function Zt({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:o,"aria-labelledby":s,"aria-label":c,weekStartsOn:d,placeholder:u,fullWidth:h=!1,min:p,max:g}){const f=G().dateRange,b=Z(),x=n??(b?function(e){let t=Yt.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Yt.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(b):Vt),y=u??f.placeholder,v=a??!l,[w,k]=ge(!1),[N,M]=ge(e),[$,C]=ge(t),[L,D]=ge(null),j=fe(null),A=fe(null),P=fe(null),S=me(),z=me(),F=me(),[B,E]=ge(!1),I=m(j,w,{preferredMaxWidth:520,preferredMaxHeight:B?720:560,popupRef:P}),H=fe(null),K=fe(null);W(()=>{const e=P.current;if(!w||!I||!e)return;const t=getComputedStyle(e),r=I.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(B)null!==K.current&&K.current<=r&&E(!1);else{const e=H.current?.offsetWidth??0;if(0===e)return;K.current=e,e>r+.5&&E(!0)}});const[_,q]=ge(!1);W(()=>{const e=!!o&&(A.current?.labels?.length??0)>0;e!==_&&q(e)});const U=!!c||!!s||_,V=/* @__PURE__ */new Date,[Y,X]=ge(()=>e?Wt(Ut(e)):qt(V,p,g)),J=Rt.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(_t(e,V),p,g)),Q=e=>e?x(e):"";xe(()=>{if(!w)return;const e=e=>{const t=e.target;j.current?.contains(t)||P.current?.contains(t)||k(!1)};document.addEventListener("mousedown",e);const t=O(()=>k(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[w]);const ee=()=>{r("",""),k(!1)},te=e&&t?`${Q(e)} — ${Q(t)}`:e?f.fromOnly(Q(e)):t?f.toOnly(Q(t)):"",re=ne(b),ae=e=>{const t=Ft(e);return t?re.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},le=e&&t?f.range(ae(e),ae(t)):e?f.fromOnly(ae(e)):t?f.toOnly(ae(t)):y,ie=e=>B?"rounded-(--radius-control) border px-2.5 py-1 text-sm transition-colors "+(L===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"text-left px-3 py-1.5 text-sm rounded-(--radius-control) transition-colors "+(L===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),oe=/* @__PURE__ */je(Ae,{children:[J.map(e=>/* @__PURE__ */De("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=_t(e,V);M(t.from),C(t.to),D(e),X(t.from.slice(0,7))})(e),className:ie(e),children:f[e]},e)),
|
|
94
94
|
/* @__PURE__ */De("button",{type:"button",onClick:()=>D("Custom"),className:ie("Custom"),children:f.custom})]}),se=
|
|
95
95
|
/* @__PURE__ */De(Ot,{mode:"range",min:p,max:g,value:N||null,endValue:$||null,month:Y,onMonthChange:X,onSelect:e=>{D("Custom"),!N||N&&$?(M(e),C("")):e<N?(C(N),M(e)):C(e)},weekStartsOn:d,"aria-label":f.dialog});/* @__PURE__ */
|
|
96
96
|
return je("div",{className:"relative"+(h?" w-full":""),ref:j,children:[
|
|
97
97
|
/* @__PURE__ */je("div",{className:`${h?"flex w-full":"inline-flex"} items-center gap-2 border rounded-lg px-2.5 py-1.5 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${e||t?"border-blue-400 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500"}`,children:[
|
|
98
|
-
/* @__PURE__ */je("button",{ref:A,type:"button",onClick:()=>{M(e),C(t),D(null),X(e?Wt(Ut(e)):qt(V,p,g)),k(!0)},"aria-haspopup":"dialog","aria-expanded":w,id:o,"aria-label":c,"aria-labelledby":s,"aria-describedby":[U?
|
|
98
|
+
/* @__PURE__ */je("button",{ref:A,type:"button",onClick:()=>{M(e),C(t),D(null),X(e?Wt(Ut(e)):qt(V,p,g)),k(!0)},"aria-haspopup":"dialog","aria-expanded":w,id:o,"aria-label":c,"aria-labelledby":s,"aria-describedby":[U?z:void 0,l?F:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":w?S:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(h?" min-w-0 flex-1 justify-start":""),children:[
|
|
99
99
|
/* @__PURE__ */De("svg",{className:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),
|
|
100
|
-
/* @__PURE__ */De("span",{className:"truncate",children:te||y})]}),v&&(e||t)&&/* @__PURE__ */De("button",{type:"button",onClick:ee,"aria-label":f.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),U&&/* @__PURE__ */De("span",{id:
|
|
100
|
+
/* @__PURE__ */De("span",{className:"truncate",children:te||y})]}),v&&(e||t)&&/* @__PURE__ */De("button",{type:"button",onClick:ee,"aria-label":f.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),U&&/* @__PURE__ */De("span",{id:z,className:"sr-only",children:le}),l&&/* @__PURE__ */De("span",{id:F,className:"sr-only",children:f.required}),i&&/* @__PURE__ */je(Ae,{children:[
|
|
101
101
|
/* @__PURE__ */De("input",{type:"hidden",name:i.from,value:e}),
|
|
102
102
|
/* @__PURE__ */De("input",{type:"hidden",name:i.to,value:t})]}),w&&Pe(
|
|
103
|
-
/* @__PURE__ */je("div",{ref:
|
|
104
|
-
/* @__PURE__ */je("div",{className:
|
|
103
|
+
/* @__PURE__ */je("div",{ref:P,id:S,role:"dialog","aria-label":f.dialog,"data-layout":B?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:R.popup,left:I?.left,right:I?.right,top:I?.top,bottom:I?.bottom,width:B&&I?I.maxWidth:"max-content",maxWidth:I?.maxWidth,maxHeight:I?.maxHeight,overflowY:"auto",visibility:I?void 0:"hidden",...T()},children:[
|
|
104
|
+
/* @__PURE__ */je("div",{className:B?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
|
|
105
105
|
/* @__PURE__ */je("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
|
|
106
106
|
/* @__PURE__ */De("span",{className:"text-xs font-medium text-gray-500",children:f.from}),
|
|
107
|
-
/* @__PURE__ */De("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(N?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:N?Q(N):f.start})]}),!
|
|
107
|
+
/* @__PURE__ */De("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(N?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:N?Q(N):f.start})]}),!B&&/* @__PURE__ */De("span",{className:"text-gray-300",children:"—"}),
|
|
108
108
|
/* @__PURE__ */je("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
|
|
109
109
|
/* @__PURE__ */De("span",{className:"text-xs font-medium text-gray-500",children:f.to}),
|
|
110
|
-
/* @__PURE__ */De("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+($?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:$?Q($):f.end})]})]}),
|
|
110
|
+
/* @__PURE__ */De("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+($?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:$?Q($):f.end})]})]}),B?/* @__PURE__ */je(Ae,{children:[J.length>0&&/* @__PURE__ */De("div",{className:"mb-3 flex flex-wrap gap-1.5",children:oe}),
|
|
111
111
|
/* @__PURE__ */De("div",{className:"w-full",children:se})]}):
|
|
112
|
-
/* @__PURE__ */je("div",{ref:
|
|
112
|
+
/* @__PURE__ */je("div",{ref:H,className:"flex w-max gap-4",children:[
|
|
113
113
|
/* @__PURE__ */De("div",{className:"w-64",children:se}),J.length>0&&/* @__PURE__ */De("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:oe})]}),
|
|
114
114
|
/* @__PURE__ */je("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[v&&/* @__PURE__ */De("button",{type:"button",onClick:ee,className:"px-3 py-1.5 text-sm text-gray-500 hover:text-gray-700",children:f.clear}),
|
|
115
115
|
/* @__PURE__ */De("button",{type:"button",onClick:()=>k(!1),className:"px-3 py-1.5 text-sm text-gray-600 border border-gray-300 rounded-(--radius-control) hover:bg-gray-50",children:f.cancel}),
|
|
116
116
|
/* @__PURE__ */De("button",{type:"button",onClick:()=>{r(N,$),k(!1)},disabled:!N||!$,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 rounded-(--radius-control) hover:bg-blue-700 disabled:opacity-50",children:f.apply})]})]}),document.body)]})}var Gt=/^\d{2}:\d{2}(:\d{2})?$/,Xt=e=>String(e).padStart(2,"0");function Jt(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Xt(e.getHours())}:${Xt(e.getMinutes())}`;return t?`${r}:${Xt(e.getSeconds())}`:r}return Gt.test(e)?e:""}var Qt=he(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",step:o,...s},c){const d=null!=o&&Number(o)<60,u=Z();/* @__PURE__ */
|
|
117
|
-
return De("input",{ref:c,type:"time",lang:u,step:o,"aria-invalid":a||void 0,value:Jt(e,d),min:Jt(r,d)||void 0,max:Jt(n,d)||void 0,onChange:e=>t?.(Gt.test(e.target.value)?e.target.value:null),className:
|
|
118
|
-
return De("input",{ref:C,type:"date",lang:
|
|
119
|
-
return je("div",{ref:
|
|
117
|
+
return De("input",{ref:c,type:"time",lang:u,step:o,"aria-invalid":a||void 0,value:Jt(e,d),min:Jt(r,d)||void 0,max:Jt(n,d)||void 0,onChange:e=>t?.(Gt.test(e.target.value)?e.target.value:null),className:Ie({invalid:a,size:l,className:i}),...s})}),er=/^\d{4}-\d{2}-\d{2}$/,tr=/^(aria|data)-/,rr=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function nr(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Kt(e);if(er.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Kt(t)}function ar(e){if(!er.test(e))return null;const[t,r,n]=e.split("-").map(Number),a=new Date(t,r-1,n);return a.getMonth()===r-1&&a.getDate()===n?a:null}function lr(e,t){const r=ar(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var ir=he(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,native:i,weekStartsOn:o,className:s="","aria-label":c,"aria-describedby":d,"aria-labelledby":u,id:h,name:p,disabled:g,placeholder:f,required:b,clearable:x,form:y,title:v,tabIndex:w,autoFocus:k,onFocus:N,onBlur:M,...$},C){const L=x??!b,D=nr(e),j=nr(r),A=nr(n),P=G().datePicker,S=Z(),z=ne(S),[F,B]=ge(!1),E=fe(null),T=fe(null),H=fe(null),K=me(),_=me(),q=me(),U=m(T,F,{popupRef:H}),[V,Y]=ge(!1);W(()=>{const e=!!h&&(T.current?.labels?.length??0)>0;e!==V&&Y(e)});const X=!c&&(!!u||V);if(xe(()=>{if(!F)return;const e=e=>{const t=e.target;E.current?.contains(t)||H.current?.contains(t)||B(!1)};document.addEventListener("pointerdown",e,!0);const t=O(()=>B(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[F]),xe(()=>{if(F)return I(e=>"Escape"===e.key&&(B(!1),T.current?.focus(),!0),()=>H.current)},[F]),i)/* @__PURE__ */
|
|
118
|
+
return De("input",{ref:C,type:"date",lang:S,id:h,name:p,disabled:g,"aria-label":c,"aria-describedby":d,"aria-invalid":a||void 0,value:D,min:j||void 0,max:A||void 0,onChange:e=>t?.(ar(e.target.value)),className:Ie({invalid:a,size:l,className:s}),"aria-labelledby":u,required:b,form:y,title:v,tabIndex:w,autoFocus:k,onFocus:N,onBlur:M,...$});const J=Object.fromEntries(Object.entries($).filter(([e])=>tr.test(e)&&!rr.has(e))),Q=$["aria-required"],ee=!!b||!0===Q||"true"===Q,te=[X?_:void 0,ee?q:void 0,d].filter(Boolean).join(" ")||void 0,re=Kt(/* @__PURE__ */new Date),ae=(!j||re>=j)&&(!A||re<=A),le=f??P.placeholder;/* @__PURE__ */
|
|
119
|
+
return je("div",{ref:E,className:"relative",children:[
|
|
120
120
|
/* @__PURE__ */De("input",{ref:C,type:"hidden",name:p,form:y,value:D}),
|
|
121
|
-
/* @__PURE__ */je("button",{ref:T,type:"button",...J,id:h,disabled:g,title:v,tabIndex:w,autoFocus:k,onFocus:N,onBlur:M,"aria-haspopup":"dialog","aria-expanded":
|
|
122
|
-
/* @__PURE__ */De("span",{className:D?"text-gray-900":"text-gray-400",children:D?lr(D,
|
|
123
|
-
/* @__PURE__ */De("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3M4 11h16M5 7h14a1 1 0 011 1v11a1 1 0 01-1 1H5a1 1 0 01-1-1V8a1 1 0 011-1z"})})]}),X&&/* @__PURE__ */De("span",{id:
|
|
124
|
-
/* @__PURE__ */je("div",{ref:
|
|
125
|
-
/* @__PURE__ */De(Ot,{value:D||null,min:j||null,max:A||null,weekStartsOn:o,onSelect:e=>{
|
|
126
|
-
return De("input",{ref:s,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:cr(e),min:cr(r)||void 0,max:cr(n)||void 0,onChange:e=>t?.(function(e){if(!or.test(e))return null;const[t,r]=e.split("T"),[n,a,l]=t.split("-").map(Number),[i,o,s=0]=r.split(":").map(Number);if(i>23||o>59||s>59)return null;const c=new Date(n,a-1,l,i,o,s);return c.getMonth()===a-1&&c.getDate()===l?c:null}(e.target.value)),className:
|
|
121
|
+
/* @__PURE__ */je("button",{ref:T,type:"button",...J,id:h,disabled:g,title:v,tabIndex:w,autoFocus:k,onFocus:N,onBlur:M,"aria-haspopup":"dialog","aria-expanded":F,"aria-controls":F?K:void 0,"aria-labelledby":u,"aria-describedby":te,"aria-label":c?`${c}${D?`, ${lr(D,z)}`:""}`:void 0,onClick:()=>B(e=>!e),className:`${Ie({invalid:a,size:l,className:s})} flex items-center justify-between text-left`,children:[
|
|
122
|
+
/* @__PURE__ */De("span",{className:D?"text-gray-900":"text-gray-400",children:D?lr(D,z):le}),
|
|
123
|
+
/* @__PURE__ */De("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3M4 11h16M5 7h14a1 1 0 011 1v11a1 1 0 01-1 1H5a1 1 0 01-1-1V8a1 1 0 011-1z"})})]}),X&&/* @__PURE__ */De("span",{id:_,className:"sr-only",children:D?lr(D,z):le}),ee&&/* @__PURE__ */De("span",{id:q,className:"sr-only",children:P.required}),F&&Pe(
|
|
124
|
+
/* @__PURE__ */je("div",{ref:H,id:K,role:"dialog","aria-label":c??P.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:R.popup,left:U?.left,right:U?.right,top:U?.top,bottom:U?.bottom,maxWidth:U?.maxWidth,visibility:U?void 0:"hidden"},children:[
|
|
125
|
+
/* @__PURE__ */De(Ot,{value:D||null,min:j||null,max:A||null,weekStartsOn:o,onSelect:e=>{B(!1),T.current?.focus(),t?.(ar(e))}}),(L||ae)&&/* @__PURE__ */je("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[L&&/* @__PURE__ */De("button",{type:"button",onClick:()=>{B(!1),T.current?.focus(),t?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:P.clear}),ae&&/* @__PURE__ */De("button",{type:"button",onClick:()=>{B(!1),T.current?.focus(),t?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:P.today})]})]}),document.body)]})}),or=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,sr=e=>String(e).padStart(2,"0");function cr(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${sr(t.getMonth()+1)}-${sr(t.getDate())}T${sr(t.getHours())}:${sr(t.getMinutes())}`:or.test(e)?e:"";var t}var dr=he(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",...o},s){const c=Z();/* @__PURE__ */
|
|
126
|
+
return De("input",{ref:s,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:cr(e),min:cr(r)||void 0,max:cr(n)||void 0,onChange:e=>t?.(function(e){if(!or.test(e))return null;const[t,r]=e.split("T"),[n,a,l]=t.split("-").map(Number),[i,o,s=0]=r.split(":").map(Number);if(i>23||o>59||s>59)return null;const c=new Date(n,a-1,l,i,o,s);return c.getMonth()===a-1&&c.getDate()===l?c:null}(e.target.value)),className:Ie({invalid:a,size:l,className:i}),...o})});function ur(e){let t=null;try{t=window.getSelection()}catch{return null}if(!t||0===t.rangeCount||t.isCollapsed)return null;const r=e;if(r&&"number"==typeof r.nodeType){let e=!1;for(let n=0;n<t.rangeCount&&!e;n++)e=t.getRangeAt(n).intersectsNode(r);if(!e)return null}const n=t.toString();if(!n.trim())return null;const a=document.createElement("div");for(let e=0;e<t.rangeCount;e++)a.appendChild(t.getRangeAt(e).cloneContents());return{text:n,html:a.innerHTML}}async function hr(e,t){try{if(t&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}const r=r=>{r.clipboardData?.setData("text/plain",e),t&&r.clipboardData?.setData("text/html",t),r.preventDefault()},n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.addEventListener("copy",r);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",r),n.remove()}}async function mr(e,t,r){const n=await hr(t,r),l=J().copy;return n?a.success(l.copiedLabel(e)):a.error(l.failed),n}var pr={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},gr={sm:{box:"gap-1.5 px-2.5 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 py-1.5 text-sm",button:"-my-0.5"}};function fr(){/* @__PURE__ */
|
|
127
127
|
return De("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function br(){/* @__PURE__ */
|
|
128
128
|
return De("svg",{className:"h-4 w-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function xr({value:e,children:t,symbol:r,label:n,size:l="md",variant:i="bordered",hideCopyButton:o=!1,onCopy:s,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=ge(!1),g=fe(null),f=G().copy;xe(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=pe(async()=>{await hr(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),s?.(e)):a.error(f.failed)},[e,s,f]),{box:x,button:y}=gr[l],v=!o;/* @__PURE__ */
|
|
129
129
|
return je("div",{id:v?void 0:d,"aria-describedby":v?void 0:u,className:["inline-flex max-w-full items-center rounded-md",pr[i],x,h].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */De("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
|
|
@@ -136,14 +136,14 @@ return je("button",{ref:s,type:l,disabled:a,"aria-pressed":n||void 0,className:[
|
|
|
136
136
|
/* @__PURE__ */De("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */De("span",{className:"text-sm text-gray-500",children:t})]})}),Cr={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},Lr="bg-white text-gray-900 shadow-sm ring-1 ring-inset ring-[color:var(--ink-faint)] rosh-segmented-on",Dr="text-gray-600 hover:text-gray-900";function jr({value:e,onChange:t,options:r,name:n,size:a="md",block:l=!1,label:i,className:o="","aria-labelledby":s,"aria-describedby":c}){const d={"aria-label":s?void 0:i,"aria-labelledby":s,"aria-describedby":c},u=me(),h=`inline-flex max-w-full items-center gap-1 overflow-x-auto rounded-(--radius-card) bg-gray-100 p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden ${l?"w-full":""} ${o}`.trim(),m=("relative inline-flex shrink-0 "+(l?"flex-1":"")).trim(),p="inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-(--radius-control) font-medium transition-colors "+(l?"flex-1":"");/* @__PURE__ */
|
|
137
137
|
return De("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const l=`${u}-${r.value}`,i=r.value===e,o=/* @__PURE__ */je("label",{htmlFor:l,className:[p,"relative",Cr[a],i?Lr:Dr,r.disabled?"cursor-not-allowed opacity-40":"cursor-pointer"].join(" "),children:[
|
|
138
138
|
/* @__PURE__ */De("input",{id:l,type:"radio",name:n,value:r.value,checked:i,disabled:r.disabled,"aria-describedby":r.title?`${l}-note`:void 0,onChange:()=>t(r.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),r.icon,r.label,r.title&&/* @__PURE__ */De("span",{id:`${l}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */De(f,{content:r.title,className:m,children:o},r.value):o})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e,l=/* @__PURE__ */je("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:[p,Cr[a],n?Lr:Dr,"disabled:cursor-not-allowed disabled:opacity-40"].join(" "),children:[r.icon,r.label]},r.value);return r.title?/* @__PURE__ */De(f,{content:r.title,className:m,children:l},r.value):l})})}var Ar={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},Pr={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},Sr={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},zr=he(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:o="",disabledReason:s,disabledReasonId:c,...d},u){const h=me(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=s&&""!==s,b=f?`${m}-reason`:void 0,x=[p,g??b].filter(Boolean).join(" ")||void 0,y=/* @__PURE__ */De("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":x,disabled:r,onClick:()=>t(!e),...d,className:["relative inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]","disabled:cursor-not-allowed disabled:opacity-40",Ar[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */De("span",{className:["inline-block rounded-full bg-white shadow transition-transform",Pr[n],e?Sr[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */je("span",{className:`flex items-start gap-3 ${o}`.trim(),children:[y,
|
|
139
|
-
/* @__PURE__ */je("span",{className:"min-w-0",children:[a&&/* @__PURE__ */De("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */De("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */De("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */De("span",{className:o,children:y})});function Fr(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var Br=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function Er(e){const t=e.trim().replace(",",".");if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}function
|
|
140
|
-
return je("div",{className:"relative",children:[h&&/* @__PURE__ */De("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:h}),
|
|
139
|
+
/* @__PURE__ */je("span",{className:"min-w-0",children:[a&&/* @__PURE__ */De("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */De("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */De("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */De("span",{className:o,children:y})});function Fr(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var Br=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function Er(e){const t=e.trim().replace(",",".");if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}function Tr({dir:e,compact:t,label:r,disabled:n,onStep:a}){const l=fe(a);l.current=a;const i=fe({}),o=pe(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);xe(()=>o,[o]),xe(()=>{n&&o()},[n,o]);const s=/* @__PURE__ */De("svg",{"aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:t?2.6:2,children:/* @__PURE__ */De("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e>0?"M4.5 15.75l7.5-7.5 7.5 7.5":"M19.5 8.25l-7.5 7.5-7.5-7.5"})}),c={tabIndex:-1,"aria-label":r,disabled:n,onPointerDown:e=>{if(0!==e.button||n)return;e.preventDefault(),o();const t=e.shiftKey;l.current(t);const r=e.currentTarget.ownerDocument.defaultView??window;r.addEventListener("pointerup",o),i.current={off:()=>r.removeEventListener("pointerup",o),wait:setTimeout(()=>{i.current.every=setInterval(()=>l.current(t),60)},400)}},onPointerLeave:o,onPointerCancel:o,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__PURE__ */De("button",{type:"button",...c,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:s}):/* @__PURE__ */De(Se,{size:"sm",...c,children:s})}var Ir=he(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,shiftStep:i,disabled:o,readOnly:s,invalid:c,placeholder:d,size:u,prefix:h,suffix:m,id:p,name:g,className:f="",onBlur:b,steppers:x=!1,stepFrom:y,snap:v=!1,allowEmpty:w=!0,"aria-label":k,"aria-labelledby":N},M){const $=G(),[C,L]=ge(()=>Br(e,a)),D=fe(C);D.current=C;const j=fe(null),A=pe(e=>{j.current=e,"function"==typeof M?M(e):M&&(M.current=e)},[M]),P=fe(e),S=fe(e);S.current=e;const z=Boolean(o||s),F="compact"===x;xe(()=>{Er(D.current)!==e&&L(Br(e,a))},[e,a]);const B=e=>{if(z)return;let i=(Er(D.current)??y??(d?Er(d):null)??0)+e;null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n);const o=a??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(o));const s=Br(i,a);D.current=s,L(s),t(i)},E=fe(B);E.current=B;const[T,O]=ge(!1);xe(()=>{if(T&&!z)return I(e=>{if("Escape"!==e.key||document.activeElement!==j.current)return!1;const r=P.current;if(Er(D.current)===r)return!1;const n=Br(r,a);return D.current=n,L(n),S.current!==r&&t(r),!0})},[T,z,a,t]);const R=()=>{const e=Er(D.current);if(null==e){if(!w){const e=Br(S.current,a);return D.current=e,L(e),S.current}return D.current="",L(""),null!==S.current&&t(null),null}let i=e;const o=a??(v?Math.max(Fr(l??1),Fr(r??0)):void 0);if(v){const e=l??1,t=r??0;i=t+Math.round((i-t)/e)*e}null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n),null!=o&&(i=Number(i.toFixed(o)));const s=Br(i,a);return D.current=s,L(s),i===e&&i===S.current||t(i),i},W=/* @__PURE__ */De("input",{ref:A,id:p,name:g,type:"text",inputMode:0===a?"numeric":"decimal",value:C,disabled:o,readOnly:s,placeholder:d,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?d||void 0:Br(e,a),"aria-invalid":c||void 0,"aria-label":k,"aria-labelledby":N,onChange:e=>(e=>{if(s)return;if(""!==e&&!/^-?\d*[.,]?\d*$/.test(e))return;L(e);const r=Er(e);(null!==r||w)&&t(r)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!z)return void(P.current=R());const t=l??1,r=i??10*t,n="ArrowUp"===e.key?e.shiftKey?r:t:"ArrowDown"===e.key?-(e.shiftKey?r:t):"PageUp"===e.key?10*t:"PageDown"===e.key?10*-t:null;null===n||z||(e.preventDefault(),B(n))},onFocus:()=>{P.current=S.current,O(!0)},onBlur:()=>{O(!1),R(),b?.()},className:Ie({invalid:c,size:u,readOnly:s,className:[h?"pl-7":"",F?m?"pr-12":"pr-6":x?m?"pr-24":"pr-16":m?"pr-9":"","text-right tabular-nums",f].filter(Boolean).join(" ")})});if(!h&&!m&&!x)return W;const H=Er(C);/* @__PURE__ */
|
|
140
|
+
return je("div",{className:"relative",children:[h&&/* @__PURE__ */De("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:h}),W,m&&/* @__PURE__ */De("span",{className:`pointer-events-none absolute ${F?"right-6":x?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-sm text-gray-500`,children:m}),x&&(()=>{const e=/* @__PURE__ */De(Tr,{dir:-1,compact:F,label:$.number.decrease,disabled:z||null!=r&&null!=H&&H<=r,onStep:e=>E.current(-(e?i??10*(l??1):l??1))}),t=/* @__PURE__ */De(Tr,{dir:1,compact:F,label:$.number.increase,disabled:z||null!=n&&null!=H&&H>=n,onStep:e=>E.current(e?i??10*(l??1):l??1)});/* @__PURE__ */
|
|
141
141
|
return je("span",F?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-md",children:[t,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,t]})})()]})}),Or=(e,t,r)=>Math.min(r,Math.max(t,e));function Rr(e,t,r,n){return Number(Or(e,t,r).toFixed(n))}function Wr({value:e,onChange:t,min:r,max:n,step:a=1,shiftStep:l,precision:i,inputMin:o,inputMax:s,suffix:c,showInput:d=!0,emptyLabel:u,placeholderValue:h,stepFrom:m,label:p,"aria-labelledby":g,valueText:f,id:b,disabled:x,size:y="md",className:v=""}){const w=G(),k=me(),N=b??k,M=i??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(a),$=o??r,C=s??n,L=void 0!==u||void 0!==h,D=m??h,j=Or(e??h??r,r,n),A=e=>f?f(e):"string"==typeof c?`${e.toFixed(M)} ${c}`:void 0,P=null==e?u??(null!=h?A(h)??String(h):void 0):A(e);/* @__PURE__ */
|
|
142
142
|
return je("div",{className:`flex items-center gap-3 ${v}`.trim(),children:[
|
|
143
|
-
/* @__PURE__ */De("input",{id:N,type:"range",min:r,max:n,step:a,value:j,disabled:x,"aria-label":g?void 0:p,"aria-labelledby":g,"aria-valuetext":P,onKeyDown:i=>{const o="ArrowUp"===i.key||"ArrowRight"===i.key?1:"ArrowDown"===i.key||"ArrowLeft"===i.key?-1:0;if(!o||i.altKey||i.ctrlKey||i.metaKey)return;const s=i.shiftKey&&null!=l;if(!s&&!(null==e&&null!=D))return;i.preventDefault();t(Rr((e??D??j)+o*(s?l??a:a),r,n,M))},onChange:e=>t(Rr(Number(e.target.value),r,n,M)),className:"min-w-0 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===y?"h-1":"h-1.5")}),d&&/* @__PURE__ */De("div",{className:"sm"===y?"w-16 shrink-0":"w-20 shrink-0",children:/* @__PURE__ */De(
|
|
144
|
-
return je("div",{ref:
|
|
145
|
-
/* @__PURE__ */De("button",{ref:
|
|
146
|
-
/* @__PURE__ */De("div",{ref:
|
|
143
|
+
/* @__PURE__ */De("input",{id:N,type:"range",min:r,max:n,step:a,value:j,disabled:x,"aria-label":g?void 0:p,"aria-labelledby":g,"aria-valuetext":P,onKeyDown:i=>{const o="ArrowUp"===i.key||"ArrowRight"===i.key?1:"ArrowDown"===i.key||"ArrowLeft"===i.key?-1:0;if(!o||i.altKey||i.ctrlKey||i.metaKey)return;const s=i.shiftKey&&null!=l;if(!s&&!(null==e&&null!=D))return;i.preventDefault();t(Rr((e??D??j)+o*(s?l??a:a),r,n,M))},onChange:e=>t(Rr(Number(e.target.value),r,n,M)),className:"min-w-0 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===y?"h-1":"h-1.5")}),d&&/* @__PURE__ */De("div",{className:"sm"===y?"w-16 shrink-0":"w-20 shrink-0",children:/* @__PURE__ */De(Ir,{value:e,onChange:e=>{null!=e?e<$||e>C||t(e):L&&t(null)},min:$,max:C,step:a,shiftStep:l,stepFrom:D,precision:M,snap:!0,allowEmpty:L,suffix:c,disabled:x,placeholder:u??(null!=h?h.toFixed(M):void 0),size:"sm","aria-label":p?w.slider.value(p):void 0,"aria-labelledby":p?void 0:g})})]})}var Hr=/(^|[\s:])!?z-/;function Kr({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:o,defaultOpen:s=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:k="",triggerClassName:N,panelClassName:C=""}){const[L,j]=ge(s),A=(o??L)&&!f,P=K(),S=fe(null),z=fe(null),F=fe(null),B=fe(null),E=me(),T=m??E,H=me(),_=me(),q=me(),U=fe(null),V=fe(!1),Y=fe({openProp:o,onOpenChange:c});Y.current={openProp:o,onOpenChange:c};const Z=pe(e=>{void 0===Y.current.openProp&&j(e),Y.current.onOpenChange?.(e)},[]),G=pe((e=!1)=>{V.current=e,Z(!1)},[Z]),X=e=>{U.current=e.nativeEvent},J=pe(()=>{const e=F.current,t=z.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=b(t),a=Math.max(0,n.right-n.left-2*x),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${a}px`,o.maxHeight="none",o.width=d?`${Math.min(r.width,a)}px`:"";const s={width:e.offsetWidth,height:e.offsetHeight},c=u??1/0,h=y({trigger:r,menu:{width:s.width,height:Math.min(s.height,c)},bounds:n,align:l,side:i}),m=Math.min(h.maxHeight,c);o.left=`${h.left}px`,o.top=`${h.top}px`,o.maxHeight=`${m}px`,o.overflowY=s.height>m?"auto":"",e.dataset.side=h.side,e.dataset.align=l},[l,i,d,u]);W(()=>{A&&P&&J()}),xe(()=>{if(!A||!P)return;const e=v(()=>z.current,J),t=B.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>J());return r.observe(t),()=>{e(),r.disconnect()}},[A,P,J]),xe(()=>{if(!A)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(U.current===e)return!1;const t=e.target;return!(t&&(S.current?.contains(t)||F.current?.contains(t)))})(e)&&G(!0))},a=e=>{t=e,r=window.setTimeout(()=>n(e),0)},l=e=>n(e);return document.addEventListener(e,a,!0),window.addEventListener(e,l),()=>{window.clearTimeout(r),document.removeEventListener(e,a,!0),window.removeEventListener(e,l)}},t=e("pointerdown"),r=e("focusin"),n=O(()=>G()),a=I(e=>"Escape"===e.key&&(G(),z.current?.focus(),!0),()=>F.current);return()=>{t(),r(),n(),a()}},[A,G]),M(F,A&&P),W(()=>{if(!A||!P)return;const e=F.current;return()=>{if(V.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||z.current?.focus({preventScroll:!0})}},[A,P]),xe(()=>{if(!A||!P)return;const e=F.current;e&&(V.current=!1,(h?.current??$(e)[0]??e).focus({preventScroll:!0}))},[A,P]);const Q="function"==typeof t?t({close:()=>G()}):t,ee=r?{"aria-labelledby":_}:a?{"aria-label":a}:{"aria-labelledby":T};/* @__PURE__ */
|
|
144
|
+
return je("div",{ref:S,className:`relative inline-flex ${k}`.trim(),children:[
|
|
145
|
+
/* @__PURE__ */De("button",{ref:z,id:T,type:"button","aria-haspopup":"dialog","aria-expanded":A,"aria-controls":A&&P?H:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>A?G():Z(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!A)return;const t=(()=>{const e=F.current;return e?$(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:N??w({variant:"secondary"}),children:e}),A&&P&&Pe(
|
|
146
|
+
/* @__PURE__ */De("div",{ref:F,id:H,role:"dialog",...ee,"aria-describedby":n?q:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:X,onFocusCapture:X,onKeyDown:e=>{const t=F.current,r=z.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=$(t),a=document.activeElement;if(e.shiftKey){if(n.length>0&&a!==n[0]&&a!==t)return;return e.preventDefault(),void r.focus({preventScroll:!0})}if(n.length>0&&a!==n[n.length-1])return;e.preventDefault();const l=D(r,t);G(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${C}`.trim(),style:Hr.test(C)?void 0:{zIndex:R.popup},children:/* @__PURE__ */je("div",{ref:B,children:[r&&/* @__PURE__ */De("h2",{id:_,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */De("p",{id:q,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */De("div",{className:"mt-3",children:Q}):Q]})}),document.body)]})}var _r=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function qr(e){const t=e.trim().replace(/^#/,"");if(!_r.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var Ur=e=>e.toUpperCase(),Vr=(e,t,r)=>Math.min(r,Math.max(t,e));function Yr(e){const t=qr(e);if(!t)return{h:0,s:0,v:0};const r=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255,l=Math.max(r,n,a),i=l-Math.min(r,n,a);let o=0;return 0!==i&&(o=l===r?(n-a)/i%6*60:l===n?60*((a-r)/i+2):60*((r-n)/i+4)),{h:(o+360)%360,s:0===l?0:i/l,v:l}}function Zr({h:e,s:t,v:r}){const n=(e%360+360)%360,a=Vr(t,0,1),l=Vr(r,0,1),i=l*a,o=i*(1-Math.abs(n/60%2-1)),s=l-i,[c,d,u]=n<60?[i,o,0]:n<120?[o,i,0]:n<180?[0,i,o]:n<240?[0,o,i]:n<300?[o,0,i]:[i,0,o],h=e=>Math.round(255*(e+s)).toString(16).padStart(2,"0");return`#${h(c)}${h(d)}${h(u)}`}var Gr=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>Zr({h:e%360,s:1,v:1})).join(", ")})`,Xr={sm:"h-5 w-5",md:"h-7 w-7",lg:"h-9 w-9"},Jr={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function Qr(e){return e?{background:e}:Jr}function en({size:e="md",selected:t=!1,className:r=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",t?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",Xr[e],r].filter(Boolean).join(" ")}var tn=he(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
|
|
147
147
|
return De("button",{ref:i,type:a,"aria-pressed":r,className:en({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */De("span",{"aria-hidden":"true",className:"absolute inset-0",style:Qr(e)})})}),rn=(e,t,r)=>Math.min(r,Math.max(t,e)),nn=e=>"string"==typeof e?{value:e}:e;var an={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function ln({value:e,onChange:t,label:r,presets:n,clearable:a=!1,fallback:l,dragWrites:i="live",disabled:o=!1,onClose:s,id:c,className:d=""}){const u=G().color,h=qr(l??""),[m,p]=ge(()=>Yr(e||h||"")),g=fe(e);xe(()=>{e!==g.current&&(g.current=e,e?p(Yr(e)):h&&p(Yr(h)))},[e]);const b=r=>{o||r===e||(g.current=r,t(r))},x=e=>{const t=qr(e);t&&(p(Yr(t)),b(t))},y=e=>{p(e),b(Zr(e))},[v,w]=ge(!1),k=fe(m);k.current=m;const N=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,k.current);"end"===i?(w(!0),p(r)):y(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,k.current);"end"===i?p(r):y(r)},onPointerUp:t=>{"end"===i&&v&&(w(!1),y(e(t,k.current)))}}),M=N((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?Vr((r-a.left)/a.width,0,1):0,v:a.height>0?1-Vr((n-a.top)/a.height,0,1):0})};var r,n,a}),$=N((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*Vr((r-n.left)/n.width,0,1)):0)};var r,n}),C=v?Zr(m):e,L=e=>`${Math.round(100*e)}%`,D=(n??[]).map(nn),j=qr(e);/* @__PURE__ */
|
|
148
148
|
return je("div",{id:c,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${d}`.trim(),onKeyDown:e=>{"Escape"===e.key&&s&&(e.preventDefault(),e.stopPropagation(),s())},children:[(D.length>0||a)&&/* @__PURE__ */je("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-1.5",children:[a&&/* @__PURE__ */De(f,{content:u.clear,children:/* @__PURE__ */De(tn,{color:"",size:"sm","aria-label":u.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(g.current="",t(""))}})}),D.map(e=>{const t=qr(e.value),r=e.label?`${e.label} · ${Ur(t??e.value)}`:Ur(t??e.value);/* @__PURE__ */
|
|
149
149
|
return De(f,{content:r,children:/* @__PURE__ */De(tn,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===j,disabled:o,onClick:()=>x(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
@@ -152,7 +152,7 @@ return De(f,{content:r,children:/* @__PURE__ */De(tn,{color:t??e.value,size:"sm"
|
|
|
152
152
|
/* @__PURE__ */je("div",{className:"flex items-center gap-2",children:[
|
|
153
153
|
/* @__PURE__ */De("span",{"aria-hidden":"true",className:"relative h-7 w-7 shrink-0 overflow-hidden rounded-md border border-gray-300",style:Qr(C||(h??""))}),
|
|
154
154
|
/* @__PURE__ */De(on,{value:C,placeholder:!e&&h?Ur(h):void 0,onChange:x,label:u.hex(r),disabled:o})]})]})}function on({value:e,onChange:t,label:r,placeholder:n,disabled:a,id:l,className:i=""}){const[o,s]=ge(null);/* @__PURE__ */
|
|
155
|
-
return De("input",{id:l,type:"text",value:o??(e?Ur(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{s(r.target.value);const n=qr(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),s(null))},onBlur:()=>s(null),className:
|
|
155
|
+
return De("input",{id:l,type:"text",value:o??(e?Ur(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{s(r.target.value);const n=qr(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),s(null))},onBlur:()=>s(null),className:Ie({size:"sm",className:`min-w-0 flex-1 font-mono uppercase ${i}`.trim()})})}function sn({value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o,id:s,showHexInput:c=!1,size:d="md",align:u="start",open:h,onOpenChange:m,className:p=""}){const g=G().color,f=me(),b=qr(l??""),x=e||b||"",y=e?Ur(e):b?Ur(b):g.none;/* @__PURE__ */
|
|
156
156
|
return je("div",{className:`inline-flex items-center gap-2 ${p}`.trim(),children:[
|
|
157
157
|
/* @__PURE__ */De(Kr,{id:s,trigger:/* @__PURE__ */De("span",{"aria-hidden":"true",className:"absolute inset-0",style:Qr(x)}),triggerLabel:g.swatch(r,y),triggerClassName:en({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:o,children:/* @__PURE__ */De(ln,{id:f,value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o})}),c&&
|
|
158
158
|
/* @__PURE__ */De("div",{className:"w-24 flex-none",children:/* @__PURE__ */De(on,{value:e,placeholder:!e&&b?Ur(b):void 0,onChange:r=>{o||r===e||t(r)},label:g.hex(r),disabled:o})})]})}var cn=he(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:o=!1,label:s,hint:c,error:d,required:u,className:h=""},m){const p=me(),g=G().files,f=U({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:o,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),b=d?`${p}-error`:c?`${p}-hint`:void 0;/* @__PURE__ */
|
|
@@ -180,17 +180,17 @@ return je("li",{className:"flex max-w-full items-center gap-1.5 rounded-md borde
|
|
|
180
180
|
/* @__PURE__ */je("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
181
181
|
/* @__PURE__ */De(pn,{onClick:p.open,count:e.length,variant:c,label:s,disabled:i}),d]}),
|
|
182
182
|
/* @__PURE__ */De(Y,{rejections:p.rejections})]})}function fn({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
183
|
-
return De("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function bn(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,allowFreeText:o=!1,onSearchChange:s,rightAdornment:c,renderOption:d,clearable:u=!0,"aria-label":h,"aria-labelledby":g,"aria-describedby":f}=e,b=!0===e.multiple,x=e.multiple?e.value:e.value?[e.value]:[],y=e.multiple?"":e.value,v=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},w=x.length>0,[k,N]=ge(!1),[M,$]=ge(-1),C=me(),L=i??`${C}-input`,D=`${C}-listbox`,j=e=>`${C}-opt-${e}`,[A,
|
|
184
|
-
return je("div",{ref:
|
|
185
|
-
/* @__PURE__ */De("input",{id:L,ref:
|
|
186
|
-
/* @__PURE__ */De("div",{ref:
|
|
183
|
+
return De("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function bn(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,allowFreeText:o=!1,onSearchChange:s,rightAdornment:c,renderOption:d,clearable:u=!0,"aria-label":h,"aria-labelledby":g,"aria-describedby":f}=e,b=!0===e.multiple,x=e.multiple?e.value:e.value?[e.value]:[],y=e.multiple?"":e.value,v=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},w=x.length>0,[k,N]=ge(!1),[M,$]=ge(-1),C=me(),L=i??`${C}-input`,D=`${C}-listbox`,j=e=>`${C}-opt-${e}`,[A,P]=ge(""),S=G(),z=n??S.select.none,F=e=>{P(e),$(-1),s?.(e)},B=fe(null),E=fe(null),H=fe(null),K=fe(null),_=fe(k);_.current=k;const q=fe(!1),U=e=>{if(!_.current)return;_.current=!1;const t=A.trim();e&&o&&t&&(b?x.includes(t)||v([...x,t]):t!==y&&v([t])),N(!1),F("")},V=(e,t)=>{if(!e.disabled){if(b)return v(x.includes(e.value)?x.filter(t=>t!==e.value):[...x,e.value]),void $(t);v([e.value]),U(!1)}},[Y,Z]=ge(null);W(()=>{if(!c||k)return void Z(null);const e=K.current?.offsetWidth??0;Z(e?e+(te?32:8)+6:null)});const X=m(E,k,{matchTriggerWidth:!0}),J=be(()=>Ue(t),[t]),Q=x.join("\0"),ee=be(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of J)x.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(o)for(const r of x)t.has(r)||e.push(r);return e.join(", ")},[J,Q,o]),te=u&&w&&!l;xe(()=>{if(!k)return;const e=e=>{const t=e.target;B.current?.contains(t)||H.current?.contains(t)||U(!0)};document.addEventListener("mousedown",e);const t=O(()=>U(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[k,o,A,Q,e.onChange]),xe(()=>{if(k)return I(e=>!("Escape"!==e.key||!_.current)&&(U(!1),E.current?.blur(),!0),()=>H.current)},[k]);const re=be(()=>{const e=/* @__PURE__ */new Set;return Ve(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),ne=be(()=>{if(s)return re;const e=A.trim().toLowerCase();return e?Ve(re,t=>t.label.toLowerCase().includes(e)||(t.sublabel?.toLowerCase().includes(e)??!1)):re},[re,A,s]),ae=be(()=>Ue(ne),[ne]);/* @__PURE__ */
|
|
184
|
+
return je("div",{ref:B,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(B.current?.contains(t)||H.current?.contains(t))||q.current||document.activeElement!==E.current&&U(!0)},children:[
|
|
185
|
+
/* @__PURE__ */De("input",{id:L,ref:E,type:"text",autoComplete:"off",role:"combobox","aria-expanded":k,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":k?D:void 0,"aria-activedescendant":k&&M>=0&&M<ae.length?j(M):void 0,"aria-label":g?void 0:h,"aria-labelledby":g,"aria-describedby":f,value:k?A:ee,onChange:e=>{F(e.target.value),N(!0)},onFocus:()=>{l||(F(""),N(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(l)return;if(e.preventDefault(),!k)return void N(!0);if(0===ae.length)return;const t="ArrowDown"===e.key?1:-1;return void $(e=>Ke(ae,e,t))}if("Enter"===e.key){e.preventDefault();const t=A.trim();k&&M>=0&&M<ae.length?V(ae[M],M):1!==ae.length||ae[0].disabled?o&&t&&(b?(x.includes(t)||v([...x,t]),F("")):(v([t]),U(!1),E.current?.blur())):V(ae[0],0)}else"Escape"===e.key?(U(!1),E.current?.blur()):"Tab"===e.key&&U(!0)},placeholder:r||z,className:`${Ee} ${a} ${te?"pr-8":""} ${l?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate`,style:Y?{paddingRight:Y}:void 0,disabled:l}),te&&/* @__PURE__ */De(fn,{ariaLabel:S.select.clear,onClear:()=>{v([]),U(!1)}}),c&&!k&&/* @__PURE__ */De("div",{ref:K,className:`absolute top-1/2 -translate-y-1/2 ${te?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:c}),k&&Pe(
|
|
186
|
+
/* @__PURE__ */De("div",{ref:H,onMouseDownCapture:()=>{q.current=!0,setTimeout(()=>{q.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:R.popup,left:X?.left,right:X?.right,top:X?.top,bottom:X?.bottom,minWidth:X?.minWidth,width:X?.width,visibility:X?void 0:"hidden",...T()},children:/* @__PURE__ */De("div",{id:D,role:ae.length?"listbox":void 0,"aria-labelledby":ae.length?g??(h?void 0:L):void 0,"aria-label":ae.length&&!g?h:void 0,"aria-multiselectable":!(!ae.length||!b)||void 0,className:"overflow-y-auto",style:{maxHeight:X?.maxHeight??p},children:0===ae.length?/* @__PURE__ */De("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:S.select.noMatches}):Ye(ne,(e,t)=>{const r=x.includes(e.value);/* @__PURE__ */
|
|
187
187
|
return je("button",{id:j(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||b)&&r.preventDefault(),V(e,t)},className:"w-full overflow-hidden text-left px-3 py-1.5 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${r?"text-blue-600 font-medium":"text-gray-700"} ${t===M?"bg-gray-100":r?"bg-blue-50/50":""}`),children:[b&&/* @__PURE__ */De(Ze,{selected:r}),
|
|
188
|
-
/* @__PURE__ */De("span",{className:"min-w-0 flex-1 truncate",children:d?d(e,{selected:r,active:t===M}):e.label}),e.sublabel&&/* @__PURE__ */De("span",{className:"min-w-0 max-w-[45%] shrink-0 truncate text-xs text-gray-400",children:e.sublabel})]},e.value)},C)})}),document.body)]})}function xn({value:e,onChange:t,options:r=[],placeholder:n,allowFreeText:a=!1,invalid:l,disabled:i,id:o,className:s=""}){const[c,d]=ge(!1),[u,h]=ge(""),g=G(),f=fe(null),b=fe(null),x=fe(null),y=m(f,c),v=e=>r.find(t=>t.value===e)?.label??e,w=be(()=>{const t=new Set(e),n=[],a=u.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!e.label.toLowerCase().includes(a)||n.push(e));return n},[r,e,u]),N=r=>{r&&!e.includes(r)?(t([...e,r]),h("")):h("")},M=r=>t(e.filter(e=>e!==r)),$=()=>{const e=u.trim();a&&e?N(e):h("")},C=fe(()=>{});C.current=()=>{$(),d(!1)},xe(()=>{if(!c)return;const e=e=>{const t=e.target;f.current?.contains(t)||x.current?.contains(t)||($(),d(!1))};document.addEventListener("mousedown",e);const t=
|
|
188
|
+
/* @__PURE__ */De("span",{className:"min-w-0 flex-1 truncate",children:d?d(e,{selected:r,active:t===M}):e.label}),e.sublabel&&/* @__PURE__ */De("span",{className:"min-w-0 max-w-[45%] shrink-0 truncate text-xs text-gray-400",children:e.sublabel})]},e.value)},C)})}),document.body)]})}function xn({value:e,onChange:t,options:r=[],placeholder:n,allowFreeText:a=!1,invalid:l,disabled:i,id:o,className:s=""}){const[c,d]=ge(!1),[u,h]=ge(""),g=G(),f=fe(null),b=fe(null),x=fe(null),y=m(f,c),v=e=>r.find(t=>t.value===e)?.label??e,w=be(()=>{const t=new Set(e),n=[],a=u.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!e.label.toLowerCase().includes(a)||n.push(e));return n},[r,e,u]),N=r=>{r&&!e.includes(r)?(t([...e,r]),h("")):h("")},M=r=>t(e.filter(e=>e!==r)),$=()=>{const e=u.trim();a&&e?N(e):h("")},C=fe(()=>{});C.current=()=>{$(),d(!1)},xe(()=>{if(!c)return;const e=e=>{const t=e.target;f.current?.contains(t)||x.current?.contains(t)||($(),d(!1))};document.addEventListener("mousedown",e);const t=O(()=>C.current());return()=>{document.removeEventListener("mousedown",e),t()}});const L=r.length>0;/* @__PURE__ */
|
|
189
189
|
return je("div",{ref:f,className:"relative",children:[
|
|
190
|
-
/* @__PURE__ */je("div",{onMouseDown:e=>{i||e.target.closest("button")||(e.preventDefault(),b.current?.focus())},className:
|
|
190
|
+
/* @__PURE__ */je("div",{onMouseDown:e=>{i||e.target.closest("button")||(e.preventDefault(),b.current?.focus())},className:Ie({invalid:l,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${i?"bg-gray-50 cursor-not-allowed":""} ${s}`}),children:[e.map(e=>/* @__PURE__ */je("span",{className:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-1.5 py-0.5 text-xs font-medium text-blue-700",children:[
|
|
191
191
|
/* @__PURE__ */De("span",{className:"truncate",children:v(e)}),!i&&/* @__PURE__ */De("button",{type:"button","aria-label":g.select.removeItem?.(v(e))??`${g.select.remove} ${v(e)}`,onClick:()=>M(e),className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none",children:"×"})]},e)),
|
|
192
192
|
/* @__PURE__ */De("input",{id:o,ref:b,type:"text",autoComplete:"off",role:"combobox","aria-expanded":c&&L,"aria-invalid":l||void 0,disabled:i,value:u,placeholder:0===e.length?n:void 0,onChange:e=>{h(e.target.value),d(!0)},onFocus:()=>{!i&&L&&d(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&a){t.preventDefault();const e=u.trim(),r=e?w.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())):[];1===r.length?N(r[0].value):$()}else"Backspace"===t.key&&""===u&&e.length>0?M(e[e.length-1]):"Escape"===t.key?(d(!1),h(""),b.current?.blur()):"Tab"===t.key&&($(),d(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),c&&L&&Pe(
|
|
193
|
-
/* @__PURE__ */De("div",{ref:x,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:
|
|
193
|
+
/* @__PURE__ */De("div",{ref:x,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:R.popup,left:y?.left,right:y?.right,top:y?.top,bottom:y?.bottom,minWidth:y?.minWidth,maxWidth:y?.maxWidth??k,width:"max-content",visibility:y?void 0:"hidden",...T()},children:/* @__PURE__ */De("div",{className:"overflow-y-auto",style:{maxHeight:y?.maxHeight??p},children:0===w.length?/* @__PURE__ */De("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:r.length>0&&e.length>=r.length?g.select.allSelected:g.select.noMatches}):w.map(e=>/* @__PURE__ */De("button",{type:"button",onMouseDown:t=>{t.preventDefault(),N(e.value)},className:"w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.label},e.value))})}),document.body)]})}var yn={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}};function vn({children:e,header:t,footer:r,padded:n=!0,padding:a,headingLevel:l,headerActions:i,"aria-label":o,className:s="",bodyClassName:c="",style:d}){const u=yn[a??(n?"md":"none")],h=me(),m=null!=l&&null!=t,p=`h${l}`,g=m||null!=o&&""!==o,f=g?"section":"div",b=`rounded-(--radius-card) border border-gray-200 bg-white shadow-sm ${s}`.trim(),x=`border-b border-gray-100 ${u.edge} text-sm font-semibold text-gray-900`;/* @__PURE__ */
|
|
194
194
|
return je(f,{className:b,style:d,...m?{"aria-labelledby":h}:g?{"aria-label":o}:{},children:[null!=t&&(null!=i?
|
|
195
195
|
/* @__PURE__ */je("div",{className:`${x} flex items-center justify-between gap-3`,children:[m?/* @__PURE__ */De(p,{id:h,children:t}):/* @__PURE__ */De("span",{children:t}),i]}):m?
|
|
196
196
|
/* @__PURE__ */De(p,{id:h,className:x,children:t}):/* @__PURE__ */De("div",{className:x,children:t})),
|
|
@@ -204,12 +204,12 @@ return De(l,{className:[kn[t],Nn[r],Mn[n],a?"block truncate":"",i].filter(Boolea
|
|
|
204
204
|
return De(`h${t}`,{className:[Cn[t],kn[r],n].filter(Boolean).join(" "),children:e})}function Dn({children:e,tone:t="secondary",size:r="sm",className:n=""}){/* @__PURE__ */
|
|
205
205
|
return De("p",{className:[kn[t],Nn[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var jn={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},An={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Pn={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function Sn({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
|
|
206
206
|
return De("div",{className:["flex flex-col",jn[t],r?An[r]:"",n?Pn[n]:"",a].filter(Boolean).join(" "),children:e})}function zn({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
|
|
207
|
-
return De("div",{className:["flex",a?"flex-wrap":"",jn[t],An[r],n?Pn[n]:"",l].filter(Boolean).join(" "),children:e})}var Fn={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Bn={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",6:"sm:grid-cols-6",12:"sm:grid-cols-12"},En={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",6:"lg:grid-cols-6",12:"lg:grid-cols-12"};function
|
|
208
|
-
return De("div",{className:["grid",Fn[t],r?Bn[r]:"",n?En[n]:"",jn[a],l].filter(Boolean).join(" "),children:e})}var
|
|
207
|
+
return De("div",{className:["flex",a?"flex-wrap":"",jn[t],An[r],n?Pn[n]:"",l].filter(Boolean).join(" "),children:e})}var Fn={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Bn={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",6:"sm:grid-cols-6",12:"sm:grid-cols-12"},En={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",6:"lg:grid-cols-6",12:"lg:grid-cols-12"};function Tn({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
|
|
208
|
+
return De("div",{className:["grid",Fn[t],r?Bn[r]:"",n?En[n]:"",jn[a],l].filter(Boolean).join(" "),children:e})}var In={sm:"my-2",md:"my-4",lg:"my-6"};function On({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=me();if("vertical"===e)/* @__PURE__ */
|
|
209
209
|
return De("span",{role:"presentation",className:`inline-block h-full min-h-[1em] w-px shrink-0 self-stretch bg-gray-200 ${a}`.trim()});if(!t)/* @__PURE__ */
|
|
210
|
-
return De("hr",{className:`border-0 border-t border-gray-200 ${
|
|
210
|
+
return De("hr",{className:`border-0 border-t border-gray-200 ${In[n]} ${a}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",o="right"===r?"w-4 shrink-0":"flex-1";
|
|
211
211
|
/* @__PURE__ */
|
|
212
|
-
return je("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${
|
|
212
|
+
return je("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${In[n]} ${a}`.trim(),children:[
|
|
213
213
|
/* @__PURE__ */De("span",{"aria-hidden":"true",className:`${i} border-t border-gray-200`}),
|
|
214
214
|
/* @__PURE__ */De("span",{id:l,className:"shrink-0 text-xs font-medium text-gray-500",children:t}),
|
|
215
215
|
/* @__PURE__ */De("span",{"aria-hidden":"true",className:`${o} border-t border-gray-200`})]})}var Rn={text:"rounded",rect:"rounded-md",circle:"rounded-full"},Wn=e=>"number"==typeof e?`${e}px`:e;function Hn({variant:e="text",width:t,height:r,lines:n=1,className:a=""}){const l=`animate-pulse bg-gray-200 ${Rn[e]} ${a}`.trim();if("circle"===e){const e=Wn(r??t)??"2.5rem";/* @__PURE__ */
|
|
@@ -254,8 +254,8 @@ return je("div",{className:"mb-6",children:[o&&o.length>0&&/* @__PURE__ */De(e,{
|
|
|
254
254
|
/* @__PURE__ */je("div",{className:"flex items-start justify-between gap-4",children:[
|
|
255
255
|
/* @__PURE__ */je("div",{children:[
|
|
256
256
|
/* @__PURE__ */je("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */De("span",{className:"shrink-0 text-gray-400",children:i}),t]}),s&&/* @__PURE__ */De("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),c&&/* @__PURE__ */De("div",{className:"flex items-center gap-2",children:c})]})]})}var ja=["success","warning","danger"];function Aa(e){return"string"==typeof e&&ja.includes(e)}function Pa(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=Sa(t),a=Sa(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function Sa(e){return null!=e&&Number.isFinite(e)?e:null}var za={success:{tone:"success",fill:"bg-green-500",ink:"text-gray-900",word:"ok"},warning:{tone:"warning",fill:"bg-amber-500",ink:"text-amber-600",word:"warning"},danger:{tone:"danger",fill:"bg-red-500",ink:"text-red-600",word:"critical"}};var Fa=/* @__PURE__ */new Set;function Ba(e,t){if(null==e)return null;if(Aa(e))return za[e];const r=function(e){const t="string"==typeof e?JSON.stringify(e):"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e?String(e):Object.prototype.toString.call(e);return t.length>32?`${t.slice(0,31)}…`:t}(e);return function(e,t){const r=`${e}:${t}`;Fa.has(r)||(Fa.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${ja.join(" | ")}. Rendering an "unknown severity" marker — a health marker must never silently disappear. If this came from a backend rollup, map it to the shell's vocabulary at the fetch boundary (see isSeverityTone).`))}(t,r),{tone:null,fill:"bg-gray-300 border border-red-500",ink:"text-gray-900",word:`unrecognised severity ${r}`,token:r}}function Ea({at:e,title:t,className:r}){/* @__PURE__ */
|
|
257
|
-
return De("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var
|
|
258
|
-
/* @__PURE__ */De("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${M}%`}}),C&&null!=f&&null!=k&&/* @__PURE__ */De(Ea,{at:
|
|
257
|
+
return De("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var Ta=e=>Math.min(100,Math.max(0,e));function Ia({label:e,value:t,max:r=100,warn:n,crit:a,severity:l,detail:i,formatValue:o,emptyLabel:s,size:c="sm",ariaLabel:d,className:u=""}){const h=G().meter,m=Z(),p=s??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var b,x;null==f&&(b=`MetricBar:max:${String(r)}`,x=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,Fa.has(b)||(Fa.add(b),console.error(x)));const y=Ba(l,"MetricBar"),v=null!=g?y??(null==(w=Pa(g,n,a))?null:za[w]):null;var w;const k=Sa(n),N=Sa(a),M=null!=g&&null!=f?Ta(g/f*100):0,$=null!=g?(o??(e=>100===f?te(e,1,m):Q(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=k||null!=N),L="md"===c?"h-2":"h-1.5",D=null!=g&&null!=f,j=/* @__PURE__ */je("div",{...D?{role:"meter","aria-label":d??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":f,"aria-valuenow":Math.min(f,Math.max(0,g)),"aria-valuetext":$}:{"aria-hidden":!0},className:D&&v?`relative mt-2 ${L} rounded-full bg-gray-200`:`relative mt-2 ${L} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[D&&
|
|
258
|
+
/* @__PURE__ */De("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${M}%`}}),C&&null!=f&&null!=k&&/* @__PURE__ */De(Ea,{at:Ta(k/f*100),title:h.warningAt(k),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=N&&/* @__PURE__ */De(Ea,{at:Ta(N/f*100),title:h.criticalAt(N),className:"bg-gray-500"})]}),A=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
|
|
259
259
|
return je("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */De("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
260
260
|
/* @__PURE__ */je("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
261
261
|
/* @__PURE__ */De("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${A}`,children:$}),
|
|
@@ -344,9 +344,9 @@ return je("div",{"aria-hidden":"true","data-timeline-part":"today",children:[
|
|
|
344
344
|
/* @__PURE__ */De("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${dl(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function Bl({nodes:e,geo:t,reveal:r}){const n=e.map(e=>{const t=e.members.map(e=>e.caption).filter(e=>!!e);return 0===t.length?null:{x:e.x,first:t[0],last:t[t.length-1]}}).filter(e=>null!==e).sort((e,t)=>e.x-t.x),a=[];let l=null;const i=()=>{l&&(a.push({x:(l.from+l.to)/2,text:l.first===l.last?l.first:`${l.first}–${l.last}`}),l=null)};for(const e of n){const t=e.first===e.last?e.first:`${e.first}–${e.last}`,r=xl(t)/2;l&&e.x-r<l.right+6?(l.to=e.x,l.last=e.last,l.right=e.x+r):(i(),l={from:e.x,to:e.x,first:e.first,last:e.last,right:e.x+r})}return i(),/* @__PURE__ */De("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */De("span",{className:"rosh-tl-caption"+(r?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:`${t.laneA}px`,...r?{animationDelay:"360ms"}:{}},children:e.text},`${e.x}-${e.text}`))})}function El({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
|
|
345
345
|
return je("div",{"aria-hidden":"true","data-timeline-part":"phase",children:[
|
|
346
346
|
/* @__PURE__ */De("div",{className:"rosh-tl-phase border-gray-300",style:{left:`${n}px`,width:`${a}px`,top:t.laneB+t.laneH-4+"px"}}),
|
|
347
|
-
/* @__PURE__ */je("span",{className:"rosh-tl-phase-label text-gray-500",style:{left:`${n+a/2}px`,top:`${t.laneB+t.laneH+5}px`},children:[e.label," · parallel"]})]})}function
|
|
347
|
+
/* @__PURE__ */je("span",{className:"rosh-tl-phase-label text-gray-500",style:{left:`${n+a/2}px`,top:`${t.laneB+t.laneH+5}px`},children:[e.label," · parallel"]})]})}function Tl({nodes:e,trackPx:t,geo:r,activeKey:n,hoveredKey:a,currentKey:l}){const i=G().timeline,o=(e,t)=>null!==t&&(e.key===t||e.members.some(e=>e.key===t)),s=e.find(e=>e.key===a)??e.find(e=>o(e,n))??null;if(!s)return null;const c=s.mark,d=c?c.label:`×${s.members.length}`,u=c?c.dateText:function(e){const t=e[0].dateText,r=e[e.length-1].dateText;return t===r?t:`${t} – ${r}`}(s.members),h=c?c.widthPx:hl(d,u),m=c?.onOpen;/* @__PURE__ */
|
|
348
348
|
return je("div",{"data-timeline-part":"label",className:`rosh-tl-label${s.key===a?" is-hot":""}${o(s,l)?" is-current":""}`,style:{left:`${dl(s.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */De("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */De("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
|
|
349
|
-
/* @__PURE__ */De("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function
|
|
349
|
+
/* @__PURE__ */De("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function Il({groups:e,trackPx:t,geo:r,startMs:n,endMs:a,currentKey:l,hoveredKey:i,reveal:o,step:s,zoomedKey:c,popId:d,aimBubble:u,openCluster:h,setOpenCluster:m,previewCluster:p,setPreviewCluster:g,setZoomKey:f,startCaptionPx:b}){const x=[];e.forEach((e,t)=>{if("cluster"===e.type){const n=`cluster-${e.members[0].key}`,a=(r=e.members,`${(r[0]?.label??"").replace(/\s*v?\d+$/i,"").trim()||(r[0]?.label??"")} ×${r.length}`);if(x.push({key:n,group:e,text:a,x:e.members.reduce((e,t)=>e+t.baseX,0)/e.members.length,index:t,lane:-1,left:0,widthPx:Math.ceil(xl(a))+28}),n===c)for(const r of e.members)x.push({key:r.key,group:{type:"item",mark:r},text:r.label,x:r.x,index:t,lane:-1,left:0,widthPx:r.widthPx});return}var r;x.push({key:e.mark.key,group:e,text:e.mark.label,x:e.mark.x,index:t,lane:-1,left:0,widthPx:e.mark.widthPx})}),x.sort((e,t)=>e.x-t.x);const y=function(e,t,r,n,a={}){const l=t>0?t:0,i=n>0?n:1,o=a.gapPx??6,s=Math.max(1,a.laneCount??4),c=e.map((e,t)=>({item:e,index:t})).sort((e,t)=>(e.item.priority??0)-(t.item.priority??0)||e.item.ms-t.item.ms||e.index-t.index),d=Array.from({length:s},()=>[]),u=/* @__PURE__ */new Map;for(const{item:e}of c){const t=Math.max(0,e.widthPx);if(l<=0||t>l){u.set(e.key,-1);continue}const n=e.xPx??(e.ms-r)/i*l,a=Math.min(Math.max(n-t/2,0),l-t),c=a+t;let h=-1;for(let e=0;e<s;e++)if(d[e].every(e=>a>e.right+o||c+o<e.left)){d[e].push({left:a,right:c}),h=e;break}u.set(e.key,h)}return e.map(e=>({key:e.key,lane:u.get(e.key)??-1}))}([...b>0?[{key:"__rosh-tl-start__",ms:n,xPx:0,widthPx:b,priority:-2}]:[],...x.map(e=>({key:e.key,ms:"cluster"===e.group.type?e.group.members[0].ms:e.group.mark.ms,xPx:e.x,widthPx:e.widthPx,priority:"cluster"===e.group.type?-1:0}))],t,n,Math.max(a-n,Ka),{laneCount:2}),v=new Map(y.map(e=>[e.key,e.lane]));for(const e of x)e.lane=v.get(e.key)??-1,e.left=dl(e.x,e.widthPx,t);const w=x.find(e=>e.key===(h??p)),k=e=>0===e?r.laneA:r.laneB,N=e=>0===e?r.rail-4:r.rail+6+3;/* @__PURE__ */
|
|
350
350
|
return je(Ae,{children:[x.map(e=>{const t=Math.max(0,e.lane),n=Math.round(e.index*s+60);if("cluster"===e.group.type){const a=h===e.key,l=e.group.members.map(e=>e.x),i=()=>{g(null),a||f(null)};/* @__PURE__ */
|
|
351
351
|
return je("div",{children:[
|
|
352
352
|
/* @__PURE__ */je("button",{type:"button","data-timeline-part":"cluster",className:`rosh-tl-pill${yl[e.group.kind]?.token?"":" text-blue-600"}${o?" rosh-tl-fade":""}`,"aria-expanded":a,"aria-controls":d,style:{left:`${e.left}px`,top:`${0===t?r.laneA+r.laneH-19:r.laneB}px`,color:yl[e.group.kind]?.token,...o?{animationDelay:`${n}ms`}:{}},onMouseEnter:()=>{g(e.key),f(e.key)},onMouseLeave:i,onFocus:()=>{g(e.key),f(e.key)},onBlur:i,onClick:()=>{m(a?null:e.key),f(a?null:e.key)},children:[
|
|
@@ -365,11 +365,11 @@ return je("div",{children:[
|
|
|
365
365
|
return je(Ae,{children:[
|
|
366
366
|
/* @__PURE__ */De("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:a.rail-9+"px",height:"24px"},onPointerDown:e=>{k(e),w(v(e.clientX))},onPointerMove:M,onPointerUp:N,onPointerCancel:N}),
|
|
367
367
|
/* @__PURE__ */De("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${dl(f,88,o)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):qa(b,p)}),
|
|
368
|
-
/* @__PURE__ */De("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":x&&x.length>0?x.length-1:C,"aria-valuenow":x&&x.length>0?Math.max(0,y):Math.round((t-l)/Ka),"aria-valuetext":$,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:k,onPointerMove:M,onPointerUp:N,onPointerCancel:N,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(x&&x.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?x[Math.min(e+1,x.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?x[Math.max(e-1,0)]:"Home"===r?x[0]:"End"===r?x[x.length-1]:null}const n=(e.shiftKey?7:1)*Ka;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function Rl(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Wl({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],pending:l=[],fillToMs:i,todayMs:o,labels:s="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:x=!0,ariaLabel:y,highlightKeys:v=null,onHoverChange:w,endMark:k=null}){const N="none"===s,M=B(Date.now,null),$=B(bl,!1),C=o??M,L=fe(null),D=G().timeline,j=Z(),A=e=>qa(e,j),P=fe(null),S=fe(null),z=fe(null),F=fe(/* @__PURE__ */new Map),E=fe(void 0),I=fe(void 0),T=fe(null),[O,R]=ge({}),[W,H]=ge(null),[_,q]=ge(null),[U,V]=ge(null),[Y,X]=ge(null),[J,Q]=ge(null),[ee,te]=ge(null),re=me(),ne=me(),ae=$l(L,!0),le=ae>0?ae-(l.length>0&&!N?176:0):0,ie=le>0&&le-20<320,oe=$l(P,!ie),se=oe>0?oe:600,ce=fl[s],de=N&&l.length>0,ue=de?Math.max(0,se-36):se,he=r=>r>=e-Ka&&r<=t+Ka,be=n.filter(e=>Number.isFinite(e.ms)&&he(e.ms)).slice().sort((e,t)=>e.ms-t.ms),ye="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],ve=cl([e,...[...be.map(e=>e.ms),...ye].filter(r=>r>e&&r<t),t],ue,"compressed"===(we=r)?{}:"spread"===we?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var we;const ke=ve.xByMs,Ne=be.filter(e=>!e.provisional),Me=g??(Ne.length>0?Ne[Ne.length-1].key:null),$e=be.map((e,t)=>{const r=e.date??A(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?vl[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:ke(e.ms),baseX:ke(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:wl(e,a,0===t&&"default"===a),role:e.key===Me?"current":n?"dot":"key",widthPx:N?Math.max(16,xl(e.caption??"")+6):O[e.key]||hl(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),Ce=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&he(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=A(t);return{key:r,ms:t,x:ke(t),baseX:ke(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??yl[e.kind].glyph,role:"key",widthPx:O[r]||hl(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),Le=de?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Ka,x:se,baseX:se,kind:e.kind??"default",label:e.label,dateText:D.notReached,detail:r.length>0?D.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],Pe=N&&k&&!de?[{key:k.key,ms:t,x:ue,baseX:ue,kind:"default",label:k.label,dateText:k.dateText??A(t),detail:k.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Se=[...$e,...Ce,...Le,...Pe].sort((e,t)=>e.x-t.x||e.ms-t.ms),ze=m?.start??D.start(A(e)),Fe=null==ze||!1===ze?0:"string"==typeof ze?Math.ceil(xl(ze)):96,Be="lanes"===s?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),o=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||o)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}(Se):[],Ee=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:ul,members:t})}n=a}return r}(Se),Ie=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Te=/* @__PURE__ */new Map;for(const e of Ee)if("cluster"===e.type)for(const t of e.members)Te.set(t.key,Ie(e));const Oe=U??Y??J,Re=Be.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Oe)??Ee.find(e=>"cluster"===e.type&&Ie(e)===Oe),We=e=>({x:e.baseX,widthPx:e.widthPx}),He=Re&&"cluster"===Re.type?Re.members.map(We):f?Se.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(We):[],Ke=He.length>1?Cl(ve,He,ue):ve,_e=Ke!==ve;if(_e)for(const e of Se)e.isCap||(e.x=Ke.xByMs(e.ms));const qe=Se.some(e=>e.x<14),Ue=_e&&Re?Oe:null,Ve=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ye=ie?Se.map(Ve):Ee.flatMap(e=>{if("item"===e.type)return[Ve(e.mark)];const t=Ie(e);if(t===Ue&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ve);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ze=/* @__PURE__ */new Map;for(const e of Ye)for(const t of e.members)Ze.set(t.key,e.key);const Ge=Ee.find(e=>"cluster"===e.type&&Ie(e)===Ue),Xe=Ge&&"cluster"===Ge.type?{from:Math.min(...Ge.members.map(e=>e.x))-16,to:Math.max(...Ge.members.map(e=>e.x))+16}:null,Je=fe(Ue),[Qe,et]=ge(!1);xe(()=>{if(Je.current===Ue)return;Je.current=Ue,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[Ue]);const tt=Se.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Ml(()=>{const e=S.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}R(e=>function(e,t){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Math.abs((e[r]??0)-(t[r]??0))<.5)}(e,t)?e:t)},[tt]);const rt=`${s}|${r}|${Se.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=ge(rt),lt=x&&nt===rt;xe(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,Se.length-1)),ot=Ll(u?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!ot)return n;let a=ot[0];for(const e of ot)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?st(u.valueMs):null,dt=h&&u?$e.filter(e=>!ot||ot.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const o=l[t],s=l[t+1],c=e.xByMs(o.ms),d=e.xByMs(s.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:ml(350*u/100,450,1400)/n;i.push({fromKey:o.key,toKey:s.key,fromMs:o.ms,toMs:s.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(Ke,dt,{speed:h?.speed,reducedMotion:$}),[ht,mt]=ge(null),pt=fe(null),gt=fe({segments:ut,value:ct,playback:h});xe(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=fe(null),bt=pe(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=pe(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!h?.playing&&!!u;xe(()=>{if(!yt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void xt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(gl(t,0))):xt()},o=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:gl(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:gl(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=gl(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:pl(l),ms:i.ms}};const o=e[t.index+1];return{cursor:o?{index:t.index+1,phase:"rest",t:0,restLeftMs:o.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(o)):xt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[yt,xt,bt]);const vt=$e.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===C?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,C):null,kt=new Set(v??[]),Nt=Se.filter(e=>kt.has(e.key)).map(e=>e.x),Mt=Nt.length>0?{from:Math.min(...Nt),to:Math.max(...Nt)}:null,$t=pe(()=>{clearTimeout(E.current),clearTimeout(I.current),H(null),q(null),V(null),X(null),Q(null)},[]);xe(()=>()=>{clearTimeout(E.current),clearTimeout(I.current)},[]),xe(()=>{const e=T.current;e&&(T.current=null,F.current.get(e)?.focus())});const Ct=null!==_||null!==U||null!==Y||null!==J;xe(()=>{if(Ct)return K(e=>"Escape"===e.key&&($t(),!0))},[Ct,$t]);const Lt=pe((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,se-r)):t;const a=e.parentElement;if(r>0&&a){const t=b(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,o=t.right-8-r-l;i<=o&&(n=Math.max(i,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[se]),Dt=Ye.find(e=>e.key===_)??null,jt=Dt?Dt.x:0;Ml(()=>{Lt(z.current,jt)},[Lt,_,jt]);const At=ct??void 0,Pt=fe(null);xe(()=>{if(void 0===At)return;const e=Ke.xByMs(At),t=Pt.current;if(Pt.current=e,null===t||e<=t)return;const r=[];for(const n of Se){if(n.x<=t||n.x>e)continue;const a=F.current.get(Ze.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[At]);const St=Ye.map(e=>e.key),zt=Me?Ze.get(Me)??null:null,Ft=ee&&St.includes(ee)?ee:zt&&St.includes(zt)?zt:St[0],Bt=e=>{const t=St.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?St.length-1:-1;r<0||r>St.length-1||(e.preventDefault(),te(St[r]),F.current.get(St[r])?.focus())},Et=()=>clearTimeout(I.current),It=e=>{Et(),Q(e)},Tt=()=>{clearTimeout(I.current),I.current=setTimeout(()=>Q(null),260)},Ot=e=>{Ue&&Te.get(e)===Ue?Et():(Et(),Q(null))},Rt=e=>{clearTimeout(E.current),H(e),q(e),w?.((e=>{const t=Ye.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{H(t=>t===e?null:t),clearTimeout(E.current),E.current=setTimeout(()=>q(t=>t===e?null:t),160),w?.(null)},Ht=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Nl(e),"aria-describedby":_===e.key?re:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),te(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),Kt=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=D,r.events(t.length,t.map(Nl))),"aria-describedby":_===e.key?re:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{e.openable?It(e.key):Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{Et(),Rt(e.key),te(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);It(e.key);const r=e.members[0];te(r.key),T.current=r.key}};var t,r},_t="lanes"!==s||Se.length>1;if(ie)/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */De("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":x&&x.length>0?x.length-1:C,"aria-valuenow":x&&x.length>0?Math.max(0,y):Math.round((t-l)/Ka),"aria-valuetext":$,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:k,onPointerMove:M,onPointerUp:N,onPointerCancel:N,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(x&&x.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?x[Math.min(e+1,x.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?x[Math.max(e-1,0)]:"Home"===r?x[0]:"End"===r?x[x.length-1]:null}const n=(e.shiftKey?7:1)*Ka;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function Rl(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Wl({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],pending:l=[],fillToMs:i,todayMs:o,labels:s="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:x=!0,ariaLabel:y,highlightKeys:v=null,onHoverChange:w,endMark:k=null}){const N="none"===s,M=_(Date.now,null),$=_(bl,!1),C=o??M,L=fe(null),D=G().timeline,j=Z(),A=e=>qa(e,j),P=fe(null),S=fe(null),z=fe(null),F=fe(/* @__PURE__ */new Map),B=fe(void 0),E=fe(void 0),T=fe(null),[O,R]=ge({}),[W,H]=ge(null),[K,q]=ge(null),[U,V]=ge(null),[Y,X]=ge(null),[J,Q]=ge(null),[ee,te]=ge(null),re=me(),ne=me(),ae=$l(L,!0),le=ae>0?ae-(l.length>0&&!N?176:0):0,ie=le>0&&le-20<320,oe=$l(P,!ie),se=oe>0?oe:600,ce=fl[s],de=N&&l.length>0,ue=de?Math.max(0,se-36):se,he=r=>r>=e-Ka&&r<=t+Ka,be=n.filter(e=>Number.isFinite(e.ms)&&he(e.ms)).slice().sort((e,t)=>e.ms-t.ms),ye="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],ve=cl([e,...[...be.map(e=>e.ms),...ye].filter(r=>r>e&&r<t),t],ue,"compressed"===(we=r)?{}:"spread"===we?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var we;const ke=ve.xByMs,Ne=be.filter(e=>!e.provisional),Me=g??(Ne.length>0?Ne[Ne.length-1].key:null),$e=be.map((e,t)=>{const r=e.date??A(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?vl[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:ke(e.ms),baseX:ke(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:wl(e,a,0===t&&"default"===a),role:e.key===Me?"current":n?"dot":"key",widthPx:N?Math.max(16,xl(e.caption??"")+6):O[e.key]||hl(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),Ce=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&he(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=A(t);return{key:r,ms:t,x:ke(t),baseX:ke(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??yl[e.kind].glyph,role:"key",widthPx:O[r]||hl(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),Le=de?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Ka,x:se,baseX:se,kind:e.kind??"default",label:e.label,dateText:D.notReached,detail:r.length>0?D.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],Pe=N&&k&&!de?[{key:k.key,ms:t,x:ue,baseX:ue,kind:"default",label:k.label,dateText:k.dateText??A(t),detail:k.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Se=[...$e,...Ce,...Le,...Pe].sort((e,t)=>e.x-t.x||e.ms-t.ms),ze=m?.start??D.start(A(e)),Fe=null==ze||!1===ze?0:"string"==typeof ze?Math.ceil(xl(ze)):96,Be="lanes"===s?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),o=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||o)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}(Se):[],Ee=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:ul,members:t})}n=a}return r}(Se),Te=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ie=/* @__PURE__ */new Map;for(const e of Ee)if("cluster"===e.type)for(const t of e.members)Ie.set(t.key,Te(e));const Oe=U??Y??J,Re=Be.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Oe)??Ee.find(e=>"cluster"===e.type&&Te(e)===Oe),We=e=>({x:e.baseX,widthPx:e.widthPx}),He=Re&&"cluster"===Re.type?Re.members.map(We):f?Se.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(We):[],Ke=He.length>1?Cl(ve,He,ue):ve,_e=Ke!==ve;if(_e)for(const e of Se)e.isCap||(e.x=Ke.xByMs(e.ms));const qe=Se.some(e=>e.x<14),Ue=_e&&Re?Oe:null,Ve=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ye=ie?Se.map(Ve):Ee.flatMap(e=>{if("item"===e.type)return[Ve(e.mark)];const t=Te(e);if(t===Ue&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ve);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ze=/* @__PURE__ */new Map;for(const e of Ye)for(const t of e.members)Ze.set(t.key,e.key);const Ge=Ee.find(e=>"cluster"===e.type&&Te(e)===Ue),Xe=Ge&&"cluster"===Ge.type?{from:Math.min(...Ge.members.map(e=>e.x))-16,to:Math.max(...Ge.members.map(e=>e.x))+16}:null,Je=fe(Ue),[Qe,et]=ge(!1);xe(()=>{if(Je.current===Ue)return;Je.current=Ue,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[Ue]);const tt=Se.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Ml(()=>{const e=S.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}R(e=>function(e,t){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Math.abs((e[r]??0)-(t[r]??0))<.5)}(e,t)?e:t)},[tt]);const rt=`${s}|${r}|${Se.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=ge(rt),lt=x&&nt===rt;xe(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,Se.length-1)),ot=Ll(u?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!ot)return n;let a=ot[0];for(const e of ot)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?st(u.valueMs):null,dt=h&&u?$e.filter(e=>!ot||ot.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const o=l[t],s=l[t+1],c=e.xByMs(o.ms),d=e.xByMs(s.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:ml(350*u/100,450,1400)/n;i.push({fromKey:o.key,toKey:s.key,fromMs:o.ms,toMs:s.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(Ke,dt,{speed:h?.speed,reducedMotion:$}),[ht,mt]=ge(null),pt=fe(null),gt=fe({segments:ut,value:ct,playback:h});xe(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=fe(null),bt=pe(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=pe(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!h?.playing&&!!u;xe(()=>{if(!yt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void xt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(gl(t,0))):xt()},o=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:gl(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:gl(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=gl(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:pl(l),ms:i.ms}};const o=e[t.index+1];return{cursor:o?{index:t.index+1,phase:"rest",t:0,restLeftMs:o.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(o)):xt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[yt,xt,bt]);const vt=$e.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===C?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,C):null,kt=new Set(v??[]),Nt=Se.filter(e=>kt.has(e.key)).map(e=>e.x),Mt=Nt.length>0?{from:Math.min(...Nt),to:Math.max(...Nt)}:null,$t=pe(()=>{clearTimeout(B.current),clearTimeout(E.current),H(null),q(null),V(null),X(null),Q(null)},[]);xe(()=>()=>{clearTimeout(B.current),clearTimeout(E.current)},[]),xe(()=>{const e=T.current;e&&(T.current=null,F.current.get(e)?.focus())});const Ct=null!==K||null!==U||null!==Y||null!==J;xe(()=>{if(Ct)return I(e=>"Escape"===e.key&&($t(),!0))},[Ct,$t]);const Lt=pe((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,se-r)):t;const a=e.parentElement;if(r>0&&a){const t=b(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,o=t.right-8-r-l;i<=o&&(n=Math.max(i,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[se]),Dt=Ye.find(e=>e.key===K)??null,jt=Dt?Dt.x:0;Ml(()=>{Lt(z.current,jt)},[Lt,K,jt]);const At=ct??void 0,Pt=fe(null);xe(()=>{if(void 0===At)return;const e=Ke.xByMs(At),t=Pt.current;if(Pt.current=e,null===t||e<=t)return;const r=[];for(const n of Se){if(n.x<=t||n.x>e)continue;const a=F.current.get(Ze.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[At]);const St=Ye.map(e=>e.key),zt=Me?Ze.get(Me)??null:null,Ft=ee&&St.includes(ee)?ee:zt&&St.includes(zt)?zt:St[0],Bt=e=>{const t=St.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?St.length-1:-1;r<0||r>St.length-1||(e.preventDefault(),te(St[r]),F.current.get(St[r])?.focus())},Et=()=>clearTimeout(E.current),Tt=e=>{Et(),Q(e)},It=()=>{clearTimeout(E.current),E.current=setTimeout(()=>Q(null),260)},Ot=e=>{Ue&&Ie.get(e)===Ue?Et():(Et(),Q(null))},Rt=e=>{clearTimeout(B.current),H(e),q(e),w?.((e=>{const t=Ye.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{H(t=>t===e?null:t),clearTimeout(B.current),B.current=setTimeout(()=>q(t=>t===e?null:t),160),w?.(null)},Ht=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Nl(e),"aria-describedby":K===e.key?re:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),te(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),Kt=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=D,r.events(t.length,t.map(Nl))),"aria-describedby":K===e.key?re:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{e.openable?Tt(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Et(),Rt(e.key),te(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Tt(e.key);const r=e.members[0];te(r.key),T.current=r.key}};var t,r},_t="lanes"!==s||Se.length>1;if(ie)/* @__PURE__ */
|
|
369
369
|
return De("div",{ref:L,children:/* @__PURE__ */De(Pl,{marks:Se.filter(e=>!e.isCap),pending:l,currentKey:Me,todayMs:C,reveal:lt,ariaLabel:y,step:it,nodeProps:Ht,onKeyDown:Bt})});const qt=(e,t)=>null==e||!1===e?null:/* @__PURE__ */De("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:ce.rail-3+"px"},children:e});/* @__PURE__ */
|
|
370
370
|
return je("div",{ref:L,className:"rosh-tl-body"+(l.length>0&&!N?"":" is-solo"),children:[
|
|
371
371
|
/* @__PURE__ */je("div",{className:"flex items-stretch gap-3",children:[N&&qt(ze,!1),
|
|
372
|
-
/* @__PURE__ */De("div",{className:"rosh-tl-stage",style:{height:`${Rl(ce,_t,p.length>0&&!N)}px`},children:/* @__PURE__ */je("div",{ref:P,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Xe)return;const t=P.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Xe.from&&r<=Xe.to?Et():
|
|
372
|
+
/* @__PURE__ */De("div",{className:"rosh-tl-stage",style:{height:`${Rl(ce,_t,p.length>0&&!N)}px`},children:/* @__PURE__ */je("div",{ref:P,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Xe)return;const t=P.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Xe.from&&r<=Xe.to?Et():It()},onMouseLeave:It,children:[!N&&/* @__PURE__ */De(Dl,{marks:Se,innerRef:S}),
|
|
373
373
|
/* @__PURE__ */De(Sl,{axis:Ke,geo:ce,fillTo:wt,reveal:lt,trackPx:ue,tweened:!!u}),de&&
|
|
374
374
|
/* @__PURE__ */De("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${ue}px`,width:se-ue+"px",top:ce.rail+3-1+"px"}}),Mt&&/* @__PURE__ */De("div",{"aria-hidden":"true",className:"rosh-tl-band","data-timeline-part":"highlight",style:{left:Mt.from-10+"px",width:Mt.to-Mt.from+20+"px",top:ce.rail-7+"px",height:"20px"}}),
|
|
375
375
|
/* @__PURE__ */De(jl,{startMs:e,endMs:t,axis:Ke,geo:ce,reveal:lt}),
|
|
@@ -378,7 +378,7 @@ return je("div",{ref:L,className:"rosh-tl-body"+(l.length>0&&!N?"":" is-solo"),c
|
|
|
378
378
|
return De("li",{children:/* @__PURE__ */De("button",{...Ht(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:n,...a}})},e.key);if(!e.mark){const t=e.kind===ul,i=kl(t?"default":e.kind,"key"),o=t?void 0:yl[e.kind]?.glyph;/* @__PURE__ */
|
|
379
379
|
return je("li",{...r(Me)?{"aria-current":"step"}:{},children:[
|
|
380
380
|
/* @__PURE__ */je("button",{...Kt(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(c)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:n,...a},children:[o&&/* @__PURE__ */De(ll,{name:o}),t&&/* @__PURE__ */je("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */je("i",{"aria-hidden":"true",className:"rosh-tl-count"+(lt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:n},children:["×",e.members.length]})]},e.key)}const i=e.mark,o=kl(i.kind,i.role,i.provisional),{glyph:s}=i;/* @__PURE__ */
|
|
381
|
-
return De("li",{...i.key===Me?{"aria-current":"step"}:{},children:/* @__PURE__ */je("button",{...Ht(i),className:`${o.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */De(ll,{name:s}),"current"===i.role&&/* @__PURE__ */De("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */De(
|
|
381
|
+
return De("li",{...i.key===Me?{"aria-current":"step"}:{},children:/* @__PURE__ */je("button",{...Ht(i),className:`${o.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */De(ll,{name:s}),"current"===i.role&&/* @__PURE__ */De("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */De(Il,{groups:Be,trackPx:se,geo:ce,startMs:e,endMs:t,currentKey:Me,hoveredKey:W,reveal:lt,step:it,zoomedKey:Ue,popId:ne,aimBubble:Lt,startCaptionPx:Fe,openCluster:U,setOpenCluster:V,previewCluster:Y,setPreviewCluster:X,setZoomKey:Q}):"active"===s?/* @__PURE__ */De(Tl,{nodes:Ye,trackPx:se,geo:ce,activeKey:c,hoveredKey:W,currentKey:Me}):null,Dt&&/* @__PURE__ */De("div",{ref:z,id:re,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${ce.rail+6+6}px`},onMouseEnter:()=>{Et(),Rt(Dt.key)},onMouseLeave:()=>{It(),Wt(Dt.key)},onFocus:()=>{Et(),Rt(Dt.key)},onBlur:()=>{It(),Wt(Dt.key)},children:Dt.mark?/* @__PURE__ */je(Ae,{children:[
|
|
382
382
|
/* @__PURE__ */De("span",{className:"rosh-tl-name",children:Dt.mark.label}),
|
|
383
383
|
/* @__PURE__ */De("span",{className:"rosh-tl-date",children:Dt.mark.dateText}),Dt.mark.preview?/* @__PURE__ */De("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:Dt.mark.preview}):Dt.mark.detail&&/* @__PURE__ */De("span",{className:"rosh-tl-detail",children:Dt.mark.detail}),(Dt.mark.onOpen??Dt.mark.onClick)&&/* @__PURE__ */De("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(Dt.mark?.onOpen??Dt.mark?.onClick)?.(),children:D.openButton})]}):
|
|
384
384
|
/* @__PURE__ */je("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
|
|
@@ -392,17 +392,17 @@ return je("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",childre
|
|
|
392
392
|
/* @__PURE__ */je("div",{className:"rosh-tl-head",children:[
|
|
393
393
|
/* @__PURE__ */je("div",{className:"rosh-tl-head-main",children:[e&&/* @__PURE__ */De("span",{className:"rosh-tl-ico text-gray-500","aria-hidden":"true",children:e}),
|
|
394
394
|
/* @__PURE__ */De("h4",{className:"rosh-tl-title text-gray-800",children:t}),o.length>0&&/* @__PURE__ */De("p",{className:"rosh-tl-meta text-gray-500",children:o.map((e,t)=>
|
|
395
|
-
/* @__PURE__ */je(Me,{children:[t>0&&/* @__PURE__ */De("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */De("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */De("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Kl({title:e,heading:t,subject:r,milestones:n,summary:a,endDate:l,phaseLabels:i,variant:o="card",edgeCaptions:s,highlightKeys:c=null,onHoverChange:d}){const u=
|
|
396
|
-
return De("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */De(Hl,{icon:/* @__PURE__ */De(il,{}),heading:t??e,subject:r,meta:k,children:L})})}var _l=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),ql=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function Ul(e){if(e.order_qty<=0)return 0;let t=0;for(const r of ql)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function Vl(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Ul(t),0)/t.length}function Yl(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:o,msPerDayOfPlayback:s=500,markers:c=[]}=e,[d,u]=ge(null),h=G().production;xe(()=>{o?u(new Date(o).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=ge(!1),g=fe(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};xe(()=>()=>f(),[]),xe(()=>{f()},[i]);const b=t.map(e=>_a(e.date)).filter(e=>null!=e),x=
|
|
397
|
-
return De("div",{className:"select-none",children:/* @__PURE__ */De(Wl,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:N,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),o(e)},playback:m,edgeCaptions:p,thumb:{valueMs:a,onChange:i,onDragStart:d,stops:k,ariaLabel:b.scrub,valueText:e=>{const t=(e=>y.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${qa(e,x)}`:qa(e,x)}},ariaLabel:b.label(qa(e,x),qa(t,x))})})}function Gl({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,onScrubProgress:l,heading:i,edgeCaptions:o,reportLabel:s=e=>e.progress_number,resetLabel:c,variant:d="card",onPlayStart:u}){const{reports:h,markers:m,poNumber:p,startMs:g,endMs:f,totalLeadDays:b,scrubMs:x,setScrubMs:y,displayed:v,scrubbedAway:w,resetToCurrent:k,currentReportId:N,currentReportProgressNumber:M,estCompletionMs:$}=e,C=function(e,t,r){const[n,a]=ge(!1),l=fe(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),l.current||(l.current=!0,t(e[0])),a(!0))},stop:()=>{l.current=!1,a(!1)}}}(h.map(e=>_a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),y,u),L=G().production,D=Z(),j=i??L.heading,A=e=>qa(e,D);if(0===h.length&&0===m.length)return null;const P=m.filter(e=>"shipment"===e.kind),S=m.filter(e=>"inspection"===e.kind),z=m.filter(e=>"invoice"===e.kind),F=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),B=v?Vl(v):0,E=h.find(e=>e.id===N),
|
|
395
|
+
/* @__PURE__ */je(Me,{children:[t>0&&/* @__PURE__ */De("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */De("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */De("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Kl({title:e,heading:t,subject:r,milestones:n,summary:a,endDate:l,phaseLabels:i,variant:o="card",edgeCaptions:s,highlightKeys:c=null,onHoverChange:d}){const u=_(Date.now,null),h=[],m=[],p=G().timeline,g=Z();for(const e of n){const t=_a(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=_a(l??null);let b,x,y=!0;0===h.length?(x=f??u??0,b=x-30*Ka,y=null!==f||null!==u):(b=h[0].ms,x=f??h[h.length-1].ms,x-b<Ka&&(x=b+Ka));const v=h.length>0?Math.max(0,Math.round((x-b)/Ka)):0,w=a??(v>0?p.duration(v):void 0),k=[h.length>0?p.started(qa(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,n.length):void 0],N=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),M={};for(const e of h)e.phase&&(M[e.phase]=M[e.phase]||[]).push(e.ms);const $=Object.entries(M).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),C="rail"===o,L=y&&/* @__PURE__ */De("div",{className:"select-none",children:/* @__PURE__ */De(Wl,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:N,pending:m,phases:$,startMs:b,endMs:x,todayMs:u??void 0,edgeCaptions:s,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
|
|
396
|
+
return De("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */De(Hl,{icon:/* @__PURE__ */De(il,{}),heading:t??e,subject:r,meta:k,children:L})})}var _l=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),ql=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function Ul(e){if(e.order_qty<=0)return 0;let t=0;for(const r of ql)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function Vl(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Ul(t),0)/t.length}function Yl(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:o,msPerDayOfPlayback:s=500,markers:c=[]}=e,[d,u]=ge(null),h=G().production;xe(()=>{o?u(new Date(o).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=ge(!1),g=fe(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};xe(()=>()=>f(),[]),xe(()=>{f()},[i]);const b=t.map(e=>_a(e.date)).filter(e=>null!=e),x=_(Date.now,null)??Math.max(0,...b,...c.map(e=>_a(e.date)??0),_a(r??null)??0,_a(n??null)??0),y=b.length?Math.min(...b):x,v=b.length?Math.max(...b):x,w=_a(r??null)??y,k=_a(n??null)??0,N=_l.has((a||"").toLowerCase()),M=c.reduce((e,t)=>{const r=_a(t.date);return null!=r&&r>e?r:e},0),$=(()=>{const e=[k,v,M,w+Ka];return N||e.push(x),Math.max(...e)})(),C=Math.max(1,Math.round(($-w)/Ka)),L=_a(o??null)??v??w,D=Math.min(Math.max(d??L,w),$),j=t.find(e=>{const t=_a(e.date);return null!=t&&t<=D})??null;let A=null;for(let e=t.length-1;e>=0;e--){const r=_a(t[e].date);if(null!=r&&r>D){A=t[e];break}}const P=(()=>{if(j||!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:n??null,created_by_name:"",notes:""}})(),S=j??P,z=j?_a(j.date):P?w:null,F=A?_a(A.date):null,B=!!(S&&A&&null!=z&&null!=F&&D>z&&D<F);let E,T;if(B&&null!=z&&null!=F){const e=(D-z)/Math.max(F-z,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of S?.items??[])r[e.part_number]=e;const n={};for(const e of A?.items??[])n[e.part_number]=e;const a=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const l=r[e]??{},i=n[e]??{},o=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:l.description??i.description??"",order_qty:o(l.order_qty??i.order_qty??0),casting:t(o(l.casting),o(i.casting)),cnc:t(o(l.cnc),o(i.cnc)),painting:t(o(l.painting),o(i.painting)),packing:t(o(l.packing),o(i.packing)),finished_goods:t(o(l.finished_goods),o(i.finished_goods)),stock_qty:t(o(l.stock_qty),o(i.stock_qty))}}),l=_a(S?.est_completion_date),i=_a(A?.est_completion_date);let o;o=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):S?.est_completion_date||A?.est_completion_date||null,E={id:`interp-${D}`,progress_number:h.estimated,date:new Date(D).toISOString().slice(0,10),created_by_name:"",est_completion_date:o,items:a,notes:""},T=S}else if(E=S??t[t.length-1]??null,E){const e=t.findIndex(e=>e.id===E.id);T=e>=0&&e<t.length-1?t[e+1]:null}else T=null;const I={};for(const e of T?.items??[])I[e.part_number]=e;const O=!(!i||E?.id===i),R=i?Math.min(_a(o??null)??$,$):$,W=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:$,totalLeadDays:C,scrubMs:D,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),o&&u(new Date(o).getTime())},scrubbedAway:O,beforeAnchor:S,nextAfter:A,displayed:E,prevReport:T,prevByPN:I,isInterpolated:B,playing:m,startPlay:()=>{if(m)return void f();if(R<=w)return void u(R);p(!0),u(w);let e=performance.now(),t=w;const r=n=>{const a=n-e;if(e=n,t+=a/s*Ka,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:_a(n??null)}}function Zl({startMs:e,endMs:t,reports:r,markers:n,valueMs:a,activeId:l,onChange:i,onPickReport:o,onOpenReport:s,onOpenMarker:c,onDragStart:d,renderReportPreview:u,reportLabel:h,playback:m,edgeCaptions:p,bare:g=!1,endMark:f=null}){const b=G().production,x=Z(),y=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),v=y.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:h(e),preview:e.preview??u?.(e),onOpen:s?()=>s(e.id):void 0})),w=new Map(y.map(({report:e,ms:t})=>[e.id,t])),k=y.map(({ms:e})=>e),N=c?n.map(e=>({...e,onOpen:c})):n;/* @__PURE__ */
|
|
397
|
+
return De("div",{className:"select-none",children:/* @__PURE__ */De(Wl,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:N,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),o(e)},playback:m,edgeCaptions:p,thumb:{valueMs:a,onChange:i,onDragStart:d,stops:k,ariaLabel:b.scrub,valueText:e=>{const t=(e=>y.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${qa(e,x)}`:qa(e,x)}},ariaLabel:b.label(qa(e,x),qa(t,x))})})}function Gl({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,onScrubProgress:l,heading:i,edgeCaptions:o,reportLabel:s=e=>e.progress_number,resetLabel:c,variant:d="card",onPlayStart:u}){const{reports:h,markers:m,poNumber:p,startMs:g,endMs:f,totalLeadDays:b,scrubMs:x,setScrubMs:y,displayed:v,scrubbedAway:w,resetToCurrent:k,currentReportId:N,currentReportProgressNumber:M,estCompletionMs:$}=e,C=function(e,t,r){const[n,a]=ge(!1),l=fe(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),l.current||(l.current=!0,t(e[0])),a(!0))},stop:()=>{l.current=!1,a(!1)}}}(h.map(e=>_a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),y,u),L=G().production,D=Z(),j=i??L.heading,A=e=>qa(e,D);if(0===h.length&&0===m.length)return null;const P=m.filter(e=>"shipment"===e.kind),S=m.filter(e=>"inspection"===e.kind),z=m.filter(e=>"invoice"===e.kind),F=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),B=v?Vl(v):0,E=h.find(e=>e.id===N),T=E?s(E):M,I=
|
|
398
398
|
/* @__PURE__ */je("button",{type:"button",onClick:C.toggle,"aria-pressed":C.playing,title:C.playing?L.pause:L.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[C.playing?/* @__PURE__ */De("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M2 1.5h2.3v7H2zM5.7 1.5H8v7H5.7z"})}):/* @__PURE__ */De("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M2 1.2 8.4 5 2 8.8z"})}),
|
|
399
|
-
/* @__PURE__ */De("span",{children:C.playing?L.pause:L.play})]}),O=w&&(c??
|
|
399
|
+
/* @__PURE__ */De("span",{children:C.playing?L.pause:L.play})]}),O=w&&(c??T)?/* @__PURE__ */De("button",{type:"button",onClick:()=>{C.stop(),k()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(T))}):null,[R,W]=re(L.showing),H=e=>/* @__PURE__ */De("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */je(Ae,{children:[e&&R,
|
|
400
400
|
/* @__PURE__ */De("b",{className:"font-medium",children:s(v)}),e&&W,
|
|
401
401
|
/* @__PURE__ */je("span",{className:"text-gray-500",children:[" · ",A(new Date(v.date).getTime())," · ",L.overall(Math.round(B))," · ",L.inStock(F)]})]}):/* @__PURE__ */De("span",{className:"text-gray-500",children:L.noReport})});if("rail"===d){const e=null!=$&&$>=f&&f>g,i=e?{key:"__estimate__",label:L.estimatedCompletion,dateText:A($)}:null;/* @__PURE__ */
|
|
402
402
|
return je("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
403
403
|
/* @__PURE__ */De(Zl,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:{start:o?.start??L.start,end:o?.end??(e?L.estDone:void 0)},onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}}),
|
|
404
|
-
/* @__PURE__ */je("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[
|
|
405
|
-
return De("div",{className:"shrink-0",children:/* @__PURE__ */De(Hl,{icon:/* @__PURE__ */De(ol,{}),heading:j,subject:p,meta:[`${A(g)} → ${A(f)}`,L.leadTime(b)],actions:/* @__PURE__ */je(Ae,{children:[O,
|
|
404
|
+
/* @__PURE__ */je("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[I,O,H(!1)]})]})}/* @__PURE__ */
|
|
405
|
+
return De("div",{className:"shrink-0",children:/* @__PURE__ */De(Hl,{icon:/* @__PURE__ */De(ol,{}),heading:j,subject:p,meta:[`${A(g)} → ${A(f)}`,L.leadTime(b)],actions:/* @__PURE__ */je(Ae,{children:[O,I]}),footer:/* @__PURE__ */je(Ae,{children:[H(!0),
|
|
406
406
|
/* @__PURE__ */je("div",{className:"rosh-tl-legend",children:[h.length>0&&/* @__PURE__ */je("span",{className:"border-gray-200 text-gray-500",children:[
|
|
407
407
|
/* @__PURE__ */De("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),P.length>0&&/* @__PURE__ */je("span",{className:"border-gray-200 text-gray-500",children:[
|
|
408
408
|
/* @__PURE__ */De("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */De(ll,{name:"truck"})}),L.shipment]}),S.length>0&&/* @__PURE__ */je("span",{className:"border-gray-200 text-gray-500",children:[
|
|
@@ -470,7 +470,7 @@ return je("button",{type:l,onClick:t,disabled:a,title:o,className:`w-full inline
|
|
|
470
470
|
/* @__PURE__ */De("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function gi(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 py-1.5 pl-2.5 pr-2.5 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function fi({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:o=0}){const s=Ba(i,"SidebarNavItem"),c=G().severity,d=s?(h=c,(u=s).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */je(Ae,{children:[null!=a&&/* @__PURE__ */De("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4 "+(r?"text-blue-600":"text-gray-400"),children:a}),s&&
|
|
471
471
|
/* @__PURE__ */De("span",{"aria-hidden":"true",title:d,className:`shrink-0 h-1.5 w-1.5 rounded-full ${s.fill}`}),
|
|
472
472
|
/* @__PURE__ */De("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),s&&/* @__PURE__ */De("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */De("span",{className:mi(r),children:t}),null!=l&&/* @__PURE__ */De("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
|
|
473
|
-
return De("button",1===o?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */De("span",{className:gi(r),children:m})}:{type:"button",onClick:n,className:"flex w-full items-center justify-between gap-2 rounded-lg px-2.5 py-1.5 text-sm text-left "+(r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:m})}function bi({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=me(),[i,o]=
|
|
473
|
+
return De("button",1===o?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */De("span",{className:gi(r),children:m})}:{type:"button",onClick:n,className:"flex w-full items-center justify-between gap-2 rounded-lg px-2.5 py-1.5 text-sm text-left "+(r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:m})}function bi({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=me(),[i,o]=q(()=>{if(a){let e=null;try{e=window.localStorage.getItem(a)}catch{}if("1"===e||"0"===e)return"1"===e}return n},n),s=!i&&ve.toArray(r).some(e=>we(e)&&!0===e.props.active);/* @__PURE__ */
|
|
474
474
|
return je("div",{children:[
|
|
475
475
|
/* @__PURE__ */je("button",{type:"button",onClick:()=>{const e=!i;if(o(e),a)try{window.localStorage.setItem(a,e?"1":"0")}catch{}},"aria-expanded":i,"aria-controls":l,className:"flex w-full items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm font-medium text-left "+(s?"bg-blue-50 text-blue-700":"text-gray-800 hover:bg-gray-100"),children:[
|
|
476
476
|
/* @__PURE__ */De("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
@@ -479,18 +479,18 @@ return je("div",{children:[
|
|
|
479
479
|
return je("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[n&&/* @__PURE__ */De("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:n}),
|
|
480
480
|
/* @__PURE__ */De("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const n=e.key===t;/* @__PURE__ */
|
|
481
481
|
return je("button",{type:"button",disabled:e.disabled,"aria-current":n?"page":void 0,onClick:()=>!e.disabled&&r?.(e.key),className:"relative inline-flex items-center gap-1.5 px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40 "+(n?"text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.icon&&/* @__PURE__ */De("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
482
|
-
/* @__PURE__ */De("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */De("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-1.5 text-[11px] font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */De("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */De("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var yi=/(^|[\s:])!?z-/,vi=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function wi({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:o="",minWidth:s=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=ge(!1),[g,f]=ge(-1),x=fe(null),w=fe(null),k=fe(null),N=fe({text:"",at:0})
|
|
483
|
-
return De("div",{role:"separator",children:/* @__PURE__ */De(
|
|
484
|
-
return De("div",{id:`${
|
|
485
|
-
return je("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),...
|
|
486
|
-
/* @__PURE__ */De(
|
|
487
|
-
return je("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>T(e),...
|
|
488
|
-
/* @__PURE__ */De(
|
|
489
|
-
return je("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>T(e),...
|
|
482
|
+
/* @__PURE__ */De("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */De("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-1.5 text-[11px] font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */De("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */De("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var yi=/(^|[\s:])!?z-/,vi=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function wi({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:o="",minWidth:s=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=ge(!1),[g,f]=ge(-1),x=fe(null),w=fe(null),k=fe(null),N=fe({text:"",at:0}),M=me(),$=me(),C=u??$,L=pe(e=>{p(!1),e&&w.current?.focus()},[]),D=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(vi(t[l]))return l}return-1},A=()=>k.current?.closest("[data-popup-menu-tree]")??null;xe(()=>{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=O(()=>L(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,L]);const P=pe(()=>{const e=A(),t=w.current;if(!e||!t)return;const a=e.style;a.left="0px",a.top="0px",a.maxWidth="none",a.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=y({trigger:t.getBoundingClientRect(),menu:l,bounds:b(t),align:r,side:n});a.left=`${i.left}px`,a.top=`${i.top}px`,a.maxWidth=`${i.maxWidth}px`,a.maxHeight=`${i.maxHeight}px`,a.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,n]);W(()=>{m&&P()}),xe(()=>{if(m)return v(()=>w.current,P)},[m,P]),xe(()=>{if(!m)return;const e=k.current,r=vi(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),xe(()=>{if(m)return I(e=>"Escape"===e.key&&(L(!0),!0),()=>k.current)},[m,L]);const E=e=>{f(e),p(!0)},T=e=>{e.disabled||(L(!0),e.onSelect())},H=c??"a",K=(e,t)=>({"data-dropdown-index":e,tabIndex:e===g?0:-1,onMouseEnter:()=>{t.disabled||f(e)}}),_=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
|
|
483
|
+
return De("div",{role:"separator",children:/* @__PURE__ */De(S,{})},e.key);if("label"===e.type)/* @__PURE__ */
|
|
484
|
+
return De("div",{id:`${M}-label-${t}`,children:/* @__PURE__ */De(z,{children:e.label})},e.key);if("checkbox"===e.type){const r=F(!1,e.disabled,"");/* @__PURE__ */
|
|
485
|
+
return je("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),...K(t,e),children:[
|
|
486
|
+
/* @__PURE__ */De(B,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=F(!1,e.disabled,"");/* @__PURE__ */
|
|
487
|
+
return je("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>T(e),...K(t,e),children:[
|
|
488
|
+
/* @__PURE__ */De(B,{kind:"radio",checked:e.checked}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=F(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */je("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...K(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */je(H,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>L(!0),...K(t,e),children:[e.icon,e.label]},e.key)}const r=F(e.danger,e.disabled,"");/* @__PURE__ */
|
|
489
|
+
return je("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>T(e),...K(t,e),children:[e.icon,e.label]},e.key)},q={...yi.test(o)?{}:{zIndex:R.popup},minWidth:s};/* @__PURE__ */
|
|
490
490
|
return je("div",{ref:x,className:`relative inline-flex ${l}`.trim(),children:[
|
|
491
|
-
/* @__PURE__ */De("button",{ref:w,id:
|
|
492
|
-
/* @__PURE__ */De(
|
|
493
|
-
return De(
|
|
491
|
+
/* @__PURE__ */De("button",{ref:w,id:C,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?M:void 0,"aria-label":a,"aria-describedby":h,disabled:d,onClick:()=>m?L(!1):E(D(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),E(D(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),E(D(t.length-1,-1)))},className:i??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60",children:e}),m&&
|
|
492
|
+
/* @__PURE__ */De(j,{portal:!0,className:o,style:q,children:/* @__PURE__ */De("div",{ref:k,id:M,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:C,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f(D(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f(D(g-1,-1));else if("Home"===e.key)e.preventDefault(),f(D(0,1));else if("End"===e.key)e.preventDefault(),f(D(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),L(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),n=e.key.toLowerCase(),a=r-N.current.at<500?N.current.text+n:n;N.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?g+1:Math.max(g,0),s=k.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(vi(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void f(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(_(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(_(t[r],r)),r+=1;const o="label"===t[l-1]?.type?`${M}-label-${l-1}`:void 0;e.push(/* @__PURE__ */De("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()})})]})}function ki(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function Ni({at:e,onClose:t,children:r,owner:n,"aria-label":a,minWidth:l=180,className:i="",autoFocus:o=!0}){const s=fe(null),[c,d]=ge(null),u=fe(t);u.current=t,W(()=>{const t=s.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},a=N({point:e,menu:r,bounds:b(n??null)});d(e=>e&&e.left===a.left&&e.top===a.top&&e.maxHeight===a.maxHeight?e:{left:a.left,top:a.top,maxHeight:a.maxHeight,scroll:r.height>a.maxHeight})},[e.x,e.y,n]);const h=fe(null),m=fe(!1);xe(()=>(h.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!s.current?.contains(e)||h.current?.focus?.({preventScroll:!0})}),[]),xe(()=>{c&&!m.current&&o&&(m.current=!0,ki(s.current)[0]?.focus({preventScroll:!0}))},[c,o]),xe(()=>{if(o)return;const e=e=>{if(s.current?.contains(document.activeElement))return;const t=ki(s.current),r="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;r&&(e.preventDefault(),r.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[o]),xe(()=>I(e=>"Escape"===e.key&&(u.current(),!0),()=>s.current),[]),xe(()=>{const e=()=>u.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const p=pe(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void u.current();const t=ki(s.current);if(0===t.length)return;const r=t.indexOf(document.activeElement),n="ArrowDown"===e.key?(r+1)%t.length:"ArrowUp"===e.key?r<=0?t.length-1:r-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;n<0||(e.preventDefault(),t[n].focus())},[]),g=c?{left:c.left,top:c.top,maxHeight:c.maxHeight,...c.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
|
|
493
|
+
return De(j,{portal:!0,minWidth:l,style:g,onClose:t,className:i,children:/* @__PURE__ */De(A.Provider,{value:!0,children:/* @__PURE__ */De("div",{ref:s,role:"menu","aria-label":a,"data-context-menu":"",onKeyDown:p,children:r})})})}function Mi(){const[e,t]=ge(null),r=pe(()=>t(null),[]),n=pe((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(P(n))return!1;e.preventDefault();const a=e.target instanceof Element?e.target:null;let{clientX:l,clientY:i}=e;if(0===l&&0===i&&a){const e=a.getBoundingClientRect();l=e.left,i=e.bottom}return t({x:l,y:i,data:r,owner:a}),!0},[]),a=pe(e=>{n(e,void 0)},[n]);return{open:n,onContextMenu:a,close:r,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:r}}}var $i="Alt+ArrowUp Alt+ArrowDown";function Ci(e){return!e.altKey||e.ctrlKey||e.metaKey?null:"ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":null}var Li=/* @__PURE__ */je("svg",{"aria-hidden":"true",viewBox:"0 0 8 14",fill:"currentColor",className:"h-3.5 w-2",children:[
|
|
494
494
|
/* @__PURE__ */De("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
495
495
|
/* @__PURE__ */De("circle",{cx:"6",cy:"3",r:"1.1"}),
|
|
496
496
|
/* @__PURE__ */De("circle",{cx:"2",cy:"7",r:"1.1"}),
|
|
@@ -498,7 +498,7 @@ return De(M,{portal:!0,minWidth:l,style:g,onClose:t,className:i,children:/* @__P
|
|
|
498
498
|
/* @__PURE__ */De("circle",{cx:"2",cy:"11",r:"1.1"}),
|
|
499
499
|
/* @__PURE__ */De("circle",{cx:"6",cy:"11",r:"1.1"})]});function Di({hint:e,dragging:t,revealClassName:r,marker:n}){const a=G().tree;/* @__PURE__ */
|
|
500
500
|
return De(f,{content:e??a.dragHint,side:"left",delay:700,className:"absolute left-0 top-1/2 inline-flex -translate-y-1/2 transition-opacity "+(t?"opacity-0":`opacity-0 ${r}`),children:/* @__PURE__ */De("span",{"aria-hidden":"true",[`data-${n}-grip`]:"",className:"flex h-4 w-2 items-center justify-center text-gray-400",children:Li})})}function ji({id:e}){/* @__PURE__ */
|
|
501
|
-
return De("span",{id:e,hidden:!0,children:G().tree.moveHint})}var Ai='[role="treeitem"]';function Pi(e){return[...e.querySelectorAll(Ai)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function Si({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=fe(null);
|
|
501
|
+
return De("span",{id:e,hidden:!0,children:G().tree.moveHint})}var Ai='[role="treeitem"]';function Pi(e){return[...e.querySelectorAll(Ai)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function Si({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=fe(null);W(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(Ai)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??Pi(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=pe(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(Ai);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const n=Pi(t),i=n.indexOf(r),o=Number(r.getAttribute("aria-level")??"1"),s=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(Ai))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":s(n[i+1]);break;case"ArrowUp":s(n[i-1]);break;case"Home":s(n[0]);break;case"End":s(n[n.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=n[i+1];t&&Number(t.getAttribute("aria-level")??"1")>o?s(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(n[e].getAttribute("aria-level")??"1")<o){s(n[e]);break}}},[a]);/* @__PURE__ */
|
|
502
502
|
return De("div",{...a,ref:l,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${n}`.trim(),children:r})}function zi({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
503
503
|
return De("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}function Fi({children:e}){/* @__PURE__ */
|
|
504
504
|
return De("div",{role:"presentation",className:"px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e})}var Bi={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function Ei({label:e,level:t=1,icon:r,preview:n,selected:a=!1,expanded:l,onToggle:i,onSelect:o,muted:s=!1,badge:c,actions:d,actionsPinned:u=!1,actionsOverlay:h=!0,rename:m,drop:p,dragging:g=!1,draggable:f=!1,dragHint:b,onMove:x,rowProps:y,className:v=""}){const w=void 0!==l,k=me(),N=[y?.["aria-describedby"],x?k:void 0].filter(Boolean).join(" ")||void 0,M=a?"bg-blue-50 text-blue-700":"into"===p?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
|
|
@@ -509,16 +509,16 @@ return je("div",{...y,role:"treeitem","aria-level":t,"aria-selected":a,"aria-exp
|
|
|
509
509
|
/* @__PURE__ */je("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:Bi,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(u||s||a?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
|
|
510
510
|
/* @__PURE__ */De("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
511
511
|
/* @__PURE__ */De("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
512
|
-
/* @__PURE__ */De("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:d})]}),x&&/* @__PURE__ */De(ji,{id:k})]});var $}function
|
|
512
|
+
/* @__PURE__ */De("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:d})]}),x&&/* @__PURE__ */De(ji,{id:k})]});var $}function Ti({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=G().tree,l=r?a.dropHere:t??a.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
|
|
513
513
|
return De("div",{...n,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */je("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
|
|
514
|
-
/* @__PURE__ */De("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */De("span",{className:i,children:l})})}function
|
|
514
|
+
/* @__PURE__ */De("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */De("span",{className:i,children:l})})}function Ii({onInsert:e,label:t,drop:r=!1,seamProps:n}){const a=G().tree,l=t??a.insertHere,i=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
|
|
515
515
|
return je("div",{...n,role:"presentation","data-tree-seam":"","data-drop":r||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${n?.className??""}`.trim(),children:[
|
|
516
516
|
/* @__PURE__ */De("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
517
517
|
/* @__PURE__ */De("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${i}`}),e&&/* @__PURE__ */De(f,{content:l,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */De("button",{type:"button","aria-label":l,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */De("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,className:"h-3 w-3",children:/* @__PURE__ */De("path",{strokeLinecap:"round",d:"M12 5v14M5 12h14"})})})})]})}var Oi=ye("compact");function Ri({"aria-label":e,"aria-labelledby":t,children:r,spacing:n="compact",className:a="",rootProps:l}){/* @__PURE__ */
|
|
518
|
-
return De(Oi.Provider,{value:n,children:/* @__PURE__ */De("div",{...l,role:"list","aria-label":t?void 0:e,"aria-labelledby":t,"data-sortable-list":n,className:`flex min-w-0 flex-col ${"comfortable"===n?"gap-2":"gap-1"} ${a}`.trim(),children:r})})}function Wi({children:e,actions:t,below:r,active:n=!1,flat:a=!1,draggable:l=!1,dragHint:i,dragging:o=!1,drop:s,onMove:c,rowProps:d,rowRef:u,className:h=""}){const m=Ne(Oi),p=fe(null),g=me(),f=[d?.["aria-describedby"],c?g:void 0].filter(Boolean).join(" ")||void 0,b=d?.tabIndex;
|
|
518
|
+
return De(Oi.Provider,{value:n,children:/* @__PURE__ */De("div",{...l,role:"list","aria-label":t?void 0:e,"aria-labelledby":t,"data-sortable-list":n,className:`flex min-w-0 flex-col ${"comfortable"===n?"gap-2":"gap-1"} ${a}`.trim(),children:r})})}function Wi({children:e,actions:t,below:r,active:n=!1,flat:a=!1,draggable:l=!1,dragHint:i,dragging:o=!1,drop:s,onMove:c,rowProps:d,rowRef:u,className:h=""}){const m=Ne(Oi),p=fe(null),g=me(),f=[d?.["aria-describedby"],c?g:void 0].filter(Boolean).join(" ")||void 0,b=d?.tabIndex;W(()=>{const e=p.current;if(!e||void 0!==b)return;const t=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(t=>t!==e);c&&!t?e.tabIndex=0:e.removeAttribute("tabindex")});/* @__PURE__ */
|
|
519
519
|
return je("div",{role:"listitem","data-list-item":"","data-drop":s,className:"relative flex min-w-0 flex-col",children:[s&&/* @__PURE__ */De("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${("comfortable"===m?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"})[s]}`}),
|
|
520
520
|
/* @__PURE__ */je("div",{...d,ref:e=>{var t,r;p.current=e,r=e,"function"==typeof(t=u)?t(r):t&&(t.current=r)},"data-list-row":"","data-active":n||void 0,"data-draggable":l||void 0,"aria-keyshortcuts":d?.["aria-keyshortcuts"]??(c?$i:void 0),"aria-describedby":f,onKeyDown:e=>{if(d?.onKeyDown?.(e),e.defaultPrevented||!c)return;const t=Ci(e);t&&!e.target.closest?.("select")&&(e.preventDefault(),c(t))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md pl-3 text-sm",l?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=t&&!1!==t?"":"pr-2",n?"bg-gray-100":a?"":"hover:bg-gray-100",o?"opacity-40":"",h].filter(Boolean).join(" "),children:[l&&/* @__PURE__ */De(Di,{marker:"list",hint:i,dragging:o,revealClassName:"group-hover/listrow:opacity-100 group-focus-within/listrow:opacity-100"}),
|
|
521
|
-
/* @__PURE__ */De("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:e}),null!=t&&!1!==t&&/* @__PURE__ */De("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:t}),c&&/* @__PURE__ */De(ji,{id:g})]}),null!=r&&!1!==r&&/* @__PURE__ */De("div",{"data-list-below":"",children:r})]})}var Hi=ye({labels:"none",shown:"none"}),Ki="button[data-icon-rail-button]:not([disabled])";function _i(e,t,r){const n=getComputedStyle(e),a=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),l="horizontal"===t?(parseFloat(n.columnGap)||0)*Math.max(0,r-1):0,i=e.parentElement;let o=1/0;if(i){const e=getComputedStyle(i);o=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:a+l,room:o}}function qi({"aria-label":e,orientation:t="vertical",children:r,className:n="",labels:a="none",labelsFit:l=!1,onLabelsShown:i}){const o=fe(null),s="none"!==a&&l,[c,d]=ge(null),u="none"===a?"none":s?c??"none":"all",h=fe(()=>{});h.current=()=>{const e=o.current;if(!e||!s)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const r=getComputedStyle(e),n=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a=parseFloat(r.minWidth)||0,l=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(a,n+l),worded:"below"===t?Math.max(a,n+Math.max(l,i)):Math.max(a,n+l+6+i),active:"true"===e.getAttribute("aria-pressed")}})}(e,a);d(function({buttons:e,orientation:t,chrome:r,room:n}){if(0===e.length)return"none";const a=n=>{const a=e.map(e=>n(e)?e.worded:e.bare);return r+("horizontal"===t?a.reduce((e,t)=>e+t,0):Math.max(...a))};return a(()=>!0)<=n+.5?"all":e.some(e=>e.active)&&a(e=>e.active)<=n+.5?"chosen":"none"}({buttons:r,orientation:t,..._i(e,t,r.length)}))},
|
|
521
|
+
/* @__PURE__ */De("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:e}),null!=t&&!1!==t&&/* @__PURE__ */De("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:t}),c&&/* @__PURE__ */De(ji,{id:g})]}),null!=r&&!1!==r&&/* @__PURE__ */De("div",{"data-list-below":"",children:r})]})}var Hi=ye({labels:"none",shown:"none"}),Ki="button[data-icon-rail-button]:not([disabled])";function _i(e,t,r){const n=getComputedStyle(e),a=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),l="horizontal"===t?(parseFloat(n.columnGap)||0)*Math.max(0,r-1):0,i=e.parentElement;let o=1/0;if(i){const e=getComputedStyle(i);o=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:a+l,room:o}}function qi({"aria-label":e,orientation:t="vertical",children:r,className:n="",labels:a="none",labelsFit:l=!1,onLabelsShown:i}){const o=fe(null),s="none"!==a&&l,[c,d]=ge(null),u="none"===a?"none":s?c??"none":"all",h=fe(()=>{});h.current=()=>{const e=o.current;if(!e||!s)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const r=getComputedStyle(e),n=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a=parseFloat(r.minWidth)||0,l=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(a,n+l),worded:"below"===t?Math.max(a,n+Math.max(l,i)):Math.max(a,n+l+6+i),active:"true"===e.getAttribute("aria-pressed")}})}(e,a);d(function({buttons:e,orientation:t,chrome:r,room:n}){if(0===e.length)return"none";const a=n=>{const a=e.map(e=>n(e)?e.worded:e.bare);return r+("horizontal"===t?a.reduce((e,t)=>e+t,0):Math.max(...a))};return a(()=>!0)<=n+.5?"all":e.some(e=>e.active)&&a(e=>e.active)<=n+.5?"chosen":"none"}({buttons:r,orientation:t,..._i(e,t,r.length)}))},W(()=>{h.current()}),xe(()=>{const e=o.current?.parentElement;if(!s||!e)return;let t=!0;const r=()=>{t&&h.current()},n="undefined"==typeof ResizeObserver?void 0:ResizeObserver,a=n?new n(r):null;return a?.observe(e),document.fonts?.ready.then(r,()=>{}),()=>{t=!1,a?.disconnect()}},[s]);const m=fe(null),p=fe(i);p.current=i,xe(()=>{s&&null!==c&&m.current!==c&&(m.current=c,p.current?.(c))},[s,c]),W(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(Ki)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===r?0:-1});/* @__PURE__ */
|
|
522
522
|
return De("div",{ref:o,role:"toolbar","aria-label":e,"aria-orientation":t,"data-orientation":t,onKeyDown:e=>{const r=o.current;if(!r)return;const n=[...r.querySelectorAll(Ki)],a=n.indexOf(e.target);if(a<0)return;const l="vertical"===t?"ArrowUp":"ArrowLeft",i="vertical"===t?"ArrowDown":"ArrowRight",s=e.key===i?(a+1)%n.length:e.key===l?(a-1+n.length)%n.length:"Home"===e.key?0:"End"===e.key?n.length-1:-1;if(!(s<0)){e.preventDefault();for(const e of n)e.tabIndex=e===n[s]?0:-1;n[s].focus()}},"data-labels":"none"===a?void 0:a,"data-labels-shown":"none"===a?void 0:u,className:`flex gap-1 ${"vertical"===t?"flex-col items-center":"flex-row items-center"} ${n}`.trim(),children:/* @__PURE__ */De(Hi.Provider,{value:{labels:a,shown:u},children:r})})}function Ui({label:e,icon:t,active:r,disabled:n,onClick:a,badge:l,tooltipSide:i="right",className:o=""}){const s=!0===r,{labels:c,shown:d}=Ne(Hi),u=void 0===l||!1===l||0===l?t:/* @__PURE__ */De(Gn,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:t}),h="none"!==c,m=h&&("all"===d||"chosen"===d&&s),p=/* @__PURE__ */De("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof r?r:void 0,disabled:n,onClick:n?void 0:a,className:[`relative inline-flex ${h?"beside"===c?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",s?"bg-blue-50 text-blue-700":"text-gray-600 hover:bg-gray-100 hover:text-gray-900",o].filter(Boolean).join(" "),children:h?/* @__PURE__ */je(Ae,{children:[
|
|
523
523
|
/* @__PURE__ */De("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:u}),
|
|
524
524
|
/* @__PURE__ */De("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",m?"beside"===c?"ml-1.5":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):u});/* @__PURE__ */
|
|
@@ -526,13 +526,13 @@ return De(f,{content:e,side:i,children:p})}var Vi=6e4;function Yi({currentVersio
|
|
|
526
526
|
return De("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-[9999] w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */je(sa,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */De(g,{type:"button",variant:"primary",size:"md",onClick:s,children:o.update.refreshNow}),children:[
|
|
527
527
|
/* @__PURE__ */De("span",{className:"font-medium",children:n??o.update.available}),
|
|
528
528
|
/* @__PURE__ */je("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var Gi={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Xi={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function Ji({onClose:e}){const t=G().dialog;/* @__PURE__ */
|
|
529
|
-
return De("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */De("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M6 6l8 8M14 6l-8 8"})})})}function Qi({open:e,onClose:t,side:r="right",size:n="md",title:a,description:l,footer:i,children:o,blocking:s=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=fe(null),g=me(),f=me(),b=me();if(
|
|
530
|
-
return je("div",{className:"fixed inset-0",style:{zIndex:
|
|
529
|
+
return De("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */De("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */De("path",{d:"M6 6l8 8M14 6l-8 8"})})})}function Qi({open:e,onClose:t,side:r="right",size:n="md",title:a,description:l,footer:i,children:o,blocking:s=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=fe(null),g=me(),f=me(),b=me();if(E(e),C(p,e,c),L(e),xe(()=>{if(e)return I(()=>(s||t(),!0),()=>p.current)},[e,s,t]),!e)return null;const x="bottom"===r,y=x?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
|
|
530
|
+
return je("div",{className:"fixed inset-0",style:{zIndex:R.overlay},role:"presentation",children:[
|
|
531
531
|
/* @__PURE__ */De("div",{className:"fixed inset-0 bg-black/30",onClick:s?void 0:t,"aria-hidden":"true"}),
|
|
532
532
|
/* @__PURE__ */je("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":a?b:u,"aria-label":a||u?void 0:d,"aria-describedby":h??(l?f:o?g:void 0),style:y,className:["fixed flex flex-col bg-white shadow-xl",x?"":`w-full max-w-full ${Gi[n]}`,Xi[r],x?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */je("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
533
533
|
/* @__PURE__ */je("div",{className:"min-w-0",children:[
|
|
534
534
|
/* @__PURE__ */De("h2",{id:b,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */De("p",{id:f,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!s&&/* @__PURE__ */De(Ji,{onClose:t})]}):!s&&/* @__PURE__ */De("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */De(Ji,{onClose:t})}),
|
|
535
|
-
/* @__PURE__ */je("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */De("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(s?"":"pr-8")).trim(),children:l}),o]}),i&&/* @__PURE__ */De("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function eo({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:o,isLoading:s=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=G().kanban,f=Z(),b=c??g.loading,x=h??g.dropHere,y=p??g.addItem,[v,w]=ge(null),[k,N]=ge(null),M=be(()=>{const n={};for(const e of t)n[e.value]=[];for(const t of e)(n[r(t)]??=[]).push(t);if(o)for(const e of Object.keys(n))n[e].sort(o);return n},[e,t,r,o]),$=()=>{w(null),N(null)},C=fe(null),L=fe(/* @__PURE__ */new Map);
|
|
535
|
+
/* @__PURE__ */je("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */De("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(s?"":"pr-8")).trim(),children:l}),o]}),i&&/* @__PURE__ */De("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function eo({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:o,isLoading:s=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=G().kanban,f=Z(),b=c??g.loading,x=h??g.dropHere,y=p??g.addItem,[v,w]=ge(null),[k,N]=ge(null),M=be(()=>{const n={};for(const e of t)n[e.value]=[];for(const t of e)(n[r(t)]??=[]).push(t);if(o)for(const e of Object.keys(n))n[e].sort(o);return n},[e,t,r,o]),$=()=>{w(null),N(null)},C=fe(null),L=fe(/* @__PURE__ */new Map);W(()=>{if(null!==v)return;const e=C.current;if(!e)return;const t=/* @__PURE__ */new Map,r=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const n=e.dataset.kanbanCard,a=e.getBoundingClientRect();t.set(n,a);const l=L.current.get(n);if(l){const t=l.left-a.left,n=l.top-a.top;(t||n)&&r.push([e,t,n])}}),L.current=t,r.length){for(const[e,t,n]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${n}px)`;requestAnimationFrame(()=>{for(const[e]of r)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[M,v]);return s?/* @__PURE__ */De("div",{className:"text-sm text-gray-500 p-4",children:b}):0!==e.length||u?/* @__PURE__ */De("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */De("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=M[e.value]??[],r=null!==k&&k.col===e.value,o=null!==v?t.findIndex(e=>n(e)===v):-1,s=r&&(-1===o||k.index!==o&&k.index!==o+1)?k.index:-1;/* @__PURE__ */
|
|
536
536
|
return je("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(r?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:t=>{t.preventDefault(),(e=>{if(v&&k&&k.col===e){const t=(M[e]??[]).findIndex(e=>n(e)===v),r=-1!==t;if(!r||k.index!==t&&k.index!==t+1){const n=r&&k.index>t?k.index-1:k.index;a(v,e,n)}}$()})(e.value)},children:[
|
|
537
537
|
/* @__PURE__ */je("div",{className:`flex items-center justify-between px-3 py-2 rounded-t-xl text-sm font-medium ${e.accent??"text-gray-700 bg-gray-100"}`,children:[
|
|
538
538
|
/* @__PURE__ */je("span",{className:"flex items-center gap-2",children:[
|
|
@@ -547,21 +547,21 @@ return je("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.t
|
|
|
547
547
|
/* @__PURE__ */De("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${to} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */De("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${to} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function no(e){const t={};if(!e)return t;for(const[r,n]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||(t[r]=n);return t}var ao=e=>Array.isArray(e.columns),lo=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",io="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",oo={sm:"px-2 py-1.5",md:"px-3 py-2"},so={left:"text-left",right:"text-right",center:"text-center"};function co({direction:e}){/* @__PURE__ */
|
|
548
548
|
return je("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
549
549
|
/* @__PURE__ */De("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */De("path",{d:"M4 0L8 5H0z"})}),
|
|
550
|
-
/* @__PURE__ */De("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */De("path",{d:"M4 5L0 0h8z"})})]})}function uo({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:o=!1,bordered:s=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:g,emptyText:f,selection:b,footer:x,virtualized:y,stackOnNarrow:v=!1,stackBelow:w,className:k=""}){const N=G(),M=f??N.table.empty,$=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!y,L=C?e:e.flatMap(e=>{if(!ao(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),D=e=>C?{role:e}:{},j=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[A,P]=ge(0),
|
|
550
|
+
/* @__PURE__ */De("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */De("path",{d:"M4 5L0 0h8z"})})]})}function uo({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:o=!1,bordered:s=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:g,emptyText:f,selection:b,footer:x,virtualized:y,stackOnNarrow:v=!1,stackBelow:w,className:k=""}){const N=G(),M=f??N.table.empty,$=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!y,L=C?e:e.flatMap(e=>{if(!ao(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),D=e=>C?{role:e}:{},j=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[A,P]=ge(0),S=y?.overscan??6,z=y?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/y.rowHeight)-S);P(e=>e===t?e:t)}:void 0,F=y?Math.ceil(y.height/y.rowHeight)+2*S:t.length,B=y?Math.min(A,Math.max(0,t.length-F)):0,E=Math.min(t.length,B+F),T=y?B*y.rowHeight:0,I=y?(t.length-E)*y.rowHeight:0,O=fe(null),[R,H]=ge(0);W(()=>{if(!y)return;const e=O.current?.offsetHeight??0;H(t=>t===e?t:e)});const K=e=>e.sortField??e.key,_=e=>n&&n.field===K(e)?n.direction:null,q=L.flatMap(e=>ao(e)?e.columns:[e]),U=L.some(ao),V=/* @__PURE__ */new Map;if(C)for(const e of L)if(ao(e))for(const t of e.columns)V.set(t,j(e.title,e.label));const Y=e=>{const t=j(e.title,e.label),r=V.get(e);return t&&r?`${r} · ${t}`:t},Z=new Set(b?.selected??[]),X=b?t.map((e,t)=>$(e,t)):[],J=X.length>0&&X.every(e=>Z.has(e)),Q=X.some(e=>Z.has(e)),ee=b?36:0,te=q.length+(b?1:0),re=q.some(e=>"left"===e.fixed),ne=C&&!b&&q.some(e=>e.cardCorner),ae=g??"a",le=`${oo[c]} ${"sm"===c?"text-xs":"text-sm"}`,ie=(e,t,r,n=0)=>{const l=_(e),i=so[e.align??(e.numeric?"right":"left")],o="left"===e.fixed,s=!(!e.sortable||!a);/* @__PURE__ */
|
|
551
551
|
return De("th",{scope:"col",...D("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===l?"ascending":"desc"===l?"descending":s?"none":void 0,style:{width:e.width,...o?{left:(se[t]??0)+ee}:{},...y?{top:n}:{}},className:[le,i,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs",o?y?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":y?"sticky z-10 bg-gray-50":"",C&&s?"rosh-dt-sort":"",C?lo(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:s?/* @__PURE__ */je("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=K(e),r=_(e),n=e.sortFirst??"asc";a(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":C?V.get(e):void 0,className:`inline-flex items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[e.title,
|
|
552
552
|
/* @__PURE__ */De(co,{direction:l})]}):e.title},e.key)};let oe=0;const se=q.map(e=>{if("left"!==e.fixed)return null;const t=oe;return oe+=e.width??0,t}),ce=/* @__PURE__ */je(Ae,{children:[
|
|
553
|
-
/* @__PURE__ */je("div",{onScroll:
|
|
553
|
+
/* @__PURE__ */je("div",{onScroll:z,style:y?{maxHeight:y.height}:void 0,className:`relative overflow-x-auto ${y?"overflow-y-auto":""} ${s?"rounded-lg border border-gray-200":""}${C?" rosh-dt-scroll":""}`.trim(),children:[o&&
|
|
554
554
|
/* @__PURE__ */je("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
555
555
|
/* @__PURE__ */De("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-gray-200 border-t-blue-600"}),
|
|
556
556
|
/* @__PURE__ */De("span",{className:"sr-only",children:N.table.loading})]}),
|
|
557
557
|
/* @__PURE__ */je("table",{...D("table"),className:(C?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */De("caption",{className:"sr-only",children:i}),
|
|
558
558
|
/* @__PURE__ */je("thead",{...D("rowgroup"),className:C?"rosh-dt-head":void 0,children:[
|
|
559
|
-
/* @__PURE__ */je("tr",{ref:
|
|
560
|
-
/* @__PURE__ */De("tbody",{...D("rowgroup"),className:C?"rosh-dt-body":void 0,children:0!==t.length||o?/* @__PURE__ */je(Ae,{children:[T>0&&/* @__PURE__ */De("tr",{"aria-hidden":"true",children:/* @__PURE__ */De("td",{colSpan:te,style:{height:T,padding:0,border:0}})}),t.slice(E
|
|
559
|
+
/* @__PURE__ */je("tr",{ref:O,...D("row"),className:"border-b border-gray-200 bg-gray-50",children:[b&&/* @__PURE__ */De("th",{scope:"col",...D("columnheader"),rowSpan:U?2:void 0,style:{width:36,...y?{top:0}:{}},className:[le,re||y?"sticky z-20 bg-gray-50":"",re?"left-0":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */De(tt,{"aria-label":N.table.selectAll,checked:J,indeterminate:Q&&!J,onChange:()=>{if(!b)return;const e=new Set(X);b.onChange(J?b.selected.filter(t=>!e.has(t)):[...b.selected,...X.filter(e=>!Z.has(e))])}})}),L.map((e,t)=>ao(e)?/* @__PURE__ */De("th",{scope:"colgroup",...D("columnheader"),colSpan:e.columns.length,style:y?{top:0}:void 0,className:[le,"text-center","font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs","border-b border-gray-200",y?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:e.title},e.key??`group-${t}`):ie(e,q.indexOf(e),U?2:1))]}),U&&/* @__PURE__ */De("tr",{...D("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>ao(e)?e.columns:[]).map(e=>ie(e,q.indexOf(e),1,R))})]}),
|
|
560
|
+
/* @__PURE__ */De("tbody",{...D("rowgroup"),className:C?"rosh-dt-body":void 0,children:0!==t.length||o?/* @__PURE__ */je(Ae,{children:[T>0&&/* @__PURE__ */De("tr",{"aria-hidden":"true",children:/* @__PURE__ */De("td",{colSpan:te,style:{height:T,padding:0,border:0}})}),t.slice(B,E).map((e,t)=>{const r=B+t,n=h?.(e,r),a=!!n?.current,l=m?.(e,r),i=void 0===l&&p?()=>p(e,r):void 0,o=void 0!==l||void 0!==i;let s=!1;const c=(e,t)=>{if(s=!0,!o)return e;const r=[io,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */De(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */De("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=q.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(o&&!s){const e=q.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=q.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const g=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
561
561
|
return je("tr",{...no(n),...D("row"),style:y?{height:y.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:g(n?.onFocus),onBlur:g(n?.onBlur),"aria-current":a&&!o?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[C?b?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",C&&ne?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",u?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[b&&(()=>{const t=$(e,r);/* @__PURE__ */
|
|
562
562
|
return De("td",{...D("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,re?"sticky left-0 z-10 bg-white":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */De(tt,{"aria-label":N.table.selectRow,checked:Z.has(t),onChange:()=>(e=>{b&&b.onChange(Z.has(e)?b.selected.filter(t=>t!==e):[...b.selected,e])})(t)})})})(),q.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ne&&!!e.cardCorner,l=C&&!a&&"wide"!==e.only;/* @__PURE__ */
|
|
563
563
|
return De("td",{...D("cell"),"data-label":l?Y(e):void 0,style:r?{left:(se[t]??0)+ee}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",C?lo(e):"",le,so[e.align??(e.numeric?"right":"left")],e.numeric&&!C?"font-mono":"","text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:C?
|
|
564
|
-
/* @__PURE__ */De("span",{className:e.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:n}):n},e.key)})]},$(e,r))}),
|
|
564
|
+
/* @__PURE__ */De("span",{className:e.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:n}):n},e.key)})]},$(e,r))}),I>0&&/* @__PURE__ */De("tr",{"aria-hidden":"true",children:/* @__PURE__ */De("td",{colSpan:te,style:{height:I,padding:0,border:0}})})]}):/* @__PURE__ */De("tr",{...D("row"),className:C?"rosh-dt-empty":void 0,children:/* @__PURE__ */De("td",{...D("cell"),colSpan:te,className:`${le} py-10 text-center text-gray-500`,children:M})})})]}),x]}),l&&l.pageCount>1&&/* @__PURE__ */De("div",{className:C?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */De(ro,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
|
|
565
565
|
return De("div",C?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${k}`.trim(),children:/* @__PURE__ */De("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */De("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:ce})})}:{className:`rosh-dt-stack ${k}`.trim(),children:ce}:{className:k,children:ce})}function ho({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=G().list,s=n??r,c=r>=s,d=t>0?o.selectedNotShown(e,t):e>0?o.selected(e):"";/* @__PURE__ */
|
|
566
566
|
return je(Ae,{children:[i,d?`${d} — `:"",c?null!=n?o.allLoaded(s,a):o.count(s,a):o.loadedOf(r,s,a),l?` · ${o.loadingMore}`:""]})}function mo({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=G().list;/* @__PURE__ */
|
|
567
567
|
return je("div",{className:`flex flex-col items-center justify-center text-center ${"card"===n?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===n?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
|
|
@@ -736,7 +736,7 @@ return De("div",{className:"h-full",children:/* @__PURE__ */De(r,{side:"left",de
|
|
|
736
736
|
/* @__PURE__ */De("p",{children:"Hi,"}),
|
|
737
737
|
/* @__PURE__ */je("p",{children:[n.preview," The full details are attached — happy to walk through anything on a quick call."]}),
|
|
738
738
|
/* @__PURE__ */je("p",{children:["Best,",
|
|
739
|
-
/* @__PURE__ */De("br",{}),n.from]})]})]})]})})})}var Eo=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],
|
|
739
|
+
/* @__PURE__ */De("br",{}),n.from]})]})]})]})})})}var Eo=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],To=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function Io(){const[e,t]=ge(1),n=Eo.find(t=>t.id===e)??Eo[0];/* @__PURE__ */
|
|
740
740
|
return De("div",{className:"h-full",children:/* @__PURE__ */De(r,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */De("div",{className:"h-full overflow-auto",children:Eo.map(r=>/* @__PURE__ */je("button",{onClick:()=>t(r.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
|
|
741
741
|
/* @__PURE__ */De(na,{name:r.name,status:r.status}),
|
|
742
742
|
/* @__PURE__ */je("div",{className:"min-w-0 flex-1",children:[
|
|
@@ -749,7 +749,7 @@ return De("div",{className:"h-full",children:/* @__PURE__ */De(r,{side:"left",de
|
|
|
749
749
|
/* @__PURE__ */je("div",{children:[
|
|
750
750
|
/* @__PURE__ */De("div",{className:"text-sm font-medium text-gray-900",children:n.name}),
|
|
751
751
|
/* @__PURE__ */De("div",{className:"text-xs text-gray-400 capitalize",children:n.status})]})]}),
|
|
752
|
-
/* @__PURE__ */De("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:
|
|
752
|
+
/* @__PURE__ */De("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:To.map((e,t)=>/* @__PURE__ */De("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */De("div",{style:{maxWidth:"75%"},className:"rounded-2xl px-3 py-2 text-sm "+(e.mine?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm"),children:e.text})},t))}),
|
|
753
753
|
/* @__PURE__ */je("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
|
|
754
754
|
/* @__PURE__ */De("div",{className:"flex-1",children:/* @__PURE__ */De(Oe,{placeholder:"Type a message…"})}),
|
|
755
755
|
/* @__PURE__ */De(g,{type:"submit",children:"Send"})]})]})})})}var Oo={featured:"success",new:"active",draft:"draft"},Ro=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,t)=>({id:t,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][t],tag:["featured","new","draft"][t%3],bg:e}));function Wo(){const[e,t]=ge("all"),r="all"===e?Ro:Ro.filter(t=>t.tag===e);/* @__PURE__ */
|
|
@@ -796,7 +796,7 @@ return je("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWid
|
|
|
796
796
|
/* @__PURE__ */De("p",{className:"mt-0.5 text-sm text-gray-500",children:e??i.description})]}),
|
|
797
797
|
/* @__PURE__ */De(it,{name:"shell-language",value:r,onChange:e=>{l(e)},hint:i.reloadNote,options:a.map(({tag:e,name:t})=>({value:e,label:/* @__PURE__ */De("span",{lang:e,children:t})}))})]})}function hs({label:e="Not available"}){/* @__PURE__ */
|
|
798
798
|
return De("span",{className:"text-gray-400",role:"img","aria-label":e,children:ie})}function ms({value:e,precise:t,locale:r,className:n}){const a=Z(),l=oe(e);if(!l)/* @__PURE__ */return De(hs,{});const i="string"==typeof e?e:l.toISOString();/* @__PURE__ */
|
|
799
|
-
return De("time",{dateTime:i,title:ce(i,{locale:r??a}),className:n,children:se(l,{precise:t,locale:r??a})})}function ps(e,t=300){const[r,n]=ge(e);return xe(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function gs(e,t){xe(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var fs=8,bs=["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)"],xs={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},ys={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function vs(e){return bs[e]??ys.muted}function ws(e,t,r){return t||(r?xs[r]:vs(e))}function ks(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function Ns(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function Ms(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function $s(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 Cs(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),o=a>0&&l>0?Math.log10(a)-i:0,s=e=>{if(o<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/o*(t.to-t.from)};return s.domain=[l,a],s.range=t,s.ticks=e=>{if(e<2||o<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},s}function Ls(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function Ds(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function js(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}var As=e=>e.toFixed(2);function Ps(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${As(e)},${As(t)}`).join(" ")}function Ss(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${As(e.start)},${As(e.y)}`,t+=` L${As(e.end)},${As(e.y)}`}),t}function zs(e){if(e.length<3)return Ps(e);const t=e.length,r=[],n=[];for(let a=0;a<t-1;a+=1){const t=e[a+1][0]-e[a][0];r.push(t),n.push(0===t?0:(e[a+1][1]-e[a][1])/t)}const a=[n[0]];for(let e=1;e<t-1;e+=1)a.push(n[e-1]*n[e]<=0?0:(n[e-1]+n[e])/2);a.push(n[t-2]);for(let e=0;e<t-1;e+=1){if(0===n[e]){a[e]=0,a[e+1]=0;continue}const t=a[e]/n[e],r=a[e+1]/n[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);a[e]=i*t*n[e],a[e+1]=i*r*n[e]}}let l=`M${As(e[0][0])},${As(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${As(e[n][0]+t)},${As(e[n][1]+a[n]*t)} ${As(e[n+1][0]-t)},${As(e[n+1][1]-a[n+1]*t)} ${As(e[n+1][0])},${As(e[n+1][1])}`}return l}function Fs(e,t=0){if(e.length<3)return Ps(e);const r=e.map(e=>e[1]),n=Math.min(...r),a=Math.max(...r),l=e=>Math.min(a,Math.max(n,e)),i=(1-t)/6;let o=`M${As(e[0][0])},${As(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],n=e[t],a=e[t+1],s=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(s[0]-n[0])*i,h=l(a[1]-(s[1]-n[1])*i);o+=` C${As(c)},${As(d)} ${As(u)},${As(h)} ${As(a[0])},${As(a[1])}`}return o}function Bs(e){if(e.length<2)return Ps(e);let t=`M${As(e[0][0])},${As(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],o=(n+l)/2;t+=` C${As(o)},${As(a)} ${As(o)},${As(i)} ${As(l)},${As(i)}`}return t}function Es(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${As(e[0][0])},${As(e[0][1])}`:"monotone"===t?zs(e):"spline"===t?Fs(e,r):"bump"===t?Bs(e):Ps(e)}function
|
|
799
|
+
return De("time",{dateTime:i,title:ce(i,{locale:r??a}),className:n,children:se(l,{precise:t,locale:r??a})})}function ps(e,t=300){const[r,n]=ge(e);return xe(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function gs(e,t){xe(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var fs=8,bs=["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)"],xs={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},ys={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function vs(e){return bs[e]??ys.muted}function ws(e,t,r){return t||(r?xs[r]:vs(e))}function ks(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function Ns(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function Ms(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function $s(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 Cs(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),o=a>0&&l>0?Math.log10(a)-i:0,s=e=>{if(o<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/o*(t.to-t.from)};return s.domain=[l,a],s.range=t,s.ticks=e=>{if(e<2||o<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},s}function Ls(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function Ds(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function js(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}var As=e=>e.toFixed(2);function Ps(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${As(e)},${As(t)}`).join(" ")}function Ss(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${As(e.start)},${As(e.y)}`,t+=` L${As(e.end)},${As(e.y)}`}),t}function zs(e){if(e.length<3)return Ps(e);const t=e.length,r=[],n=[];for(let a=0;a<t-1;a+=1){const t=e[a+1][0]-e[a][0];r.push(t),n.push(0===t?0:(e[a+1][1]-e[a][1])/t)}const a=[n[0]];for(let e=1;e<t-1;e+=1)a.push(n[e-1]*n[e]<=0?0:(n[e-1]+n[e])/2);a.push(n[t-2]);for(let e=0;e<t-1;e+=1){if(0===n[e]){a[e]=0,a[e+1]=0;continue}const t=a[e]/n[e],r=a[e+1]/n[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);a[e]=i*t*n[e],a[e+1]=i*r*n[e]}}let l=`M${As(e[0][0])},${As(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${As(e[n][0]+t)},${As(e[n][1]+a[n]*t)} ${As(e[n+1][0]-t)},${As(e[n+1][1]-a[n+1]*t)} ${As(e[n+1][0])},${As(e[n+1][1])}`}return l}function Fs(e,t=0){if(e.length<3)return Ps(e);const r=e.map(e=>e[1]),n=Math.min(...r),a=Math.max(...r),l=e=>Math.min(a,Math.max(n,e)),i=(1-t)/6;let o=`M${As(e[0][0])},${As(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],n=e[t],a=e[t+1],s=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(s[0]-n[0])*i,h=l(a[1]-(s[1]-n[1])*i);o+=` C${As(c)},${As(d)} ${As(u)},${As(h)} ${As(a[0])},${As(a[1])}`}return o}function Bs(e){if(e.length<2)return Ps(e);let t=`M${As(e[0][0])},${As(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],o=(n+l)/2;t+=` C${As(o)},${As(a)} ${As(o)},${As(i)} ${As(l)},${As(i)}`}return t}function Es(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${As(e[0][0])},${As(e[0][1])}`:"monotone"===t?zs(e):"spline"===t?Fs(e,r):"bump"===t?Bs(e):Ps(e)}function Ts(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${As(a[0])},${As(r)} L${As(n[0])},${As(r)} Z`}function Is(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${As(e)},${As(t)}`).join(" L")} Z`}function Os(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const o=a+2*i*Math.PI/n;return[e+r*Math.cos(o),t+r*Math.sin(o)]})}function Rs(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${Rs(e,t,r,n,a,l)} ${Rs(e,t,r,n,l,a+2*Math.PI)}`}const o=Math.abs(i)>Math.PI?1:0,s=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=s(n,a),[u,h]=s(n,l);if(r<=0)return`M${As(e)},${As(t)} L${As(c)},${As(d)} A${As(n)},${As(n)} 0 ${o} 1 ${As(u)},${As(h)} Z`;const[m,p]=s(r,l),[g,f]=s(r,a);return`M${As(c)},${As(d)} A${As(n)},${As(n)} 0 ${o} 1 ${As(u)},${As(h)} L${As(m)},${As(p)} A${As(r)},${As(r)} 0 ${o} 0 ${As(g)},${As(f)} Z`}function Ws(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const n=Math.max(...e),a=Math.min(...e),l=t*t,i=r*r;return Math.max(i*n/l,l/(i*a))}function Hs(e,t,r,n){const a=n?r.height:r.width,l=a>0?t/a:0;let i=0;return{tiles:e.map(e=>{const o=t>0?e.value/t*a:0,s=n?{...e,x:r.x,y:r.y+i,width:l,height:o}:{...e,x:r.x+i,y:r.y,width:o,height:l};return i+=o,s}),rest:n?{x:r.x+l,y:r.y,width:r.width-l,height:r.height}:{x:r.x,y:r.y+l,width:r.width,height:r.height-l}}}function Ks(e,t,r){const n=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===n.length||t<=0||r<=0)return[];const a=n.reduce((e,t)=>e+t.value,0),l=t*r,i=[];let o={x:0,y:0,width:t,height:r},s=[],c=0,d=[...n.map(e=>({...e,value:e.value/a*l}))];for(;d.length>0;){const e=d[0],t=Math.min(o.width,o.height),r=o.width>=o.height,n=Ws(s.map(e=>e.value),c,t),a=Ws([...s.map(e=>e.value),e.value],c+e.value,t);if(0===s.length||a<=n)s.push(e),c+=e.value,d=d.slice(1);else{const e=Hs(s,c,o,r);i.push(...e.tiles),o=e.rest,s=[],c=0}}s.length>0&&i.push(...Hs(s,c,o,o.width>=o.height).tiles);const u=new Map(e.map(e=>[e.key,e.value]));return i.map(e=>({...e,value:u.get(e.key)??e.value}))}var _s=ye({highlighted:null,setHighlighted:()=>{}});function qs({children:e}){const[t,r]=ge(null),n=be(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
|
|
800
800
|
return De(_s.Provider,{value:n,children:e})}function Us(){return Ne(_s)}function Vs(e,t,r=.22){return null===t?null:t===e?1:r}function Ys(e,t="none"){if("none"===t||0===e.length)return null;if("last"===t){for(let t=e.length-1;t>=0;t-=1)if("number"==typeof e[t]&&Number.isFinite(e[t]))return t;return null}let r=null;return e.forEach((n,a)=>{if("number"!=typeof n||!Number.isFinite(n))return;if(null===r)return void(r=a);const l=e[r];("max"===t?n>l:n<l)&&(r=a)}),r}function Zs(e,t=720){const[r,n]=ge(t);return xe(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&n(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function Gs({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:o=30,animate:s=!0,className:c,emptyLabel:d}){const u=G().charts,h=Z(),m=r??(e=>Q(e,h)),p=d??u.nothingToRank;if(0===e.length)/* @__PURE__ */
|
|
801
801
|
return De("p",{className:`text-sm text-gray-500 ${c??""}`,children:p});const g=Ys(e.map(e=>e.value),a),f=n??(null===g?void 0:e[g]?.key),b=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),x=vs(0);/* @__PURE__ */
|
|
802
802
|
return De("ol",{className:`m-0 list-none p-0 ${c??""}`,style:{display:"grid",rowGap:`${Math.max(4,o-i)}px`},children:e.map((e,t)=>{const r=e.key===f,n=r?l?xs[l]:vs(1):f?ys.muted:x,a=Number.isFinite(e.value)?e.value:null,o=null!==a&&b>0?Math.max(0,Math.min(1,a/b)):0;/* @__PURE__ */
|
|
@@ -844,7 +844,7 @@ return De(qs,{children:/* @__PURE__ */je("section",{className:`flex min-w-0 flex
|
|
|
844
844
|
/* @__PURE__ */De("h3",{className:"truncate text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */De("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),u&&/* @__PURE__ */De("div",{className:"shrink-0",children:u})]}),i?/* @__PURE__ */De(tc,{variant:o,height:s}):/* @__PURE__ */De("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:h}),!i&&r&&r.length>1&&/* @__PURE__ */De(nc,{entries:r,interactive:c,fallbackSwatch:d}),!i&&n&&/* @__PURE__ */je("details",{className:"border-t border-gray-100 pt-3",children:[
|
|
845
845
|
/* @__PURE__ */De("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:a??p.showTable}),
|
|
846
846
|
/* @__PURE__ */De("div",{className:"mt-3 overflow-x-auto",style:{color:ys.label},children:n})]})]})})}function lc({variant:e="solid",title:t,rows:r,footnote:n,emphasisKey:a,className:l}){const i="glass"===e;/* @__PURE__ */
|
|
847
|
-
return je("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?
|
|
847
|
+
return je("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${i?"":"bg-white shadow-xl ring-1 ring-black/5"} ${l??""}`,style:i?T():void 0,children:[t&&/* @__PURE__ */De("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
|
|
848
848
|
/* @__PURE__ */De("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:r.map(e=>/* @__PURE__ */je("li",{className:"flex items-center gap-2.5",style:a&&e.key!==a?{opacity:.45}:void 0,children:[
|
|
849
849
|
/* @__PURE__ */De("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??ys.muted}}),
|
|
850
850
|
/* @__PURE__ */De("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
|
|
@@ -856,46 +856,46 @@ return De("div",{className:o,children:/* @__PURE__ */je("svg",{ref:c,width:"100%
|
|
|
856
856
|
/* @__PURE__ */De("path",{d:v,fill:ys.grid}),
|
|
857
857
|
/* @__PURE__ */De("rect",{x:0,y:0,width:p(u),height:a,fill:ys.surface,fillOpacity:.72}),
|
|
858
858
|
/* @__PURE__ */De("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:ys.surface,fillOpacity:.72}),
|
|
859
|
-
/* @__PURE__ */De("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}function sc(e,t,r){const n=(t/2+8).toFixed(1),a=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${n}px), calc(100% - 184px))`;var t};return e<=r/2?{left:a(e)}:{right:a(r-e)}}function cc({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:o=4,formatValue:s,yAxisLabel:c,xTickAnchor:d="center",children:u,tooltip:h,ariaLabel:m,className:p,emptyLabel:g}){const f=G().charts,b=Z(),x=s??(e=>Q(e,b)),y=g??f.noData,v=fe(null),w=Zs(v),k=n??w,[N,M]=ge(null),$=me();if(xe(()=>{if(null!==N)return
|
|
859
|
+
/* @__PURE__ */De("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}function sc(e,t,r){const n=(t/2+8).toFixed(1),a=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${n}px), calc(100% - 184px))`;var t};return e<=r/2?{left:a(e)}:{right:a(r-e)}}function cc({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:o=4,formatValue:s,yAxisLabel:c,xTickAnchor:d="center",children:u,tooltip:h,ariaLabel:m,className:p,emptyLabel:g}){const f=G().charts,b=Z(),x=s??(e=>Q(e,b)),y=g??f.noData,v=fe(null),w=Zs(v),k=n??w,[N,M]=ge(null),$=me();if(xe(()=>{if(null!==N)return I(e=>"Escape"===e.key&&(M(null),!0))},[N]),0===e.length)/* @__PURE__ */
|
|
860
860
|
return De("div",{className:p,ref:v,children:/* @__PURE__ */De("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:y})});const C={top:12,right:16,bottom:26,left:c?58:48},L=C.left,D=Math.max(L+1,k-C.right),j=C.top,A=r-C.bottom,P=t.filter(Number.isFinite),S=l??Math.min(0,...P),z=ks([S,i??$s(Math.max(...P,0))],{from:A,to:j}),F=Ns(e.length,{from:L,to:D},a),B=z.ticks(o+1),E=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor(k/84))));/* @__PURE__ */
|
|
861
861
|
return je("div",{className:`relative ${p??""}`,ref:v,children:[
|
|
862
862
|
/* @__PURE__ */je("svg",{width:"100%",height:r,viewBox:`0 0 ${k} ${r}`,role:"img","aria-label":m,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>M(null),onBlur:()=>M(null),onKeyDown:t=>{if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;M(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
|
|
863
863
|
/* @__PURE__ */De("defs",{children:/* @__PURE__ */De("clipPath",{id:$,children:/* @__PURE__ */De("rect",{x:L,y:j,width:D-L,height:A-j})})}),B.map(e=>/* @__PURE__ */De("line",{x1:L,y1:z(e),x2:D,y2:z(e),stroke:ys.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
864
864
|
/* @__PURE__ */De("line",{x1:L,y1:z(Math.max(S,0)),x2:D,y2:z(Math.max(S,0)),stroke:ys.axis,strokeWidth:1,shapeRendering:"crispEdges"}),B.map(e=>/* @__PURE__ */De("text",{x:L-8,y:z(e)+4,textAnchor:"end",fontSize:11,fill:ys.label,style:{fontVariantNumeric:"tabular-nums"},children:x(e)},`t${e}`)),c&&/* @__PURE__ */De("text",{x:14,y:(j+A)/2,transform:`rotate(-90 14 ${(j+A)/2})`,textAnchor:"middle",fontSize:11,fill:ys.label,children:c}),
|
|
865
865
|
/* @__PURE__ */De("g",{clipPath:`url(#${$})`,children:u({x:F,y:z,left:L,right:D,top:j,bottom:A,width:k,height:r,clipId:$,active:N})}),e.map((e,t)=>t%E===0?/* @__PURE__ */De("text",{x:"start"===d?F(t):F.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:ys.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */De("rect",{x:F.center(r)-(D-L)/e.length/2,y:j,width:(D-L)/e.length,height:A-j,fill:"transparent",onMouseEnter:()=>M(r)},`h${r}`))]}),h&&null!==N&&
|
|
866
|
-
/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 z-10",style:sc(F.center(N),F.bandwidth,k),children:h(N)})]})}var dc=12,uc=16,hc=26,mc=52,pc=e=>"number"==typeof e&&Number.isFinite(e);function gc({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:o=0,max:s,yTickCount:c=4,formatValue:d,yAxisLabel:u,referenceLines:h,labelEndpoints:m=!1,dots:p,dotVariant:g="border",pulse:f=!1,brush:b=!1,range:x,onRangeChange:y,loading:v=!1,animate:w=!0,reveal:k="left-to-right",fillVariant:N="gradient",gridStyle:M="solid",width:$,className:C,emptyLabel:L}){const D=G().charts,j=Z(),A=d??(e=>Q(e,j)),P=L??D.noData,S=fe(null),z=Zs(S),F=$??z,[B,E]=ge(null),[
|
|
867
|
-
return De("div",{className:C,ref:S,children:/* @__PURE__ */De(tc,{height:r,width:$??z})});const
|
|
866
|
+
/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 z-10",style:sc(F.center(N),F.bandwidth,k),children:h(N)})]})}var dc=12,uc=16,hc=26,mc=52,pc=e=>"number"==typeof e&&Number.isFinite(e);function gc({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:o=0,max:s,yTickCount:c=4,formatValue:d,yAxisLabel:u,referenceLines:h,labelEndpoints:m=!1,dots:p,dotVariant:g="border",pulse:f=!1,brush:b=!1,range:x,onRangeChange:y,loading:v=!1,animate:w=!0,reveal:k="left-to-right",fillVariant:N="gradient",gridStyle:M="solid",width:$,className:C,emptyLabel:L}){const D=G().charts,j=Z(),A=d??(e=>Q(e,j)),P=L??D.noData,S=fe(null),z=Zs(S),F=$??z,[B,E]=ge(null),[T,O]=ge(null),{highlighted:R}=Us(),W=me();if(xe(()=>{if(null!==B)return I(e=>"Escape"===e.key&&(E(null),!0))},[B]),v)/* @__PURE__ */
|
|
867
|
+
return De("div",{className:C,ref:S,children:/* @__PURE__ */De(tc,{height:r,width:$??z})});const H=t,K=x??T??[0,Math.max(0,H.length-1)],[_,q]=K,U=e=>b?e.slice(_,q+1):e,V=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(pc)).map(e=>({...e,data:U(e.data)}));if(t=U(H),0===V.length||0===t.length)/* @__PURE__ */
|
|
868
868
|
return De("div",{className:C,ref:S,children:/* @__PURE__ */De("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:P})});const Y={left:mc,right:Math.max(mc+1,F-uc),top:dc,bottom:r-hc},X=Ns(t.length,{from:Y.left,to:Y.right}),J=t.map((e,t)=>V.reduce((e,r)=>e+(pc(r.data[t])?r.data[t]:0),0)),ee=(e,t)=>J[t]>0?e/J[t]:null,re=[];if(n){let e=t.map(()=>0);for(const t of V)e=e.map((e,r)=>e+(pc(t.data[r])?t.data[r]:0)),re.push("percent"===a?e.map((e,t)=>ee(e,t)):[...e])}const ne=l&&l.length>0?Ms(l,{from:Y.bottom,to:Y.top}):null,ae=n?(re.at(-1)??[]).filter(pc):V.flatMap(e=>e.data.filter(pc)),le=ks([0,n&&"percent"===a?1:s??$s(Math.max(...ae,0))],{from:Y.bottom,to:Y.top}),ie=e=>ne?ne(e):le(e),oe=n&&"percent"===a?e=>te(Math.round(100*e),0,j):A,se=ne?ne.levels.map(e=>({value:e,y:ne(e)})):le.ticks(c+1).map(e=>({value:e,y:le(e)})),ce=e=>r=>{r.preventDefault(),E(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},de=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(F/96))));/* @__PURE__ */
|
|
869
869
|
return je("div",{className:`relative ${C??""}`,ref:S,children:[
|
|
870
870
|
/* @__PURE__ */je("svg",{width:"100%",height:r,viewBox:`0 0 ${F} ${r}`,role:"img","aria-label":D.overIntervals(V.map(e=>e.label),t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:e=>{"ArrowRight"===e.key&&ce(1)(e),"ArrowLeft"===e.key&&ce(-1)(e)},children:[
|
|
871
|
-
/* @__PURE__ */De("defs",{children:/* @__PURE__ */De("clipPath",{id:
|
|
872
|
-
/* @__PURE__ */De(el,{id:
|
|
871
|
+
/* @__PURE__ */De("defs",{children:/* @__PURE__ */De("clipPath",{id:W,children:/* @__PURE__ */De("rect",{x:Y.left,y:Y.top,width:Y.right-Y.left,height:Y.bottom-Y.top})})}),
|
|
872
|
+
/* @__PURE__ */De(el,{id:W,fills:V.map((e,t)=>({color:ws(e.slot,e.color,e.tone),variant:e.fillVariant??N})),fadeFrom:n?.42:.3,reveal:!!w&&k}),se.map(e=>/* @__PURE__ */De("line",{x1:Y.left,y1:e.y,x2:Y.right,y2:e.y,stroke:ys.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===M?"3 3":void 0},`grid-${e.value}`)),
|
|
873
873
|
/* @__PURE__ */De("line",{x1:Y.left,y1:Y.bottom,x2:Y.right,y2:Y.bottom,stroke:ys.axis,strokeWidth:1,shapeRendering:"crispEdges"}),se.map(e=>/* @__PURE__ */De("text",{x:Y.left-8,y:e.y+4,textAnchor:"end",fontSize:11,fill:ys.label,style:{fontVariantNumeric:"tabular-nums"},children:oe(e.value)},`ytick-${e.value}`)),u&&/* @__PURE__ */De("text",{x:12,y:(Y.top+Y.bottom)/2,transform:`rotate(-90 12 ${(Y.top+Y.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:ys.label,children:u}),
|
|
874
|
-
/* @__PURE__ */De("g",{clipPath:`url(#${
|
|
874
|
+
/* @__PURE__ */De("g",{clipPath:`url(#${W})`,mask:w&&k?`url(#${Ya(W)})`:void 0,children:V.map((e,r)=>{const a=ws(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),s=Vs(e.key,R);if("step"===l){const r=t.map((t,r)=>({start:X(r),end:X.end(r),value:e.data[r]})).filter(e=>pc(e.value)).map(e=>({start:e.start,end:e.end,y:ie(e.value)}));/* @__PURE__ */
|
|
875
875
|
return De("path",{d:Ss(r),fill:"none",stroke:a,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:s??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,a)=>{const l=n?re[r]?.[a]:e.data[a];return pc(l)?[X.center(a),ie(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*X.bandwidth);/* @__PURE__ */
|
|
876
876
|
return De("g",{opacity:s??void 0,className:"rosh-viz-mark",children:t.map((t,i)=>{const o=n?re[r]?.[i]:e.data[i];if(!pc(o))return null;const s=ie(o);/* @__PURE__ */
|
|
877
|
-
return De("rect",{x:X.center(i)-l/2,y:s,width:l,height:Math.max(0,Y.bottom-s),rx:2,fill:a,fillOpacity:.35,className:w?rl.rise:void 0,style:w?nl(i,26):void 0},i)})},e.key)}const d=Es(c,i,o),u=n&&r>0?t.map((e,t)=>[X.center(t),ie(re[r-1]?.[t]??0)-2]):null,h=u?
|
|
877
|
+
return De("rect",{x:X.center(i)-l/2,y:s,width:l,height:Math.max(0,Y.bottom-s),rx:2,fill:a,fillOpacity:.35,className:w?rl.rise:void 0,style:w?nl(i,26):void 0},i)})},e.key)}const d=Es(c,i,o),u=n&&r>0?t.map((e,t)=>[X.center(t),ie(re[r-1]?.[t]??0)-2]):null,h=u?Is(d,u):Ts(d,c,Y.bottom);/* @__PURE__ */
|
|
878
878
|
return je("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===l||n)&&
|
|
879
|
-
/* @__PURE__ */De("path",{d:h,fill:Ga(
|
|
879
|
+
/* @__PURE__ */De("path",{d:h,fill:Ga(W,r,e.fillVariant??N,a),stroke:"none"}),
|
|
880
880
|
/* @__PURE__ */De("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:Xa(e.stroke??(e.forecast?"animated-dashed":"solid")),className:w&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?rl.march:void 0})]},e.key)})}),h?.map((e,t)=>{const r=e.color??xs[e.tone??"critical"],n=ie(e.value);/* @__PURE__ */
|
|
881
881
|
return je("g",{children:[
|
|
882
882
|
/* @__PURE__ */De("line",{x1:Y.left,y1:n,x2:Y.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */De("text",{x:Y.right-4,y:n-5,textAnchor:"end",fontSize:10.5,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(p??(m?"last":"none"))&&V.map((e,r)=>{const a=p??(m?"last":"none"),l=ws(e.slot,e.color,e.tone),i=[...e.data].map(pc).lastIndexOf(!0),o="all"===a?t.map((e,t)=>t).filter(t=>pc(n?re[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
|
|
883
|
-
return je("g",{children:[o.map(a=>{const o=n?re[r]?.[a]:e.data[a];return pc(o)?/* @__PURE__ */De(ic,{cx:X.center(a),cy:ie(o),color:l,variant:g,pulse:f&&a===i,title:`${t[a]}: ${e.label} ${A(o)}`},a):null}),m&&i>=0&&pc(n?re[r]?.[i]:e.data[i])&&/* @__PURE__ */De("text",{x:X.center(i)-10,y:ie(n?re[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:ys.label,style:{fontVariantNumeric:"tabular-nums"},children:A(n?re[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%de===0?/* @__PURE__ */De("text",{x:X.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:ys.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==B&&/* @__PURE__ */De("line",{x1:X.center(B),y1:Y.top,x2:X.center(B),y2:Y.bottom,stroke:ys.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */De("rect",{x:X(t),y:Y.top,width:Math.max(1,X.bandwidth),height:Y.bottom-Y.top,fill:"transparent",onMouseEnter:()=>E(t)},`hit-${t}`))]}),b&&
|
|
883
|
+
return je("g",{children:[o.map(a=>{const o=n?re[r]?.[a]:e.data[a];return pc(o)?/* @__PURE__ */De(ic,{cx:X.center(a),cy:ie(o),color:l,variant:g,pulse:f&&a===i,title:`${t[a]}: ${e.label} ${A(o)}`},a):null}),m&&i>=0&&pc(n?re[r]?.[i]:e.data[i])&&/* @__PURE__ */De("text",{x:X.center(i)-10,y:ie(n?re[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:ys.label,style:{fontVariantNumeric:"tabular-nums"},children:A(n?re[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%de===0?/* @__PURE__ */De("text",{x:X.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:ys.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==B&&/* @__PURE__ */De("line",{x1:X.center(B),y1:Y.top,x2:X.center(B),y2:Y.bottom,stroke:ys.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */De("rect",{x:X(t),y:Y.top,width:Math.max(1,X.bandwidth),height:Y.bottom-Y.top,fill:"transparent",onMouseEnter:()=>E(t)},`hit-${t}`))]}),b&&H.length>2&&/* @__PURE__ */De(oc,{className:"mt-1",labels:H,width:F,data:e[0]?.data??[],range:K,onRangeChange:e=>{y?y(e):O(e)}}),null!==B&&
|
|
884
884
|
/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 z-10",style:sc(X.center(B),X.bandwidth,F),children:/* @__PURE__ */De(lc,{title:t[B],rows:V.map((e,t)=>({key:e.key,label:e.label,color:ws(e.slot,e.color,e.tone),value:pc(e.data[B])?n&&"percent"===a?`${te(100*(ee(e.data[B],B)??0),1,j)} · ${A(e.data[B])}`:A(e.data[B]):void 0})),footnote:n&&"percent"===a?D.inBucket(A(J[B])):void 0})})]})}function fc({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=220,width:l,max:i,formatValue:o,yAxisLabel:s,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:b="none"}){const x=me(),{highlighted:y}=Us(),v=G().charts,w=Z(),k=o??(e=>Q(e,w));if(h)/* @__PURE__ */return De(tc,{height:a,width:l,variant:"bars",className:c});const N=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),M=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},$=t.map((e,t)=>N.reduce((e,r)=>e+M(r,t),0)),C=t.map((e,t)=>N.reduce((e,r)=>e+Math.max(0,M(r,t)),0)),L=t.map((e,t)=>N.reduce((e,r)=>e+Math.min(0,M(r,t)),0)),D=r&&"percent"===n,j=(e,t)=>$[t]>0?e/$[t]:null,A=D?[1]:r?[...C,...L]:N.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
|
|
885
885
|
return De(cc,{labels:t,values:A,height:a,width:l,max:D?1:i,formatValue:D?e=>te(Math.round(100*e),0,w):k,yAxisLabel:s,className:c,emptyLabel:d,ariaLabel:v.acrossCategories(N.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */De(lc,{title:t[e],rows:N.map(t=>({key:t.key,label:t.label,color:ws(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?D?`${te(100*(j(t.data[e],e)??0),1,w)} · ${k(t.data[e])}`:k(t.data[e]):void 0})),footnote:D?v.inCategory(k($[e])):void 0}),children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,o=Ys(r?$:N[0]?.data??[],b),s=l??(i>=0?i:o);/* @__PURE__ */
|
|
886
886
|
return je("g",{children:[
|
|
887
887
|
/* @__PURE__ */De(el,{id:x,glow:p}),t.map((t,a)=>{const l=e.bandwidth/(r?1:Math.max(1,N.length));let i=0,o=0;const c=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return N.map((t,d)=>{const h=t.data[a];if(!Number.isFinite(h))return null;const f=D?j(h,a):h;if(null===f)return null;const b=ws(t.slot,t.color,t.tone),v=r?e(a):e(a)+d*l;let w,k,M=!0;if(r){const e=f>=0?i:o,t=e+f;f>=0?i=t:o=t,w=n(Math.max(e,t)),k=n(Math.min(e,t)),M=0===e}else w=Math.min(n(f),c),k=Math.max(n(f),c);const $=Math.max(0,k-w-(r&&!M?2:0)),C=null===s||s===a,L=C?b:g?ys.muted:b,A=Vs(t.key,y);/* @__PURE__ */
|
|
888
|
-
return De("rect",{x:v,y:w,width:Math.max(1,l),height:$,rx:u,fill:L,fillOpacity:A??(C?1:g?.32:.45),filter:p&&s===a?`url(#${Va(x)})`:void 0,className:"rosh-viz-mark"+(m?` ${rl.rise}`:""),style:m?nl(a*(r?1:N.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */De("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:ys.axis,strokeWidth:1})]})}})}var bc=3;function xc({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:o,yDomain:s,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=G().charts,g=Z(),f=l??(e=>Q(e,g)),b=i??(e=>Q(e,g)),x=m??p.noObservations,y=fe(null),v=Zs(y),w=r??v,k=me(),[N,M]=ge(null);xe(()=>{if(null!==N)return
|
|
889
|
-
return De("div",{className:h,ref:y,children:/* @__PURE__ */De("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:x})});const j=L.flatMap(e=>e.points),A=j.some(e=>null!=e.size),P=14,S=20,z=34,F=52,B=Math.max(F+1,w-S),E=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,$s(Math.max(...e))];return"log"===r?Cs(i,n):ks(i,n)},
|
|
888
|
+
return De("rect",{x:v,y:w,width:Math.max(1,l),height:$,rx:u,fill:L,fillOpacity:A??(C?1:g?.32:.45),filter:p&&s===a?`url(#${Va(x)})`:void 0,className:"rosh-viz-mark"+(m?` ${rl.rise}`:""),style:m?nl(a*(r?1:N.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */De("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:ys.axis,strokeWidth:1})]})}})}var bc=3;function xc({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:o,yDomain:s,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=G().charts,g=Z(),f=l??(e=>Q(e,g)),b=i??(e=>Q(e,g)),x=m??p.noObservations,y=fe(null),v=Zs(y),w=r??v,k=me(),[N,M]=ge(null);xe(()=>{if(null!==N)return I(e=>"Escape"===e.key&&(M(null),!0))},[N]);const $=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.filter(e=>e.points.length>0).slice(0,3),L=o||s?C.map(e=>({...e,points:e.points.filter(e=>$(e.x,o)&&$(e.y,s))})).filter(e=>e.points.length>0):C,D=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
|
|
889
|
+
return De("div",{className:h,ref:y,children:/* @__PURE__ */De("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:x})});const j=L.flatMap(e=>e.points),A=j.some(e=>null!=e.size),P=14,S=20,z=34,F=52,B=Math.max(F+1,w-S),E=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,$s(Math.max(...e))];return"log"===r?Cs(i,n):ks(i,n)},T=E(j.map(e=>e.x),o,c,{from:F,to:B}),O=E(j.map(e=>e.y),s,d,{from:t-z,to:P}),R=Ds([0,Math.max(...j.map(e=>e.size??1))],{from:u[0],to:u[1]}),W=N?L[N.s]:void 0,H=N&&W?W.points[N.i]:void 0,K=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
|
|
890
890
|
return je("div",{className:`relative ${h??""}`,ref:y,children:[
|
|
891
|
-
/* @__PURE__ */je("svg",{width:"100%",height:t,viewBox:`0 0 ${w} ${t}`,role:"img","aria-label":p.scatter(L.map(e=>e.label),a??p.yAxis,n??p.xAxis)+(D>0?`. ${p.outsideRange(D)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>M(null),onBlur:()=>M(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=N?
|
|
892
|
-
/* @__PURE__ */De("defs",{children:/* @__PURE__ */De("clipPath",{id:k,children:/* @__PURE__ */De("rect",{x:F-u[1],y:P-u[1],width:B-F+2*u[1],height:t-z-P+2*u[1]})})}),
|
|
893
|
-
/* @__PURE__ */De("line",{x1:F,y1:
|
|
894
|
-
/* @__PURE__ */De("text",{x:F-8,y:
|
|
895
|
-
/* @__PURE__ */De("g",{clipPath:`url(#${k})`,children:L.map((e,t)=>{const r=ws(t,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */De("circle",{cx:
|
|
891
|
+
/* @__PURE__ */je("svg",{width:"100%",height:t,viewBox:`0 0 ${w} ${t}`,role:"img","aria-label":p.scatter(L.map(e=>e.label),a??p.yAxis,n??p.xAxis)+(D>0?`. ${p.outsideRange(D)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>M(null),onBlur:()=>M(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=N?K.findIndex(e=>e.s===N.s&&e.i===N.i):0;M(K[Math.min(K.length-1,Math.max(0,r+t))])},children:[
|
|
892
|
+
/* @__PURE__ */De("defs",{children:/* @__PURE__ */De("clipPath",{id:k,children:/* @__PURE__ */De("rect",{x:F-u[1],y:P-u[1],width:B-F+2*u[1],height:t-z-P+2*u[1]})})}),O.ticks(5).map(e=>/* @__PURE__ */je("g",{children:[
|
|
893
|
+
/* @__PURE__ */De("line",{x1:F,y1:O(e),x2:B,y2:O(e),stroke:ys.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
894
|
+
/* @__PURE__ */De("text",{x:F-8,y:O(e)+4,textAnchor:"end",fontSize:11,fill:ys.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),T.ticks(5).map(e=>/* @__PURE__ */De("text",{x:T(e),y:t-12,textAnchor:"middle",fontSize:11,fill:ys.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */De("text",{x:(F+B)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:ys.label,children:n}),a&&/* @__PURE__ */De("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:ys.label,children:a}),
|
|
895
|
+
/* @__PURE__ */De("g",{clipPath:`url(#${k})`,children:L.map((e,t)=>{const r=ws(t,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */De("circle",{cx:T(n.x),cy:O(n.y),r:A?R(n.size??0):u[0]+1,fill:r,fillOpacity:N&&N.s!==t?.25:.62,stroke:ys.surface,strokeWidth:2,onMouseEnter:()=>M({s:t,i:a})},`${e.key}-${a}`))})})]}),N&&W&&H&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(lc,{title:H.label??W.label,rows:[{key:"x",label:n??p.xAxis,color:ws(N.s,W.color,W.tone),value:f(H.x)},{key:"y",label:a??p.yAxis,color:ws(N.s,W.color,W.tone),value:b(H.y)},...null!=H.size?[{key:"size",label:p.size,color:ys.muted,value:Q(H.size,g)}]:[]],footnote:H.label?W.label:void 0})})]})}function yc({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=220,width:l,max:i,min:o,formatValue:s,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=G().charts,b=Z(),x=s??(e=>Q(e,b)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=ws(0,d,u);/* @__PURE__ */
|
|
896
896
|
return De(cc,{labels:t,values:v,height:a,width:l,max:i,min:o,formatValue:x,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(y,t.length),tooltip:r=>/* @__PURE__ */De(lc,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:x(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:x(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */De("g",{children:e.map((e,r)=>/* @__PURE__ */De("rect",{x:t(r),y:a(e.high),width:Math.max(1,t.bandwidth),height:Math.max(1,a(e.low)-a(e.high)),rx:g,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */je("g",{children:[(()=>{const r=e.map((e,r)=>[t.center(r),a(e.high)]),l=e.map((e,r)=>[t.center(r),a(e.low)]);/* @__PURE__ */
|
|
897
897
|
return je(Ae,{children:[
|
|
898
|
-
/* @__PURE__ */De("path",{d:
|
|
898
|
+
/* @__PURE__ */De("path",{d:Is(Es(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
|
|
899
899
|
/* @__PURE__ */De("path",{d:Es(r,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
|
|
900
900
|
/* @__PURE__ */De("path",{d:Es(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */De("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:ys.axis,strokeWidth:1})]})})}function vc({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:o=3,connectors:s=!0}){const c=G().charts,d=Z(),u=n??(e=>Q(e,d));let h=0;const m=e.map(e=>{if(e.total){const t={from:0,to:h,value:h,total:!0};return{...e,...t}}const t=h;return h+=e.value,{...e,from:t,to:h,value:e.value,total:!1}}),p=m.flatMap(e=>[e.from,e.to]);/* @__PURE__ */
|
|
901
901
|
return De(cc,{labels:e.map(e=>e.label),values:p,height:t,width:r,formatValue:u,yAxisLabel:a,className:l,emptyLabel:i,bandPadding:.36,ariaLabel:c.waterfall(e.length,u(m[0]?.from??0),u(h)),tooltip:e=>{const t=m[e],r=t?.total?xs.neutral:t.value>=0?xs.good:xs.critical;/* @__PURE__ */
|
|
@@ -917,7 +917,7 @@ return De(lc,{title:r.label,rows:[{key:"open",label:c.open,color:a,value:u(r.ope
|
|
|
917
917
|
return je("g",{opacity:d?.45:1,children:[
|
|
918
918
|
/* @__PURE__ */De("line",{x1:s,y1:n(e.high),x2:s,y2:n(e.low),stroke:o,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */De("rect",{x:s-c/2,y:u,width:c,height:h,rx:1,fill:i?o:"transparent",fillOpacity:i?.85:1,stroke:o,strokeWidth:1.5}):/* @__PURE__ */je(Ae,{children:[
|
|
919
919
|
/* @__PURE__ */De("line",{x1:s-c/2,y1:n(e.open),x2:s,y2:n(e.open),stroke:o,strokeWidth:2}),
|
|
920
|
-
/* @__PURE__ */De("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function Mc({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:o,label:s,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=G().charts,p=Z(),g=o??(e=>Q(e,p)),f=s??m.intensity,b=d??m.noActivity,x=fe(null),y=Zs(x),v=a??y,w=me(),[k,N]=ge(null);if(xe(()=>{if(null!==k)return
|
|
920
|
+
/* @__PURE__ */De("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function Mc({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:o,label:s,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=G().charts,p=Z(),g=o??(e=>Q(e,p)),f=s??m.intensity,b=d??m.noActivity,x=fe(null),y=Zs(x),v=a??y,w=me(),[k,N]=ge(null);if(xe(()=>{if(null!==k)return I(e=>"Escape"===e.key&&(N(null),!0))},[k]),0===e.length||0===t.length)/* @__PURE__ */
|
|
921
921
|
return De("div",{className:c,ref:x,children:/* @__PURE__ */De("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const M=l??ws(0),$=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=n??L+26+26,j=Math.max(2,(Math.max(97,v)-C)/t.length),A=e=>{const t=$>0?Math.max(0,Math.min(1,e/$)):0;return`color-mix(in oklab, ${M} ${(8+92*t).toFixed(1)}%, ${ys.surface})`};/* @__PURE__ */
|
|
922
922
|
return je("div",{className:`relative ${c??""}`,ref:x,children:[
|
|
923
923
|
/* @__PURE__ */je("svg",{width:"100%",height:D,viewBox:`0 0 ${v} ${D}`,role:"img","aria-label":m.heatmap(f,e.length,t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>N(null),onBlur:()=>N(null),onKeyDown:r=>{const n="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,a="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===n&&0===a||(r.preventDefault(),N(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+n)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+a))})))},children:[
|
|
@@ -945,11 +945,11 @@ return je("g",{opacity:$(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:o?`url(#${Ya(p
|
|
|
945
945
|
/* @__PURE__ */De("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:x.map((e,t)=>/* @__PURE__ */je("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
946
946
|
/* @__PURE__ */De("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:ws(t,e.color,e.tone)}}),
|
|
947
947
|
/* @__PURE__ */De("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
948
|
-
/* @__PURE__ */De($c,{caption:d.acrossMeasures(x.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:x.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}function jc({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:o,centerLabel:s,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=G().charts,g=Z(),f=o??(e=>Q(e,g)),b=i??p.other,x=m??p.nothingToBreakDown,y=me(),[v,w]=ge(null),{highlighted:k}=Us(),N=e.filter(e=>e.value>0);if(0===N.length)/* @__PURE__ */return De("p",{className:`text-sm text-gray-500 ${h??""}`,children:x});const M=[...N].sort((e,t)=>t.value-e.value),$=M.slice(0,l),C=M.slice(l),L=C.length>0?[...$,{key:"__other__",label:b,value:C.reduce((e,t)=>e+t.value,0)}]:$,D=L.reduce((e,t)=>e+t.value,0),j=r/2,A=r/2,P=r/2-12,S=n??("ring"===t?.58*P:0),z=Ls(L.length,a),F=Math.max(...L.map(e=>e.value)),B=e=>S+(P-S)*Math.sqrt(Math.max(0,e)/F);let E=-Math.PI/2;const
|
|
948
|
+
/* @__PURE__ */De($c,{caption:d.acrossMeasures(x.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:x.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}function jc({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:o,centerLabel:s,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=G().charts,g=Z(),f=o??(e=>Q(e,g)),b=i??p.other,x=m??p.nothingToBreakDown,y=me(),[v,w]=ge(null),{highlighted:k}=Us(),N=e.filter(e=>e.value>0);if(0===N.length)/* @__PURE__ */return De("p",{className:`text-sm text-gray-500 ${h??""}`,children:x});const M=[...N].sort((e,t)=>t.value-e.value),$=M.slice(0,l),C=M.slice(l),L=C.length>0?[...$,{key:"__other__",label:b,value:C.reduce((e,t)=>e+t.value,0)}]:$,D=L.reduce((e,t)=>e+t.value,0),j=r/2,A=r/2,P=r/2-12,S=n??("ring"===t?.58*P:0),z=Ls(L.length,a),F=Math.max(...L.map(e=>e.value)),B=e=>S+(P-S)*Math.sqrt(Math.max(0,e)/F);let E=-Math.PI/2;const T=(()=>{if("outside"!==d)return[];let e=-Math.PI/2;const r=L.map((r,n)=>{const l="rose"===t?Ls(L.length,a).step:r.value/D*Math.PI*2,i="rose"===t?Ls(L.length,a).center(n):e+l/2;e+=l;const o="rose"===t?B(r.value):P;return{key:r.key,label:r.label,share:r.value/D,right:Math.cos(i)>=0,anchor:[j+o*Math.cos(i),A+o*Math.sin(i)],y:A+(o+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u);for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<15&&(t[e].y=t[e-1].y+15)}return r})(),I=(e,t)=>null!==v?v!==e:null!==k&&k!==t,O=null!==v?L[v]:void 0;/* @__PURE__ */
|
|
949
949
|
return je("div",{className:`relative ${h??""}`,children:[
|
|
950
950
|
/* @__PURE__ */je("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":y,onMouseLeave:()=>w(null),children:[
|
|
951
951
|
/* @__PURE__ */De("title",{id:y,children:p.breakdown(f(D),L.length)}),L.map((e,r)=>{const n=ws(r,e.color,e.tone),l="rose"===t?z(r):E,i="rose"===t?z.step:e.value/D*Math.PI*2-a;"rose"!==t&&(E+=e.value/D*Math.PI*2);const o=l+Math.max(.001,i),s="rose"===t?B(e.value):P;/* @__PURE__ */
|
|
952
|
-
return De("path",{d:Rs(j,A,S,s,l,o),fill:n,fillOpacity:
|
|
952
|
+
return De("path",{d:Rs(j,A,S,s,l,o),fill:n,fillOpacity:I(r,e.key)?.4:1,stroke:ys.surface,strokeWidth:1,className:c?rl.sweep:void 0,style:c?nl(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),T.map(e=>{const t=e.right?r-6:6,n=e.right?r-58:58;/* @__PURE__ */
|
|
953
953
|
return je("g",{children:[
|
|
954
954
|
/* @__PURE__ */De("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${n},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:ys.grid,strokeWidth:1}),
|
|
955
955
|
/* @__PURE__ */De("text",{x:t,y:e.y-2,fontSize:10.5,fill:ys.label,textAnchor:e.right?"end":"start",children:e.label}),
|
|
@@ -985,7 +985,7 @@ return je("g",{opacity:$&&$!==e.key?.55:1,onMouseEnter:()=>b(e.key),children:[
|
|
|
985
985
|
/* @__PURE__ */De($c,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function Fc(e,t,r,n,a,l,i,o){if(n>=8)return;const s=e.reduce((e,t)=>e+Bc(t,8-n),0);if(s<=0)return;let c=t;e.forEach((e,t)=>{const d=Bc(e,8-n),u=d/s*r,h=`${i}/${e.key}`,m=0===n?t:a,p=0===n?e.key:l;o.push({id:h,label:e.label,value:d,depth:n,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&Fc(e.children,c,u,n+1,m,p,h,o),c+=u})}function Bc(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+Bc(r,t-1),0):Math.max(0,e.value??0)}function Ec({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:o}){const s=G().charts,c=Z(),d=a??(e=>Q(e,c)),u=o??s.nothingToBreakDown,[h,m]=ge(null),{highlighted:p}=Us(),g=[];if(Fc(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return De("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,b=t/2,x=t/2,y=(t/2-8-r)/f,v=g.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),w=e=>`color-mix(in oklab, ${ws(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${ys.surface})`,k=e=>null!==h?e.id===h:null===p||e.branchKey===p,N=h?g.find(e=>e.id===h):void 0,M=e=>te(e.value/v*100,1,c);/* @__PURE__ */
|
|
986
986
|
return je("div",{className:`relative ${i??""}`,children:[
|
|
987
987
|
/* @__PURE__ */je("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":s.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */De("path",{d:Rs(b,x,r+e.depth*y+n/2,r+(e.depth+1)*y-n/2,e.start,e.end),fill:w(e),fillOpacity:k(e)?1:.45,stroke:ys.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */De("text",{x:b,y:x+5,textAnchor:"middle",fontSize:15,fontWeight:600,fill:ys.label,children:l})]}),N&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(lc,{title:N.label,rows:[{key:"value",label:s.value,color:w(N),value:d(N.value)},{key:"share",label:s.share,color:ys.muted,value:M(N)}]})}),
|
|
988
|
-
/* @__PURE__ */De($c,{caption:s.sunburst(d(v),f),head:[s.tableLevel,s.tableItem,s.value,s.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),M(e)])})]})}function
|
|
988
|
+
/* @__PURE__ */De($c,{caption:s.sunburst(d(v),f),head:[s.tableLevel,s.tableItem,s.value,s.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),M(e)])})]})}function Tc({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:o,emptyLabel:s}){const c=G().charts,d=Z(),u=i??(e=>Q(e,d)),h=s??c.noFlows,m=fe(null),p=Zs(m),g=n??p,[f,b]=ge(null),{highlighted:x}=Us();if(0===e.length||0===t.length)/* @__PURE__ */
|
|
989
989
|
return De("div",{className:o,ref:m,children:/* @__PURE__ */De("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const y=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>y.length<=1?0:y.indexOf(e)/(y.length-1)*(g-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),k=/* @__PURE__ */new Map;for(const t of e)k.set(t.depth,[...k.get(t.depth)??[],t]);const N=Math.max(...[...k.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),M=r-20,$=N>0?(M-l*(Math.max(...[...k.values()].map(e=>e.length))-1))/N:0,C=/* @__PURE__ */new Map;for(const[e,t]of k){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*$)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>M&&a>0?Math.max(0,1-(n-M)/a):1;let o=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:o,h:a,index:n}),o+=a+l})}const L=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,j=/* @__PURE__ */new Map,A=(e,t)=>e.from===t||e.to===t,P="link"===f?.kind?t[f.index]:void 0,S="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
|
|
990
990
|
return je("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
991
991
|
/* @__PURE__ */je("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>b(null),children:[t.map((e,t)=>{const r=C.get(e.from),n=C.get(e.to);if(!r||!n)return null;const l=Math.max(1,e.value*$),i=r.y+(L.get(e.from)??0)+l/2,o=n.y+(D.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),D.set(e.to,(D.get(e.to)??0)+l);const s=r.x+a,c=n.x,d=ws(r.index,e.color),u=`${e.from}→${e.to}`,h=j.get(u)??0;j.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:A(e,f.key):null!==x?A(e,x):null)(e,t);/* @__PURE__ */
|
|
@@ -993,11 +993,11 @@ return De("path",{d:Bs([[s,i],[c,o]]),fill:"none",stroke:d,strokeWidth:l,strokeO
|
|
|
993
993
|
return je("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>b({kind:"node",key:e.key}),children:[
|
|
994
994
|
/* @__PURE__ */De("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:ws(r.index,e.color,e.tone)}),
|
|
995
995
|
/* @__PURE__ */De("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:ys.label,children:e.label})]},e.key)})]}),P&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(lc,{title:`${P.from} → ${P.to}`,rows:[{key:"value",label:c.flow,color:ws(C.get(P.from)?.index??0,P.color),value:u(P.value)}]})}),S&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(lc,{title:S.label,rows:[{key:"value",label:c.throughput,color:ws(C.get(S.key)?.index??0,S.color,S.tone),value:u(w.get(S.key)??0)}]})}),
|
|
996
|
-
/* @__PURE__ */De($c,{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
|
|
996
|
+
/* @__PURE__ */De($c,{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 Ic({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=G().charts,d=Z(),u=i??(e=>Q(e,d)),h=s??c.noFlows,[m,p]=ge(null),{highlighted:g}=Us(),f=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},b=e.map((t,r)=>e.reduce((e,t,n)=>e+f(r,n)+f(n,r),0)),x=e.map((e,t)=>t).sort((e,t)=>b[t]-b[e]).slice(0,n),y=x.reduce((e,t)=>e+b[t],0);if(y<=0)/* @__PURE__ */return De("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const v=r/2,w=r/2,k=r/2-44,N=k-l,M=a*x.length,$=/* @__PURE__ */new Map;let C=-Math.PI/2;x.forEach((e,t)=>{const r=b[e]/y*(2*Math.PI-M);$.set(e,{start:C,end:C+r,slot:t}),C+=r+a});const L=/* @__PURE__ */new Map,D=[];for(const e of x)for(const t of x){const r=f(e,t);if(r<=0)continue;const n=$.get(e),a=r/Math.max(1,b[e])*(n.end-n.start),l=L.get(e)??0;L.set(e,l+a),D.push({from:e,to:t,value:r,a:n.start+l+a/2,b:$.get(t).start+($.get(t).end-$.get(t).start)/2})}const j=(e,t)=>[v+t*Math.cos(e),w+t*Math.sin(e)],A="arc"===m?.kind?m.index:void 0,P="ribbon"===m?.kind?D[m.index]:void 0;/* @__PURE__ */
|
|
997
997
|
return je("div",{className:`relative ${o??""}`,children:[
|
|
998
998
|
/* @__PURE__ */je("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord(x.length),onMouseLeave:()=>p(null),children:[D.map((t,n)=>{const[a,l]=j(t.a,N),[i,o]=j(t.b,N),s=ws($.get(t.from).slot),c=((t,r)=>m?"ribbon"===m.kind?m.index===r:m.index===t.from||m.index===t.to:null!==g?e[t.from]===g||e[t.to]===g:null)(t,n);/* @__PURE__ */
|
|
999
999
|
return De("path",{d:`M${a},${l} Q${v},${w} ${i},${o}`,fill:"none",stroke:s,strokeWidth:Math.max(1,t.value/y*r*.9),strokeOpacity:null===c||c?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:n})},`${e[t.from]}→${e[t.to]}`)}),x.map(t=>{const r=$.get(t),n=(r.start+r.end)/2,[a,l]=j(n,k+16),i=(t=>m?"arc"===m.kind?m.index===t:D[m.index].from===t||D[m.index].to===t:null!==g?e[t]===g:null)(t);/* @__PURE__ */
|
|
1000
1000
|
return je("g",{onMouseEnter:()=>p({kind:"arc",index:t}),children:[
|
|
1001
1001
|
/* @__PURE__ */De("path",{d:Rs(v,w,N,k,r.start,r.end),fill:ws(r.slot),fillOpacity:null===i||i?1:.45}),
|
|
1002
1002
|
/* @__PURE__ */De("text",{x:a,y:l+4,fontSize:11,fill:ys.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==A&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(lc,{title:e[A],rows:[{key:"total",label:c.totalFlow,color:ws($.get(A).slot),value:u(b[A])}]})}),P&&/* @__PURE__ */De("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */De(lc,{title:`${e[P.from]} → ${e[P.to]}`,rows:[{key:"value",label:c.flow,color:ws($.get(P.from).slot),value:u(P.value)}]})}),
|
|
1003
|
-
/* @__PURE__ */De($c,{caption:c.chord(x.length),head:[c.tableFrom,c.tableTo,c.value],rows:D.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{Vi as APP_UPDATE_POLL_MS,fa as Accordion,Zi as AppUpdateBanner,pn as AttachButton,hn as AttachmentDropZone,mn as AttachmentList,Ko as AuthScreen,na as Avatar,aa as AvatarGroup,sa as Banner,go as BarChart,kc as BoxPlotChart,Mt as BrandAssetEditor,Ha as BudgetBar,ys as CHART_INK,ns as CORNERS,Ot as Calendar,Nc as CandlestickChart,vn as Card,cc as CartesianPlot,oc as ChartBrush,el as ChartDefs,ic as ChartDot,ac as ChartFrame,qs as ChartHighlightProvider,tc as ChartSkeleton,lc as ChartTooltip,
|
|
1003
|
+
/* @__PURE__ */De($c,{caption:c.chord(x.length),head:[c.tableFrom,c.tableTo,c.value],rows:D.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{Vi as APP_UPDATE_POLL_MS,fa as Accordion,Zi as AppUpdateBanner,pn as AttachButton,hn as AttachmentDropZone,mn as AttachmentList,Ko as AuthScreen,na as Avatar,aa as AvatarGroup,sa as Banner,go as BarChart,kc as BoxPlotChart,Mt as BrandAssetEditor,Ha as BudgetBar,ys as CHART_INK,ns as CORNERS,Ot as Calendar,Nc as CandlestickChart,vn as Card,cc as CartesianPlot,oc as ChartBrush,el as ChartDefs,ic as ChartDot,ac as ChartFrame,qs as ChartHighlightProvider,tc as ChartSkeleton,lc as ChartTooltip,Io as ChatTemplate,tt as Checkbox_default,So as CheckoutTemplate,Ic as ChordChart,sn as ColorPicker,ln as ColorPickerPanel,tn as ColorSwatch,Ca as ColoredBadge,fc as ColumnChart,gn as ComposerAttachments,Jl as ContainerFillChart,Ni as ContextMenu,Gn as CountBadge,Ka as DAY_MS,Mo as DashboardTemplate,uo as DataTable,Do as DataTablePage,ir as DatePicker_default,Zt as DateRangePicker,dr as DateTimePicker_default,Vn as DescriptionList,On as Divider,bo as DonutChart,Qi as Drawer,wi as DropdownMenu,Bo as EmailTemplate,La as EmptyState,hs as EmptyValue,Vo as ErrorBoundary,qo as ErrorPage,cn as FilePicker_default,ot as FormErrorSummary,at as FormField,Ao as FormLayoutPage,Sc as FunnelChart,ba as GROUP_COLORS,xa as GROUP_COLORS_SOLID,Wo as GalleryTemplate,Tn as Grid,Mc as HeatmapChart,di as HelpCenter,on as HexInput,wc as HistogramChart,Ee as INPUT_BASE,Be as INPUT_SIZES,Se as IconButton_default,qi as IconRail,Ui as IconRailButton,zn as Inline,Ir as InputNumber_default,Oe as Input_default,eo as Kanban,dt as Label,us as LanguagePanel,ds as LanguageSelect,yo as LineChart,ho as ListFooter,mo as ListLoadError,Wi as ListRow,yr as MAX_FRACTION_DIGITS,rl as MOTION,si as Markdown,Nt as MediaUploadField,Pt as MediaUploadGrid,Js as Meter,Ia as MetricBar,Kl as MilestoneTimeline,Ge as NativeSelect,Nr as NumericKeypad,_l as POST_PRODUCTION_STATUSES,Da as PageHeader,ro as Pagination,dn as PaperclipGlyph,Dn as Paragraph,jc as PieChart,Kr as Popover,Dt as PortalBrandingProvider,Gl as ProductionTimeline,Cc as RADAR_SERIES_CAP,Dc as RadarChart,Pc as RadialBarChart,it as RadioGroup,nt as Radio_default,yc as RangeChart,Gs as RankedBars,bc as SCATTER_SERIES_CAP,fs as SERIES_SLOT_COUNT,bs as SERIES_VARS,ql as STAGES,xs as STATUS_VARS,Tc as SankeyChart,xc as ScatterChart,bn as SearchableSelect,jr as Segmented,Qe as Select_default,Yn as SettingRow,hi as SidebarActionButton,pi as SidebarGroupLabel,bi as SidebarNavGroup,fi as SidebarNavItem,Hn as Skeleton,Wr as Slider,xr as Snippet,Ri as SortableList,po as Sparkline,Sn as Stack,wn as StatCard,ec as StatTile,Qn as Statistic,$a as StatusBadge,Na as StatusBadgeProvider,ga as Stepper,Ec as SunburstChart,zr as Switch_default,ma as Tabs,xn as TagInput,$n as Text,Re as Textarea_default,$r as TileButton_default,ms as TimeAgo,Qt as TimePicker_default,gc as TimeSeriesChart,Wl as TimelineTrack,Ln as Title,xi as TopNav,Si as Tree,Ti as TreeEmptySlot,zi as TreeGroup,Fi as TreeGroupLabel,Ei as TreeRow,Ii as TreeSeam,zc as TreemapChart,vc as WaterfallChart,Ls as angleScale,vr as appendKey,ls as applyCorners,is as applyIconSet,os as applyThemePrefs,Rs as arcPath,Is as areaBetween,Ts as areaFrom,Ys as autoHighlightIndex,wr as backspace,Ns as bandScale,js as binValues,Ra as budgetState,Bs as bumpPath,Ul as calcOverall,Vl as calcReportOverall,Qr as colorFill,en as colorSwatchClasses,mr as copyToClipboard,Es as curvePath,Xa as dashFor,Ga as fillFor,Ua as fillId,We as firstEnabledIndex,qa as fmtSliderDate,Ft as fromKey,Va as glowId,Za as groundId,ya as groupColors,Yr as hexToHsv,Vs as highlightOpacity,Zr as hsvToHex,Ie as inputClasses,Aa as isSeverityTone,ct as labelClasses,Ms as ladderScale,He as lastEnabledIndex,Ps as linearPath,ks as linearScale,Cs as logScale,Ya as maskId,_e as matchTypeahead,ht as mediaFileName,zs as monotonePath,Ke as nextEnabledIndex,$s as niceMax,qr as parseHexColor,Os as polygonPoints,Ds as radiusScale,as as resolveCorners,$t as resolvePortalBrandAsset,ws as resolveSeriesColor,es as resolveTheme,ur as selectionAt,vs as seriesColor,Pa as severityOf,Fs as splinePath,Ks as squarify,nl as stagger,Ss as stepPath,ca as tabButtonId,da as tabPanelId,_a as toDayMs,Kt as toISODate,zt as toKey,Yi as useAppUpdate,gs as useClickOutside,Mi as useContextMenu,ps as useDebouncedValue,Us as useHighlight,Zs as usePlotWidth,jt as usePortalBranding,Yl as useProductionTimeline,Ma as useStatusLabel,ss as useTheme};
|