efficient-shell 7.56.0 → 7.56.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Browser-6SOGC27E.js → Browser-HTH7GWNA.js} +14 -14
- package/dist/Calculator-WUFXRLVM.js +29 -0
- package/dist/{CurrencyConverter-XFICWUGP.js → CurrencyConverter-2A45OUOD.js} +5 -5
- package/dist/{Documents-C7DJOE4M.js → Documents-X33TJJFX.js} +16 -16
- package/dist/{Files-Q5HVPRVK.js → Files-KIJPNW23.js} +80 -80
- package/dist/{Notepad-3XPZIKLE.js → Notepad-O6GFW5XQ.js} +11 -11
- package/dist/PdfViewer-A4WWSSFU.js +1 -0
- package/dist/{PomodoroTimer-ZEPPQYCU.js → PomodoroTimer-LXUCEGO2.js} +6 -6
- package/dist/{Preview-HV2KJRRI.js → Preview-KKLHDTZC.js} +48 -48
- package/dist/{Sidebar-LKER76LS.js → Sidebar-5LMCOUCB.js} +28 -28
- package/dist/{Spreadsheet-URLX55NC.js → Spreadsheet-WOUU5DK7.js} +12 -12
- package/dist/{Stock-M6GGO7XF.js → Stock-L2W6WRVP.js} +1 -1
- package/dist/{Weather-VU7VGUDO.js → Weather-7GK4V2SQ.js} +17 -17
- package/dist/{WorldClock-QAMG23XA.js → WorldClock-2D2YSOTH.js} +6 -6
- package/dist/ai/index.js +13 -13
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-WFQIEKM3.js → chunk-4OKCSGQU.js} +31 -31
- package/dist/{chunk-HCC7EJUD.js → chunk-6ATKOYTG.js} +1 -1
- package/dist/chunk-7L7CUVCD.js +1 -0
- package/dist/{chunk-56DUNIS6.js → chunk-BVEUHQOE.js} +16 -16
- package/dist/{chunk-OWXCXFL6.js → chunk-EYOYUZFK.js} +2 -2
- package/dist/{chunk-DCMTTLLV.js → chunk-GXGRCLNE.js} +1 -1
- package/dist/{chunk-5H3MONF5.js → chunk-HKISG22R.js} +1 -1
- package/dist/{chunk-FP4N53XC.js → chunk-INXHIPJ5.js} +1 -1
- package/dist/{chunk-QGMHTEJ2.js → chunk-JIRDFTVN.js} +4 -4
- package/dist/{chunk-J4NEE4AO.js → chunk-MPAW7WHG.js} +26 -26
- package/dist/{chunk-YIIFH7CK.js → chunk-OGVC2IS3.js} +1 -1
- package/dist/{chunk-H4SBJXBL.js → chunk-ONEEJJK5.js} +1 -1
- package/dist/{chunk-L37CPWIB.js → chunk-RUJK3FOM.js} +13 -13
- package/dist/{chunk-7ZYZDQ5V.js → chunk-UHRGYZRP.js} +4 -4
- package/dist/{chunk-MRQLTNG6.js → chunk-VT6TBIVE.js} +321 -321
- package/dist/index.js +126 -126
- package/dist/map/index.js +7 -7
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-Z6JA6D6Q.js +0 -29
- package/dist/PdfViewer-NW6NQ6NP.js +0 -1
- package/dist/chunk-T6D5LTQR.js +0 -1
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-DRQF3Z2O.js";import{BrandMark as t}from"./chunk-
|
|
1
|
+
import{Breadcrumbs as e}from"./chunk-DRQF3Z2O.js";import{BrandMark as t}from"./chunk-UHRGYZRP.js";import{SidebarLayout as r}from"./chunk-6ST5FSQF.js";import{useShellLanguage as n}from"./chunk-NKOABAWD.js";import{loadIconSet as a,iconSetFor as l}from"./chunk-63RTIL66.js";import{Markdown as i,Banner as o,Textarea_default as s}from"./chunk-BVEUHQOE.js";import{IconButton_default as c}from"./chunk-EU4BCXGA.js";import{inputClasses as d,PLACEHOLDER_INK as u,FILTER_ON as h,FILTER_ON_INK as m,FILTER_OFF as p,INPUT_BASE_ON as f,INPUT_BASE as g,INPUT_SIZES as b}from"./chunk-HJQAE6SP.js";import{isSafeLinkHref as y}from"./chunk-PJPK2ADX.js";import{toast_default as x}from"./chunk-OGVC2IS3.js";import{useIsMobile as v,GROUP_COLORS as w,OneLineLabel as N,useShortcutLabel as k,TH_ONE_LINE as $,StatusBadgeProvider as M,StatusBadge as C,useShellPrefs as L}from"./chunk-2H3XIWVB.js";import{PopupMenu as D,PopupMenuDivider as S,PopupMenuLabel as A,menuTextRowStyle as P,itemLook as j,MenuCheckMark as z,MenuSemanticsContext as F,leavesContextMenuAlone as E}from"./chunk-4AHFABYE.js";import{reportBoundaryError as B}from"./chunk-KNUR2UEG.js";import{useTabLayer as O,focusableIn as T,useFocusTrap as I,useScrollLock as R,dialogA11y as W,stopAfter as K}from"./chunk-J5USRYOM.js";import{useDismissPopupsOnOpen as H}from"./chunk-UVBK6YSR.js";import{Button_default as _}from"./chunk-DELNCIUK.js";import{Tooltip as q,useDropdownPosition as U,MENU_MAX_HEIGHT as V,placeMenu as Y,popupBounds as G,followAnchor as X,VIEWPORT_MARGIN as J,swallowPress as Z,describedByWith as Q,OffWithReason as ee,POPUP_MAX_WIDTH as te,followRect as re,placeAtPoint as ne}from"./chunk-RDLWLATO.js";import{solidSurfaceStyle as ae,glassStyle as le,GLASS_DIVIDER as ie}from"./chunk-7IQ3B77H.js";import{useBrowserLayoutEffect as oe,useBrowserValue as se,useHydrated as ce,useBrowserValueOnce as de,useBrowserState as ue}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as he,onOverlayOpen as me,Z_LAYERS as pe}from"./chunk-FIEA5CGB.js";import{iconButtonClasses as fe,buttonClasses as ge}from"./chunk-K7PQXJO7.js";import{Icon as be,setIconSet as ye}from"./chunk-TAUIAKU3.js";import{parseFocal as xe,formatFocal as ve,nudgeFocal as we,focalFromRect as Ne}from"./chunk-AP2QEJXQ.js";import{calendarNames as ke,firstDayOfWeek as $e,formatDate as Me,EMPTY_VALUE as Ce,toInstant as Le,timeAgo as De,formatDateTime as Se}from"./chunk-W32SKK3D.js";import{useFileIntake as Ae,humanSize as Pe,FileIntakeAlert as je}from"./chunk-54LUMK66.js";import{useShellStrings as ze,useShellLocale as Fe,DEFAULT_SHELL_STRINGS as Ee,currentShellStrings as Be,splitAround as Oe}from"./chunk-BLMDTJOK.js";import{formatPlain as Te,formatFixed as Ie,formatPercent as Re}from"./chunk-C3QOHMR6.js";import{SpinnerRing as We,LoadingSpinner as Ke}from"./chunk-2J6F4EE7.js";import{forwardRef as He,useId as _e,useState as qe,useRef as Ue,useMemo as Ve,useCallback as Ye,useEffect as Ge,createContext as Xe,useLayoutEffect as Je,Children as Ze,isValidElement as Qe,cloneElement as et,useContext as tt,Fragment as rt,Component as nt,useSyncExternalStore as at}from"react";import{jsxs as lt,jsx as it,Fragment as ot}from"react/jsx-runtime";import{createPortal as st}from"react-dom";var ct=/(^|[\s:])!?z-/,dt={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"},ut=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled;function ht({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,"aria-disabled":m=!1,onOpenChange:p,footer:f,footerLabel:g}){const[b,y]=qe(!1),[x,v]=qe(-1),w=Ue(null),N=Ue(null),k=Ue(null),$=Ue(null),M=Ue(null),C=null!=f&&!1!==f,L=Ue({text:"",at:0}),F=_e(),E=_e(),B=u??E,I=Ue(p);I.current=p;const R=Ue(b);R.current=b;const W=Ye(e=>{y(!1),R.current&&(R.current=!1,I.current?.(!1)),e&&N.current?.focus()},[]),K=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(ut(t[l]))return l}return-1},H=()=>k.current?.closest("[data-popup-menu-tree]")??null;Ge(()=>{if(!b)return;const e=e=>{const t=e.target;w.current?.contains(t)||H()?.contains(t)||W(!1)};document.addEventListener("pointerdown",e,!0);const t=me(()=>W(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[b,W]);const _=Ye(()=>{const e=H(),t=N.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:G(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]);oe(()=>{b&&_()}),Ge(()=>{if(b)return X(()=>N.current,_)},[b,_]),Ge(()=>{if(!b)return;const e=k.current,r=ut(t[x])?e?.querySelector(`[data-dropdown-index="${x}"]`):null;(r??e)?.focus({preventScroll:!0})},[b,x]),Ge(()=>{if(b)return he(e=>"Escape"===e.key&&(W(!0),!0),()=>$.current)},[b,W]),O($,b&&C);const q=Ue(null),U=e=>"first"===e?K(0,1):K(t.length-1,-1),V=e=>{v(U(e)),y(!0),R.current||(R.current=!0,q.current=e,p?.(!0))};oe(()=>{const e=q.current;if(!b||!e)return;q.current=null;const t=U(e);t!==x&&v(t)});const J=e=>{e.disabled||(W(!0),e.onSelect())},Z=c??"a",Q=e=>`${F}-status-${e}`,ee=t.flatMap((e,t)=>"status"===e.type?[Q(t)]:[]).join(" ")||void 0,te=(e,t)=>({"data-dropdown-index":e,tabIndex:e===x?0:-1,onMouseEnter:()=>{t.disabled||M.current?.contains(document.activeElement)||v(e)}}),re=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
|
|
2
2
|
return it("div",{role:"separator",children:/* @__PURE__ */it(S,{})},e.key);if("label"===e.type)/* @__PURE__ */
|
|
3
3
|
return it("div",{id:`${F}-label-${t}`,children:/* @__PURE__ */it(A,{children:e.label})},e.key);if("status"===e.type)/* @__PURE__ */
|
|
4
|
-
return it("div",{id:Q(t),className:"text-xs",style:
|
|
4
|
+
return it("div",{id:Q(t),className:"text-xs",style:P(),children:e.label},e.key);if("checkbox"===e.type){const r=j(!1,e.disabled,"");/* @__PURE__ */
|
|
5
5
|
return lt("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),...te(t,e),children:[
|
|
6
|
-
/* @__PURE__ */it(z,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=
|
|
7
|
-
return lt("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>
|
|
8
|
-
/* @__PURE__ */it(z,{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=
|
|
9
|
-
return lt("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>
|
|
6
|
+
/* @__PURE__ */it(z,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=j(!1,e.disabled,"");/* @__PURE__ */
|
|
7
|
+
return lt("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>J(e),...te(t,e),children:[
|
|
8
|
+
/* @__PURE__ */it(z,{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=j(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */lt("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...te(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */lt(Z,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>W(!0),...te(t,e),children:[e.icon,e.label]},e.key)}const r=j(e.danger,e.disabled,"");/* @__PURE__ */
|
|
9
|
+
return lt("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>J(e),...te(t,e),children:[e.icon,e.label]},e.key)},ne="function"==typeof f?f({close:()=>W(!0)}):f,ae={...ct.test(o)?{}:{zIndex:pe.popup},minWidth:s};/* @__PURE__ */
|
|
10
10
|
return lt("div",{ref:w,className:`relative inline-flex ${l}`.trim(),children:[
|
|
11
11
|
/* @__PURE__ */it("button",{ref:N,id:B,type:"button","aria-haspopup":"menu","aria-expanded":b,"aria-controls":b?F:void 0,"aria-label":a,"aria-describedby":h,"aria-disabled":m||void 0,disabled:d,onClick:()=>{m||(b?W(!1):V("first"))},onKeyDown:e=>{m||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),V("first")):"ArrowUp"===e.key&&(e.preventDefault(),V("last")))},className:i??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled: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 "+(a?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:e}),b&&
|
|
12
12
|
/* @__PURE__ */it(D,{portal:!0,className:o,style:ae,children:/* @__PURE__ */lt("div",{ref:$,children:[
|
|
13
13
|
/* @__PURE__ */it("div",{ref:k,id:F,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:B,"aria-describedby":ee,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),v(K(x+1,1));else if("ArrowUp"===e.key)e.preventDefault(),v(K(x-1,-1));else if("Home"===e.key)e.preventDefault(),v(K(0,1));else if("End"===e.key)e.preventDefault(),v(K(t.length-1,-1));else if("Tab"===e.key){e.preventDefault();const t=!e.shiftKey&&M.current?T(M.current)[0]:void 0;t?t.focus({preventScroll:!0}):W(!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-L.current.at<500?L.current.text+n:n;L.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?x+1:Math.max(x,0),s=k.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(ut(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void v(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(re(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(re(t[r],r)),r+=1;const o="label"===t[l-1]?.type?`${F}-label-${l-1}`:void 0;e.push(/* @__PURE__ */it("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()}),C&&/* @__PURE__ */lt("div",{ref:M,role:"group","aria-label":g,"data-dropdown-footer":"",onKeyDown:e=>{const t=M.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=T(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=k.current?.querySelector(`[data-dropdown-index="${x}"]`);return void(t??k.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),W(!0))},children:[
|
|
14
14
|
/* @__PURE__ */it("div",{"aria-hidden":"true",children:/* @__PURE__ */it(S,{})}),
|
|
15
|
-
/* @__PURE__ */it("div",{style:dt,children:ne})]})]})})]})}var mt="relative focus-visible:z-10",pt={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},ft=
|
|
15
|
+
/* @__PURE__ */it("div",{style:dt,children:ne})]})]})})]})}var mt="relative focus-visible:z-10",pt={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},ft=He(function({children:e,onClick:t,type:r="button",items:n,menuLabel:a,variant:l="primary",size:i="md",loading:o=!1,leftIcon:s,disabled:c=!1,disabledReason:d,tooltip:u,menuDisabled:h=!1,menuDisabledReason:m,onMenuOpenChange:p,menuFooter:f,menuFooterLabel:g,align:b="end",side:y="bottom",menuMinWidth:x,linkAs:v,block:w=!1,className:N=""},k){const $=c&&(null!=d&&""!==d&&!1!==d)&&!o,M=h&&null!=m&&""!==m&&!1!==m,C=_e(),L=/* @__PURE__ */it(_,{ref:k,type:r,variant:l,size:i,loading:o,leftIcon:s,block:w,disabled:c&&!$,"aria-disabled":!!$||void 0,disabledReason:$?d:void 0,onClick:t,className:`rounded-r-none ${mt}`,children:e}),D=w?"relative flex min-w-0 flex-1":"relative inline-flex",S=i.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
16
16
|
return lt("div",{className:[w?"flex w-full":"inline-flex","items-stretch",N].filter(Boolean).join(" "),children:[null==u||""===u||$?L:/* @__PURE__ */it(q,{content:u,className:D,children:L}),
|
|
17
|
-
/* @__PURE__ */it(q,{content:M?m:a,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */it(ht,{"aria-label":a,"aria-describedby":M?C:void 0,items:n,align:b,side:y,minWidth:x,linkAs:v,disabled:h&&!M,"aria-disabled":M,onOpenChange:p,footer:f,footerLabel:g,triggerClassName:fe({variant:l,size:i,className:`rounded-l-none ${pt[l]} ${mt}`}),trigger:/* @__PURE__ */it(
|
|
17
|
+
/* @__PURE__ */it(q,{content:M?m:a,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */it(ht,{"aria-label":a,"aria-describedby":M?C:void 0,items:n,align:b,side:y,minWidth:x,linkAs:v,disabled:h&&!M,"aria-disabled":M,onOpenChange:p,footer:f,footerLabel:g,triggerClassName:fe({variant:l,size:i,className:`rounded-l-none ${pt[l]} ${mt}`}),trigger:/* @__PURE__ */it(be,{name:"chevron-down",className:S,strokeWidth:2,"aria-hidden":"true"})})}),M&&/* @__PURE__ */it("span",{id:C,className:"sr-only",children:m})]})}),gt=He(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",readOnly:l,...i},o){const s=`${t?"pl-10":""} ${r?"pr-10":""}`.trim(),c=
|
|
18
18
|
/* @__PURE__ */it("input",{ref:o,"aria-invalid":e||void 0,readOnly:l,className:d({invalid:e,size:n,readOnly:l,className:[s,a].filter(Boolean).join(" ")}),...i});return t||r?/* @__PURE__ */lt("div",{className:"relative",children:[t&&/* @__PURE__ */it("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${u}`,children:t}),c,r&&/* @__PURE__ */it("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):c});function bt(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function yt(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function xt(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?bt(e):yt(e)}function vt(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 wt=e=>Array.isArray(e.options);function Nt(e){const t=[];for(const r of e)wt(r)?t.push(...r.options):t.push(r);return t}function kt(e,t){const r=[];for(const n of e){if(!wt(n)){t(n)&&r.push(n);continue}const e=n.options.filter(t);e.length&&r.push({...n,options:e})}return r}function $t(e,t,r,n=""){const a=[];let l=0;return e.forEach((e,i)=>{if(!wt(e))return a.push(t(e,l)),void(l+=1);const o=`${r}-group-${i}`,s=l;l+=e.options.length,a.push(
|
|
19
19
|
/* @__PURE__ */lt("div",{role:"group","aria-labelledby":o,children:[
|
|
20
20
|
/* @__PURE__ */it("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 Mt({selected:e}){/* @__PURE__ */
|
|
21
|
-
return it(
|
|
22
|
-
return it("span",{className:`min-w-0 ${t?"shrink":"max-w-[45%] shrink-0"} truncate text-xs text-gray-400`,children:e})}var Dt=
|
|
21
|
+
return it(be,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(e?"":"invisible"),strokeWidth:2.5})}function Ct(e,t){return e.label.toLowerCase().includes(t)||(e.sublabel?.toLowerCase().includes(t)??!1)}function Lt({children:e,grows:t=!1}){/* @__PURE__ */
|
|
22
|
+
return it("span",{className:`min-w-0 ${t?"shrink":"max-w-[45%] shrink-0"} truncate text-xs text-gray-400`,children:e})}var Dt=He(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:i,touchSize:o,renderOption:s,renderValue:c,valueText:u,readOnly:h,footer:m,changed:p,multiple:f,...g},b){const y=t;/* @__PURE__ */
|
|
23
23
|
return lt("select",{ref:b,value:e,multiple:f||void 0,onChange:e=>y(f?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":a||void 0,className:d({invalid:a,size:i,className:`pr-8 ${l}`.trim()}),...g,children:[void 0!==n&&!f&&/* @__PURE__ */it("option",{value:"",disabled:!0,children:n}),
|
|
24
24
|
/* @__PURE__ */it(St,{items:r})]})});function St({items:e}){const t=e=>/* @__PURE__ */it("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
25
|
-
return it(ot,{children:e.map((e,r)=>(e=>wt(e))(e)?/* @__PURE__ */it("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var At=
|
|
26
|
-
return lt("div",{id:G(r),role:"option",lang:t.description||p?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||D(r)},onClick:()=>ge(r),className:`mx-1 cursor-pointer truncate rounded-lg ${
|
|
25
|
+
return it(ot,{children:e.map((e,r)=>(e=>wt(e))(e)?/* @__PURE__ */it("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var At=He(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:i,disabled:o,size:s,touchSize:c,title:h,multiple:m,renderOption:p,renderValue:f,valueText:g,readOnly:b=!1,footer:y,changed:x=!1,"aria-describedby":v,"aria-label":w,"aria-labelledby":N,...k},$){const[M,C]=qe(!1),[L,D]=qe(-1),S=Ue(null),A=Ue(null),P=Ue(null),j=Ue(null),z=Ue([]),F=()=>j.current??P.current,E=!!y?.length,B="sm"===s,O=B?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",T=B?"text-2xs leading-4":"text-xs leading-4",[I,R]=qe(null),W=ze(),K=Ue(M);K.current=M;const H=Ue({buffer:"",timer:null}),_=_e(),q=`${_}-listbox`,Y=i??`${_}-trigger`,G=e=>`${_}-opt-${e}`,X=`${_}-changed`,J=[v,x?X:void 0].filter(Boolean).join(" ")||void 0,Z=Ve(()=>Nt(r),[r]),Q=m?e:[],ee=t,te=U(A,M,{matchTriggerWidth:!0,...y?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),re="undefined"==typeof window?Ge:Je,ne=`${M}|${te?.top}|${te?.bottom}|${te?.maxHeight}|${r.length}`;re(()=>{R(null)},[ne]),re(()=>{const e=P.current;if(!M||!e||null!==I)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let a=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;a=r}a>r&&R(Math.floor(a))},[M,I,ne]);const le=m?Z.findIndex(e=>Q.includes(e.value)):Z.findIndex(t=>t.value===e),ie=m?Z.filter(e=>Q.includes(e.value)).map(e=>e.label).join(", ")||void 0:le>=0?Z[le].label:void 0,oe=!m&&le>=0?Z[le].lang:void 0,se=m?Z.filter(e=>Q.includes(e.value)):le>=0?[Z[le]]:[],ce=f&&se.length?f(se):void 0,de=void 0!==ce&&g?g(se):void 0,ue=Ye((e=!0)=>{C(!1),D(-1),e&&A.current?.focus()},[]),fe=Ye(()=>{o||b||(D(le>=0?le:bt(Z)),C(!0))},[o,b,Z,le]),ge=Ye(t=>{const r=Z[t];if(r&&!r.disabled){if(m){const n=e;return ee(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void D(t)}ee(r.value),ue()}},[Z,m,e,ee,ue]);Ge(()=>{if(!M)return;return he(e=>!("Escape"!==e.key||!K.current)&&(ue(),!0),F)},[M,ue]),Ge(()=>{if(!M)return;const e=e=>{const t=e.target;S.current?.contains(t)||F()?.contains(t)||ue(!1)};document.addEventListener("pointerdown",e);const t=me(()=>ue(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[M,ue]),Ge(()=>{!M||L<0||P.current?.querySelector(`#${CSS.escape(G(L))}`)?.scrollIntoView({block:"nearest"})},[M,L]);const ye=Ye(e=>{const t=H.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=M?L:le,n=vt(Z,t.buffer,r);n<0||(M?D(n):m?(D(n),C(!0)):ge(n))},[M,L,le,Z,ge,m]),xe=M?$t(r,(t,r)=>{const n=(a=t.value,m?Q.includes(a):e===a);var a;const l=r===L;/* @__PURE__ */
|
|
26
|
+
return lt("div",{id:G(r),role:"option",lang:t.description||p?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||D(r)},onClick:()=>ge(r),className:`mx-1 cursor-pointer truncate rounded-lg ${O}${m?" 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:[m&&/* @__PURE__ */it(Mt,{selected:n}),p?/* @__PURE__ */it("span",{className:"block min-w-0 flex-1 truncate",children:p(t,{selected:n,active:l})}):m?/* @__PURE__ */lt("span",{className:"block min-w-0 flex-1",children:[
|
|
27
27
|
/* @__PURE__ */it("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */it("span",{className:`mt-0.5 block truncate ${T} font-normal text-gray-500`,children:t.description})]}):t.description?
|
|
28
28
|
/* @__PURE__ */lt(ot,{children:[
|
|
29
29
|
/* @__PURE__ */it("span",{lang:t.lang,className:"block truncate",children:t.label}),
|
|
30
|
-
/* @__PURE__ */it("span",{className:`mt-0.5 block truncate ${T} font-normal text-gray-500`,children:t.description})]}):t.label]},t.value)},
|
|
30
|
+
/* @__PURE__ */it("span",{className:`mt-0.5 block truncate ${T} font-normal text-gray-500`,children:t.description})]}):t.label]},t.value)},_,"mx-1"):null,ve=void 0!==ce?
|
|
31
31
|
/* @__PURE__ */lt("span",{className:"relative block min-w-0 truncate",children:[
|
|
32
32
|
/* @__PURE__ */it("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:ce}),
|
|
33
|
-
/* @__PURE__ */it("span",{lang:void 0===de?oe:void 0,className:"sr-only",children:de??ie})]}):/* @__PURE__ */it("span",{lang:oe,className:"block truncate "+(void 0===ie?"text-gray-400":""),children:ie??n??" "}),we={zIndex:pe.popup,left:te?.left,top:te?.top,bottom:te?.bottom,width:te?.width,maxHeight:te?.maxHeight??V,visibility:te?void 0:"hidden",...ae()},Ne=/* @__PURE__ */it("div",{ref:
|
|
34
|
-
/* @__PURE__ */it("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:y.map((e,t)=>/* @__PURE__ */lt("button",{ref:e=>{z.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(ue(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(y?.length??0)-1,n=t=>{e.preventDefault(),z.current[t]?.focus()},a=()=>{e.preventDefault(),A.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?a():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?a():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void ue());case"Escape":return e.preventDefault(),e.stopPropagation(),void ue()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${
|
|
33
|
+
/* @__PURE__ */it("span",{lang:void 0===de?oe:void 0,className:"sr-only",children:de??ie})]}):/* @__PURE__ */it("span",{lang:oe,className:"block truncate "+(void 0===ie?"text-gray-400":""),children:ie??n??" "}),we={zIndex:pe.popup,left:te?.left,top:te?.top,bottom:te?.bottom,width:te?.width,maxHeight:te?.maxHeight??V,visibility:te?void 0:"hidden",...ae()},Ne=/* @__PURE__ */it("div",{ref:P,id:q,role:"listbox","aria-labelledby":N??(w?void 0:Y),"aria-label":N?void 0:w,"aria-multiselectable":m||void 0,className:E?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:E?null!==I?{maxHeight:I}:void 0:null!==I?{...we,maxHeight:I}:we,children:xe}),ke=E?/* @__PURE__ */lt("div",{ref:j,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:we,children:[Ne,
|
|
34
|
+
/* @__PURE__ */it("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:y.map((e,t)=>/* @__PURE__ */lt("button",{ref:e=>{z.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(ue(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(y?.length??0)-1,n=t=>{e.preventDefault(),z.current[t]?.focus()},a=()=>{e.preventDefault(),A.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?a():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?a():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void ue());case"Escape":return e.preventDefault(),e.stopPropagation(),void ue()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${O} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */it(be,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
35
35
|
/* @__PURE__ */it("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Ne;/* @__PURE__ */
|
|
36
36
|
return lt("div",{ref:S,className:"relative",children:[
|
|
37
|
-
/* @__PURE__ */it("button",{ref:A,id:Y,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":M,"aria-controls":M?q:void 0,"aria-activedescendant":M&&L>=0?G(L):void 0,"aria-invalid":a||void 0,"aria-describedby":
|
|
37
|
+
/* @__PURE__ */it("button",{ref:A,id:Y,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":M,"aria-controls":M?q:void 0,"aria-activedescendant":M&&L>=0?G(L):void 0,"aria-invalid":a||void 0,"aria-describedby":J,"aria-label":w,"aria-labelledby":N,title:h,disabled:o,"aria-readonly":b||void 0,onClick:()=>M?ue():fe(),onKeyDown:e=>{if(!o&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(M?D(e=>xt(Z,e,1)):fe());case"ArrowUp":return e.preventDefault(),void(M?D(e=>xt(Z,e,-1)):fe());case"Home":return void(M&&(e.preventDefault(),D(bt(Z))));case"End":return void(M&&(e.preventDefault(),D(yt(Z))));case"Enter":return void(M&&(e.preventDefault(),ge(L)));case" ":return e.preventDefault(),void(M?ge(L):fe());case"Escape":return void(M&&(e.preventDefault(),e.stopPropagation(),ue()));case"Tab":return M&&E&&!e.shiftKey?(e.preventDefault(),void z.current[0]?.focus()):void(M&&ue(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),ye(e.key))}},className:d({invalid:a,size:s,readOnly:b,className:`${b?"":"pr-8 "}text-left ${l}`.trim()}),children:x?
|
|
38
38
|
/* @__PURE__ */lt("span",{className:"flex min-w-0 items-center gap-1",children:[ve,
|
|
39
|
-
/* @__PURE__ */it("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):ve}),x&&/* @__PURE__ */it("span",{id:X,hidden:!0,children:W.select.changed}),!b&&/* @__PURE__ */it(
|
|
39
|
+
/* @__PURE__ */it("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):ve}),x&&/* @__PURE__ */it("span",{id:X,hidden:!0,children:W.select.changed}),!b&&/* @__PURE__ */it(be,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${u}`,strokeWidth:2}),
|
|
40
40
|
/* @__PURE__ */lt("select",{ref:$,value:e,multiple:m||void 0,onChange:e=>ee(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:o,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...k,children:[void 0!==n&&!m&&/* @__PURE__ */it("option",{value:"",disabled:!0,children:n}),
|
|
41
|
-
/* @__PURE__ */it(St,{items:r})]}),M&&st(ke,document.body)]})}),
|
|
42
|
-
/* @__PURE__ */lt("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */it("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */it("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),Ft="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",Et=
|
|
41
|
+
/* @__PURE__ */it(St,{items:r})]}),M&&st(ke,document.body)]})}),Pt=He(function({touchSize:e="touch",...t},r){const n=v();return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */it(Dt,{ref:r,...t,size:e}):/* @__PURE__ */it(At,{ref:r,...t}):/* @__PURE__ */it(At,{ref:r,...t,size:e})});function jt(e,t,r,n){const a=_e(),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 zt=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=Ue(null),h=jt(n,a,o,s);Ge(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=Ye(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */it("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__ */lt("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
|
|
42
|
+
/* @__PURE__ */lt("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */it("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */it("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),Ft="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",Et=He(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":o,...s},c){const d=jt(r,n,i,o);return r||n?/* @__PURE__ */lt("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
|
|
43
43
|
/* @__PURE__ */it("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${Ft} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s}),
|
|
44
|
-
/* @__PURE__ */lt("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */it("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */it("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */it("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${Ft} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s})});function Bt({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===
|
|
44
|
+
/* @__PURE__ */lt("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */it("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */it("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */it("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${Ft} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s})});function Bt({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===Ze.count(o)?Ze.only(o):null,d=Qe(c)?c:null,u={};if(d){if(s){const e=(d.props["aria-describedby"]??"").split(/\s+/);u["aria-describedby"]=Array.from(new Set([...e,s].filter(Boolean))).join(" ")}a&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0)}const h=d&&Object.keys(u).length>0?et(d,u):o;/* @__PURE__ */
|
|
45
45
|
return lt("div",{className:i,children:[e&&/* @__PURE__ */lt("label",{id:r,htmlFor:t,className:"mb-1 block text-xs font-medium text-gray-600",children:[e,l&&/* @__PURE__ */it("span",{"aria-hidden":"true",className:"ml-0.5 text-red-500",children:"*"})]}),h,a?
|
|
46
|
-
/* @__PURE__ */it("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-2xs text-red-600",children:a}):n?/* @__PURE__ */it("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-2xs text-gray-400",children:n}):null]})}var
|
|
47
|
-
return it(Bt,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */it("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:
|
|
46
|
+
/* @__PURE__ */it("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-2xs text-red-600",children:a}):n?/* @__PURE__ */it("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-2xs text-gray-400",children:n}):null]})}var Ot={vertical:"flex flex-col gap-2",horizontal:"flex flex-wrap items-start gap-x-6 gap-y-2"};function Tt({label:e,hint:t,error:r,required:n,name:a,value:l,onChange:i,options:o,orientation:s="vertical",disabled:c=!1,className:d=""}){const u=_e(),h=e?`${u}-label`:void 0;/* @__PURE__ */
|
|
47
|
+
return it(Bt,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */it("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:Ot[s],children:o.map(e=>/* @__PURE__ */it(Et,{name:a,value:e.value,checked:l===e.value,onChange:t=>{t&&i(e.value)},label:e.label,description:e.description,disabled:c||e.disabled},e.value))})})}function It({errors:e,title:t,autoFocus:r=!0,className:n=""}){const a=ze(),l=Ue(null),i=Ue(!1);if(Ge(()=>{const t=e.length>0;t&&!i.current&&r&&l.current?.focus(),i.current=t},[e.length>0,r]),0===e.length)return null;/* @__PURE__ */
|
|
48
48
|
return lt("div",{ref:l,role:"alert",tabIndex:-1,className:`rounded-md border border-red-300 bg-red-50 px-4 py-3 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-invalid-solid)] ${n}`.trim(),children:[
|
|
49
49
|
/* @__PURE__ */it("h2",{className:"text-sm font-semibold text-red-800",children:t??a.form.errorSummaryTitle}),
|
|
50
50
|
/* @__PURE__ */it("ul",{className:"mt-2 space-y-1",children:e.map(({fieldId:e,message:t},r)=>/* @__PURE__ */it("li",{children:e?/* @__PURE__ */it("a",{href:`#${e}`,onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&(t.scrollIntoView({block:"center"}),t.focus())})(e)},className:"text-sm text-red-700 underline hover:text-red-900",children:t}):
|
|
51
51
|
/* @__PURE__ */it("span",{className:"text-sm text-red-700",children:t})},`${e??""}-${r}`))})]})}var Rt="text-xs font-medium text-gray-600";function Wt({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",Rt,t].filter(Boolean).join(" ")}function Kt({required:e,children:t,className:r="",...n}){/* @__PURE__ */
|
|
52
|
-
return lt("label",{className:Wt({className:r}),...n,children:[t,e&&/* @__PURE__ */it("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var
|
|
53
|
-
return it(q,{content:e,describe:!1,children:/* @__PURE__ */it("button",{type:"button",onClick:r,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */it("span",{"aria-hidden":"true",children:t})})})}function qt({state:e,label:t,verb:r,subject:n,pct:a,onCancel:l,onRetry:i,onDismiss:o,className:s=""}){const c=
|
|
54
|
-
return lt("span",{role:"status",className:`${
|
|
55
|
-
/* @__PURE__ */it("span",{children:c.error}),i&&/* @__PURE__ */it(
|
|
56
|
-
return lt("span",{role:"status","aria-live":"polite",className:`${
|
|
57
|
-
/* @__PURE__ */it("span",{className:"tabular-nums",children:"string"==typeof d?m(d):/* @__PURE__ */lt(ot,{children:[d,m("")&&` ${m("")}`]})}),l&&/* @__PURE__ */it(
|
|
52
|
+
return lt("label",{className:Wt({className:r}),...n,children:[t,e&&/* @__PURE__ */it("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var Ht="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function _t({label:e,glyph:t,onClick:r}){/* @__PURE__ */
|
|
53
|
+
return it(q,{content:e,describe:!1,children:/* @__PURE__ */it("button",{type:"button",onClick:r,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */it("span",{"aria-hidden":"true",children:t})})})}function qt({state:e,label:t,verb:r,subject:n,pct:a,onCancel:l,onRetry:i,onDismiss:o,className:s=""}){const c=ze().transfer;if("idle"===e)return null==t?null:/* @__PURE__ */it("span",{className:`${Ht} ${w.neutral} pr-2 ${s}`.trim(),children:t});if("error"===e)/* @__PURE__ */
|
|
54
|
+
return lt("span",{role:"status",className:`${Ht} ${w.danger} ${s}`.trim(),children:[
|
|
55
|
+
/* @__PURE__ */it("span",{children:c.error}),i&&/* @__PURE__ */it(_t,{label:c.retry,glyph:"↻",onClick:i}),o&&/* @__PURE__ */it(_t,{label:c.dismiss,glyph:"×",onClick:o})]});const d=r??c.uploading,u=null==a||Number.isNaN(a)?null:Math.max(0,Math.min(100,Math.round(a))),h="string"==typeof d?c.cancelVerb(d.toLowerCase()):c.cancel,m=e=>[e,n,null==u?"":`${u}%`].filter(Boolean).join(" ");/* @__PURE__ */
|
|
56
|
+
return lt("span",{role:"status","aria-live":"polite",className:`${Ht} ${w.info} ${s}`.trim(),children:[null==u&&/* @__PURE__ */it(We,{ink:""}),
|
|
57
|
+
/* @__PURE__ */it("span",{className:"tabular-nums",children:"string"==typeof d?m(d):/* @__PURE__ */lt(ot,{children:[d,m("")&&` ${m("")}`]})}),l&&/* @__PURE__ */it(_t,{label:h,glyph:"×",onClick:l})]})}var Ut=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function Vt(e){if(/^data:/i.test(e||""))return function(e){const t=Ut.exec(e);if(!t)return"media";const[,r,n]=t,a=n.split("+")[0].split(".").pop().replace(/^x-/i,"");return a?`${r.toLowerCase()}.${a.toLowerCase()}`:"media"}(e);const t=(e||"").split("?")[0].split("#")[0],r=t.substring(t.lastIndexOf("/")+1);try{return decodeURIComponent(r.replace(/^[0-9a-f]{32}_/i,""))||r||"media"}catch{return r||"media"}}var Yt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function Gt(e,t=Ee.media){const r=function(e){const t=e.includes("video"),r=e.includes("image")||"*"===e||""===e;return t&&!r?"video":r&&!t?"image":"file"}(e);return"image"===r?t.uploadImage:"video"===r?t.uploadVideo:t.uploadFile}function Xt(e,t,r="",n="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",n,t?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",r].filter(Boolean).join(" ")}function Jt(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function Zt({label:e,progress:t,rounded:r="rounded-lg"}){/* @__PURE__ */
|
|
58
58
|
return it("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${r}`,children:/* @__PURE__ */it(qt,{state:"busy",verb:e,pct:t})})}function Qt({children:e}){/* @__PURE__ */
|
|
59
59
|
return it("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function er(e,t=""){if(!e)return!1;const r=Ut.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return Yt.test(e)||n&&!a}function tr({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
60
|
-
return it(
|
|
61
|
-
return it(
|
|
62
|
-
/* @__PURE__ */lt("div",{...T.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",
|
|
60
|
+
return it(be,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function rr({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
61
|
+
return it(be,{name:"upload",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function nr({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:g=!0,allowReplace:b=!0,allowRemove:y=!0,replaceLabel:x,removeLabel:v,busy:w=!1,busyLabel:N,progress:k,disabled:$=!1}){const M=ze().media,C=p??M.cta,L=x??M.replace,D=v??M.remove,S=N??M.uploading,A=_e(),P=Ue(null),[j,z]=qe(null);Ge(()=>()=>{P.current&&URL.revokeObjectURL(P.current)},[]);const F=$||w,E=!!e&&(er(e,c)||e===j),B=m??Gt(c,M),O=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)},T=Ae({accept:c,maxSizeBytes:d,acceptHint:f,multiple:!1,disabled:F,onAccept:([e])=>O(e)}),{dragOver:I}=T,R=()=>{F||(r?r():T.open())},W=e?Vt(e):"",K=/* @__PURE__ */lt("div",{children:[
|
|
62
|
+
/* @__PURE__ */lt("div",{...T.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",I?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[E?/* @__PURE__ */it("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__ */it("img",{src:e??void 0,alt:W,className:"h-full w-full",style:{objectFit:u}}),g&&e&&/* @__PURE__ */it(Qt,{children:W}),w&&/* @__PURE__ */it(Zt,{label:S,progress:k,rounded:"rounded-md"})]}),!$&&(b||y)&&/* @__PURE__ */lt("div",{className:"mt-2 flex gap-2",children:[b&&/* @__PURE__ */it(_,{id:A,variant:"secondary",size:"sm",onClick:()=>R(),disabled:w,children:L}),y&&/* @__PURE__ */it(_,{variant:"ghost",size:"sm",onClick:()=>{P.current&&(URL.revokeObjectURL(P.current),P.current=null),z(null),t("")},disabled:w,children:D})]})]}),H=/* @__PURE__ */it("button",{type:"button",id:A,onClick:()=>R(),disabled:F,"aria-label":"string"==typeof B?B:M.upload,"aria-busy":w||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${A}-error`:l?`${A}-hint`:void 0,...T.zoneProps,className:Xt(I,F,Jt(F)),style:{minHeight:h},children:w?/* @__PURE__ */it(qt,{state:"busy",verb:S,pct:k}):/* @__PURE__ */lt(ot,{children:[
|
|
63
63
|
/* @__PURE__ */it("span",{className:"text-gray-400",children:/* @__PURE__ */it(rr,{})}),
|
|
64
64
|
/* @__PURE__ */it("span",{className:"px-3 text-xs text-gray-500",children:B}),
|
|
65
65
|
/* @__PURE__ */it("span",{className:"text-sm font-medium text-blue-600",children:C}),f&&/* @__PURE__ */it("span",{className:"text-xs text-gray-400",children:f})]})});/* @__PURE__ */
|
|
66
|
-
return lt(Bt,{label:a,htmlFor:A,hint:l,error:i,required:o,className:s,children:[e?K:
|
|
67
|
-
/* @__PURE__ */it(
|
|
66
|
+
return lt(Bt,{label:a,htmlFor:A,hint:l,error:i,required:o,className:s,children:[e?K:H,!r&&/* @__PURE__ */it("input",{...T.inputProps}),
|
|
67
|
+
/* @__PURE__ */it(je,{rejections:T.rejections})]})}function ar({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 g=Ue(null),[b,y]=qe(null),[x,v]=qe(""),[w,N]=qe(""),[k,$]=qe(!1),[M,C]=qe(!1),L=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(s),D=ze().brandAsset,S=x||e||a||"",A=b?null:e?r:l,P=b?null:e?n:i;Ge(()=>()=>{g.current&&URL.revokeObjectURL(g.current)},[]);const j=()=>{g.current&&(URL.revokeObjectURL(g.current),g.current=null)};/* @__PURE__ */
|
|
68
68
|
return lt("section",{"aria-label":D.region(s,o),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
69
69
|
/* @__PURE__ */lt("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
70
|
-
/* @__PURE__ */it(nr,{value:S,onChange:()=>{},onFile:e=>{if(f)return;
|
|
70
|
+
/* @__PURE__ */it(nr,{value:S,onChange:()=>{},onFile:e=>{if(f)return;j();const t=URL.createObjectURL(e);g.current=t,y(e),v(t),N("")},label:s,hint:w||D.usedFor(o),error:w||void 0,accept:u,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:k||M,disabled:f}),
|
|
71
71
|
/* @__PURE__ */lt("div",{className:"mt-3 flex flex-wrap gap-2",children:[
|
|
72
|
-
/* @__PURE__ */it(
|
|
72
|
+
/* @__PURE__ */it(_,{onClick:async()=>{if(b&&!f&&!k){$(!0),N("");try{await c(b),j(),y(null),v("")}catch(e){N(e instanceof Error?e.message:D.saveFailed(L,s))}finally{$(!1)}}},disabled:!b||f,loading:k,children:D.save(L,s)}),(b||e)&&/* @__PURE__ */it(_,{variant:"ghost-danger",onClick:async()=>{if(!f&&!M){if(b)return j(),y(null),v(""),void N("");if(e){C(!0),N("");try{await d()}catch(e){N(e instanceof Error?e.message:D.removeFailed(L,s))}finally{C(!1)}}}},disabled:f,loading:M,children:b?D.discard:D.remove(L,s)})]})]}),p.length>0&&/* @__PURE__ */lt("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":D.previews(s),children:[
|
|
73
73
|
/* @__PURE__ */it("h3",{className:"text-sm font-semibold text-gray-900",children:D.preview}),
|
|
74
|
-
/* @__PURE__ */it("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const r=/* @__PURE__ */it(t,{src:S,alt:D.alt(o,s),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:A,isLight:
|
|
74
|
+
/* @__PURE__ */it("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const r=/* @__PURE__ */it(t,{src:S,alt:D.alt(o,s),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:A,isLight:P,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
|
|
75
75
|
return lt("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
|
|
76
76
|
/* @__PURE__ */it("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */lt("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
|
|
77
77
|
/* @__PURE__ */lt("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[r,
|
|
@@ -84,191 +84,191 @@ return lt("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-whit
|
|
|
84
84
|
/* @__PURE__ */it("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??o}),e.url&&/* @__PURE__ */it("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
|
|
85
85
|
/* @__PURE__ */it("div",{className:"mt-2 text-sm font-medium text-blue-700",children:e.title??o}),e.description&&/* @__PURE__ */it("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */lt("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,
|
|
86
86
|
/* @__PURE__ */it("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function lr(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 ir=Xe(null);function or(e){const t=document.head.querySelector('link[data-portal-branding="favicon"]');if(!e)return void t?.remove();const r=t??document.createElement("link");r.rel="icon",r.href=e,r.dataset.portalBranding="favicon",t||document.head.appendChild(r)}function sr({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=qe(t),[i,o]=qe(!0),[s,c]=qe(null),d=Ue(e),u=Ue(t);d.current=e,u.current=t,Ge(()=>{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()}},[]),Ge(()=>(or(a.favicon_url),()=>or(null)),[a.favicon_url]),Ge(()=>{r&&(document.title=r(a))},[a,r]);const h=Ve(()=>({branding:a,loading:i,error:s}),[a,i,s]);/* @__PURE__ */
|
|
87
|
-
return it(ir.Provider,{value:h,children:n})}function cr(){const e=tt(ir);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var dr=/* @__PURE__ */it(
|
|
87
|
+
return it(ir.Provider,{value:h,children:n})}function cr(){const e=tt(ir);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var dr=/* @__PURE__ */it(be,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function ur({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:f,cta:g,acceptHint:b,showCover:y=!1,coverLabel:x,busy:v=!1,busyLabel:w,progress:N,disabled:k=!1,readOnly:$=!1}){const M=ze().media,C=g??M.cta,L=x??M.cover,D=w??M.uploading,S=_e(),[A,P]=qe(null),j=k||v,z=!(!t&&!r||j||$),F=!!n&&!j&&!$,E=!!a&&!j&&!$,B=Jt(j),O=f??Gt(d,M),T=Ae({accept:d,maxSizeBytes:u,maxFiles:h,acceptHint:b,multiple:!0,disabled:!z,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),I=T.dragOver,R=()=>{z&&(t?t():T.open())},W={width:p,height:p},K=z&&/* @__PURE__ */lt("button",{type:"button",onClick:()=>R(),"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:W,children:[
|
|
88
88
|
/* @__PURE__ */it(rr,{className:"h-5 w-5"}),
|
|
89
|
-
/* @__PURE__ */it("span",{className:"text-xs font-medium text-gray-500",children:M.add})]}),
|
|
89
|
+
/* @__PURE__ */it("span",{className:"text-xs font-medium text-gray-500",children:M.add})]}),H=z?/* @__PURE__ */lt("button",{type:"button",onClick:()=>R(),"aria-label":"string"==typeof O?O:M.upload,className:Xt(I,!1,B),style:{minHeight:p+32},children:[
|
|
90
90
|
/* @__PURE__ */it("span",{className:"text-gray-400",children:/* @__PURE__ */it(rr,{})}),
|
|
91
|
-
/* @__PURE__ */it("span",{className:"px-3 text-xs text-gray-500",children:
|
|
91
|
+
/* @__PURE__ */it("span",{className:"px-3 text-xs text-gray-500",children:O}),
|
|
92
92
|
/* @__PURE__ */it("span",{className:"text-sm font-medium text-blue-600",children:C}),b&&/* @__PURE__ */it("span",{className:"text-xs text-gray-400",children:b})]}):/* @__PURE__ */it("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:/* @__PURE__ */it("span",{className:v?"invisible":void 0,children:M.empty})});/* @__PURE__ */
|
|
93
93
|
return lt(Bt,{label:l,labelId:l?`${S}-label`:void 0,htmlFor:S,hint:i,error:o,required:s,className:c,children:[
|
|
94
|
-
/* @__PURE__ */lt("div",{id:S,role:"group","aria-labelledby":l?`${S}-label`:void 0,"aria-describedby":o?`${S}-error`:i?`${S}-hint`:void 0,"aria-busy":v||void 0,...T.zoneProps,className:"relative rounded-lg transition-colors",style:{...
|
|
95
|
-
return lt("div",{draggable:E||void 0,onDragStart:E?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),
|
|
96
|
-
/* @__PURE__ */it(
|
|
94
|
+
/* @__PURE__ */lt("div",{id:S,role:"group","aria-labelledby":l?`${S}-label`:void 0,"aria-describedby":o?`${S}-error`:i?`${S}-hint`:void 0,"aria-busy":v||void 0,...T.zoneProps,className:"relative rounded-lg transition-colors",style:{...j?{opacity:.6}:{},...I?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?H:/* @__PURE__ */lt("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:er(t.url,d),i=Vt(t.url),o=y&&(t.cover??0===r);/* @__PURE__ */
|
|
95
|
+
return lt("div",{draggable:E||void 0,onDragStart:E?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),P(r)}:void 0,onDragEnd:E?()=>P(null):void 0,onDragOver:E?e=>{null!=A&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:E?e=>{null!=A&&(e.preventDefault(),e.stopPropagation(),A!==r&&a(A,r),P(null))}:void 0,tabIndex:E?0:void 0,"aria-label":E?M.reorder(i,r+1,e.length):void 0,onKeyDown:E?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",B,A===r?"opacity-50":""].join(" "),style:{...W,cursor:E?"move":void 0},children:[l?/* @__PURE__ */it("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */it("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),o&&/* @__PURE__ */it("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-2 py-0.5 text-xs font-medium text-white",children:L}),null!=t.caption&&/* @__PURE__ */it(Qt,{children:t.caption}),F&&/* @__PURE__ */it("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:dr})]},t.id)}),K]}),v&&/* @__PURE__ */it(Zt,{label:D,progress:N})]}),!t&&r&&/* @__PURE__ */it("input",{...T.inputProps}),
|
|
96
|
+
/* @__PURE__ */it(je,{rejections:T.rejections})]})}var hr=e=>String(e).padStart(2,"0"),mr="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";function pr(e){return`${e.getFullYear()}-${hr(e.getMonth()+1)}-${hr(e.getDate())}`}function fr(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 gr=e=>`${e.getFullYear()}-${hr(e.getMonth()+1)}`;var br=()=>pr(/* @__PURE__ */new Date);var yr=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),xr=(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 vr({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:o,onMonthChange:s,weekStartsOn:c,quickJump:d=!0,markedDates:u,readOnly:h=!1,"aria-label":m,className:p=""}){const f=Ve(()=>new Set(u??[]),[u]),g=fr(e),b=se(br,null),y=fr(b),x=ze().calendar,v=Fe(),w=ke(v),N=se(()=>$e(v),0),k=c??N,$=()=>{if(!y)return null;const e=gr(y);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[M,C]=qe(()=>o||(g?gr(g):$())),L=i??M??$(),D=null===L?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(L,y),[S,A]=qe(()=>e??b),P=Ue(null),j=Ue(!1),[z,F]=qe("days"),E=Ve(()=>D?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),n=(r.getDay()-t+7)%7,a=new Date(r.getFullYear(),r.getMonth(),1-n);return Array.from({length:42},(e,t)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+t))}(D,k):[],[L,k]),B=e=>!!a&&e<a||!!l&&e>l,O=S??b,T=E.some(e=>pr(e)===O),I=D?E.find(e=>e.getMonth()===D.getMonth())??E[0]:null,R=T&&O?O:I?pr(I):"";if(Ge(()=>{j.current&&(j.current=!1,P.current?.querySelector('[data-active="true"]')?.focus())},[R,L]),!D)/* @__PURE__ */
|
|
97
97
|
return lt("div",{className:p,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
98
98
|
/* @__PURE__ */it("div",{className:"mb-2 h-6"}),
|
|
99
|
-
/* @__PURE__ */it("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */it("div",0===t?{className:"py-1 text-xs",children:" "}:{className:mr,children:/* @__PURE__ */it("span",{className:"aspect-square"})},t))})]});const W=e=>"years"===z?new Date(D.getFullYear()+12*e,D.getMonth(),1):"months"===z?new Date(D.getFullYear()+e,D.getMonth(),1):xr(D,e),K=e=>{const t=gr(e);void 0===i&&C(t),s?.(t)},
|
|
99
|
+
/* @__PURE__ */it("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */it("div",0===t?{className:"py-1 text-xs",children:" "}:{className:mr,children:/* @__PURE__ */it("span",{className:"aspect-square"})},t))})]});const W=e=>"years"===z?new Date(D.getFullYear()+12*e,D.getMonth(),1):"months"===z?new Date(D.getFullYear()+e,D.getMonth(),1):xr(D,e),K=e=>{const t=gr(e);void 0===i&&C(t),s?.(t)},H=m??w.monthYear(D.getFullYear(),D.getMonth());/* @__PURE__ */
|
|
100
100
|
return lt("div",{className:p,children:[
|
|
101
101
|
/* @__PURE__ */lt("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
102
|
-
/* @__PURE__ */it("button",{type:"button","aria-label":"years"===z?x.previousYears:"months"===z?x.previousYear:x.previousMonth,onClick:()=>K(W(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */it(
|
|
102
|
+
/* @__PURE__ */it("button",{type:"button","aria-label":"years"===z?x.previousYears:"months"===z?x.previousYear:x.previousMonth,onClick:()=>K(W(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */it(be,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
|
|
103
103
|
/* @__PURE__ */it("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */lt(ot,{children:["years"!==z&&/* @__PURE__ */it("button",{type:"button","aria-label":x.chooseMonth(w.months[D.getMonth()]),onClick:()=>F(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:w.months[D.getMonth()]}),
|
|
104
104
|
/* @__PURE__ */it("button",{type:"button","aria-label":x.chooseYear(D.getFullYear()),onClick:()=>F(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:D.getFullYear()})]}):/* @__PURE__ */it("span",{children:w.monthYear(D.getFullYear(),D.getMonth())})}),
|
|
105
|
-
/* @__PURE__ */it("button",{type:"button","aria-label":"years"===z?x.nextYears:"months"===z?x.nextYear:x.nextMonth,onClick:()=>K(W(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */it(
|
|
106
|
-
/* @__PURE__ */lt("div",{ref:
|
|
105
|
+
/* @__PURE__ */it("button",{type:"button","aria-label":"years"===z?x.nextYears:"months"===z?x.nextYear:x.nextMonth,onClick:()=>K(W(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */it(be,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===z&&/* @__PURE__ */it("div",{role:"group","aria-label":x.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:w.monthsShort.map((e,t)=>/* @__PURE__ */it("button",{type:"button","aria-pressed":t===D.getMonth(),onClick:()=>{K(new Date(D.getFullYear(),t,1)),F("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===D.getMonth()?"bg-blue-600 font-semibold text-white":y&&t===y.getMonth()&&D.getFullYear()===y.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===z&&/* @__PURE__ */it("div",{role:"group","aria-label":x.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=D.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */it("button",{type:"button","aria-pressed":e===D.getFullYear(),onClick:()=>{K(new Date(e,D.getMonth(),1)),F("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===D.getFullYear()?"bg-blue-600 font-semibold text-white":e===y?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
106
|
+
/* @__PURE__ */lt("div",{ref:P,role:"grid","aria-label":H,className:"space-y-1","aria-readonly":h||void 0,onKeyDown:e=>{const t=fr(R)??y??D,r={ArrowLeft:()=>yr(t,-1),ArrowRight:()=>yr(t,1),ArrowUp:()=>yr(t,-7),ArrowDown:()=>yr(t,7),Home:()=>yr(t,-(t.getDay()-k+7)%7),End:()=>yr(t,6-(t.getDay()-k+7)%7),PageUp:()=>xr(t,e.shiftKey?-12:-1),PageDown:()=>xr(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),j.current=!0,A(pr(a)),void(gr(a)!==L&&K(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h||B(R)||n(R))},hidden:"days"!==z,children:[
|
|
107
107
|
/* @__PURE__ */it("div",{role:"row",className:`${mr} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+k)%7).map(e=>
|
|
108
108
|
/* @__PURE__ */it("div",{role:"columnheader","aria-label":w.weekdays[e],className:"py-1",children:/* @__PURE__ */it("abbr",{title:w.weekdays[e],className:"no-underline",children:w.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */it("div",{role:"row",className:`${mr} text-center text-sm`,children:E.slice(7*l,7*l+7).map(a=>{const l=pr(a),i=a.getMonth()!==D.getMonth(),o=l===e||"range"===r&&l===t,s=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=B(l),d=w.longDate(a.getFullYear(),a.getMonth(),a.getDate()),u=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",c?"cursor-not-allowed text-gray-300":o?"bg-blue-600 font-semibold text-white":s?"bg-blue-100 text-blue-800":i?"text-gray-500"+(e?" hover:bg-gray-100":""):"text-gray-700"+(e?" hover:bg-gray-100":""),l!==b||o?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),m=f.has(l)&&/* @__PURE__ */it("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(o?"bg-white":i?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
|
|
109
|
-
return it("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */lt("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */lt("button",{type:"button","data-active":l===R,tabIndex:l===R?0:-1,disabled:c,"aria-label":d,"aria-current":l===b?"date":void 0,onClick:()=>{A(l),n(l)},className:u(!0),children:[a.getDate(),m]})},l)})},l))]})]})}var wr=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Nr=e=>`${e.getFullYear()}-${kr(e.getMonth()+1)}`,kr=e=>String(e).padStart(2,"0");function $r(e){return`${e.getFullYear()}-${kr(e.getMonth()+1)}-${kr(e.getDate())}`}function Mr(e,t){const r=t.getFullYear(),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:$r(new Date(r,n,t.getDate()-14)),to:$r(a)};case"lastMonth":return{from:$r(i(1)),to:$r(l)};case"last3Months":return{from:$r(i(3)),to:$r(l)};case"last6Months":return{from:$r(i(6)),to:$r(l)};case"last12Months":return{from:$r(i(12)),to:$r(l)}}}function Cr(e,t,r){const n=Nr(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Lr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function Dr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Sr=/* @__PURE__ */new Map;function Ar({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:f=!1,min:g,max:b,disabled:y=!1,allowOpenEnd:x=!1}){const v=
|
|
110
|
-
/* @__PURE__ */it("button",{type:"button",onClick:()=>
|
|
111
|
-
/* @__PURE__ */it(vr,{mode:"range",min:g,max:b,value:L||null,endValue:S||null,month:ee,onMonthChange:te,onSelect:e=>{
|
|
109
|
+
return it("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */lt("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */lt("button",{type:"button","data-active":l===R,tabIndex:l===R?0:-1,disabled:c,"aria-label":d,"aria-current":l===b?"date":void 0,onClick:()=>{A(l),n(l)},className:u(!0),children:[a.getDate(),m]})},l)})},l))]})]})}var wr=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Nr=e=>`${e.getFullYear()}-${kr(e.getMonth()+1)}`,kr=e=>String(e).padStart(2,"0");function $r(e){return`${e.getFullYear()}-${kr(e.getMonth()+1)}-${kr(e.getDate())}`}function Mr(e,t){const r=t.getFullYear(),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:$r(new Date(r,n,t.getDate()-14)),to:$r(a)};case"lastMonth":return{from:$r(i(1)),to:$r(l)};case"last3Months":return{from:$r(i(3)),to:$r(l)};case"last6Months":return{from:$r(i(6)),to:$r(l)};case"last12Months":return{from:$r(i(12)),to:$r(l)}}}function Cr(e,t,r){const n=Nr(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Lr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function Dr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Sr=/* @__PURE__ */new Map;function Ar({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:f=!1,min:g,max:b,disabled:y=!1,allowOpenEnd:x=!1}){const v=ze().dateRange,w=Fe(),N=n??(w?function(e){let t=Sr.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Sr.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}}(w):Dr),k=u??v.placeholder,$=a??!l,[M,C]=qe(!1),[L,D]=qe(e),[S,A]=qe(t),[P,j]=qe(null),[z,F]=qe("from"),E=Ue(null),B=Ue(null),O=Ue(null),T=_e(),I=_e(),R=_e(),[W,K]=qe(!1),H=U(E,M,{preferredMaxWidth:520,preferredMaxHeight:W?720:560,popupRef:O}),_=Ue(null),q=Ue(null),[V,Y]=qe(!0);oe(()=>{const e=q.current;if(!M||!W||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==V&&Y(a)});const G=Ue(null);oe(()=>{const e=O.current;if(!M||!H||!e)return;const t=getComputedStyle(e),r=H.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(W)null!==G.current&&G.current<=r&&K(!1);else{const e=_.current?.offsetWidth??0;if(0===e)return;G.current=e,e>r+.5&&K(!0)}});const[X,J]=qe(!1);oe(()=>{const e=!!o&&(B.current?.labels?.length??0)>0;e!==X&&J(e)});const Z=!!c||!!s||X,Q=/* @__PURE__ */new Date,[ee,te]=qe(()=>e?Nr(Lr(e)):Cr(Q,g,b)),re=wr.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(Mr(e,Q),g,b)),ne=e=>e?N(e):"";Ge(()=>{if(!M)return;const e=e=>{const t=e.target;E.current?.contains(t)||O.current?.contains(t)||C(!1)};document.addEventListener("mousedown",e);const t=me(()=>C(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[M]),Ge(()=>{y&&C(!1)},[y]);const ae=()=>{r("",""),C(!1)},ie=e&&t?`${ne(e)} — ${ne(t)}`:e?v.fromOnly(ne(e)):t?v.toOnly(ne(t)):"",se=ke(w),ce=e=>{const t=fr(e);return t?se.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},de=e&&t?v.range(ce(e),ce(t)):e?v.fromOnly(ce(e)):t?v.toOnly(ce(t)):k,ue=e=>W?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(P===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(P===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),he=/* @__PURE__ */lt(ot,{children:[re.map(e=>/* @__PURE__ */it("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=Mr(e,Q);D(t.from),A(t.to),j(e),te(t.from.slice(0,7))})(e),className:ue(e),"aria-label":W?v[e]:void 0,children:W?V?v[e]:v[`${e}Short`]:v[e]},e)),
|
|
110
|
+
/* @__PURE__ */it("button",{type:"button",onClick:()=>j("Custom"),className:ue("Custom"),children:v.custom})]}),fe=(e,t)=>x?/* @__PURE__ */it("button",{type:"button","data-range-end":e,"aria-pressed":z===e,onClick:()=>F(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */it("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),ye=e=>x&&z===e?" ring-1 ring-blue-400":"",xe=
|
|
111
|
+
/* @__PURE__ */it(vr,{mode:"range",min:g,max:b,value:L||null,endValue:S||null,month:ee,onMonthChange:te,onSelect:e=>{j("Custom"),x?"from"===z?(S&&e>S?(D(S),A(e)):D(e),F("to")):L&&e<L?(A(L),D(e)):A(e):!L||L&&S?(D(e),A("")):e<L?(A(L),D(e)):A(e)},weekStartsOn:d,"aria-label":v.dialog});/* @__PURE__ */
|
|
112
112
|
return lt("div",{className:"relative"+(f?" w-full":""),ref:E,children:[
|
|
113
113
|
/* @__PURE__ */lt("div",{className:`${f?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${e||t?`${h} ${m}`:p}${y?" cursor-not-allowed opacity-60":""}`,children:[
|
|
114
|
-
/* @__PURE__ */lt("button",{ref:B,type:"button",onClick:()=>{y||(D(e),A(t),
|
|
115
|
-
/* @__PURE__ */it(
|
|
116
|
-
/* @__PURE__ */it("span",{className:"truncate",children:ie||k})]}),$&&!y&&(e||t)&&/* @__PURE__ */it("button",{type:"button",onClick:ae,"aria-label":v.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:"×"})]}),
|
|
114
|
+
/* @__PURE__ */lt("button",{ref:B,type:"button",onClick:()=>{y||(D(e),A(t),j(null),F(e&&!t?"to":"from"),te(e?Nr(Lr(e)):Cr(Q,g,b)),C(!0))},"aria-haspopup":"dialog","aria-expanded":M,id:o,disabled:y||void 0,"aria-label":c,"aria-labelledby":s,"aria-describedby":[Z?I:void 0,l?R:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":M?T:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(f?" min-w-0 flex-1 justify-start":""),children:[
|
|
115
|
+
/* @__PURE__ */it(be,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
116
|
+
/* @__PURE__ */it("span",{className:"truncate",children:ie||k})]}),$&&!y&&(e||t)&&/* @__PURE__ */it("button",{type:"button",onClick:ae,"aria-label":v.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:"×"})]}),Z&&/* @__PURE__ */it("span",{id:I,className:"sr-only",children:de}),l&&/* @__PURE__ */it("span",{id:R,className:"sr-only",children:v.required}),i&&/* @__PURE__ */lt(ot,{children:[
|
|
117
117
|
/* @__PURE__ */it("input",{type:"hidden",name:i.from,value:e,disabled:y||void 0}),
|
|
118
118
|
/* @__PURE__ */it("input",{type:"hidden",name:i.to,value:t,disabled:y||void 0})]}),M&&st(
|
|
119
|
-
/* @__PURE__ */lt("div",{ref:
|
|
119
|
+
/* @__PURE__ */lt("div",{ref:O,id:T,role:"dialog","aria-label":v.dialog,"data-layout":W?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:pe.popup,left:H?.left,right:H?.right,top:H?.top,bottom:H?.bottom,width:W&&H?H.maxWidth:"max-content",maxWidth:H?.maxWidth,maxHeight:H?.maxHeight,overflowY:"auto",visibility:H?void 0:"hidden",...le()},children:[
|
|
120
120
|
/* @__PURE__ */lt("div",{className:W?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[fe("from",/* @__PURE__ */lt(ot,{children:[
|
|
121
121
|
/* @__PURE__ */it("span",{className:"text-xs font-medium text-gray-500",children:v.from}),
|
|
122
|
-
/* @__PURE__ */it("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${L?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${
|
|
122
|
+
/* @__PURE__ */it("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${L?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${ye("from")}`,children:L?ne(L):v.start})]})),!W&&/* @__PURE__ */it("span",{className:"text-gray-300",children:"—"}),fe("to",/* @__PURE__ */lt(ot,{children:[
|
|
123
123
|
/* @__PURE__ */it("span",{className:"text-xs font-medium text-gray-500",children:v.to}),
|
|
124
|
-
/* @__PURE__ */it("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${S?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${
|
|
124
|
+
/* @__PURE__ */it("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${S?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${ye("to")}`,children:S?ne(S):v.end})]}))]}),W?/* @__PURE__ */lt(ot,{children:[re.length>0&&/* @__PURE__ */lt("div",{className:"mb-3 @container",children:[!V&&/* @__PURE__ */it("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:v.lastHeading}),
|
|
125
125
|
/* @__PURE__ */lt("div",{ref:q,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[he,re.map(e=>/* @__PURE__ */it("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:v[e]},e))]})]}),
|
|
126
|
-
/* @__PURE__ */it("div",{className:"w-full",children:
|
|
127
|
-
/* @__PURE__ */lt("div",{ref:
|
|
128
|
-
/* @__PURE__ */it("div",{className:"w-64",children:
|
|
126
|
+
/* @__PURE__ */it("div",{className:"w-full",children:xe})]}):
|
|
127
|
+
/* @__PURE__ */lt("div",{ref:_,className:"flex w-max gap-4",children:[
|
|
128
|
+
/* @__PURE__ */it("div",{className:"w-64",children:xe}),re.length>0&&/* @__PURE__ */it("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:he})]}),
|
|
129
129
|
/* @__PURE__ */lt("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[$&&/* @__PURE__ */it("button",{type:"button",onClick:ae,className:ge({variant:"ghost"}),children:v.clear}),
|
|
130
130
|
/* @__PURE__ */it("button",{type:"button",onClick:()=>C(!1),className:ge({variant:"secondary"}),children:v.cancel}),
|
|
131
|
-
/* @__PURE__ */it("button",{type:"button",onClick:()=>{r(L,S),C(!1)},disabled:x?!L&&!S:!L||!S,className:ge({variant:"primary"}),children:v.apply})]})]}),document.body)]})}var
|
|
132
|
-
return it("input",{ref:c,type:"time",lang:h,step:o,"aria-invalid":a||void 0,value:zr(e,u),min:zr(r,u)||void 0,max:zr(n,u)||void 0,onChange:e=>t?.(
|
|
133
|
-
return it("input",{ref:L,type:"date",lang:z,id:p,name:f,disabled:g,"aria-label":c,"aria-describedby":h,"aria-invalid":a||void 0,value:S,min:A||void 0,max:
|
|
134
|
-
return lt("div",{ref:
|
|
131
|
+
/* @__PURE__ */it("button",{type:"button",onClick:()=>{r(L,S),C(!1)},disabled:x?!L&&!S:!L||!S,className:ge({variant:"primary"}),children:v.apply})]})]}),document.body)]})}var Pr=/^\d{2}:\d{2}(:\d{2})?$/,jr=e=>String(e).padStart(2,"0");function zr(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${jr(e.getHours())}:${jr(e.getMinutes())}`;return t?`${r}:${jr(e.getSeconds())}`:r}return Pr.test(e)?e:""}var Fr=He(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",step:o,...s},c){const u=null!=o&&Number(o)<60,h=Fe();/* @__PURE__ */
|
|
132
|
+
return it("input",{ref:c,type:"time",lang:h,step:o,"aria-invalid":a||void 0,value:zr(e,u),min:zr(r,u)||void 0,max:zr(n,u)||void 0,onChange:e=>t?.(Pr.test(e.target.value)?e.target.value:null),className:d({invalid:a,size:l,className:i}),...s})}),Er=/^\d{4}-\d{2}-\d{2}$/,Br=/^(aria|data)-/,Or=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function Tr(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":$r(e);if(Er.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":$r(t)}function Ir(e){if(!Er.test(e))return null;const[t,r,n]=e.split("-").map(Number),a=new Date(t,r-1,n);return a.getMonth()===r-1&&a.getDate()===n?a:null}function Rr(e,t){const r=Ir(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var Wr=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":h,"aria-labelledby":m,id:p,name:f,disabled:g,placeholder:b,required:y,clearable:x,form:v,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,...C},L){const D=x??!y,S=Tr(e),A=Tr(r),P=Tr(n),j=ze().datePicker,z=Fe(),F=ke(z),[E,B]=qe(!1),O=Ue(null),T=Ue(null),I=Ue(null),R=_e(),W=_e(),K=_e(),H=U(T,E,{popupRef:I}),[_,q]=qe(!1);oe(()=>{const e=!!p&&(T.current?.labels?.length??0)>0;e!==_&&q(e)});const V=!c&&(!!m||_);if(Ge(()=>{if(!E)return;const e=e=>{const t=e.target;O.current?.contains(t)||I.current?.contains(t)||B(!1)};document.addEventListener("pointerdown",e,!0);const t=me(()=>B(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[E]),Ge(()=>{if(E)return he(e=>"Escape"===e.key&&(B(!1),T.current?.focus(),!0),()=>I.current)},[E]),i)/* @__PURE__ */
|
|
133
|
+
return it("input",{ref:L,type:"date",lang:z,id:p,name:f,disabled:g,"aria-label":c,"aria-describedby":h,"aria-invalid":a||void 0,value:S,min:A||void 0,max:P||void 0,onChange:e=>t?.(Ir(e.target.value)),className:d({invalid:a,size:l,className:s}),"aria-labelledby":m,required:y,form:v,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,...C});const Y=Object.fromEntries(Object.entries(C).filter(([e])=>Br.test(e)&&!Or.has(e))),G=C["aria-required"],X=!!y||!0===G||"true"===G,J=[V?W:void 0,X?K:void 0,h].filter(Boolean).join(" ")||void 0,Z=$r(/* @__PURE__ */new Date),Q=(!A||Z>=A)&&(!P||Z<=P),ee=b??j.placeholder;/* @__PURE__ */
|
|
134
|
+
return lt("div",{ref:O,className:"relative",children:[
|
|
135
135
|
/* @__PURE__ */it("input",{ref:L,type:"hidden",name:f,form:v,value:S}),
|
|
136
|
-
/* @__PURE__ */lt("button",{ref:T,type:"button",...Y,id:p,disabled:g,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":E?R:void 0,"aria-labelledby":m,"aria-describedby":
|
|
136
|
+
/* @__PURE__ */lt("button",{ref:T,type:"button",...Y,id:p,disabled:g,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":E?R:void 0,"aria-labelledby":m,"aria-describedby":J,"aria-label":c?`${c}${S?`, ${Rr(S,F)}`:""}`:void 0,onClick:()=>B(e=>!e),className:`${d({invalid:a,size:l,className:s})} flex items-center justify-between text-left`,children:[
|
|
137
137
|
/* @__PURE__ */it("span",{className:S?"text-gray-900":"text-gray-400",children:S?Rr(S,F):ee}),
|
|
138
|
-
/* @__PURE__ */it(
|
|
139
|
-
/* @__PURE__ */lt("div",{ref:
|
|
140
|
-
/* @__PURE__ */it(vr,{value:S||null,min:A||null,max:
|
|
141
|
-
return it("input",{ref:s,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:
|
|
142
|
-
return it(
|
|
143
|
-
return it(
|
|
138
|
+
/* @__PURE__ */it(be,{name:"date",className:`h-4 w-4 shrink-0 ${u}`,strokeWidth:"1.75","aria-hidden":"true"})]}),V&&/* @__PURE__ */it("span",{id:W,className:"sr-only",children:S?Rr(S,F):ee}),X&&/* @__PURE__ */it("span",{id:K,className:"sr-only",children:j.required}),E&&st(
|
|
139
|
+
/* @__PURE__ */lt("div",{ref:I,id:R,role:"dialog","aria-label":c??j.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:pe.popup,left:H?.left,right:H?.right,top:H?.top,bottom:H?.bottom,maxWidth:H?.maxWidth,visibility:H?void 0:"hidden"},children:[
|
|
140
|
+
/* @__PURE__ */it(vr,{value:S||null,min:A||null,max:P||null,weekStartsOn:o,onSelect:e=>{B(!1),T.current?.focus(),t?.(Ir(e))}}),(D||Q)&&/* @__PURE__ */lt("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[D&&/* @__PURE__ */it("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:j.clear}),Q&&/* @__PURE__ */it("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:j.today})]})]}),document.body)]})}),Kr=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Hr=e=>String(e).padStart(2,"0");function _r(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Hr(t.getMonth()+1)}-${Hr(t.getDate())}T${Hr(t.getHours())}:${Hr(t.getMinutes())}`:Kr.test(e)?e:"";var t}var qr=He(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",...o},s){const c=Fe();/* @__PURE__ */
|
|
141
|
+
return it("input",{ref:s,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:_r(e),min:_r(r)||void 0,max:_r(n)||void 0,onChange:e=>t?.(function(e){if(!Kr.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:d({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 Vr(e,t){try{if(t&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}const r=r=>{r.clipboardData?.setData("text/plain",e),t&&r.clipboardData?.setData("text/html",t),r.preventDefault()},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 Yr(e,t,r){const n=await Vr(t,r),a=Be().copy;return n?x.success(a.copiedLabel(e)):x.error(a.failed),n}var Gr={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},Xr={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function Jr(){/* @__PURE__ */
|
|
142
|
+
return it(be,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function Zr(){/* @__PURE__ */
|
|
143
|
+
return it(be,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function Qr({value:e,children:t,symbol:r,label:n,size:a="md",variant:l="bordered",hideCopyButton:i=!1,onCopy:o,multiline:s=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=qe(!1),f=Ue(null),g=ze().copy;Ge(()=>()=>{f.current&&clearTimeout(f.current)},[]);const b=Ye(async()=>{await Vr(e)?(p(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{p(!1),f.current=null},2e3),o?.(e)):x.error(g.failed)},[e,o,g]),{box:y,button:v}=Xr[a],w=!i;/* @__PURE__ */
|
|
144
144
|
return lt("div",{id:w?void 0:d,"aria-describedby":w?void 0:u,className:["inline-flex max-w-full items-center rounded-md",Gr[l],y,h].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */it("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
|
|
145
145
|
/* @__PURE__ */it("span",{className:"min-w-0 font-mono text-gray-800 "+(s?"whitespace-pre-wrap break-all":"truncate"),title:s?void 0:e,children:t??e}),!i&&/* @__PURE__ */lt(ot,{children:[
|
|
146
|
-
/* @__PURE__ */it(c,{id:d,"aria-label":n?g.copyLabel(n):g.copy,"aria-describedby":u,onClick:b,className:`${v} text-gray-400`,children:/* @__PURE__ */it(m?Jr
|
|
147
|
-
/* @__PURE__ */it("span",{"aria-live":"polite",className:"sr-only",children:m?g.copied:""})]})]})}var en=2;function tn(e,t){if("."===t)return e.includes(".")?e:""===e?"0.":`${e}.`;if(t<"0"||t>"9")return e;const r=e.indexOf(".");return-1!==r&&e.length-r-1>=2?e:"0"===e?t:e+t}function rn(e){return e.slice(0,-1)}var nn=["1","2","3","4","5","6","7","8","9",".","0"];function an({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=
|
|
148
|
-
return lt("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[nn.map(t=>/* @__PURE__ */it(
|
|
149
|
-
/* @__PURE__ */it(
|
|
146
|
+
/* @__PURE__ */it(c,{id:d,"aria-label":n?g.copyLabel(n):g.copy,"aria-describedby":u,onClick:b,className:`${v} text-gray-400`,children:/* @__PURE__ */it(m?Zr:Jr,{})}),
|
|
147
|
+
/* @__PURE__ */it("span",{"aria-live":"polite",className:"sr-only",children:m?g.copied:""})]})]})}var en=2;function tn(e,t){if("."===t)return e.includes(".")?e:""===e?"0.":`${e}.`;if(t<"0"||t>"9")return e;const r=e.indexOf(".");return-1!==r&&e.length-r-1>=2?e:"0"===e?t:e+t}function rn(e){return e.slice(0,-1)}var nn=["1","2","3","4","5","6","7","8","9",".","0"];function an({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=ze().keypad,o=r=>{r!==e&&t(r)};/* @__PURE__ */
|
|
148
|
+
return lt("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[nn.map(t=>/* @__PURE__ */it(_,{size:"touch-xl",variant:"secondary",onClick:()=>o(tn(e,t)),children:t},t)),
|
|
149
|
+
/* @__PURE__ */it(_,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>o(rn(e)),children:"⌫"}),r&&/* @__PURE__ */it(_,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var ln={md:"h-24 p-3",lg:"h-32 p-4"},on=He(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...o},s){/* @__PURE__ */
|
|
150
150
|
return lt("button",{ref:s,type:l,disabled:a,"aria-pressed":n||void 0,className:["flex w-full flex-col justify-between rounded-xl border text-left transition-colors rosh-focus-ring","disabled:cursor-not-allowed disabled:opacity-50",n?"border-blue-600 bg-blue-50 ring-2 ring-blue-400/40":"border-gray-200 bg-white hover:bg-gray-50 focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",ln[r],i].filter(Boolean).join(" "),...o,children:[
|
|
151
151
|
/* @__PURE__ */it("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */it("span",{className:"text-sm text-gray-500",children:t})]})}),sn={sm:"h-(--control-height-sm) px-(--space-control-x-sm) gap-(--space-icon-gap-sm) text-xs",md:"h-(--control-height-md) px-(--space-control-x) gap-(--space-icon-gap) text-sm",lg:"h-(--control-height-lg) px-(--space-control-x-lg) gap-(--space-icon-gap) text-sm",touch:"h-14 px-(--space-20) gap-(--space-icon-gap) text-base"};function cn(e=!1,t=""){return["rosh-choice-track inline-flex max-w-full items-center gap-(--space-4) overflow-x-auto rounded-(--radius-card) bg-gray-100 p-(--space-4)","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",e?"w-full":"",t].filter(Boolean).join(" ")}function dn({size:e="md",selected:t,disabled:r=!1,block:n=!1}){return["relative inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-(--radius-control) font-medium transition-colors",sn[e],t?"bg-blue-600 text-white shadow-sm rosh-segmented-on":"text-gray-600 hover:text-gray-900",r?"cursor-not-allowed opacity-40":"cursor-pointer",n?"flex-1":""].filter(Boolean).join(" ")}function un(e=!1){return e?"relative inline-flex shrink-0 flex-1":"relative inline-flex shrink-0"}function hn({icon:e,label:t}){/* @__PURE__ */
|
|
152
|
-
return lt(ot,{children:[e?/* @__PURE__ */it("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e}):null,t]})}function mn({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=
|
|
152
|
+
return lt(ot,{children:[e?/* @__PURE__ */it("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e}):null,t]})}function mn({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=_e(),h=cn(l,o),m=un(l);/* @__PURE__ */
|
|
153
153
|
return it("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const i=`${u}-${r.value}`,o=r.value===e,s=/* @__PURE__ */lt("label",{htmlFor:i,className:dn({size:a,selected:o,disabled:r.disabled,block:l}),children:[
|
|
154
154
|
/* @__PURE__ */it("input",{id:i,type:"radio",name:n,value:r.value,checked:o,disabled:r.disabled,"aria-describedby":r.title?`${i}-note`:void 0,onChange:()=>t(r.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),
|
|
155
|
-
/* @__PURE__ */it(hn,{icon:r.icon,label:r.label}),r.title&&/* @__PURE__ */it("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */it(q,{content:r.title,className:m,children:s},r.value):s})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e,i=/* @__PURE__ */it("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:dn({size:a,selected:n,disabled:r.disabled,block:l}),children:/* @__PURE__ */it(hn,{icon:r.icon,label:r.label})},r.value);return r.title?/* @__PURE__ */it(q,{content:r.title,className:m,children:i},r.value):i})})}var pn=/(^|[\s:])!?z-/;function fn({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":f,disabled:g,className:b="",triggerClassName:y,panelClassName:x=""}){const[v,w]=qe(s),N=(o??v)&&!g,k=ce(),$=Ue(null),M=Ue(null),C=Ue(null),L=Ue(null),D=
|
|
155
|
+
/* @__PURE__ */it(hn,{icon:r.icon,label:r.label}),r.title&&/* @__PURE__ */it("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */it(q,{content:r.title,className:m,children:s},r.value):s})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e,i=/* @__PURE__ */it("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:dn({size:a,selected:n,disabled:r.disabled,block:l}),children:/* @__PURE__ */it(hn,{icon:r.icon,label:r.label})},r.value);return r.title?/* @__PURE__ */it(q,{content:r.title,className:m,children:i},r.value):i})})}var pn=/(^|[\s:])!?z-/;function fn({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":f,disabled:g,className:b="",triggerClassName:y,panelClassName:x=""}){const[v,w]=qe(s),N=(o??v)&&!g,k=ce(),$=Ue(null),M=Ue(null),C=Ue(null),L=Ue(null),D=_e(),S=m??D,A=_e(),P=_e(),j=_e(),z=Ue(null),F=Ue(!1),E=Ue({openProp:o,onOpenChange:c});E.current={openProp:o,onOpenChange:c};const B=Ye(e=>{void 0===E.current.openProp&&w(e),E.current.onOpenChange?.(e)},[]),I=Ye((e=!1)=>{F.current=e,B(!1)},[B]),R=e=>{z.current=e.nativeEvent},W=Ye(()=>{const e=C.current,t=M.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=G(t),a=Math.max(0,n.right-n.left-2*J),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]);oe(()=>{N&&k&&W()}),Ge(()=>{if(!N||!k)return;const e=X(()=>M.current,W),t=L.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>W());return r.observe(t),()=>{e(),r.disconnect()}},[N,k,W]),Ge(()=>{if(!N)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(z.current===e)return!1;const t=e.target;return!(t&&($.current?.contains(t)||C.current?.contains(t)))})(e)&&I(!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=me(()=>I()),a=he(e=>"Escape"===e.key&&(I(),M.current?.focus(),!0),()=>C.current);return()=>{t(),r(),n(),a()}},[N,I]),O(C,N&&k),oe(()=>{if(!N||!k)return;const e=C.current;return()=>{if(F.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||M.current?.focus({preventScroll:!0})}},[N,k]),Ge(()=>{if(!N||!k)return;const e=C.current;e&&(F.current=!1,(h?.current??T(e)[0]??e).focus({preventScroll:!0}))},[N,k]);const H="function"==typeof t?t({close:()=>I()}):t,_=r?{"aria-labelledby":P}:a?{"aria-label":a}:{"aria-labelledby":S};/* @__PURE__ */
|
|
156
156
|
return lt("div",{ref:$,className:`relative inline-flex ${b}`.trim(),children:[
|
|
157
|
-
/* @__PURE__ */it("button",{ref:M,id:S,type:"button","aria-haspopup":"dialog","aria-expanded":N,"aria-controls":N&&k?A:void 0,"aria-label":p,"aria-describedby":f,disabled:g,onClick:()=>N?
|
|
158
|
-
/* @__PURE__ */it("div",{ref:C,id:A,role:"dialog",...
|
|
157
|
+
/* @__PURE__ */it("button",{ref:M,id:S,type:"button","aria-haspopup":"dialog","aria-expanded":N,"aria-controls":N&&k?A:void 0,"aria-label":p,"aria-describedby":f,disabled:g,onClick:()=>N?I():B(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!N)return;const t=(()=>{const e=C.current;return e?T(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:y??ge({variant:"secondary"}),children:e}),N&&k&&st(
|
|
158
|
+
/* @__PURE__ */it("div",{ref:C,id:A,role:"dialog",..._,"aria-describedby":n?j:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:R,onFocusCapture:R,onKeyDown:e=>{const t=C.current,r=M.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=T(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=K(r,t);I(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${x}`.trim(),style:pn.test(x)?void 0:{zIndex:pe.popup},children:/* @__PURE__ */lt("div",{ref:L,children:[r&&/* @__PURE__ */it("h2",{id:P,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */it("p",{id:j,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */it("div",{className:"mt-3",children:H}):H]})}),document.body)]})}var gn={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function bn({value:e,onChange:t,options:r,label:n,emptyValue:a,columns:l=5,disabled:i=!1,className:o=""}){const s=ze(),d=s.iconPicker,u=s.iconNames,h=e=>e.label??u[e.value]??e.value,m=Ue([]),p=Math.max(0,r.findIndex(t=>t.value===e)),f=r[p],g=f?.value===a,b=Ue(null);/* @__PURE__ */
|
|
159
159
|
return it(fn,{className:o,disabled:i,triggerLabel:f?d.button(n,h(f)):n,"aria-label":n,initialFocus:b,panelClassName:"!p-2",trigger:/* @__PURE__ */lt("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */it("span",g||!f?{className:"text-sm",children:f?h(f):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:f.icon}),
|
|
160
|
-
/* @__PURE__ */it(
|
|
161
|
-
return it(q,{content:h(n),children:/* @__PURE__ */it(c,{ref:e=>{m.current[i]=e,i===p&&(b.current=e)},role:"option","aria-selected":o,"aria-label":h(n),pressed:o,tabIndex:i===p?0:-1,onKeyDown:e=>((e,t)=>{const n=gn[t.key];if(!n)return;t.preventDefault();const a=Math.floor(e/l)+n[0],i=e%l+n[1];if(a<0||i<0||i>=l)return;const o=a*l+i;if(!(o>=r.length)){for(const[e,t]of m.current.entries())t?.setAttribute("tabindex",e===o?"0":"-1");m.current[o]?.focus()}})(i,e),onClick:()=>{t(n.value),a()},children:/* @__PURE__ */it("span",{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})})},n.value)})})})}function yn(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var xn=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function vn({dir:e,compact:t,label:r,disabled:n,onStep:a}){const l=Ue(a);l.current=a;const i=Ue({}),o=Ye(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);Ge(()=>o,[o]),Ge(()=>{n&&o()},[n,o]);const s=/* @__PURE__ */it(
|
|
162
|
-
return lt("div",{className:"relative",children:[m&&/* @__PURE__ */it("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:m}),re,p&&/* @__PURE__ */it("span",{className:`pointer-events-none absolute ${U?"right-6":v?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-gray-500`,children:p}),v&&(()=>{const e=/* @__PURE__ */it(vn,{dir:-1,compact:U,label:
|
|
163
|
-
return lt("span",U?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[t,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,t]})})()]})}),Nn="h-3.5 w-3.5",kn={top:/* @__PURE__ */it(
|
|
160
|
+
/* @__PURE__ */it(be,{name:"chevron-down",className:"h-4 w-4"})]}),children:({close:a})=>/* @__PURE__ */it("div",{role:"listbox","aria-label":n,className:"grid gap-1",style:{gridTemplateColumns:`repeat(${l}, 2rem)`},children:r.map((n,i)=>{const o=n.value===e;/* @__PURE__ */
|
|
161
|
+
return it(q,{content:h(n),children:/* @__PURE__ */it(c,{ref:e=>{m.current[i]=e,i===p&&(b.current=e)},role:"option","aria-selected":o,"aria-label":h(n),pressed:o,tabIndex:i===p?0:-1,onKeyDown:e=>((e,t)=>{const n=gn[t.key];if(!n)return;t.preventDefault();const a=Math.floor(e/l)+n[0],i=e%l+n[1];if(a<0||i<0||i>=l)return;const o=a*l+i;if(!(o>=r.length)){for(const[e,t]of m.current.entries())t?.setAttribute("tabindex",e===o?"0":"-1");m.current[o]?.focus()}})(i,e),onClick:()=>{t(n.value),a()},children:/* @__PURE__ */it("span",{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})})},n.value)})})})}function yn(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var xn=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function vn({dir:e,compact:t,label:r,disabled:n,onStep:a}){const l=Ue(a);l.current=a;const i=Ue({}),o=Ye(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);Ge(()=>o,[o]),Ge(()=>{n&&o()},[n,o]);const s=/* @__PURE__ */it(be,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),d={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__ */it("button",{type:"button",...d,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__ */it(c,{size:"sm",...d,children:s})}var wn=He(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,shiftStep:i,disabled:o,readOnly:s,invalid:c,placeholder:u,size:h,prefix:m,suffix:p,id:f,name:g,className:b="",onBlur:y,onFocus:x,steppers:v=!1,stepFrom:w,snap:N=!1,allowEmpty:k=!0,appearance:$="box",display:M,reportWhileTyping:C=!0,onRevert:L,"aria-label":D,"aria-labelledby":S,"aria-describedby":A,...P},j){const z="bare"===$,F="string"==typeof p&&""!==p.trim()?p.trim():void 0,E=e=>function(e,t){let r=e.trim();if(t&&r.endsWith(t)&&(r=r.slice(0,-t.length).trim()),r=r.replace(",","."),""===r||"-"===r||"."===r||"-."===r)return null;const n=Number(r);return Number.isFinite(n)?n:null}(e,F),B=Object.fromEntries(Object.entries(P).filter(([e])=>e.startsWith("data-"))),O=ze(),[T,I]=qe(()=>xn(e,a)),R=Ue(T);R.current=T;const W=Ue(null),K=Ye(e=>{W.current=e,"function"==typeof j?j(e):j&&(j.current=e)},[j]),H=Ue(e),_=Ue(e);_.current=e;const q=Boolean(o||s),U="compact"===v;Ge(()=>{E(R.current)!==e&&I(xn(e,a))},[e,a]);const V=e=>{if(q)return;let i=(E(R.current)??w??(u?E(u):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=xn(i,a);R.current=s,I(s),t(i),Q()},Y=Ue(V);Y.current=V;const[G,X]=qe(!1),[J,Z]=qe(0),Q=()=>{z&&Z(e=>e+1)};Ge(()=>{z&&G&&document.activeElement===W.current&&W.current?.select()},[z,G,J]);const ee=Ue(!1);Ge(()=>{if(G&&!q)return he(e=>{if("Escape"!==e.key||document.activeElement!==W.current)return!1;const r=H.current;if(E(R.current)===r)return!1;const n=xn(r,a);return R.current=n,I(n),_.current!==r&&(L??t)(r),Q(),!0})},[G,q,a,t,L]);const te=()=>{const e=E(R.current);if(null==e){if(!k){const e=xn(_.current,a);return R.current=e,I(e),_.current}return R.current="",I(""),null!==_.current&&t(null),null}let i=e;const o=a??(N?Math.max(yn(l??1),yn(r??0)):void 0);N&&(i=function(e,t,r){const n=(e-r)/t;return r+Math.round(n+1e-9*Math.sign(e))*t}(i,l??1,r??0)),null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n),null!=o&&(i=Number(i.toFixed(o)));const s=xn(i,a);return R.current=s,I(s),i===e&&i===_.current||t(i),i},re=/* @__PURE__ */it("input",{ref:K,id:f,name:g,type:"text",inputMode:0===a?"numeric":"decimal",value:!G&&M?M(e):T,disabled:o,readOnly:s,placeholder:u,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?u||void 0:`${xn(e,a)}${z&&F?F:""}`,"aria-describedby":A,"data-appearance":z?"bare":void 0,...B,autoComplete:z?"off":void 0,spellCheck:!z&&void 0,"aria-invalid":c||void 0,"aria-label":D,"aria-labelledby":S,onChange:e=>(e=>{if(s)return;const r=F&&e.trimEnd().endsWith(F)?e.trimEnd().slice(0,-F.length).trimEnd():e;if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(I(e),!C)return;const n=E(e);(null!==n||k)&&t(n)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!q)return H.current=te(),void Q();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||q||(e.preventDefault(),V(n))},onFocus:()=>{H.current=_.current,X(!0),ee.current=!0,x?.()},onMouseUp:z?e=>{ee.current&&(ee.current=!1,e.preventDefault())}:void 0,onBlur:()=>{X(!1),ee.current=!1,te(),y?.()},className:z?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",G?"bg-white":"bg-transparent",q?"cursor-default":"cursor-text",b].filter(Boolean).join(" "):d({invalid:c,size:h,readOnly:s,className:[m?"pl-6":"",U?p?"pr-10":"pr-6":v?p?"pr-24":"pr-16":p?"pr-10":"","text-left tabular-nums",b].filter(Boolean).join(" ")})});if(z||!m&&!p&&!v)return re;const ne=E(T);/* @__PURE__ */
|
|
162
|
+
return lt("div",{className:"relative",children:[m&&/* @__PURE__ */it("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:m}),re,p&&/* @__PURE__ */it("span",{className:`pointer-events-none absolute ${U?"right-6":v?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-gray-500`,children:p}),v&&(()=>{const e=/* @__PURE__ */it(vn,{dir:-1,compact:U,label:O.number.decrease,disabled:q||null!=r&&null!=ne&&ne<=r,onStep:e=>Y.current(-(e?i??10*(l??1):l??1))}),t=/* @__PURE__ */it(vn,{dir:1,compact:U,label:O.number.increase,disabled:q||null!=n&&null!=ne&&ne>=n,onStep:e=>Y.current(e?i??10*(l??1):l??1)});/* @__PURE__ */
|
|
163
|
+
return lt("span",U?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[t,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,t]})})()]})}),Nn="h-3.5 w-3.5",kn={top:/* @__PURE__ */it(be,{name:"padding-top","aria-hidden":"true",className:Nn}),right:/* @__PURE__ */it(be,{name:"padding-right","aria-hidden":"true",className:Nn}),bottom:/* @__PURE__ */it(be,{name:"padding-bottom","aria-hidden":"true",className:Nn}),left:/* @__PURE__ */it(be,{name:"padding-left","aria-hidden":"true",className:Nn}),vertical:/* @__PURE__ */it(be,{name:"padding-y","aria-hidden":"true",className:Nn}),horizontal:/* @__PURE__ */it(be,{name:"padding-left-right","aria-hidden":"true",className:Nn}),each:/* @__PURE__ */it(be,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"})};var $n=(e,t,r)=>null===e[r]?t[r]:String(e[r]);function Mn(e,t){const r=r=>$n(e,t,r);return r("left")!==r("right")||r("top")!==r("bottom")}function Cn({label:e,value:t,onChange:r,each:n,placeholder:a,words:l,min:i=0,max:o=200,step:s=4,readOnly:c}){const d=(e,n,d)=>{const u=function(e,t){const r=t.map(t=>e[t]);return r.every(e=>e===r[0])?r[0]:"mixed"}(t,e),h=e.map(e=>$n(t,a,e)),m="mixed"!==u&&h.every(e=>e===h[0])?h[0]:"–";/* @__PURE__ */
|
|
164
164
|
return it("div",{"data-side":e.join("-"),className:"min-w-0",children:/* @__PURE__ */it(wn,{value:"mixed"===u?null:u,onChange:n=>((e,n)=>{const a={...t};for(const t of e)a[t]=n;r(a)})(e,n),min:i,max:o,step:s,snap:!0,precision:0,steppers:"compact",readOnly:c,placeholder:m,prefix:d,suffix:l.unit,"aria-label":n})})};/* @__PURE__ */
|
|
165
165
|
return it("div",{role:"group","aria-label":e,"data-sides":n?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */lt(ot,n?{children:[d(["left"],l.sides.left,kn.left),d(["top"],l.sides.top,kn.top),d(["right"],l.sides.right,kn.right),d(["bottom"],l.sides.bottom,kn.bottom)]}:{children:[d(["left","right"],l.horizontal,kn.horizontal),d(["top","bottom"],l.vertical,kn.vertical)]})})}function Ln({each:e,onChange:t,label:r,disabled:n}){/* @__PURE__ */
|
|
166
|
-
return it(q,{content:r,children:/* @__PURE__ */it(c,{size:"sm","aria-label":r,"aria-pressed":e,disabled:n,onClick:()=>t(!e),children:kn.each})})}var Dn=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function Sn(e){const t=e.trim().replace(/^#/,"");if(!Dn.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var An=e=>e.toUpperCase(),
|
|
167
|
-
return it("button",{ref:i,type:a,"aria-pressed":r,className:Tn({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */it("span",{"aria-hidden":"true",className:"absolute inset-0",style:
|
|
168
|
-
return lt("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:[(L.length>0||a)&&/* @__PURE__ */lt("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-2",children:[a&&/* @__PURE__ */it(q,{content:u.clear,children:/* @__PURE__ */it(
|
|
169
|
-
return it(q,{content:r,children:/* @__PURE__ */it(
|
|
166
|
+
return it(q,{content:r,children:/* @__PURE__ */it(c,{size:"sm","aria-label":r,"aria-pressed":e,disabled:n,onClick:()=>t(!e),children:kn.each})})}var Dn=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function Sn(e){const t=e.trim().replace(/^#/,"");if(!Dn.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var An=e=>e.toUpperCase(),Pn=(e,t,r)=>Math.min(r,Math.max(t,e));function jn(e){const t=Sn(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 zn({h:e,s:t,v:r}){const n=(e%360+360)%360,a=Pn(t,0,1),l=Pn(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 Fn=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>zn({h:e%360,s:1,v:1})).join(", ")})`,En={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},Bn={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function On(e){return e?{background:e}:Bn}function Tn({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",En[e],r].filter(Boolean).join(" ")}var In=He(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
|
|
167
|
+
return it("button",{ref:i,type:a,"aria-pressed":r,className:Tn({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */it("span",{"aria-hidden":"true",className:"absolute inset-0",style:On(e)})})}),Rn=(e,t,r)=>Math.min(r,Math.max(t,e)),Wn=e=>"string"==typeof e?{value:e}:e;var Kn={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function Hn({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=ze().color,h=Sn(l??""),[m,p]=qe(()=>jn(e||h||"")),f=Ue(e);Ge(()=>{e!==f.current&&(f.current=e,e?p(jn(e)):h&&p(jn(h)))},[e]);const g=r=>{o||r===e||(f.current=r,t(r))},b=e=>{const t=Sn(e);t&&(p(jn(t)),g(t))},y=e=>{p(e),g(zn(e))},[x,v]=qe(!1),w=Ue(m);w.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,w.current);"end"===i?(v(!0),p(r)):y(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,w.current);"end"===i?p(r):y(r)},onPointerUp:t=>{"end"===i&&x&&(v(!1),y(e(t,w.current)))}}),k=N((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?Pn((r-a.left)/a.width,0,1):0,v:a.height>0?1-Pn((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*Pn((r-n.left)/n.width,0,1)):0)};var r,n}),M=x?zn(m):e,C=e=>`${Math.round(100*e)}%`,L=(n??[]).map(Wn),D=Sn(e);/* @__PURE__ */
|
|
168
|
+
return lt("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:[(L.length>0||a)&&/* @__PURE__ */lt("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-2",children:[a&&/* @__PURE__ */it(q,{content:u.clear,children:/* @__PURE__ */it(In,{color:"",size:"sm","aria-label":u.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(f.current="",t(""))}})}),L.map(e=>{const t=Sn(e.value),r=e.label?`${e.label} · ${An(t??e.value)}`:An(t??e.value);/* @__PURE__ */
|
|
169
|
+
return it(q,{content:r,children:/* @__PURE__ */it(In,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===D,disabled:o,onClick:()=>b(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
170
170
|
/* @__PURE__ */it("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*m.v),"aria-valuetext":u.squareValue(Math.round(100*m.s),Math.round(100*m.v)),"aria-disabled":o||void 0,"data-color-square":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?.1:.01,a={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[t];return a?{...e,s:Rn(e.s+a[0],0,1),v:Rn(e.v+a[1],0,1)}:null}(m,e.key,e.shiftKey);t&&(e.preventDefault(),y(t))},...k,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:zn({h:m.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */it("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:C(m.s),top:C(1-m.v),...Kn}})}),
|
|
171
171
|
/* @__PURE__ */it("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(m.h),"aria-orientation":"horizontal","aria-disabled":o||void 0,"data-color-hue":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?10:1;switch(t){case"ArrowLeft":case"ArrowDown":return Rn(e-n,0,359);case"ArrowRight":case"ArrowUp":return Rn(e+n,0,359);case"PageDown":return Rn(e-10,0,359);case"PageUp":return Rn(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}(m.h,e.key,e.shiftKey);null!==t&&(e.preventDefault(),y({...m,h:t}))},...$,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:Fn},children:/* @__PURE__ */it("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:m.h/360*100+"%",background:zn({h:m.h,s:1,v:1}),...Kn}})}),
|
|
172
172
|
/* @__PURE__ */lt("div",{className:"flex items-center gap-2",children:[
|
|
173
|
-
/* @__PURE__ */it("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:
|
|
174
|
-
/* @__PURE__ */it(qn,{value:M,placeholder:!e&&h?An(h):void 0,onChange:b,label:u.hex(r),disabled:o})]})]})}var
|
|
175
|
-
return it("input",{id:l,type:"text",value:s??(e?An(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{c(r.target.value);const n=Sn(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),c(null))},onBlur:()=>c(null),className:d({size:i,className:`${
|
|
173
|
+
/* @__PURE__ */it("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:On(M||(h??""))}),
|
|
174
|
+
/* @__PURE__ */it(qn,{value:M,placeholder:!e&&h?An(h):void 0,onChange:b,label:u.hex(r),disabled:o})]})]})}var _n={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"};function qn({value:e,onChange:t,label:r,placeholder:n,disabled:a,id:l,size:i="md",className:o=""}){const[s,c]=qe(null);/* @__PURE__ */
|
|
175
|
+
return it("input",{id:l,type:"text",value:s??(e?An(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{c(r.target.value);const n=Sn(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),c(null))},onBlur:()=>c(null),className:d({size:i,className:`${_n[i]} flex-1 font-mono uppercase ${o}`.trim()}).replace(/(^| )w-full( |$)/," ")})}function Un({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 f=ze().color,g=_e(),b=Sn(l??""),y=e||b||"",x=e?An(e):b?An(b):f.none;/* @__PURE__ */
|
|
176
176
|
return lt("div",{className:`inline-flex items-center gap-2 ${p}`.trim(),children:[
|
|
177
|
-
/* @__PURE__ */it(fn,{id:s,trigger:/* @__PURE__ */it("span",{"aria-hidden":"true",className:"absolute inset-0",style:
|
|
178
|
-
/* @__PURE__ */it("div",{className:"w-24 flex-none",children:/* @__PURE__ */it(qn,{value:e,placeholder:!e&&b?An(b):void 0,onChange:r=>{o||r===e||t(r)},label:f.hex(r),disabled:o,size:d})})]})}var Vn=["solid","dashed","dotted"],Yn=["top","right","bottom","left"];function Gn(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(Yn.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function Xn(e,t){const r=e??{},n=Gn(t),a=Yn.some(e=>"number"==typeof r[e]),l=Yn.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:a?0:n[e]);return!l.every(e=>e===l[0])}var
|
|
179
|
-
return lt("div",{role:"group","aria-label":e,"data-border":n?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[o?n?/* @__PURE__ */lt(ot,{children:[f("left",i.sides.left,
|
|
177
|
+
/* @__PURE__ */it(fn,{id:s,trigger:/* @__PURE__ */it("span",{"aria-hidden":"true",className:"absolute inset-0",style:On(y)}),triggerLabel:f.swatch(r,x),triggerClassName:Tn({size:d}),"aria-label":f.panel(r),align:u,open:h,onOpenChange:m,disabled:o,children:/* @__PURE__ */it(Hn,{id:g,value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o})}),c&&
|
|
178
|
+
/* @__PURE__ */it("div",{className:"w-24 flex-none",children:/* @__PURE__ */it(qn,{value:e,placeholder:!e&&b?An(b):void 0,onChange:r=>{o||r===e||t(r)},label:f.hex(r),disabled:o,size:d})})]})}var Vn=["solid","dashed","dotted"],Yn=["top","right","bottom","left"];function Gn(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(Yn.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function Xn(e,t){const r=e??{},n=Gn(t),a=Yn.some(e=>"number"==typeof r[e]),l=Yn.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:a?0:n[e]);return!l.every(e=>e===l[0])}var Jn="h-3.5 w-3.5",Zn={all:/* @__PURE__ */it(be,{name:"border-all","aria-hidden":"true",className:Jn}),top:/* @__PURE__ */it(be,{name:"border-top","aria-hidden":"true",className:Jn}),right:/* @__PURE__ */it(be,{name:"border-right","aria-hidden":"true",className:Jn}),bottom:/* @__PURE__ */it(be,{name:"border-bottom","aria-hidden":"true",className:Jn}),left:/* @__PURE__ */it(be,{name:"border-left","aria-hidden":"true",className:Jn})},Qn={solid:/* @__PURE__ */it(be,{name:"line-solid","aria-hidden":"true",className:Jn}),dashed:/* @__PURE__ */it(be,{name:"line-dashed","aria-hidden":"true",className:Jn}),dotted:/* @__PURE__ */it(be,{name:"line-dotted","aria-hidden":"true",className:Jn})};function ea({label:e,value:t,onChange:r,each:n,placeholder:a,presets:l,words:i,widths:o=!0,styles:s=!0,min:c=0,max:d=20,step:u=1,readOnly:h}){const m=e=>"number"==typeof t[e]?t[e]:null,p=(e,n)=>{const a={...t};if("number"==typeof t.width)for(const e of Yn)null===m(e)&&(a[e]=t.width);a[e]=n,delete a.width,r(a)},f=(e,t,r,n,a,l)=>/* @__PURE__ */it("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */it(wn,{value:n,onChange:l,min:c,max:d,step:u,precision:0,steppers:"compact",readOnly:h,placeholder:a,prefix:r,suffix:i.unit,"aria-label":t})}),g=Yn.map(m),b="number"==typeof t.width?t.width:g.every(e=>null!==e&&e===g[0])?g[0]:null,y=null===b&&g.some(e=>null!==e),x=Yn.every(e=>a.sides[e]===a.sides.top)?String(a.sides.top):"–",v=e=>m(e)??("number"==typeof t.width?t.width:null),w=t.style??a.style;/* @__PURE__ */
|
|
179
|
+
return lt("div",{role:"group","aria-label":e,"data-border":n?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[o?n?/* @__PURE__ */lt(ot,{children:[f("left",i.sides.left,Zn.left,v("left"),String(a.sides.left),e=>p("left",e)),f("top",i.sides.top,Zn.top,v("top"),String(a.sides.top),e=>p("top",e)),f("right",i.sides.right,Zn.right,v("right"),String(a.sides.right),e=>p("right",e)),f("bottom",i.sides.bottom,Zn.bottom,v("bottom"),String(a.sides.bottom),e=>p("bottom",e))]}):f("all",i.width,Zn.all,b,y?"–":x,e=>{const n={...t,width:e};for(const e of Yn)delete n[e];r(n)}):null,s&&/* @__PURE__ */it("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */it(mn,{block:!0,size:"sm",label:i.style,value:w,onChange:e=>{h||r({...t,style:e})},options:Vn.map(e=>({value:e,label:/* @__PURE__ */lt(ot,{children:[Qn[e],
|
|
180
180
|
/* @__PURE__ */it("span",{className:"sr-only",children:i.styles[e]})]}),title:i.styles[e]}))})}),
|
|
181
|
-
/* @__PURE__ */it("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */it(Un,{value:t.color??"",onChange:e=>{h||r({...t,color:e})},label:i.color,presets:l,fallback:a.color,showHexInput:!0,size:"sm",disabled:h})})]})}var ta={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},ra={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},na={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},aa=
|
|
182
|
-
/* @__PURE__ */lt("span",{className:"min-w-0",children:[a&&/* @__PURE__ */it("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */it("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),g&&/* @__PURE__ */it("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */it("span",{className:o,children:x})}),la=(e,t,r)=>Math.min(r,Math.max(t,e));var ia=8,oa=40;var sa="undefined"==typeof window?Ge:
|
|
183
|
-
return it(da.Provider,{value:a,children:e})}function ha({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":f,valueText:g,id:b,disabled:y,size:x="md",className:v=""}){const w=
|
|
181
|
+
/* @__PURE__ */it("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */it(Un,{value:t.color??"",onChange:e=>{h||r({...t,color:e})},label:i.color,presets:l,fallback:a.color,showHexInput:!0,size:"sm",disabled:h})})]})}var ta={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},ra={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},na={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},aa=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=_e(),m=i??h,p=l?`${m}-hint`:void 0,f=r&&c?c:void 0,g=r&&!f&&null!=s&&""!==s,b=g?`${m}-reason`:void 0,y=[p,f??b].filter(Boolean).join(" ")||void 0,x=/* @__PURE__ */it("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":y,disabled:r,onClick:()=>t(!e),...d,className:["relative inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]","disabled:cursor-not-allowed disabled:opacity-40",ta[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */it("span",{className:["inline-block rounded-full bg-white shadow transition-transform",ra[n],e?na[n]:"translate-x-0"].join(" ")})});return a||l||g?/* @__PURE__ */lt("span",{className:`flex items-start gap-3 ${o}`.trim(),children:[x,
|
|
182
|
+
/* @__PURE__ */lt("span",{className:"min-w-0",children:[a&&/* @__PURE__ */it("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */it("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),g&&/* @__PURE__ */it("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */it("span",{className:o,children:x})}),la=(e,t,r)=>Math.min(r,Math.max(t,e));var ia=8,oa=40;var sa="undefined"==typeof window?Ge:Je;function ca(e,t,r,n){return Number(la(e,t,r).toFixed(n))}var da=Xe(null);function ua({children:e}){const[t,r]=qe({}),n=Ve(()=>(e,t)=>r(r=>{if(null===t){if(!(e in r))return r;const t={...r};return delete t[e],t}return r[e]===t?r:{...r,[e]:t}}),[]),a=Ve(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
|
|
183
|
+
return it(da.Provider,{value:a,children:e})}function ha({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":f,valueText:g,id:b,disabled:y,size:x="md",className:v=""}){const w=ze(),N=_e(),k=b??N,$=i??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(a),M=o??r,C=s??n,L=void 0!==u||void 0!==h,D=m??h,S=la(e??h??r,r,n),A=Ue(null),[P,j]=qe(null),z=Boolean(c);sa(()=>{const e=()=>{const e=A.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,r)=>e+(parseFloat(t[r])||0),0);r<=0||j(e=>e&&e.frame===r&&e.fontSize===t.fontSize?e:{frame:r,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[z,d]);const F=e=>g?g(e):"string"==typeof c?`${e.toFixed($)} ${c}`:void 0,E=null==e?u??(null!=h?F(h)??String(h):void 0):F(e),B=`calc(${O=[r.toFixed($),n.toFixed($),e?.toFixed($),u,h?.toFixed($)],Math.max(1,...O.map(e=>(e??"").length))}ch + ${(P?.frame??10+(z?oa:ia))+2}px)`;var O;const T=tt(da),I=_e(),R=T?.set;return sa(()=>{R&&R(I,d?B:null)},[R,I,B,d]),Ge(()=>()=>R?.(I,null),[R,I]),/* @__PURE__ */lt("div",{className:`flex items-center gap-3 ${v}`.trim(),children:[
|
|
184
184
|
/* @__PURE__ */it("input",{id:k,type:"range",min:r,max:n,step:a,value:S,disabled:y,"aria-label":f?void 0:p,"aria-labelledby":f,"aria-valuetext":E,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(ca((e??D??S)+o*(s?l??a:a),r,n,$))},onChange:e=>t(ca(Number(e.target.value),r,n,$)),className:"min-w-0 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===x?"h-1":"h-1.5")}),d&&
|
|
185
|
-
/* @__PURE__ */it("div",{ref:A,className:"shrink-0 text-xs",style:{width:T?.width??B,...
|
|
186
|
-
return it("div",{role:"group","aria-label":a?void 0:r,"aria-labelledby":a,"aria-describedby":l,className:`flex flex-wrap gap-2 ${n}`.trim(),children:e.map((e,r)=>{const n=`${o}-${r}-state`,a=`${o}-${r}-reason`,l=Boolean(e.disabled)&&null!=e.disabledReason&&""!==e.disabledReason,s=/* @__PURE__ */lt("button",{type:"button","aria-pressed":e.shown,disabled:!(!e.disabled||l)||void 0,"aria-disabled":!!l||void 0,"aria-describedby":Q(n,l?a:void 0),onClick:l?
|
|
187
|
-
/* @__PURE__ */it(
|
|
185
|
+
/* @__PURE__ */it("div",{ref:A,className:"shrink-0 text-xs",style:{width:T?.width??B,...P?{fontSize:P.fontSize}:{}},children:/* @__PURE__ */it(wn,{value:e,onChange:e=>{null!=e?e<M||e>C||t(e):L&&t(null)},min:M,max:C,step:a,shiftStep:l,stepFrom:D,precision:$,snap:!0,allowEmpty:L,suffix:c,disabled:y,placeholder:u??(null!=h?h.toFixed($):void 0),size:"sm","aria-label":p?w.slider.value(p):void 0,"aria-labelledby":p?void 0:f})})]})}function ma({items:e,onChange:t,label:r,className:n="","aria-labelledby":a,"aria-describedby":l}){const i=ze().displayChips,o=_e();/* @__PURE__ */
|
|
186
|
+
return it("div",{role:"group","aria-label":a?void 0:r,"aria-labelledby":a,"aria-describedby":l,className:`flex flex-wrap gap-2 ${n}`.trim(),children:e.map((e,r)=>{const n=`${o}-${r}-state`,a=`${o}-${r}-reason`,l=Boolean(e.disabled)&&null!=e.disabledReason&&""!==e.disabledReason,s=/* @__PURE__ */lt("button",{type:"button","aria-pressed":e.shown,disabled:!(!e.disabled||l)||void 0,"aria-disabled":!!l||void 0,"aria-describedby":Q(n,l?a:void 0),onClick:l?Z:()=>t(e.id,!e.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(e.shown?"border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100":"border-gray-200 bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-900"),children:[
|
|
187
|
+
/* @__PURE__ */it(be,{name:e.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
|
|
188
188
|
/* @__PURE__ */it(N,{children:e.label})]}),c=/* @__PURE__ */it("span",{id:n,className:"sr-only",children:e.shown?i.shown:i.hidden});/* @__PURE__ */
|
|
189
189
|
return lt(rt,{children:[l?/* @__PURE__ */it(ee,{reason:e.disabledReason,id:a,children:s}):/* @__PURE__ */it(q,{content:e.shown?i.shownHint:i.hiddenHint,describe:!1,className:"relative inline-flex max-w-full",children:s}),c]},e.id)})})}function pa({options:e,value:t,onChange:r,onClear:n,columns:a,captions:l=!1,label:i,className:o="","aria-labelledby":s}){/* @__PURE__ */
|
|
190
|
-
return it("div",{role:"group","aria-label":s?void 0:i,"aria-labelledby":s,style:a?{gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`}:void 0,className:`grid gap-(--space-8) ${a?"":"grid-cols-[repeat(auto-fill,minmax(58px,1fr))]"} ${o}`.replace(/\s+/g," ").trim(),children:e.map(e=>{const a=e.value===t,i=/* @__PURE__ */lt("button",{type:"button","aria-pressed":a,"aria-label":l?void 0:e.label,disabled:e.disabled||void 0,onClick:()=>{a?n?.():r(e.value)},className:`flex w-full min-w-0 flex-col items-center justify-center gap-(--space-4) rounded-(--radius-control) border transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)] disabled:cursor-not-allowed disabled:opacity-50 ${l?"px-(--space-4) py-(--space-8)":"p-(--space-4)"} ${a?"border-blue-600 bg-white text-blue-600 ring-2 ring-blue-400/40":"border-gray-200 bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-700"}`,children:[e.picture,l&&/* @__PURE__ */it("span",{className:"max-w-full truncate text-2xs leading-4",children:e.label})]});return l?/* @__PURE__ */it("div",{className:"flex min-w-0",children:i},e.value):/* @__PURE__ */it(q,{content:e.label,describe:!1,className:"relative flex min-w-0",children:i},e.value)})})}var fa=4,ga=10,ba={1:["100%"],2:["50%","50%"],3:["33.34%","33.33%","33.33%"],4:["25%","25%","25%","25%"]},ya={1:[],2:[50],3:[34,33],4:[25,25,25]},xa=e=>"number"==typeof e&&Number.isFinite(e);function va(e,t){if(!Number.isInteger(t)||t<2||t>4)return;if(!Array.isArray(e)||e.length!==t-1)return;if(!e.every(xa))return;const r=[];let n=0;return e.forEach((e,a)=>{const l=((e,t,r)=>Math.min(r,Math.max(t,Math.round(e))))(e,ga,100-n-(t-1-a)*ga);r.push(l),n+=l}),r}function wa(e,t){const r=va(e,t);if(!r)return(e=>[...ba[e]??ba[1]])(t);const n=r.reduce((e,t)=>e+t,0);return[...r.map(e=>`${e}%`),100-n+"%"]}function Na(e,t){return wa(t,e)}var ka=(e,t,r)=>Math.min(r,Math.max(t,e)),$a=e=>e.reduce((e,t)=>e+t,0),Ma=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var Ca,La="w-0.5",Da=`${La} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var Sa=["text-blue-700","text-gray-600"];function Aa({count:e,value:t,onChange:r,label:n,"aria-labelledby":a,readOnly:l=!1,disabled:i=!1,footer:o=!0,className:s=""}){const c=
|
|
190
|
+
return it("div",{role:"group","aria-label":s?void 0:i,"aria-labelledby":s,style:a?{gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`}:void 0,className:`grid gap-(--space-8) ${a?"":"grid-cols-[repeat(auto-fill,minmax(58px,1fr))]"} ${o}`.replace(/\s+/g," ").trim(),children:e.map(e=>{const a=e.value===t,i=/* @__PURE__ */lt("button",{type:"button","aria-pressed":a,"aria-label":l?void 0:e.label,disabled:e.disabled||void 0,onClick:()=>{a?n?.():r(e.value)},className:`flex w-full min-w-0 flex-col items-center justify-center gap-(--space-4) rounded-(--radius-control) border transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)] disabled:cursor-not-allowed disabled:opacity-50 ${l?"px-(--space-4) py-(--space-8)":"p-(--space-4)"} ${a?"border-blue-600 bg-white text-blue-600 ring-2 ring-blue-400/40":"border-gray-200 bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-700"}`,children:[e.picture,l&&/* @__PURE__ */it("span",{className:"max-w-full truncate text-2xs leading-4",children:e.label})]});return l?/* @__PURE__ */it("div",{className:"flex min-w-0",children:i},e.value):/* @__PURE__ */it(q,{content:e.label,describe:!1,className:"relative flex min-w-0",children:i},e.value)})})}var fa=4,ga=10,ba={1:["100%"],2:["50%","50%"],3:["33.34%","33.33%","33.33%"],4:["25%","25%","25%","25%"]},ya={1:[],2:[50],3:[34,33],4:[25,25,25]},xa=e=>"number"==typeof e&&Number.isFinite(e);function va(e,t){if(!Number.isInteger(t)||t<2||t>4)return;if(!Array.isArray(e)||e.length!==t-1)return;if(!e.every(xa))return;const r=[];let n=0;return e.forEach((e,a)=>{const l=((e,t,r)=>Math.min(r,Math.max(t,Math.round(e))))(e,ga,100-n-(t-1-a)*ga);r.push(l),n+=l}),r}function wa(e,t){const r=va(e,t);if(!r)return(e=>[...ba[e]??ba[1]])(t);const n=r.reduce((e,t)=>e+t,0);return[...r.map(e=>`${e}%`),100-n+"%"]}function Na(e,t){return wa(t,e)}var ka=(e,t,r)=>Math.min(r,Math.max(t,e)),$a=e=>e.reduce((e,t)=>e+t,0),Ma=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var Ca,La="w-0.5",Da=`${La} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var Sa=["text-blue-700","text-gray-600"];function Aa({count:e,value:t,onChange:r,label:n,"aria-labelledby":a,readOnly:l=!1,disabled:i=!1,footer:o=!0,className:s=""}){const c=ze().widths,d=_e(),u=ka(Math.round(e)||1,1,4),h=va(t,u),m=h??[...ya[u]??[]],p=[...m,100-$a(m)],f=l||i,g=Ue(null),b=Ue({onChange:r,shown:m,locked:f,n:u,stored:h});b.current={onChange:r,shown:m,locked:f,n:u,stored:h};const y=e=>{const{onChange:t,shown:r,locked:n,n:a}=b.current;if(n)return!1;const l=va(e,a);return!(!l||Ma(l,r))&&(t(l),!0)},x=(e,t,r)=>{const n=e[t]+e[t+1],a=[...e];a[t]=ka(Math.round(r),ga,n-ga),a[t+1]=n-a[t],y(a.slice(0,-1))&&(O.current=null)},v=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const r=t.shiftKey?10:1,n=p[e]+p[e+1],a="ArrowRight"===t.key?p[e]+r:"ArrowLeft"===t.key?p[e]-r:"PageUp"===t.key?p[e]+10:"PageDown"===t.key?p[e]-10:"Home"===t.key?ga:"End"===t.key?n-ga:null;null!==a&&(t.preventDefault(),x(p,e,a))},w=Ue(null),[N,k]=qe(null),$=()=>{w.current=null,k(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};Ge(()=>$,[]);const M=e=>t=>{if(0!==t.button||f)return;t.preventDefault();const r=g.current?.getBoundingClientRect().width??0;r<=0||(w.current={i:e,x:t.clientX,width:r,from:p,moved:!1,pointer:t.pointerId},k(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},C=e=>{const t=w.current;if(!t)return;if(0===e.buttons)return void $();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}x(t.from,t.i,t.from[t.i]+r/t.width*100)},L=e=>{const t=w.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),$())},D=(e,t)=>{const{shown:r}=b.current,n=function(e,t,r){const n=e.length,a=[...e];if(n<2)return a;const l=ka(Math.round(r),ga,100-(n-1)*ga);let i=l-a[t];a[t]=l;const o=[...Array.from({length:n-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(i<0)return a[o[0]]-=i,a;for(const e of o){if(i<=0)break;const t=Math.min(i,a[e]-ga);a[e]-=t,i-=t}return a}([...r,100-$a(r)],e,t);return y(n.slice(0,-1))?n:null},[S,A]=qe(0);Ge(()=>{const e=g.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>A(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const P=Ue(null),[j,z]=qe(null),[F,E]=qe([]),B=(e,t)=>z(r=>t?e:r===e?null:r),O=Ue(null),T=(e,t)=>{const r=O.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:a,stored:l}=b.current;var i,o;return a||(i=l,o=r.stored,void 0===i||void 0===o?i===o:Ma(i,o))||n(r.stored),!0},I=p.join(",");Ge(()=>{const e=null===j?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===Ca&&(Ca=document.createElement("canvas").getContext("2d")),!Ca)return[];const a=Ca;return r.flatMap((e,r)=>{if(r===t)return[];const l=e.getBoundingClientRect(),i=getComputedStyle(e);a.font=`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;const o=a.measureText(e.value).width/2,s=(l.left+l.right)/2;return s+o>n.left&&s-o<n.right?[r]:[]})}(P.current,j);E(t=>Ma(t,e)?t:e)},[j,I,S]);const R=p.slice(0,-1).map((e,t)=>$a(p.slice(0,t+1)));/* @__PURE__ */
|
|
191
191
|
return lt("div",{role:"group","aria-label":a?void 0:n,"aria-labelledby":a,"aria-describedby":u>1?d:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${i?"opacity-60":""} ${s}`.trim(),children:[
|
|
192
|
-
/* @__PURE__ */lt("div",{ref:
|
|
192
|
+
/* @__PURE__ */lt("div",{ref:P,"data-widths-bar":"",className:"relative h-8",children:[
|
|
193
193
|
/* @__PURE__ */it("div",{ref:g,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-white",children:p.map((e,t)=>/* @__PURE__ */it("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${Sa[t%2]} ${t%2==0?"bg-blue-50":""}`,children:1===u&&/* @__PURE__ */it("span",{"data-widths-label":"",children:`${e}%`})},t))}),
|
|
194
|
-
/* @__PURE__ */it("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-gray-300"}),u>1&&p.map((e,t)=>/* @__PURE__ */lt(rt,{children:[(()=>{const r=
|
|
195
|
-
return it("div",{className:"absolute inset-y-0 "+(r?"z-20":""),style:{left:`clamp(0px, calc(${n+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */it(wn,{appearance:"bare",value:e,display:()=>(e=>S>0&&S*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:ga,max:100-(u-1)*ga,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:l,disabled:i,"aria-label":c.column(t+1),"aria-describedby":d,"data-widths-label":"",onChange:e=>{null===e||T(t,e)||D(t,e)},onRevert:e=>((e,t)=>{b.current.locked||null===t||T(e,t)||D(e,t)})(t,e),onFocus:()=>{
|
|
194
|
+
/* @__PURE__ */it("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-gray-300"}),u>1&&p.map((e,t)=>/* @__PURE__ */lt(rt,{children:[(()=>{const r=j===t,n=$a(p.slice(0,t)),a=r?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
195
|
+
return it("div",{className:"absolute inset-y-0 "+(r?"z-20":""),style:{left:`clamp(0px, calc(${n+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */it(wn,{appearance:"bare",value:e,display:()=>(e=>S>0&&S*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:ga,max:100-(u-1)*ga,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:l,disabled:i,"aria-label":c.column(t+1),"aria-describedby":d,"data-widths-label":"",onChange:e=>{null===e||T(t,e)||D(t,e)},onRevert:e=>((e,t)=>{b.current.locked||null===t||T(e,t)||D(e,t)})(t,e),onFocus:()=>{O.current={column:t,share:e,stored:b.current.stored},B(t,!0)},onBlur:()=>B(t,!1),className:`absolute inset-0 text-xs font-medium ${Sa[t%2]} ${F.includes(t)&&!r?"opacity-0":""}`})})})(),t<u-1&&/* @__PURE__ */it("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${R[t]}%`},children:/* @__PURE__ */it(q,{content:c.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */it("div",{role:"separator",tabIndex:i?-1:0,"aria-orientation":"vertical","aria-label":c.divider(t+1,t+2),"aria-valuenow":p[t],"aria-valuemin":ga,"aria-valuemax":p[t]+p[t+1]-ga,"aria-valuetext":c.dividerValue(t+1,p[t],t+2,p[t+1]),"aria-disabled":f||void 0,onKeyDown:f?void 0:v(t),onPointerDown:M(t),onPointerMove:C,onPointerUp:L,onPointerCancel:L,onLostPointerCapture:()=>{w.current&&$()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(f?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */it("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(f?`${La} bg-gray-300`:`bg-blue-600 transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${N===t?"w-1":Da}`)})})})})]},t))]}),u>1&&!o&&/* @__PURE__ */it("span",{id:d,className:"sr-only",children:c.hint(u,ga)}),u>1&&o&&/* @__PURE__ */it("div",{"data-widths-footer":"",className:"@container",children:/* @__PURE__ */lt("div",{className:"flex items-center justify-between gap-2 @max-[264px]:flex-col @max-[264px]:items-end",children:[
|
|
196
196
|
/* @__PURE__ */it("span",{id:d,"data-widths-hint":"",className:"text-2xs leading-tight text-gray-500 @max-[264px]:self-stretch",children:c.hint(u,ga)}),
|
|
197
|
-
/* @__PURE__ */it(
|
|
197
|
+
/* @__PURE__ */it(_,{variant:"secondary",size:"sm",disabled:f,onClick:()=>{f||void 0===t||r(void 0)},className:"shrink-0",children:c.reset})]})})]})}var Pa={background:"color-mix(in srgb, var(--status-on-solid) 45%, transparent)"},ja={borderColor:"var(--status-on-solid)",boxShadow:"0 0 0 1px var(--rosh-media-scrim-button), 0 1px 4px var(--rosh-media-scrim-button)"};function za({value:e,onChange:t,label:r,image:n,hint:a,emptyText:l,actions:i,disabled:o=!1,id:s,className:c=""}){const d=ze().imageFocus,u=_e(),h=Ue(null),m=Ue(!1),{x:p,y:f}=xe(e),g=ve(p,f),b=r=>{r!==e&&t(r)},y=(e,t)=>{const r=h.current?.getBoundingClientRect();if(!r)return;const n=Ne(r,e,t);b(ve(n.x,n.y))},x=()=>{m.current=!1};if(!n)/* @__PURE__ */
|
|
198
198
|
return it("div",{"data-image-focus":"",className:c||void 0,children:/* @__PURE__ */it("p",{className:"text-xs text-gray-500",children:l??d.noImage})});const v=void 0===a,w=null!==a;/* @__PURE__ */
|
|
199
199
|
return lt("div",{"data-image-focus":"",className:`flex flex-col gap-2 ${c}`.trim(),children:[
|
|
200
|
-
/* @__PURE__ */it("button",{id:s,type:"button","data-image-focus-picture":"",disabled:o,"aria-label":d.picture(r,g),"aria-describedby":u,onKeyDown:t=>{if(o||t.altKey||t.ctrlKey||t.metaKey)return;const r=
|
|
200
|
+
/* @__PURE__ */it("button",{id:s,type:"button","data-image-focus-picture":"",disabled:o,"aria-label":d.picture(r,g),"aria-describedby":u,onKeyDown:t=>{if(o||t.altKey||t.ctrlKey||t.metaKey)return;const r=we(e,t.key,t.shiftKey);null!==r&&(t.preventDefault(),b(r))},onPointerDown:e=>{o||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),m.current=!0,y(e.clientX,e.clientY))},onPointerMove:e=>{m.current&&!o&&y(e.clientX,e.clientY)},onPointerUp:x,onPointerCancel:x,onLostPointerCapture:x,className:["flex min-h-36 w-full touch-none items-center justify-center overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-0","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",o?"cursor-not-allowed opacity-60":"cursor-crosshair"].join(" "),children:/* @__PURE__ */lt("span",{ref:h,"data-image-focus-pane":"",className:"relative block max-w-full",children:[
|
|
201
201
|
/* @__PURE__ */it("img",{src:n,alt:"",draggable:!1,className:"block h-auto max-h-36 w-auto max-w-full select-none object-contain"}),
|
|
202
|
-
/* @__PURE__ */it("span",{"aria-hidden":"true","data-image-focus-cross":"h",className:"pointer-events-none absolute inset-x-0 h-px",style:{top:`${f}%`,...
|
|
203
|
-
/* @__PURE__ */it("span",{"aria-hidden":"true","data-image-focus-cross":"v",className:"pointer-events-none absolute inset-y-0 w-px",style:{left:`${p}%`,...
|
|
204
|
-
/* @__PURE__ */it("span",{"aria-hidden":"true","data-image-focus-dot":"",className:"pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2",style:{left:`${p}%`,top:`${f}%`,...
|
|
205
|
-
return it("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 Ea(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,filter:o=!1,allowFreeText:s=!1,freeTextOption:c,onSearchChange:d,loading:u=!1,error:h,onRetry:m,rightAdornment:p,renderOption:b,clearable:y=!0,"aria-label":x,"aria-labelledby":v,"aria-describedby":w}=e,N=!0===e.multiple,k=e.multiple?e.value:e.value?[e.value]:[],$=e.multiple?"":e.value,M=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},C=k.length>0,L=o&&C&&!l,D=N||o,S=null!=c,A=s||S,[j
|
|
206
|
-
return lt("div",{ref:Y,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Y.current?.contains(t)||X.current?.contains(t))||Q.current||document.activeElement!==G.current&&ee(!0)},children:[(Pe=/* @__PURE__ */it("input",{id:B,ref:G,type:"text",autoComplete:"off",role:"combobox","aria-expanded":
|
|
207
|
-
/* @__PURE__ */it("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */it("span",{ref:
|
|
202
|
+
/* @__PURE__ */it("span",{"aria-hidden":"true","data-image-focus-cross":"h",className:"pointer-events-none absolute inset-x-0 h-px",style:{top:`${f}%`,...Pa}}),
|
|
203
|
+
/* @__PURE__ */it("span",{"aria-hidden":"true","data-image-focus-cross":"v",className:"pointer-events-none absolute inset-y-0 w-px",style:{left:`${p}%`,...Pa}}),
|
|
204
|
+
/* @__PURE__ */it("span",{"aria-hidden":"true","data-image-focus-dot":"",className:"pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2",style:{left:`${p}%`,top:`${f}%`,...ja}})]})}),w||i?/* @__PURE__ */lt("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */it("span",w?{id:v?u:void 0,className:"min-w-0 flex-1 text-xs text-gray-500",children:v?d.hint:a}:{className:"min-w-0 flex-1"}),i]}):null,!v&&/* @__PURE__ */it("span",{id:u,className:"sr-only",children:d.hint})]})}function Fa({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
205
|
+
return it("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 Ea(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,filter:o=!1,allowFreeText:s=!1,freeTextOption:c,onSearchChange:d,loading:u=!1,error:h,onRetry:m,rightAdornment:p,renderOption:b,clearable:y=!0,"aria-label":x,"aria-labelledby":v,"aria-describedby":w}=e,N=!0===e.multiple,k=e.multiple?e.value:e.value?[e.value]:[],$=e.multiple?"":e.value,M=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},C=k.length>0,L=o&&C&&!l,D=N||o,S=null!=c,A=s||S,[P,j]=qe(!1),[z,F]=qe(-1),E=_e(),B=i??`${E}-input`,O=`${E}-listbox`,T=e=>`${E}-opt-${e}`,[I,R]=qe(""),W=ze(),K=n??W.select.none,H=e=>{R(e),F(-1),d?.(e)},Y=Ue(null),G=Ue(null),X=Ue(null),J=Ue(null),Z=Ue(P);Z.current=P;const Q=Ue(!1),ee=e=>{Z.current&&(Z.current=!1,e&&s&&!S&&De&&(N?k.includes(De)||M([...k,De]):De!==$&&M([De])),j(!1),H(""))},te=(e,t)=>{if(!e.disabled){if(N)return M(k.includes(e.value)?k.filter(t=>t!==e.value):[...k,e.value]),void(e===Se?H(""):F(t));M([e.value]),ee(!1)}},[re,ne]=qe(null);oe(()=>{if(!p||P)return void ne(null);const e=J.current?.offsetWidth??0;ne(e?e+(fe?32:8)+6:null)});const ae=U(G,P,D?{popupRef:X}:{matchTriggerWidth:!0}),se=Ve(()=>Nt(t),[t]),ce=k.join("\0"),de=Ve(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of se)k.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(A)for(const r of k)t.has(r)||e.push(r);return e},[se,ce,A]),ue=de.join(", "),fe=y&&C&&!l,[ge,be]=qe(null),ye=Ue(null),xe=Ue(""),ve=Ue(()=>{});ve.current=()=>{const e=G.current,t=ye.current;if(!N||!e||!t)return;const r=getComputedStyle(e),n=e.clientWidth-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0),a=[r.fontStyle,r.fontWeight,r.fontSize,r.fontFamily,r.letterSpacing].join("|"),l=`${n}|${a}|${de.join("\0")}`;if(l===xe.current)return;xe.current=l;let i=null;n>0&&de.length>0&&(t.style.fontStyle=r.fontStyle,t.style.fontWeight=r.fontWeight,t.style.fontSize=r.fontSize,t.style.fontFamily=r.fontFamily,t.style.letterSpacing=r.letterSpacing,i=function(e,t){const r=e.length;if(0===r||t(e.join(", ")))return{shown:r,cut:!1};if(1===r)return{shown:1,cut:!0};let n=0;for(let a=1;a<r&&t(`${e.slice(0,a).join(", ")} +${r-a}`);a+=1)n=a;return{shown:n,cut:!1}}(de,e=>(t.textContent=e,t.getBoundingClientRect().width<=n)),t.textContent=""),be(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},oe(()=>{ve.current()}),Ge(()=>{const e=G.current;if(!N||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>ve.current());return t.observe(e),()=>t.disconnect()},[N]);const we=de.length,Ne=!N||!ge||ge.shown>=we?ue:0===ge.shown?W.select.selectedCount(we):`${de.slice(0,ge.shown).join(", ")} +${we-ge.shown}`,ke=N&&null!==ge&&(ge.shown<we||ge.cut),$e=P&&C&&D;Ge(()=>{if(!P)return;const e=e=>{const t=e.target;Y.current?.contains(t)||X.current?.contains(t)||ee(!0)};document.addEventListener("mousedown",e);const t=me(()=>ee(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[P,s,I,ce,e.onChange]),Ge(()=>{if(P)return he(e=>!("Escape"!==e.key||!Z.current)&&(ee(!1),G.current?.blur(),!0),()=>X.current)},[P]);const Me=Ve(()=>{const e=/* @__PURE__ */new Set;return kt(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),Ce=Ve(()=>{if(d)return Me;const e=I.trim().toLowerCase();return e?kt(Me,t=>Ct(t,e)):Me},[Me,I,d]),Le=Ve(()=>Nt(Ce),[Ce]),De=I.trim(),Se=Ve(()=>S&&De?se.some(e=>e.label===De)||k.includes(De)?null:{value:De,label:De}:null,[S,De,se,ce]),Ae=Ve(()=>Se?[...Le,Se]:Le,[Le,Se]);/* @__PURE__ */
|
|
206
|
+
return lt("div",{ref:Y,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Y.current?.contains(t)||X.current?.contains(t))||Q.current||document.activeElement!==G.current&&ee(!0)},children:[(Pe=/* @__PURE__ */it("input",{id:B,ref:G,type:"text",autoComplete:"off",role:"combobox","aria-expanded":P,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":P?O:void 0,"aria-activedescendant":P&&z>=0&&z<Ae.length?T(z):void 0,"aria-label":v?void 0:x,"aria-labelledby":v,"aria-describedby":w,value:P?I:Ne,onChange:e=>{H(e.target.value),j(!0)},onFocus:()=>{l||(H(""),j(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(l)return;if(e.preventDefault(),!P)return void j(!0);if(0===Ae.length)return;const t="ArrowDown"===e.key?1:-1;return void F(e=>xt(Ae,e,t))}"Enter"===e.key?(e.preventDefault(),P&&z>=0&&z<Ae.length?te(Ae[z],z):1!==Le.length||Le[0].disabled?s&&!S&&De&&(N?(k.includes(De)||M([...k,De]),H("")):(M([De]),ee(!1),G.current?.blur())):te(Le[0],0)):"Escape"===e.key?(ee(!1),G.current?.blur()):"Tab"===e.key&&ee(!0)},placeholder:$e?Ne:r||K,className:`${L?f:g} ${a} ${fe?"pr-8":""} ${l?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${$e?" rosh-field-shows-choice":""}`,style:re?{paddingRight:re}:void 0,disabled:l}),N?/* @__PURE__ */it(q,{content:!P&&ke?ue:null,className:"block",children:Pe}):Pe),N&&
|
|
207
|
+
/* @__PURE__ */it("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */it("span",{ref:ye,className:"whitespace-pre"})}),fe&&/* @__PURE__ */it(Fa,{ariaLabel:W.select.clear,onClear:()=>{M([]),ee(!1)}}),p&&!P&&/* @__PURE__ */it("div",{ref:J,className:`absolute top-1/2 -translate-y-1/2 ${fe?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:p}),P&&st(
|
|
208
208
|
/* @__PURE__ */lt("div",{ref:X,onMouseDownCapture:()=>{Q.current=!0,setTimeout(()=>{Q.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:pe.popup,left:ae?.left,right:ae?.right,top:ae?.top,bottom:ae?.bottom,minWidth:ae?.minWidth,width:ae?.width,...D&&{maxWidth:ae?.maxWidth},visibility:ae?void 0:"hidden",...le()},children:[N&&C&&y&&!l&&
|
|
209
209
|
/* @__PURE__ */it("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),M([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-gray-50 border-b ${ie}`,children:W.select.clearAll}),u?
|
|
210
|
-
/* @__PURE__ */it(
|
|
211
|
-
/* @__PURE__ */it("span",{className:"min-w-0 flex-1",children:h}),m&&/* @__PURE__ */it(
|
|
212
|
-
/* @__PURE__ */lt("div",{id:
|
|
210
|
+
/* @__PURE__ */it(Ke,{size:"sm",padding:"py-2",label:W.search.searching}):h?/* @__PURE__ */lt("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
211
|
+
/* @__PURE__ */it("span",{className:"min-w-0 flex-1",children:h}),m&&/* @__PURE__ */it(_,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:m,className:"shrink-0",children:W.list.retry})]}):null,
|
|
212
|
+
/* @__PURE__ */lt("div",{id:O,role:Ae.length?"listbox":void 0,"aria-labelledby":Ae.length?v??(x?void 0:B):void 0,"aria-label":Ae.length&&!v?x:void 0,"aria-multiselectable":!(!Ae.length||!N)||void 0,className:"overflow-y-auto",style:{maxHeight:ae?.maxHeight??V},children:[0===Ae.length?u||h?null:/* @__PURE__ */it("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:W.select.noMatches}):0===Le.length?null:$t(Ce,(e,t)=>{const r=k.includes(e.value);/* @__PURE__ */
|
|
213
213
|
return lt("button",{id:T(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||N)&&r.preventDefault(),te(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${r?"text-blue-600 font-medium":"text-gray-700"} ${t===z?"bg-gray-100":r?"bg-blue-50/50":""}`),children:[N&&/* @__PURE__ */it(Mt,{selected:r}),
|
|
214
|
-
/* @__PURE__ */it("span",{className:`min-w-0 ${D?"flex-auto":"flex-1"} truncate`,children:b?b(e,{selected:r,active:t===z}):e.label}),e.sublabel&&/* @__PURE__ */it(Lt,{grows:D,children:e.sublabel})]},e.value)},E),
|
|
215
|
-
/* @__PURE__ */it("button",{id:T(
|
|
214
|
+
/* @__PURE__ */it("span",{className:`min-w-0 ${D?"flex-auto":"flex-1"} truncate`,children:b?b(e,{selected:r,active:t===z}):e.label}),e.sublabel&&/* @__PURE__ */it(Lt,{grows:D,children:e.sublabel})]},e.value)},E),Se&&c&&
|
|
215
|
+
/* @__PURE__ */it("button",{id:T(Le.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{N&&e.preventDefault(),te(Se,Le.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${Le.length?`border-t ${ie}`:""} ${z===Le.length?"bg-gray-100":""}`,children:/* @__PURE__ */it("span",{className:"min-w-0 flex-1 truncate",children:c(Se.value)})},`${E}-typed`)]})]}),document.body)]});var Pe}function Ba(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var Oa="address",Ta={kindOf:()=>Oa,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},Ia=e=>y(e.trim());function Ra(e){const{value:t,kinds:r,rules:n=Ta,filtersFor:a,label:l,readOnly:i,placeholder:o,className:s=""}=e,c=void 0!==e.onApply,d=ze().link,u=n.isSafe??Ia,h=_e(),m=Ue(null),p=Ue(null),[f,g]=qe({url:t}),b=c?f.url:t,[y,x]=qe(!1),[v,w]=qe(null),[N,k]=qe(null),$=Ue(()=>{});$.current=c?e.onCancel:()=>{},Ge(()=>{if(c)return he(e=>{const t=m.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&($.current(),!0)},()=>m.current)},[c]),Ge(()=>{if(!c)return;const e=p.current;e?(e.focus(),e.select()):m.current?.querySelector("button, input")?.focus()},[]);const M=r??[{value:Oa,label:d.address,target:{type:"text"}}],C=v&&v.against===b?v.kind:n.kindOf(b),L=M.filter(e=>!e.hideWhenEmpty||Ba(e.target).length>0||e.value===C),D=L.find(e=>"text"===e.target.type),S=L.find(e=>e.value===C)??D??L[0];if(!S)return null;const A="text"!==S.target.type,P=A?n.targetOf(b):b,j=Ba(S.target),z=j.find(e=>e.value===P),F=e=>({value:e,label:d.unavailable(e)}),E="select"===S.target.type&&P&&a?a(P):null,B=E?n.readFilter(b):null,O=B?E?.find(e=>e.param===B.param):void 0,T=N&&N.against===b?N.text:b,I=!A&&""!==T.trim()&&!u(T),R=I&&(!c||y),W=(t,r)=>{c?g({url:t,name:r}):void 0===r?e.onChange(t):e.onChange(t,r)},K=(e,t)=>{w(t=>t?{...t,against:e}:t),W(e,t)},H=e=>{if(!e)return K("");const t=j.find(t=>t.value===e);K(e,t?.label)},q=A?b:T.trim(),U=()=>{if(!c||!q)return;if(!A&&I)return void x(!0);const t=A&&f.url===q?f.name:void 0,r=e.onApply;void 0===t?r(q):r(q,t)},V=(e,t)=>t&&!e.some(e=>e.value===t)?[F(t),...e]:[...e],Y=(e,t,r,n,a)=>{const l=[];for(const e of r){const t=l[l.length-1],r={value:e.value,label:e.label};e.group?t&&"options"in t&&t.label===e.group?t.options.push(r):l.push({label:e.group,options:[r]}):l.push(r)}if(a){const a=r.some(e=>""===e.value);/* @__PURE__ */
|
|
216
216
|
return it(Ea,{"aria-label":e,value:t,options:l,disabled:i,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
217
|
-
return it(
|
|
218
|
-
return it("div",{ref:m,className:`flex min-w-0 flex-auto flex-col gap-2 ${s}`.trim(),role:l?"group":void 0,"aria-label":l,children:X});const
|
|
217
|
+
return it(Pt,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:n})};let G;if("text"===S.target.type)G=/* @__PURE__ */it(gt,{ref:p,id:`${h}-address`,size:"sm",type:"text",invalid:R,"aria-label":d.address,"aria-describedby":R?`${h}-why`:void 0,placeholder:o??d.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:T,readOnly:i,onChange:e=>(e=>{x(!1);const t=e.trim();t?u(e)?(k({text:e,against:t}),K(t)):k({text:e,against:b}):(k({text:e,against:""}),K(""))})(e.target.value)});else{const e="groups"===S.target.type?S.target.groups.flatMap(e=>e.options.map(t=>({value:t.value,label:t.label,group:e.label}))):S.target.options.map(e=>({value:e.value,label:e.label})),t=[{value:"",label:S.target.placeholder},...V(e,P)];G=Y(S.label,P,t,H,e.length>10)}const X=/* @__PURE__ */lt(ot,{children:[r&&Y(d.linkType,S.value,L.map(e=>({value:e.value,label:e.label})),e=>{k(null),x(!1);const t=L.find(t=>t.value===e);if(!t||"text"===t.target.type)return void w({kind:e,against:b});const r=Ba(t.target)[0];w({kind:e,against:r?r.value:""}),r?W(r.value,r.label):W("")},!1),G,E&&Y(d.filter,B?.param??"",[{value:"",label:d.noFilter},...B&&!O?[F(B.param)]:[],...E.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return K(P,z?.label);const t=E?.find(t=>t.param===e),r=t?.values[0];r&&K(n.withFilter(P,{param:e,value:r.value}),r.label)},!1),E&&B&&Y(d.value,B.value,V((O?.values??[]).map(e=>({value:e.value,label:e.label})),B.value),e=>{if(!B)return;const t=O?.values.find(t=>t.value===e);K(n.withFilter(P,{param:B.param,value:e}),t?.label)},(O?.values.length??0)>10),R&&/* @__PURE__ */it("p",{id:`${h}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:d.unsafe}),S.hint&&/* @__PURE__ */it("p",{className:"text-2xs leading-4 text-gray-400",children:S.hint}),E&&/* @__PURE__ */it("p",{className:"text-2xs leading-4 text-gray-400",children:d.filterHint})]});if(!c)/* @__PURE__ */
|
|
218
|
+
return it("div",{ref:m,className:`flex min-w-0 flex-auto flex-col gap-2 ${s}`.trim(),role:l?"group":void 0,"aria-label":l,children:X});const J=e.onRemove;/* @__PURE__ */
|
|
219
219
|
return lt("div",{ref:m,role:"dialog","aria-label":l??d.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${s}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),U())},children:[A?/* @__PURE__ */it("span",{className:Wt({inline:!0}),children:d.title}):/* @__PURE__ */it("label",{htmlFor:`${h}-address`,className:Wt({inline:!0}),children:d.title}),X,
|
|
220
|
-
/* @__PURE__ */lt("div",{className:"flex items-center justify-between gap-2",children:[
|
|
220
|
+
/* @__PURE__ */lt("div",{className:"flex items-center justify-between gap-2",children:[J?/* @__PURE__ */it(_,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:J,children:d.remove}):null,
|
|
221
221
|
/* @__PURE__ */lt("span",{className:"ml-auto flex gap-1",children:[
|
|
222
|
-
/* @__PURE__ */it(
|
|
223
|
-
/* @__PURE__ */it(
|
|
222
|
+
/* @__PURE__ */it(_,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>$.current(),children:d.cancel}),
|
|
223
|
+
/* @__PURE__ */it(_,{variant:"primary",size:"sm","data-window-action":"apply",onClick:U,disabled:i||""===q,children:d.apply})]})]})]})}function Wa({label:e,text:t,onTextChange:r,link:n,onLinkChange:a,kinds:l,rules:i,filtersFor:o,textPlaceholder:s,readOnly:c,className:d=""}){const u=ze().link,[h,m]=qe(!1),p=Ue(null),f=_e(),g=()=>{m(!1),p.current?.focus()};/* @__PURE__ */
|
|
224
224
|
return lt("div",{className:`flex min-w-0 flex-auto flex-col ${d}`.trim(),children:[
|
|
225
225
|
/* @__PURE__ */it(gt,{size:"sm",type:"text",className:"rounded-b-none","aria-label":u.text(e),placeholder:s,value:t,readOnly:c,onChange:e=>r(e.target.value)}),
|
|
226
226
|
/* @__PURE__ */lt("button",{ref:p,type:"button","aria-label":u.linkOf(e,n),"aria-expanded":h,"aria-controls":h?f:void 0,disabled:c,onClick:()=>m(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-gray-300 bg-gray-50 ${b.sm} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
227
|
-
/* @__PURE__ */it(
|
|
228
|
-
/* @__PURE__ */it("span",{className:"min-w-0 truncate "+(n?"text-blue-600":"text-gray-400"),children:n||u.addLink})]}),h&&/* @__PURE__ */it("div",{id:f,className:"mt-2",children:/* @__PURE__ */it(Ra,{value:n,label:u.linkOf(e,n),kinds:l,rules:i,filtersFor:o,onApply:(e,t)=>{void 0===t?a(e):a(e,t),g()},onRemove:n?()=>{a(""),g()}:void 0,onCancel:g})})]})}var Ka=e=>e.preventDefault(),
|
|
229
|
-
return it(q,{content:e,children:t},t.key??void 0)}function Xa({offered:e,pressed:t,onMark:r,color:n,linkOpen:a=!1,last:l,alignment:i,list:o,letterCase:s,disabled:d=!1,"aria-label":u,windows:h,className:m=""}){const p=
|
|
227
|
+
/* @__PURE__ */it(be,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(n?"text-blue-600":"text-gray-400")}),
|
|
228
|
+
/* @__PURE__ */it("span",{className:"min-w-0 truncate "+(n?"text-blue-600":"text-gray-400"),children:n||u.addLink})]}),h&&/* @__PURE__ */it("div",{id:f,className:"mt-2",children:/* @__PURE__ */it(Ra,{value:n,label:u.linkOf(e,n),kinds:l,rules:i,filtersFor:o,onApply:(e,t)=>{void 0===t?a(e):a(e,t),g()},onRemove:n?()=>{a(""),g()}:void 0,onCancel:g})})]})}var Ka=e=>e.preventDefault(),Ha=e=>null!=e&&!1!==e,_a=["bold","italic","underline","strike","link","sup","sub","code"],qa=["left","center","right","justify"];function Ua(e,t,r){const n={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===n||0===t.length)return;const a=[...e.currentTarget.querySelectorAll('[role="radio"]')],l=a.findIndex(t=>t===e.target||t.contains(e.target));if(l<0)return;e.preventDefault();const i=a.length,o="first"===n?0:"last"===n?i-1:(l+n+i)%i;a[o].disabled||(r(t[o]),a[o].focus())}function Va(e,t){const r=["bold","italic","underline","strike"].filter(t=>e.has(t)).length;return{color:r,link:r+(t?1:0)}}function Ya({offered:e,color:t,last:r,alignment:n,list:a,letterCase:l}){const i=_a.filter(t=>e.has(t)).length+(t?1:0)+(Ha(r)?1:0),o=(n?qa.filter(e=>n.allow.includes(e)).length:0)+(a&&e.has("bullet")?1:0)+(a&&e.has("number")?1:0)+(e.has("quote")?1:0)+(l?3:0);return{words:i>0,paragraph:o>0,oneRow:i>0&&o>0&&i+1+o<=9,flow:i>0&&o>0&&i+1+o>9&&i<=7}}function Ga(e,t){/* @__PURE__ */
|
|
229
|
+
return it(q,{content:e,children:t},t.key??void 0)}function Xa({offered:e,pressed:t,onMark:r,color:n,linkOpen:a=!1,last:l,alignment:i,list:o,letterCase:s,disabled:d=!1,"aria-label":u,windows:h,className:m=""}){const p=ze().textToolbar,f=Ya({offered:e,color:n,last:l,alignment:i,list:o,letterCase:s});if(!f.words&&!f.paragraph)return null;const g=(e,t="")=>`rosh-tb-btn${e?" is-on":""}${t?` ${t}`:""}`,b=(n,l,i,o)=>e.has(n)?Ga(l,/* @__PURE__ */it(c,"link"===n?{pressed:a,className:g(a),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":a,"aria-keyshortcuts":o,disabled:d,onMouseDown:Ka,onClick:()=>r(n),children:i}:{className:g(Boolean(t[n])),"aria-label":l,"aria-pressed":Boolean(t[n]),"aria-keyshortcuts":o,disabled:d,onMouseDown:Ka,onClick:()=>r(n),children:i},n)):null,y=[["left",p.alignLeft,/* @__PURE__ */it(be,{name:"align-left"})],["center",p.alignCenter,/* @__PURE__ */it(be,{name:"align-center"})],["right",p.alignRight,/* @__PURE__ */it(be,{name:"align-right"})],["justify",p.alignJustify,/* @__PURE__ */it(be,{name:"align-justify"})]],x=i?qa.filter(e=>i.allow.includes(e)):[],v=i&&x.includes(i.value)?i.value:x[0],w=[["none",p.caseNone,/* @__PURE__ */it(be,{name:"case-normal"})],["upper",p.caseUpper,/* @__PURE__ */it(be,{name:"case-upper"})],["lower",p.caseLower,/* @__PURE__ */it(be,{name:"case-lower"})]],N=/* @__PURE__ */lt(ot,{children:[b("bold",p.bold,/* @__PURE__ */it(be,{name:"bold"}),"Meta+B"),b("italic",p.italic,/* @__PURE__ */it(be,{name:"italic"}),"Meta+I"),b("underline",p.underline,/* @__PURE__ */it(be,{name:"underline"}),"Meta+U"),b("strike",p.strike,/* @__PURE__ */it(be,{name:"strike"})),n?Ga(p.color,/* @__PURE__ */it(c,{pressed:n.open,className:g(n.open,"rosh-tb-color"),"aria-label":p.color,"aria-haspopup":"dialog","aria-expanded":n.open,disabled:d,style:n.run?{"--rosh-tb-run":n.run}:void 0,onMouseDown:Ka,onClick:n.onToggle,children:/* @__PURE__ */it(be,{name:"text-color"})},"color")):null,b("link",p.link,/* @__PURE__ */it(be,{name:"link"}),"Meta+K"),b("sup",p.sup,/* @__PURE__ */it(be,{name:"superscript"})),b("sub",p.sub,/* @__PURE__ */it(be,{name:"subscript"})),b("code",p.code,/* @__PURE__ */it(be,{name:"code"})),Ha(l)?l:null]}),k=/* @__PURE__ */lt(ot,{children:[i&&x.length>0?/* @__PURE__ */it("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":p.alignment,onKeyDown:e=>Ua(e,x,e=>i.onChange(e)),children:y.map(([e,t,r])=>i.allow.includes(e)?Ga(t,/* @__PURE__ */it(c,{role:"radio",pressed:i.value===e,className:g(i.value===e),"aria-checked":i.value===e,"aria-label":t,tabIndex:e===v?0:-1,disabled:d||i.disabled,onMouseDown:Ka,onClick:()=>i.onChange(e),children:r},e)):null)}):null,o&&e.has("bullet")?Ga(p.bullet,/* @__PURE__ */it(c,{className:g("bullet"===o.pressed),"aria-label":p.bullet,"aria-pressed":"bullet"===o.pressed,disabled:d,onMouseDown:Ka,onClick:()=>o.onList("bullet"),children:/* @__PURE__ */it(be,{name:"list"})},"bullet")):null,o&&e.has("number")?Ga(p.number,/* @__PURE__ */it(c,{className:g("number"===o.pressed),"aria-label":p.number,"aria-pressed":"number"===o.pressed,disabled:d,onMouseDown:Ka,onClick:()=>o.onList("number"),children:/* @__PURE__ */it(be,{name:"numbered-list"})},"number")):null,b("quote",p.quote,/* @__PURE__ */it(be,{name:"quote"})),s?/* @__PURE__ */it("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":p.letterCase,onKeyDown:e=>Ua(e,w.map(([e])=>e),e=>s.onChange(e)),children:w.map(([e,t,r])=>Ga(t,/* @__PURE__ */it(c,{role:"radio",pressed:s.value===e,className:g(s.value===e),"aria-checked":s.value===e,"aria-label":t,tabIndex:e===(s.value||"none")?0:-1,disabled:d||s.disabled,onMouseDown:Ka,onClick:()=>s.onChange(s.value===e?"":e),children:r},e)))}):null]}),$=f.flow?" is-flow":f.oneRow?" is-one-row":f.words&&void 0===l?" is-eight":"",M=Va(e,Boolean(n)),C={"--rosh-tb-color-col":String(M.color),"--rosh-tb-link-col":String(M.link)};let L;return L=f.flow?/* @__PURE__ */lt("div",{className:"rosh-tb-row is-flow",children:[N,
|
|
230
230
|
/* @__PURE__ */it("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),k]}):f.oneRow?/* @__PURE__ */lt("div",{className:"rosh-tb-row is-one-row",children:[
|
|
231
231
|
/* @__PURE__ */it("div",{className:"rosh-tb-words",children:N}),
|
|
232
232
|
/* @__PURE__ */it("div",{className:"rosh-tb-para",children:k})]}):/* @__PURE__ */lt(ot,{children:[f.words?/* @__PURE__ */it("div",{className:"rosh-tb-row"+(void 0===l?" is-eight":""),children:N}):null,f.paragraph?/* @__PURE__ */it("div",{className:"rosh-tb-row",children:k}):null]}),/* @__PURE__ */lt("div",{className:`rosh-tb-wrap${$} ${m}`.trim(),style:C,children:[
|
|
233
|
-
/* @__PURE__ */it("div",{className:"rosh-tb",role:"toolbar","aria-label":u??p.formatting,children:L}),h]})}var
|
|
233
|
+
/* @__PURE__ */it("div",{className:"rosh-tb",role:"toolbar","aria-label":u??p.formatting,children:L}),h]})}var Ja={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},Za=["tl","tr","bl","br"];function Qa({label:e,value:t,corners:r,onChange:n,radius:a=null,onRadiusChange:l,radiusLabel:i,radiusMin:o=0,radiusMax:s,radiusStep:d=1,radiusPlaceholder:u,disabled:h=!1,disabledReason:m,id:p,className:f=""}){const g=ze(),b=function(e){const t=Za.map(t=>e.find(e=>e.value===t));for(const r of e){if(Za.includes(r.value))continue;const e=t.findIndex(e=>void 0===e);-1===e?t.push(r):t[e]=r}return t.filter(e=>void 0!==e)}(r),[y,x]=qe(0),v=Ue(null);/* @__PURE__ */
|
|
234
234
|
return lt("div",{id:p,role:"group","aria-label":e,className:`flex min-w-0 flex-wrap items-center gap-2 ${f}`.trim(),children:[l&&
|
|
235
235
|
/* @__PURE__ */it("div",{className:"w-30 shrink-0",children:/* @__PURE__ */it(wn,{value:a,onChange:l,min:o,max:s,step:d,precision:0,placeholder:u,prefix:/* @__PURE__ */it("span",{"data-radius-mark":"","aria-hidden":"true",children:g.corners.radiusMark}),suffix:g.corners.unit,steppers:"compact",disabled:h,"aria-label":i??g.corners.radius})}),
|
|
236
|
-
/* @__PURE__ */it("div",{ref:v,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const t=Array.from(v.current?.querySelectorAll("button[data-corner]")??[]),r=t.indexOf(document.activeElement);if(-1===r)return;const n=r%2,a=Math.floor(r/2),l="ArrowRight"===e.key?2*a+1:"ArrowLeft"===e.key?2*a:"ArrowDown"===e.key?2+n:"ArrowUp"===e.key?n:null;null!==l&&(e.preventDefault(),l<t.length&&t[l].focus())},children:b.map((e,r)=>{const a=t.includes(e.value),l=h||!0===e.disabled,i=l&&(!0===e.disabled&&e.title||(h?m:void 0))||void 0,o=/* @__PURE__ */it(c,{"aria-pressed":a,"aria-label":e.label,"aria-disabled":l||void 0,disabledReason:i,"data-corner":e.value,size:"sm",tabIndex:r===y?0:-1,onFocus:()=>x(r),onClick:()=>{l||n(a?t.filter(t=>t!==e.value):[...t,e.value])},children:/* @__PURE__ */it(
|
|
237
|
-
return it("div",{id:i,role:"radiogroup","aria-label":e,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-gray-200 bg-gray-200 ${o}`.trim(),children:r.map((e,i)=>{const o=t===e.value,d=a||!0===e.disabled,u=d&&(!0===e.disabled&&e.title||(a?l:void 0))||void 0,m=`${s}-${i}`,p=/* @__PURE__ */it("button",{type:"button",role:"radio","aria-checked":o,"aria-label":e.label,"aria-disabled":d||void 0,"aria-describedby":Q(void 0,u?m:void 0),ref:e=>{c.current[i]=e},tabIndex:i===h?0:-1,onKeyDown:e=>((e,l)=>{const i=el[l.key];if(!i)return;l.preventDefault();const o=Math.floor(e/3)+i[0],s=e%3+i[1];if(o<0||s<0||s>=3)return;const d=3*o+s;if(d>=r.length)return;c.current[d]?.focus();const u=r[d];a||!0===u.disabled||u.value===t||n(u.value)})(i,e),onClick:d?
|
|
236
|
+
/* @__PURE__ */it("div",{ref:v,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const t=Array.from(v.current?.querySelectorAll("button[data-corner]")??[]),r=t.indexOf(document.activeElement);if(-1===r)return;const n=r%2,a=Math.floor(r/2),l="ArrowRight"===e.key?2*a+1:"ArrowLeft"===e.key?2*a:"ArrowDown"===e.key?2+n:"ArrowUp"===e.key?n:null;null!==l&&(e.preventDefault(),l<t.length&&t[l].focus())},children:b.map((e,r)=>{const a=t.includes(e.value),l=h||!0===e.disabled,i=l&&(!0===e.disabled&&e.title||(h?m:void 0))||void 0,o=/* @__PURE__ */it(c,{"aria-pressed":a,"aria-label":e.label,"aria-disabled":l||void 0,disabledReason:i,"data-corner":e.value,size:"sm",tabIndex:r===y?0:-1,onFocus:()=>x(r),onClick:()=>{l||n(a?t.filter(t=>t!==e.value):[...t,e.value])},children:/* @__PURE__ */it(be,{name:"corner",strokeWidth:2,className:["h-4 w-4",Ja[e.value]??""].filter(Boolean).join(" ")})},e.value);return i?o:/* @__PURE__ */it(q,{content:e.title??e.label,children:o},e.value)})})]})}var el={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function tl({label:e,value:t,points:r,onChange:n,disabled:a=!1,disabledReason:l,id:i,className:o=""}){const s=_e(),c=Ue([]),d=r.findIndex(e=>e.value===t),u=r.findIndex(e=>!a&&!0!==e.disabled),h=d>=0?d:Math.max(0,u);/* @__PURE__ */
|
|
237
|
+
return it("div",{id:i,role:"radiogroup","aria-label":e,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-gray-200 bg-gray-200 ${o}`.trim(),children:r.map((e,i)=>{const o=t===e.value,d=a||!0===e.disabled,u=d&&(!0===e.disabled&&e.title||(a?l:void 0))||void 0,m=`${s}-${i}`,p=/* @__PURE__ */it("button",{type:"button",role:"radio","aria-checked":o,"aria-label":e.label,"aria-disabled":d||void 0,"aria-describedby":Q(void 0,u?m:void 0),ref:e=>{c.current[i]=e},tabIndex:i===h?0:-1,onKeyDown:e=>((e,l)=>{const i=el[l.key];if(!i)return;l.preventDefault();const o=Math.floor(e/3)+i[0],s=e%3+i[1];if(o<0||s<0||s>=3)return;const d=3*o+s;if(d>=r.length)return;c.current[d]?.focus();const u=r[d];a||!0===u.disabled||u.value===t||n(u.value)})(i,e),onClick:d?Z:()=>n(e.value),className:"group relative flex size-(--control-height-lg) items-center justify-center transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring)] aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(o?"bg-blue-50 hover:bg-blue-100":"bg-white hover:bg-gray-50"),children:e.icon?/* @__PURE__ */it("span",{"data-icon-slot":"","aria-hidden":"true",className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4 "+(o?"text-blue-700":"text-gray-500 group-hover:text-gray-700"),children:e.icon}):/* @__PURE__ */it("span",{"data-dot":"","aria-hidden":"true",className:o?"size-3 rounded-sm bg-blue-600":"size-1 rounded-full bg-[color:var(--ink-faintest)] transition-colors group-hover:bg-[color:var(--ink-faint)]"})},e.value);return u?/* @__PURE__ */it(ee,{reason:u,id:m,block:!0,children:p},e.value):/* @__PURE__ */it(q,{content:e.title??e.label,className:"relative flex",children:p},e.value)})})}var rl=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=_e(),f=ze().files,g=Ae({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__ */
|
|
238
238
|
return lt(Bt,{label:s,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
|
|
239
|
-
/* @__PURE__ */lt("button",{ref:m,type:"button",id:p,disabled:o,onClick:g.open,"aria-invalid":!!d||void 0,"aria-required":u||void 0,"aria-describedby":b,...g.zoneProps,className:Xt(g.dragOver,o,
|
|
239
|
+
/* @__PURE__ */lt("button",{ref:m,type:"button",id:p,disabled:o,onClick:g.open,"aria-invalid":!!d||void 0,"aria-required":u||void 0,"aria-describedby":b,...g.zoneProps,className:Xt(g.dragOver,o,Jt(o),"px-4 py-6"),children:[
|
|
240
240
|
/* @__PURE__ */lt("span",{children:[
|
|
241
241
|
/* @__PURE__ */it("span",{className:"text-sm font-medium text-blue-600",children:a?f.chooseMany:f.chooseOne}),
|
|
242
242
|
/* @__PURE__ */it("span",{className:"text-sm text-gray-500",children:` ${a?f.dragMany:f.dragOne}`})]}),n&&/* @__PURE__ */it("span",{className:"text-xs text-gray-400",children:n})]}),
|
|
243
243
|
/* @__PURE__ */it("input",{...g.inputProps}),e.length>0&&/* @__PURE__ */it("ul",{className:"mt-2 flex flex-col gap-1",children:e.map((r,n)=>/* @__PURE__ */lt("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
|
|
244
244
|
/* @__PURE__ */it("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:r.name,children:r.name}),
|
|
245
|
-
/* @__PURE__ */it("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:
|
|
245
|
+
/* @__PURE__ */it("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:Pe(r.size,f)}),
|
|
246
246
|
/* @__PURE__ */it("button",{type:"button",disabled:o,onClick:()=>{g.clearRejections(),t(e.filter((e,t)=>t!==n))},"aria-label":f.remove(r.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */it(tr,{})})]},`${r.name}-${n}`))}),
|
|
247
|
-
/* @__PURE__ */it(
|
|
248
|
-
return it(
|
|
249
|
-
return it(
|
|
247
|
+
/* @__PURE__ */it(je,{rejections:g.rejections})]})});function nl({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
248
|
+
return it(be,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function al({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
249
|
+
return it(be,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function ll({intake:e,dropLabel:t,className:r="",children:n}){const a=ze().files;/* @__PURE__ */
|
|
250
250
|
return lt("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,children:[n,
|
|
251
|
-
/* @__PURE__ */it("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */it("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function il({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=
|
|
251
|
+
/* @__PURE__ */it("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */it("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function il({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=ze().files,l=Ue(/* @__PURE__ */new Map);Ge(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),Ge(()=>()=>{for(const e of l.current.values())URL.revokeObjectURL(e);l.current.clear()},[]);const i=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=l.current.get(e);return t||(t=URL.createObjectURL(e),l.current.set(e,t)),t};return 0===e.length?null:/* @__PURE__ */it("ul",{className:`flex flex-wrap gap-2 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
|
|
252
252
|
return lt("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-gray-200 bg-gray-50 py-1 pl-2 pr-1 text-xs text-gray-700",children:[l?/* @__PURE__ */it("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */it("span",{className:"text-gray-400",children:/* @__PURE__ */it(al,{})}),
|
|
253
253
|
/* @__PURE__ */it("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
|
|
254
|
-
/* @__PURE__ */it("span",{className:"shrink-0 tabular-nums text-gray-400",children:
|
|
255
|
-
/* @__PURE__ */it(c,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */it(nl,{})}),t>0&&/* @__PURE__ */it("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-2xs font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */it(
|
|
254
|
+
/* @__PURE__ */it("span",{className:"shrink-0 tabular-nums text-gray-400",children:Pe(e.size,a)}),t&&/* @__PURE__ */it("button",{type:"button",disabled:r,onClick:()=>t(n),"aria-label":a.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */it(tr,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function ol({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=ze().files,i=n??l.attach,o=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */lt("span",{className:"relative inline-flex",children:[
|
|
255
|
+
/* @__PURE__ */it(c,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */it(nl,{})}),t>0&&/* @__PURE__ */it("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-2xs font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */it(_,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */it(nl,{}),children:o})}function sl({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i=!1,dropLabel:o,attachLabel:s,trigger:c="button",actions:d,onReject:u,className:h="",children:m}){const p=Ae({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),f=Ue([]);return Ge(()=>{u&&p.rejections.length>0&&p.rejections!==f.current&&(f.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */lt(ll,{intake:p,dropLabel:o,className:h,children:[m,
|
|
256
256
|
/* @__PURE__ */it(il,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
|
|
257
257
|
/* @__PURE__ */lt("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
258
258
|
/* @__PURE__ */it(ol,{onClick:p.open,count:e.length,variant:c,label:s,disabled:i}),d]}),
|
|
259
|
-
/* @__PURE__ */it(
|
|
259
|
+
/* @__PURE__ */it(je,{rejections:p.rejections})]})}var cl={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${w.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function dl({value:e,onChange:t,options:r=[],placeholder:n,allowFreeText:a=!1,invalid:l,disabled:i,id:o,className:s="",tone:c,tooltip:u,split:h}){const[m,p]=qe(!1),[f,g]=qe(""),b=ze(),y=Ue(null),x=Ue(null),v=Ue(null),w=U(y,m),N=e=>r.find(t=>t.value===e)?.label??e,k=Ve(()=>{const t=new Set(e),n=[],a=f.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!Ct(e,a)||n.push(e));return n},[r,e,f]),$=n=>{const l=[...e];for(const e of n){const t=e.trim();if(!t)continue;const n=t.toLowerCase(),i=r.find(e=>e.value===t||e.label.toLowerCase()===n)?.value,o=i??(a?t:null);o&&!l.includes(o)&&l.push(o)}l.length!==e.length&&t(l)},M=r=>{r&&!e.includes(r)?(t([...e,r]),g("")):g("")},C=r=>t(e.filter(e=>e!==r)),L=()=>{const e=f.trim();if(h&&e)return $(e.split(h)),void g("");a&&e?M(e):g("")},D=Ue(()=>{});D.current=()=>{L(),p(!1)},Ge(()=>{if(!m)return;const e=e=>{const t=e.target;y.current?.contains(t)||v.current?.contains(t)||(L(),p(!1))};document.addEventListener("mousedown",e);const t=me(()=>D.current());return()=>{document.removeEventListener("mousedown",e),t()}});const S=r.length>0;/* @__PURE__ */
|
|
260
260
|
return lt("div",{ref:y,className:"relative",children:[
|
|
261
261
|
/* @__PURE__ */lt("div",{onMouseDown:e=>{i||e.target.closest("button")||(e.preventDefault(),x.current?.focus())},className:d({invalid:l,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${i?"bg-gray-50 cursor-not-allowed":""} ${s}`}),children:[e.map(e=>{const t=c?.(e),r=cl[t??"accent"],n=/* @__PURE__ */lt("span",{"data-tone":t,className:r.chip,children:[
|
|
262
262
|
/* @__PURE__ */it("span",{className:"truncate",children:N(e)}),!i&&/* @__PURE__ */it("button",{type:"button","aria-label":b.select.removeItem?.(N(e))??`${b.select.remove} ${N(e)}`,onClick:()=>C(e),className:r.remove,children:"×"})]},e),a=u?.(e);return null==a?n:/* @__PURE__ */it(q,{content:a,className:"relative inline-flex max-w-full",children:n},e)}),
|
|
263
263
|
/* @__PURE__ */it("input",{id:o,ref:x,type:"text",autoComplete:"off",role:"combobox","aria-expanded":m&&S,"aria-invalid":l||void 0,disabled:i,value:f,placeholder:0===e.length?n:void 0,onChange:e=>{(e=>{if(h){const t=e.split(h);if(t.length>1)return $(t.slice(0,-1)),void g(t[t.length-1])}g(e)})(e.target.value),p(!0)},onFocus:()=>{!i&&S&&p(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&a){t.preventDefault();const e=f.trim(),r=e?k.filter(t=>Ct(t,e.toLowerCase())):[];1===r.length?M(r[0].value):L()}else"Backspace"===t.key&&""===f&&e.length>0?C(e[e.length-1]):"Escape"===t.key?(p(!1),g(""),x.current?.blur()):"Tab"===t.key&&(L(),p(!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"})]}),m&&S&&st(
|
|
264
264
|
/* @__PURE__ */it("div",{ref:v,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:pe.popup,left:w?.left,right:w?.right,top:w?.top,bottom:w?.bottom,minWidth:w?.minWidth,maxWidth:w?.maxWidth??te,width:"max-content",visibility:w?void 0:"hidden",...le()},children:/* @__PURE__ */it("div",{className:"overflow-y-auto",style:{maxHeight:w?.maxHeight??V},children:0===k.length?/* @__PURE__ */it("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:r.length>0&&e.length>=r.length?b.select.allSelected:b.select.noMatches}):k.map(e=>/* @__PURE__ */it("button",{type:"button",onMouseDown:t=>{t.preventDefault(),M(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.sublabel?/* @__PURE__ */lt(ot,{children:[
|
|
265
265
|
/* @__PURE__ */it("span",{className:"min-w-0 truncate",children:e.label}),
|
|
266
|
-
/* @__PURE__ */it(Lt,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}var ul={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"}},hl={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function ml({children:e,header:t,description:r,footer:n,padded:a=!0,padding:l,headingLevel:i,headerActions:o,"aria-label":s,className:c="",bodyClassName:d="",style:u,tone:h="neutral"}){const m=ul[l??(a?"md":"none")],p=
|
|
266
|
+
/* @__PURE__ */it(Lt,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}var ul={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"}},hl={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function ml({children:e,header:t,description:r,footer:n,padded:a=!0,padding:l,headingLevel:i,headerActions:o,"aria-label":s,className:c="",bodyClassName:d="",style:u,tone:h="neutral"}){const m=ul[l??(a?"md":"none")],p=_e(),f=_e(),g=null!=t&&null!=r&&""!==r,b=null!=i&&null!=t,y=`h${i}`,x=null!=s&&""!==s,v=b||x,w=v?"section":"div",N=`rounded-(--radius-card) border ${hl[h]} bg-white shadow-sm ${c}`.trim(),k=Ze.toArray(e).length>0,$=k?"border-b border-gray-100 ":"",M="current"===h,C=M?"text-base font-semibold text-blue-700":"text-base font-semibold text-gray-900",L=M?"rounded-t-(--radius-card) bg-blue-50 ":"",D=`${$}${L}${m.edge} ${C}`;/* @__PURE__ */
|
|
267
267
|
return lt(w,{className:N,style:u,...x?{"aria-label":s}:b?{"aria-labelledby":p}:{},...g&&v?{"aria-describedby":f}:{},...M?{"aria-current":!0}:{},children:[g?
|
|
268
268
|
/* @__PURE__ */lt("div",{className:`${$}${L}${m.edge}`,children:[null!=o?/* @__PURE__ */lt("div",{className:`flex items-center justify-between gap-3 ${C}`,children:[b?/* @__PURE__ */it(y,{id:p,children:t}):/* @__PURE__ */it("span",{children:t}),o]}):b?/* @__PURE__ */it(y,{id:p,className:C,children:t}):/* @__PURE__ */it("div",{className:C,children:t}),
|
|
269
269
|
/* @__PURE__ */it("p",{id:f,className:M?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-gray-500",children:r})]}):null!=t&&(null!=o?
|
|
270
270
|
/* @__PURE__ */lt("div",{className:`${D} flex items-center justify-between gap-3`,children:[b?/* @__PURE__ */it(y,{id:p,children:t}):/* @__PURE__ */it("span",{children:t}),o]}):b?
|
|
271
|
-
/* @__PURE__ */it(y,{id:p,className:D,children:t}):/* @__PURE__ */it("div",{className:D,children:t})),k&&/* @__PURE__ */it("div",{className:[m.body,d].filter(Boolean).join(" "),children:e}),n&&/* @__PURE__ */it("div",{className:`border-t border-gray-100 ${m.edge}`,children:n})]})}function pl({label:e,value:t,icon:r,delta:n,className:a=""}){const l=
|
|
271
|
+
/* @__PURE__ */it(y,{id:p,className:D,children:t}):/* @__PURE__ */it("div",{className:D,children:t})),k&&/* @__PURE__ */it("div",{className:[m.body,d].filter(Boolean).join(" "),children:e}),n&&/* @__PURE__ */it("div",{className:`border-t border-gray-100 ${m.edge}`,children:n})]})}function pl({label:e,value:t,icon:r,delta:n,className:a=""}){const l=Fe(),i="number"==typeof t&&l?Te(t,l):t,o="up"===n?.direction?"text-green-600":"down"===n?.direction?"text-red-600":"text-gray-500",s="up"===n?.direction?"▲":"down"===n?.direction?"▼":"→";/* @__PURE__ */
|
|
272
272
|
return lt("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${a}`.trim(),children:[
|
|
273
273
|
/* @__PURE__ */lt("div",{className:"flex items-center justify-between text-gray-500",children:[
|
|
274
274
|
/* @__PURE__ */it("span",{className:"text-xs font-medium uppercase tracking-wide",children:e}),r]}),
|
|
@@ -279,44 +279,44 @@ return it(r??`h${t}`,{id:n,className:[xl[t],fl[a],l].filter(Boolean).join(" "),c
|
|
|
279
279
|
return it("p",{className:[fl[t],gl[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var Nl={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},kl={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},$l={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function Ml({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
|
|
280
280
|
return it("div",{className:["flex flex-col",Nl[t],r?kl[r]:"",n?$l[n]:"",a].filter(Boolean).join(" "),children:e})}function Cl({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
|
|
281
281
|
return it("div",{className:["flex",a?"flex-wrap":"",Nl[t],kl[r],n?$l[n]:"",l].filter(Boolean).join(" "),children:e})}var Ll={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Dl={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"},Sl={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 Al({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
|
|
282
|
-
return it("div",{className:["grid",Ll[t],r?Dl[r]:"",n?Sl[n]:"",Nl[a],l].filter(Boolean).join(" "),children:e})}var
|
|
282
|
+
return it("div",{className:["grid",Ll[t],r?Dl[r]:"",n?Sl[n]:"",Nl[a],l].filter(Boolean).join(" "),children:e})}var Pl={sm:"my-2",md:"my-4",lg:"my-6"};function jl({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=_e();if("vertical"===e)/* @__PURE__ */
|
|
283
283
|
return it("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__ */
|
|
284
|
-
return it("hr",{className:`border-0 border-t border-gray-200 ${
|
|
284
|
+
return it("hr",{className:`border-0 border-t border-gray-200 ${Pl[n]} ${a}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",o="right"===r?"w-4 shrink-0":"flex-1";
|
|
285
285
|
/* @__PURE__ */
|
|
286
|
-
return lt("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${
|
|
286
|
+
return lt("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${Pl[n]} ${a}`.trim(),children:[
|
|
287
287
|
/* @__PURE__ */it("span",{"aria-hidden":"true",className:`${i} border-t border-gray-200`}),
|
|
288
288
|
/* @__PURE__ */it("span",{id:l,className:"shrink-0 text-xs font-medium text-gray-500",children:t}),
|
|
289
|
-
/* @__PURE__ */it("span",{"aria-hidden":"true",className:`${o} border-t border-gray-200`})]})}var zl=[2,4,8,12,16,20,24,32,40,48],Fl={iconGap:8,iconGapSm:4,controlXSm:8,controlX:12,controlXLg:16,cellX:12,label:4,toolbar:8,formRow:12,card:16,block:16,gutter:16,panelGroup:2,panelSub:4,panelLayer:8,panelRow:12,panelPad:16,panelPadNarrow:12,panelSetting:32},El={sm:24,md:32,lg:40},Bl={menu:36,windowBar:44,compactBar:32};function
|
|
289
|
+
/* @__PURE__ */it("span",{"aria-hidden":"true",className:`${o} border-t border-gray-200`})]})}var zl=[2,4,8,12,16,20,24,32,40,48],Fl={iconGap:8,iconGapSm:4,controlXSm:8,controlX:12,controlXLg:16,cellX:12,label:4,toolbar:8,formRow:12,card:16,block:16,gutter:16,panelGroup:2,panelSub:4,panelLayer:8,panelRow:12,panelPad:16,panelPadNarrow:12,panelSetting:32},El={sm:24,md:32,lg:40},Bl={menu:36,windowBar:44,compactBar:32};function Ol(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&zl.includes(4*t)}var Tl=[9,11,12,14,16,18,20,24,30],Il={body:400,control:500,heading:600,figure:700},Rl={fast:120,base:160},Wl={hairline:1,strong:2,accent:4},Kl=["control","card","panel","popup","window"],Hl=["none","raised","panel","popup","dialog"],_l={text:"rounded",rect:"rounded-md",circle:"rounded-full"},ql=e=>"number"==typeof e?`${e}px`:e;function Ul({variant:e="text",width:t,height:r,lines:n=1,className:a=""}){const l=`animate-pulse bg-gray-200 ${_l[e]} ${a}`.trim();if("circle"===e){const e=ql(r??t)??"2.5rem";/* @__PURE__ */
|
|
290
290
|
return it("span",{className:`inline-block ${l}`,style:{width:e,height:e},"aria-hidden":"true"})}const i={width:ql(t)??"100%",height:ql(r)??("text"===e?"1rem":"4rem")};/* @__PURE__ */
|
|
291
|
-
return it("span","text"===e&&n>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:n},(e,t)=>/* @__PURE__ */it("span",{className:`block ${l}`,style:{...i,width:t===n-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var Vl={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},Yl={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},Gl={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},Xl={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function
|
|
291
|
+
return it("span","text"===e&&n>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:n},(e,t)=>/* @__PURE__ */it("span",{className:`block ${l}`,style:{...i,width:t===n-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var Vl={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},Yl={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},Gl={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},Xl={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function Jl({items:e,columns:t=1,bordered:r=!1,size:n="md",title:a,className:l="",emptyText:i="—"}){const o="number"==typeof t?{base:t}:t,s=o.base??1,c=Math.max(s,o.sm??0,o.lg??0),d="sm"===n?"px-3 py-2":"px-4 py-3",u="sm"===n?"text-xs":"text-sm";/* @__PURE__ */
|
|
292
292
|
return lt("div",{className:[r?"rounded-lg border border-gray-200 bg-white":"",l].filter(Boolean).join(" "),children:[a&&/* @__PURE__ */it("div",{className:`${d} ${r?"border-b border-gray-100":""} text-sm font-semibold text-gray-900`.trim(),children:a}),
|
|
293
293
|
/* @__PURE__ */it("dl",{className:["grid",Vl[s],o.sm?Yl[o.sm]:"",o.lg?Gl[o.lg]:"",r?"":"gap-x-6 gap-y-3",r?"":"px-4 py-3"===d?"py-1":""].filter(Boolean).join(" "),children:e.map((e,t)=>/* @__PURE__ */lt("div",{className:[e.span?Xl[c]:"",r?`${d} border-b border-gray-100 last:border-b-0`:""].filter(Boolean).join(" "),children:[
|
|
294
294
|
/* @__PURE__ */it("dt",{className:`${u} text-gray-500`,children:e.label}),
|
|
295
|
-
/* @__PURE__ */it("dd",{className:`mt-0.5 min-w-0 break-words ${u} text-gray-900`,children:null===e.value||void 0===e.value||""===e.value?i:e.value})]},e.key??t))})]})}var
|
|
295
|
+
/* @__PURE__ */it("dd",{className:`mt-0.5 min-w-0 break-words ${u} text-gray-900`,children:null===e.value||void 0===e.value||""===e.value?i:e.value})]},e.key??t))})]})}var Zl=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function Ql(e,t){let r=e;for(const e of t.split(".")){if(null===r||"object"!=typeof r)return;r=r[e]}return r}function ei(e,t,r={}){if(null==e||"object"!=typeof e)return!0;if(Zl(e,"not"))return!ei(e.not,t,r);if(Zl(e,"all")){const n=e.all;return!Array.isArray(n)||n.every(e=>ei(e,t,r))}if(Zl(e,"any")){const n=e.any;return!Array.isArray(n)||n.some(e=>ei(e,t,r))}const n=e;let a;if("string"==typeof n.field)a=Ql(t??{},n.field);else{if("string"!=typeof n.context)return!0;a=Ql(r??{},n.context)}return null==a&&Zl(n,"default")&&(a=n.default),Zl(n,"is")?a===n.is:Zl(n,"in")?!Array.isArray(n.in)||n.in.some(e=>e===a):!Zl(n,"set")||function(e){return null!=e&&!1!==e&&("string"==typeof e?""!==e.trim():!Array.isArray(e)||e.length>0)}(a)===(!0===n.set)}var ti={default:{pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},compact:{pad:"px-3 py-2",gap:"gap-3",text:"text-xs",bodyTop:"mt-2",bodyPad:"pt-2"}};function ri({label:e,value:t,description:r,children:n,controlId:a,unknownText:l="—",quiet:i=!1,size:o="default",divider:s=!0,showWhen:c,values:d,context:u,className:h=""}){if(!ei(c,d,u))return null;const m=ti[o],p=void 0!==t||void 0===n,f=null==t||""===t,g=i?"text-gray-500":"text-gray-800",b=f?"text-gray-400":i?"text-gray-500":"text-gray-900",y=`${m.text} font-medium ${g}`,x=[s?"border-t border-gray-100 first:border-t-0":"",m.pad,h].filter(Boolean).join(" ");/* @__PURE__ */
|
|
296
296
|
return lt("div",{className:x,children:[
|
|
297
297
|
/* @__PURE__ */lt("div",{className:`flex items-center justify-between ${m.gap}`,children:[
|
|
298
|
-
/* @__PURE__ */lt("div",{className:"min-w-0 flex-1",children:[a?/* @__PURE__ */it("label",{htmlFor:a,className:y,children:e}):/* @__PURE__ */it("span",{className:y,children:e}),r&&/* @__PURE__ */it("p",{className:"mt-0.5 text-xs text-gray-500",children:r})]}),p&&/* @__PURE__ */it("div",{className:`shrink-0 ${m.text} ${b}`,children:f?l:t})]}),null!=n&&!1!==n&&/* @__PURE__ */it("div",{className:`${m.bodyTop} border-t border-gray-100 ${m.bodyPad}`,children:n})]})}function ni({rule:e,values:t,context:r,children:n}){return ei(e,t,r)?/* @__PURE__ */it(ot,{children:n}):null}var ai={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function li({count:e=0,max:t=99,dot:r=!1,tone:n="danger",showZero:a=!1,children:l,className:i=""}){const o=r||e>0||0===e&&a,s=
|
|
298
|
+
/* @__PURE__ */lt("div",{className:"min-w-0 flex-1",children:[a?/* @__PURE__ */it("label",{htmlFor:a,className:y,children:e}):/* @__PURE__ */it("span",{className:y,children:e}),r&&/* @__PURE__ */it("p",{className:"mt-0.5 text-xs text-gray-500",children:r})]}),p&&/* @__PURE__ */it("div",{className:`shrink-0 ${m.text} ${b}`,children:f?l:t})]}),null!=n&&!1!==n&&/* @__PURE__ */it("div",{className:`${m.bodyTop} border-t border-gray-100 ${m.bodyPad}`,children:n})]})}function ni({rule:e,values:t,context:r,children:n}){return ei(e,t,r)?/* @__PURE__ */it(ot,{children:n}):null}var ai={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function li({count:e=0,max:t=99,dot:r=!1,tone:n="danger",showZero:a=!1,children:l,className:i=""}){const o=r||e>0||0===e&&a,s=Fe(),c=e>t?`${Te(t,s)}+`:Te(e,s),d=l?"":i,u=o?/* @__PURE__ */it("span",r?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${ai[n]} ${d}`.trim(),"aria-hidden":l?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center whitespace-nowrap rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${ai[n]} ${d}`.trim(),children:c}):null;return l?/* @__PURE__ */lt("span",{className:`relative inline-flex ${i}`.trim(),children:[l,u&&/* @__PURE__ */it("span",{className:"absolute -right-1.5 -top-1.5 flex",children:u})]}):u}var ii={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},oi={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function si({title:e,value:t,precision:r,prefix:n,suffix:a,tone:l="default",size:i="md",className:o=""}){const s=Fe(),c="number"!=typeof t?t:null!=r?Ie(t,r,s):s?Te(t,s):t;/* @__PURE__ */
|
|
299
299
|
return lt("div",{className:o,children:[e&&/* @__PURE__ */it("div",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
300
300
|
/* @__PURE__ */lt("div",{className:`mt-1 flex items-baseline gap-1 ${oi[l]}`,children:[n&&/* @__PURE__ */it("span",{className:"text-sm",children:n}),
|
|
301
301
|
/* @__PURE__ */it("span",{className:`font-semibold tabular-nums ${ii[i]}`,children:c}),a&&/* @__PURE__ */it("span",{className:"text-sm",children:a})]})]})}var ci={xs:24,sm:32,md:40,lg:56},di={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function ui(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function hi({src:e,name:t,size:r="md",status:n,className:a=""}){const l=ci[r],i=Math.max(8,Math.round(.28*l)),[o,s]=qe(!1);Ge(()=>{s(!1)},[e]);const c=Boolean(e)&&!o;
|
|
302
302
|
/* @__PURE__ */
|
|
303
|
-
return lt("span",{className:`relative inline-flex shrink-0 ${a}`.trim(),style:{width:l,height:l},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[c?/* @__PURE__ */it("img",{src:e,alt:"",onError:()=>s(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */it("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*l)},children:ui(t)}),n&&/* @__PURE__ */it("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${di[n]}`,style:{width:i,height:i}})]})}function mi({children:e,max:t,size:r="md",className:n=""}){const a=
|
|
304
|
-
return lt("div",{className:`flex items-center ${n}`.trim(),children:[l.map((e,t)=>/* @__PURE__ */it("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-s},children:e},t)),i>0&&/* @__PURE__ */lt("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:o,height:o,marginLeft:-s,fontSize:Math.round(.36*o)},children:["+",
|
|
305
|
-
return it("div",{role:"tablist","aria-label":o,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=u(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=u(a,-1);else if("Home"===n.key)l=h(1);else{if("End"!==n.key)return;l=h(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),c.current[l]?.focus())},className:d?cn(a,i):gi(a,i),children:e.map((e,n)=>{const i=e.id===t,o=/* @__PURE__ */it("button",{ref:e=>{c.current[n]=e},type:"button",role:"tab",id:l?pi(l,e.id):void 0,"aria-controls":l?fi(l,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:d?dn({selected:i,disabled:e.disabled,block:a}):bi(i,a),children:/* @__PURE__ */it(hn,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */it(q,{content:e.tooltip,className:d||a?un(a):void 0,children:o},e.id):o})})}var xi=()=>/* @__PURE__ */it(
|
|
303
|
+
return lt("span",{className:`relative inline-flex shrink-0 ${a}`.trim(),style:{width:l,height:l},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[c?/* @__PURE__ */it("img",{src:e,alt:"",onError:()=>s(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */it("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*l)},children:ui(t)}),n&&/* @__PURE__ */it("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${di[n]}`,style:{width:i,height:i}})]})}function mi({children:e,max:t,size:r="md",className:n=""}){const a=Ze.toArray(e),l=t?a.slice(0,t):a,i=t?a.length-l.length:0,o=ci[r],s=Math.round(.3*o),c=Fe();/* @__PURE__ */
|
|
304
|
+
return lt("div",{className:`flex items-center ${n}`.trim(),children:[l.map((e,t)=>/* @__PURE__ */it("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-s},children:e},t)),i>0&&/* @__PURE__ */lt("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:o,height:o,marginLeft:-s,fontSize:Math.round(.36*o)},children:["+",Te(i,c)]})]})}var pi=(e,t)=>`${e}-tab-${t}`,fi=(e,t)=>`${e}-panel-${t}`,gi=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function bi(e,t){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":"border-transparent text-gray-900 hover:border-gray-300"}`}function yi({items:e,value:t,onChange:r,variant:n="underline",block:a=!1,idPrefix:l,className:i="","aria-label":o,"aria-labelledby":s}){const c=Ue([]),d="pill"===n,u=(t,r)=>{for(let n=1;n<=e.length;n+=1){const a=((t+r*n)%e.length+e.length)%e.length;if(!e[a]?.disabled)return a}return null},h=t=>{const r=1===t?e.map((e,t)=>t):e.map((t,r)=>e.length-1-r);for(const t of r)if(!e[t]?.disabled)return t;return null};/* @__PURE__ */
|
|
305
|
+
return it("div",{role:"tablist","aria-label":o,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=u(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=u(a,-1);else if("Home"===n.key)l=h(1);else{if("End"!==n.key)return;l=h(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),c.current[l]?.focus())},className:d?cn(a,i):gi(a,i),children:e.map((e,n)=>{const i=e.id===t,o=/* @__PURE__ */it("button",{ref:e=>{c.current[n]=e},type:"button",role:"tab",id:l?pi(l,e.id):void 0,"aria-controls":l?fi(l,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:d?dn({selected:i,disabled:e.disabled,block:a}):bi(i,a),children:/* @__PURE__ */it(hn,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */it(q,{content:e.tooltip,className:d||a?un(a):void 0,children:o},e.id):o})})}var xi=()=>/* @__PURE__ */it(be,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function vi({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
|
|
306
306
|
return it("ol",{"aria-label":n,className:`grid items-start ${a}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,n)=>{const a=n<l?"complete":n===l?"current":"upcoming",i="complete"===a&&!!r,o=/* @__PURE__ */it("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===a?"bg-blue-600 text-white":"","current"===a?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===a?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===a?/* @__PURE__ */it(xi,{}):n+1}),s=/* @__PURE__ */lt("span",{className:"min-w-0 text-center",children:[
|
|
307
307
|
/* @__PURE__ */it("span",{className:"block text-sm font-medium "+("upcoming"===a?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */it("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
|
|
308
|
-
return lt("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */it("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(n<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */lt("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[o,s]}):/* @__PURE__ */lt("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[o,s]})]},t.id)})})}var wi=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("");function Ni({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,level:l=3,className:i=""}){const[o,s]=qe(t),c=
|
|
308
|
+
return lt("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */it("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(n<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */lt("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[o,s]}):/* @__PURE__ */lt("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[o,s]})]},t.id)})})}var wi=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("");function Ni({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,level:l=3,className:i=""}){const[o,s]=qe(t),c=_e(),d=`h${l}`,u=r??o;/* @__PURE__ */
|
|
309
309
|
return it("div",{className:`divide-y divide-gray-100 overflow-hidden rounded-lg border border-gray-200 ${i}`.trim(),children:e.map(e=>{const t=u.includes(e.id),l=`${c}-${wi(e.id)}-head`,i=`${c}-${wi(e.id)}-panel`;/* @__PURE__ */
|
|
310
310
|
return lt("div",{children:[
|
|
311
311
|
/* @__PURE__ */it(d,{className:"m-0 p-0 border-0 [font:inherit] [letter-spacing:inherit] [text-transform:inherit]",children:/* @__PURE__ */lt("button",{type:"button",id:l,disabled:e.disabled,"aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>(e=>{const t=u.includes(e)?u.filter(t=>t!==e):a?[...u,e]:[e];void 0===r&&s(t),n?.(t)})(e.id),className:"flex w-full items-center justify-between gap-3 px-4 py-3 text-left text-sm font-medium text-gray-900 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:[
|
|
312
312
|
/* @__PURE__ */it("span",{children:e.title}),
|
|
313
|
-
/* @__PURE__ */it(
|
|
314
|
-
return lt("div",{className:`flex flex-col items-center justify-center text-center ${"card"===s?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===s?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[c&&/* @__PURE__ */it("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */it(
|
|
313
|
+
/* @__PURE__ */it(be,{name:"chevron-down",className:"h-4 w-4 shrink-0 transition-transform "+(t?"rotate-180":""),strokeWidth:"2","aria-hidden":"true"})]})}),t&&/* @__PURE__ */it("div",{id:i,role:"region","aria-labelledby":l,className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}function ki(){const[e,t]=qe(null);return{pct:e,start:Ye(e=>{const r=e.reduce((e,t)=>e+t.size,0)||1,n=new Array(e.length).fill(0);return t(0),e=>a=>{n[e]=a,t(Math.min(100,Math.round(n.reduce((e,t)=>e+t,0)/r*100)))}},[]),done:Ye(()=>t(null),[])}}function $i({title:e,message:t,description:r,hint:n,variant:a,frameless:l,icon:i,children:o}){const s=l?"none":a??"dashed",c="boolean"!=typeof i&&null!=i?i:null,d=!c&&(i??"card"!==s),u=ze().emptyState,h=t??(e?void 0:u.message),m=r??n;/* @__PURE__ */
|
|
314
|
+
return lt("div",{className:`flex flex-col items-center justify-center text-center ${"card"===s?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===s?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[c&&/* @__PURE__ */it("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */it(be,{name:"inbox",className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",strokeWidth:1}),e&&/* @__PURE__ */it("h3",{className:"text-sm font-medium text-gray-900",children:e}),h&&/* @__PURE__ */it("p",{className:"text-sm text-gray-500 "+(e?"mt-2":""),children:h}),m&&/* @__PURE__ */it("p",{className:"text-xs text-gray-400 mt-1",children:m}),o&&/* @__PURE__ */it("div",{className:"mt-4",children:o})]})}function Mi({title:t,description:r,subtitle:n,actions:a,children:l,icon:i,breadcrumbs:o}){const s=r??n,c=a??l;/* @__PURE__ */
|
|
315
315
|
return lt("div",{className:"mb-6",children:[o&&o.length>0&&/* @__PURE__ */it(e,{items:o,className:"mb-3"}),
|
|
316
316
|
/* @__PURE__ */lt("div",{className:"flex items-start justify-between gap-4",children:[
|
|
317
317
|
/* @__PURE__ */lt("div",{children:[
|
|
318
|
-
/* @__PURE__ */lt("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */it("span",{className:"shrink-0",children:i}),t]}),s&&/* @__PURE__ */it("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),c&&/* @__PURE__ */it("div",{className:"flex items-center gap-2",children:c})]})]})}var Ci=["success","warning","danger"];function Li(e){return"string"==typeof e&&Ci.includes(e)}function Di(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=Si(t),a=Si(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function Si(e){return null!=e&&Number.isFinite(e)?e:null}var Ai={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
|
|
319
|
-
return it("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var Fi=e=>Math.min(100,Math.max(0,e));function Ei({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=
|
|
318
|
+
/* @__PURE__ */lt("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */it("span",{className:"shrink-0",children:i}),t]}),s&&/* @__PURE__ */it("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),c&&/* @__PURE__ */it("div",{className:"flex items-center gap-2",children:c})]})]})}var Ci=["success","warning","danger"];function Li(e){return"string"==typeof e&&Ci.includes(e)}function Di(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=Si(t),a=Si(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function Si(e){return null!=e&&Number.isFinite(e)?e:null}var Ai={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 Pi=/* @__PURE__ */new Set;function ji(e,t){if(null==e)return null;if(Li(e))return Ai[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}`;Pi.has(r)||(Pi.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${Ci.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 zi({at:e,title:t,className:r}){/* @__PURE__ */
|
|
319
|
+
return it("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var Fi=e=>Math.min(100,Math.max(0,e));function Ei({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=ze().meter,m=Fe(),p=s??h.noData,f=null!=t&&Number.isFinite(t)?t:null,g=Number.isFinite(r)&&r>0?r:null;var b,y;null==g&&(b=`MetricBar:max:${String(r)}`,y=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,Pi.has(b)||(Pi.add(b),console.error(y)));const x=ji(l,"MetricBar"),v=null!=f?x??(null==(w=Di(f,n,a))?null:Ai[w]):null;var w;const N=Si(n),k=Si(a),$=null!=f&&null!=g?Fi(f/g*100):0,M=null!=f?(o??(e=>100===g?Re(e,1,m):Te(e,m)))(f):"—",C=null!=f&&null!=g&&(null!=N||null!=k),L="md"===c?"h-2":"h-1.5",D=null!=f&&null!=g,S=/* @__PURE__ */lt("div",{...D?{role:"meter","aria-label":d??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":g,"aria-valuenow":Math.min(g,Math.max(0,f)),"aria-valuetext":M}:{"aria-hidden":!0},className:D&&v?`relative mt-2 ${L} rounded-full bg-gray-200`:`relative mt-2 ${L} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[D&&
|
|
320
320
|
/* @__PURE__ */it("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${$}%`}}),C&&null!=g&&null!=N&&/* @__PURE__ */it(zi,{at:Fi(N/g*100),title:h.warningAt(N),className:"bg-gray-400 opacity-75"}),C&&null!=g&&null!=k&&/* @__PURE__ */it(zi,{at:Fi(k/g*100),title:h.criticalAt(k),className:"bg-gray-500"})]}),A=v?v.ink:null!=f?"text-gray-900":"text-gray-400";/* @__PURE__ */
|
|
321
321
|
return lt("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */it("div",{className:"text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
322
322
|
/* @__PURE__ */lt("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
@@ -324,14 +324,14 @@ return lt("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */it("div"
|
|
|
324
324
|
/* @__PURE__ */it("span",{className:"min-w-0 truncate text-2xs tabular-nums text-gray-400",children:null!=f?i:p})]}),S]}:{className:u,children:[
|
|
325
325
|
/* @__PURE__ */lt("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */it("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
326
326
|
/* @__PURE__ */it("span",{className:`text-sm font-semibold tabular-nums ${A}`,children:M}),
|
|
327
|
-
/* @__PURE__ */it("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:null!=f?i:p})]}),S]})}function Bi(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function
|
|
327
|
+
/* @__PURE__ */it("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:null!=f?i:p})]}),S]})}function Bi(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function Oi(e,t){const r=Bi(e);if(null==r)return"no-reading";const n=Bi(t);return null==n||0===n?"no-budget":r>n?"over":"within"}var Ti=e=>Math.min(100,Math.max(0,e));function Ii({label:e,elapsed:t,budget:r,grace:n,detail:a,formatDuration:l,formatValue:i,pace:o,emptyLabel:s,noBudgetLabel:c,size:d="sm",ariaLabel:u,className:h=""}){const m=ze().meter,p=Fe(),f=i??l??(e=>function(e,t=Ee.meter){const r=Math.round(e),n=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return n>0?t.hoursMinutes(n,a):a>0?t.minutesSeconds(a,l):t.seconds(l)}(e,m)),g=s??m.noReading,b=c??m.noBudget,y=Bi(t),x=Bi(r),v=null!=x&&x>0?x:null,w=Bi(n)??0,N="over"===Oi(t,r),k=null!=v?v+w:null,$=null!=v&&null!=k?Ti(v/k*100):null,M=N&&w>0,C=null==k||null==y?0:N?M?$??0:0:Ti(y/k*100),L=M?$??0:0,D=N?M&&null!=k&&null!=y?Ti(y/k*100):100:0,S=Math.max(0,D-L),A=Bi(o),P=null!=A&&null!=k?Ti(A/k*100):null,j=null!=y&&null!=v?y/v*100:null,z=null!=j?Re(Math.round(j),0,p):null!=y?f(y):"—",F=a??(null==y?g:null==v?b:`${f(y)} / ${f(v)}`),E="md"===d?"h-2":"h-1.5",B=N?"text-red-600":null!=y?"text-gray-900":"text-gray-400",O=null!=y&&null!=v&&null!=k?/* @__PURE__ */lt("div",{role:"meter","aria-label":u??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":k,"aria-valuenow":Math.min(k,y),"aria-valuetext":m.ofBudget(z),className:`relative mt-2 ${E} overflow-hidden rounded-full bg-gray-200`,children:[(!N||M)&&/* @__PURE__ */it("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${C}%`}}),S>0&&/* @__PURE__ */it("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${L}%`,width:`${S}%`}}),w>0&&null!=$&&/* @__PURE__ */it("div",{title:m.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${$}%`}}),null!=P&&/* @__PURE__ */it("div",{title:m.pace,"data-pace":"true",className:"absolute inset-y-0 w-0.5 -translate-x-1/2 bg-gray-700",style:{left:`${P}%`}})]}):null;/* @__PURE__ */
|
|
328
328
|
return lt("div","md"===d?{className:h,children:[null!=e&&/* @__PURE__ */it("div",{className:"text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
329
329
|
/* @__PURE__ */lt("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
330
330
|
/* @__PURE__ */it("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${B}`,children:z}),
|
|
331
|
-
/* @__PURE__ */it("span",{className:"min-w-0 truncate text-2xs tabular-nums text-gray-400",children:F})]}),
|
|
331
|
+
/* @__PURE__ */it("span",{className:"min-w-0 truncate text-2xs tabular-nums text-gray-400",children:F})]}),O]}:{className:h,children:[
|
|
332
332
|
/* @__PURE__ */lt("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */it("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
333
333
|
/* @__PURE__ */it("span",{className:`text-sm font-semibold tabular-nums ${B}`,children:z}),
|
|
334
|
-
/* @__PURE__ */it("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:F})]}),
|
|
334
|
+
/* @__PURE__ */it("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:F})]}),O]})}var Ri=864e5;function Wi(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const r=new Date(t).getUTCFullYear();return r<2e3||r>2100?null:t}function Ki(e,t){return Me(new Date(e).toISOString().slice(0,10),{locale:t})}var Hi=(e,t)=>`${e}-fill-${t}`,_i=e=>`${e}-glow`,qi=e=>`${e}-reveal`,Ui=e=>`${e}-ground`;function Vi(e,t,r,n){return"solid"===r?n:`url(#${Hi(e,t)})`}function Yi(e){return"solid"===e?void 0:"4 3"}function Gi({id:e,index:t,colour:r,variant:n,from:a,to:l}){const i=Hi(e,t);if("solid"===n)return null;if("gradient"===n||"gradient-reverse"===n){const e="gradient-reverse"===n;/* @__PURE__ */
|
|
335
335
|
return lt("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
|
|
336
336
|
/* @__PURE__ */it("stop",{offset:"0%",stopColor:r,stopOpacity:e?l:a}),
|
|
337
337
|
/* @__PURE__ */it("stop",{offset:"100%",stopColor:r,stopOpacity:e?a:l})]})}const o=/* @__PURE__ */it("rect",{width:"100%",height:"100%",fill:r,fillOpacity:.45*a});return"duotone"===n?/* @__PURE__ */lt("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
|
|
@@ -345,12 +345,12 @@ return lt("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
|
|
|
345
345
|
/* @__PURE__ */it("circle",{cx:"2",cy:"2",r:"1.2",fill:r,fillOpacity:.85})]}:"lines"===n?{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",children:[o,
|
|
346
346
|
/* @__PURE__ */it("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"1.5",strokeOpacity:.8})]}:{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:[o,
|
|
347
347
|
/* @__PURE__ */it("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"2",strokeOpacity:.75})]})}function Xi({id:e,direction:t}){const r="center-out"===t?"rosh-viz-wipe-center":"right-to-left"===t?"rosh-viz-wipe-rtl":"rosh-viz-wipe";/* @__PURE__ */
|
|
348
|
-
return it("mask",{id:qi(e),maskUnits:"objectBoundingBox",maskContentUnits:"objectBoundingBox",children:/* @__PURE__ */it("rect",{x:"0",y:"0",width:"1",height:"1",fill:"white",className:r})})}function
|
|
349
|
-
return lt("defs",{children:[t.map((t,a)=>/* @__PURE__ */it(Gi,{id:e,index:a,colour:t.color,variant:t.variant??"gradient",from:r,to:n},a)),l&&/* @__PURE__ */it(Xi,{id:e,direction:l}),a&&/* @__PURE__ */lt("filter",{id:
|
|
348
|
+
return it("mask",{id:qi(e),maskUnits:"objectBoundingBox",maskContentUnits:"objectBoundingBox",children:/* @__PURE__ */it("rect",{x:"0",y:"0",width:"1",height:"1",fill:"white",className:r})})}function Ji({id:e,fills:t=[],fadeFrom:r=.3,fadeTo:n=0,glow:a=!1,reveal:l=!1,background:i="none"}){/* @__PURE__ */
|
|
349
|
+
return lt("defs",{children:[t.map((t,a)=>/* @__PURE__ */it(Gi,{id:e,index:a,colour:t.color,variant:t.variant??"gradient",from:r,to:n},a)),l&&/* @__PURE__ */it(Xi,{id:e,direction:l}),a&&/* @__PURE__ */lt("filter",{id:_i(e),x:"-40%",y:"-40%",width:"180%",height:"180%",children:[
|
|
350
350
|
/* @__PURE__ */it("feGaussianBlur",{stdDeviation:"3.5",result:"blur"}),
|
|
351
351
|
/* @__PURE__ */lt("feMerge",{children:[
|
|
352
352
|
/* @__PURE__ */it("feMergeNode",{in:"blur"}),
|
|
353
|
-
/* @__PURE__ */it("feMergeNode",{in:"SourceGraphic"})]})]}),"none"!==i&&/* @__PURE__ */it(
|
|
353
|
+
/* @__PURE__ */it("feMergeNode",{in:"SourceGraphic"})]})]}),"none"!==i&&/* @__PURE__ */it(Zi,{id:Ui(e),variant:i})]})}function Zi({id:e,variant:t}){/* @__PURE__ */
|
|
354
354
|
return it("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */it("circle",{cx:"2",cy:"2",r:"1",fill:"currentColor"})}:"grid"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */it("path",{d:"M 20 0 L 0 0 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"cross-hatch"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */it("path",{d:"M 0 0 L 20 20 M 20 0 L 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"plus"===t?{id:e,width:"16",height:"16",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */it("path",{d:"M 8 4 L 8 12 M 4 8 L 12 8",fill:"none",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round"})}:{id:e,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:/* @__PURE__ */it("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"currentColor",strokeWidth:"0.5"})})}var Qi={rise:"rosh-viz-rise",grow:"rosh-viz-grow",sweep:"rosh-viz-sweep",march:"rosh-viz-march",fade:"rosh-viz-fade"},eo=(e,t=60)=>({animationDelay:e*t+"ms"}),to={receipt:/* @__PURE__ */lt(ot,{children:[
|
|
355
355
|
/* @__PURE__ */it("path",{d:"M3.4 1.9h5.2v7.2l-1.3-.9-1.3.9-1.3-.9-1.3.9z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
|
|
356
356
|
/* @__PURE__ */it("path",{d:"M4.9 4.4h2.2M4.9 6.1h2.2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),check:/* @__PURE__ */it("path",{d:"M2.6 6.3 4.9 8.6 9.4 3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"}),doc:/* @__PURE__ */lt(ot,{children:[
|
|
@@ -366,10 +366,10 @@ return it("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:to[e]})}funct
|
|
|
366
366
|
return lt("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
|
|
367
367
|
/* @__PURE__ */it("path",{d:"M4.2 2.2v11.6"}),
|
|
368
368
|
/* @__PURE__ */it("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function ao(){/* @__PURE__ */
|
|
369
|
-
return it("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */it("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var lo=1e-6;function io(e,t,r={}){const n=Number.isFinite(t)&&t>0?t:0,a=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(n<=0||a.length<2){const e=a[0]??0;return{anchorsMs:a,xs:a.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=a[a.length-1]-a[0],i=r.maxTimeShare??.3,o=Math.min(r.breakPx??48,n),s=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<a.length;e++){const t=a[e+1]-a[e];c.push(t),d.push(l>0?t/l*n:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,n-h*o);let p=0,f=0;for(let e=0;e<c.length;e++)u[e]||(p+=c[e],f+=1);const g=c.map((e,t)=>u[t]?o:0===f?0:p>0?m*e/p:m/f),b=function(e,t,r){const n=e.slice();let a=0;for(let e=0;e<n.length;e++)t[e]||n[e]>=r-lo||(a+=r-n[e],n[e]=r);if(a<=lo)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+lo&&(l+=n[e]-r);if(l<=lo)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+lo||(n[e]-=i*(n[e]-r)/l);return n}(g,u,s),y=b.reduce((e,t,r)=>u[r]?e:e+t,0),x=b.map((e,t)=>u[t]?e:y>0?e*m/y:e),v=[0];for(let e=0;e<x.length;e++)v.push(v[e]+x[e]);v[v.length-1]=n;const w=v.slice(0,-1).map((e,t)=>({fromMs:a[t],toMs:a[t+1],gapMs:c[t],fromPx:e,toPx:v[t+1],wantPx:d[t],clampedPx:g[t],px:v[t+1]-e,compressed:u[t]}));return{anchorsMs:a,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=a[0])return 0;if(e>=a[a.length-1])return n;for(let t=0;t+1<a.length;t++){if(e>a[t+1])continue;const r=a[t+1]-a[t],n=r>0?(e-a[t])/r:0;return v[t]+n*(v[t+1]-v[t])}return n},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),n);for(let e=0;e+1<a.length;e++){if(t>v[e+1]&&e+2<a.length)continue;const r=v[e+1]-v[e],n=r>0?(t-v[e])/r:0;return a[e]+n*(a[e+1]-a[e])}return a[a.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function oo(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var so="mixed";function co(e,t){return 5.6*Math.max(e.length,t.length)+8}var uo=(e,t,r)=>Math.min(Math.max(e,t),r),ho=e=>-(Math.cos(Math.PI*e)-1)/2;function mo(e,t){if(!(t>0))return{px:e.fromPx,ms:e.fromMs};if(t>=1||e.durationMs<=0)return{px:e.toPx,ms:e.toMs};const r=e.fromPx+(e.toPx-e.fromPx)*ho(t);return{px:r,ms:e.msByPx(r)}}var po={lanes:{tag:0,laneA:17,laneH:30,rail:52,ruler:64,laneB:86,height:120},active:{tag:0,laneA:17,laneH:30,rail:38,ruler:50,laneB:74,height:108},none:{tag:0,laneA:16,laneH:14,rail:34,ruler:46,laneB:46,height:72}};function fo(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var go=e=>5.6*e.length,bo={default:{},dfm:{glyph:"doc",token:"var(--tl-dfm)"},shipment:{diamond:!0,glyph:"truck",token:"var(--tl-shipment)"},testing:{glyph:"flask",token:"var(--tl-testing)"},completion:{glyph:"check",token:"var(--tl-completion)"},inspection:{glyph:"flask",token:"var(--tl-inspection)"},invoice:{glyph:"receipt",token:"var(--tl-invoice)"},report:{}},yo={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function xo(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:bo[t].glyph??(r?"flag":void 0)}function vo(e,t,r=!1){const n=bo[e],a=["rosh-tl-node","rosh-tl-mark",`is-${t}`];n.diamond&&a.push("is-diamond"),r&&a.push("is-provisional");const l="current"===t?"var(--tl-accent)":n.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:a.join(" "),style:i}}function wo(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var No="undefined"==typeof document?Ge:
|
|
369
|
+
return it("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */it("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var lo=1e-6;function io(e,t,r={}){const n=Number.isFinite(t)&&t>0?t:0,a=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(n<=0||a.length<2){const e=a[0]??0;return{anchorsMs:a,xs:a.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=a[a.length-1]-a[0],i=r.maxTimeShare??.3,o=Math.min(r.breakPx??48,n),s=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<a.length;e++){const t=a[e+1]-a[e];c.push(t),d.push(l>0?t/l*n:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,n-h*o);let p=0,f=0;for(let e=0;e<c.length;e++)u[e]||(p+=c[e],f+=1);const g=c.map((e,t)=>u[t]?o:0===f?0:p>0?m*e/p:m/f),b=function(e,t,r){const n=e.slice();let a=0;for(let e=0;e<n.length;e++)t[e]||n[e]>=r-lo||(a+=r-n[e],n[e]=r);if(a<=lo)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+lo&&(l+=n[e]-r);if(l<=lo)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+lo||(n[e]-=i*(n[e]-r)/l);return n}(g,u,s),y=b.reduce((e,t,r)=>u[r]?e:e+t,0),x=b.map((e,t)=>u[t]?e:y>0?e*m/y:e),v=[0];for(let e=0;e<x.length;e++)v.push(v[e]+x[e]);v[v.length-1]=n;const w=v.slice(0,-1).map((e,t)=>({fromMs:a[t],toMs:a[t+1],gapMs:c[t],fromPx:e,toPx:v[t+1],wantPx:d[t],clampedPx:g[t],px:v[t+1]-e,compressed:u[t]}));return{anchorsMs:a,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=a[0])return 0;if(e>=a[a.length-1])return n;for(let t=0;t+1<a.length;t++){if(e>a[t+1])continue;const r=a[t+1]-a[t],n=r>0?(e-a[t])/r:0;return v[t]+n*(v[t+1]-v[t])}return n},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),n);for(let e=0;e+1<a.length;e++){if(t>v[e+1]&&e+2<a.length)continue;const r=v[e+1]-v[e],n=r>0?(t-v[e])/r:0;return a[e]+n*(a[e+1]-a[e])}return a[a.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function oo(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var so="mixed";function co(e,t){return 5.6*Math.max(e.length,t.length)+8}var uo=(e,t,r)=>Math.min(Math.max(e,t),r),ho=e=>-(Math.cos(Math.PI*e)-1)/2;function mo(e,t){if(!(t>0))return{px:e.fromPx,ms:e.fromMs};if(t>=1||e.durationMs<=0)return{px:e.toPx,ms:e.toMs};const r=e.fromPx+(e.toPx-e.fromPx)*ho(t);return{px:r,ms:e.msByPx(r)}}var po={lanes:{tag:0,laneA:17,laneH:30,rail:52,ruler:64,laneB:86,height:120},active:{tag:0,laneA:17,laneH:30,rail:38,ruler:50,laneB:74,height:108},none:{tag:0,laneA:16,laneH:14,rail:34,ruler:46,laneB:46,height:72}};function fo(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var go=e=>5.6*e.length,bo={default:{},dfm:{glyph:"doc",token:"var(--tl-dfm)"},shipment:{diamond:!0,glyph:"truck",token:"var(--tl-shipment)"},testing:{glyph:"flask",token:"var(--tl-testing)"},completion:{glyph:"check",token:"var(--tl-completion)"},inspection:{glyph:"flask",token:"var(--tl-inspection)"},invoice:{glyph:"receipt",token:"var(--tl-invoice)"},report:{}},yo={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function xo(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:bo[t].glyph??(r?"flag":void 0)}function vo(e,t,r=!1){const n=bo[e],a=["rosh-tl-node","rosh-tl-mark",`is-${t}`];n.diamond&&a.push("is-diamond"),r&&a.push("is-provisional");const l="current"===t?"var(--tl-accent)":n.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:a.join(" "),style:i}}function wo(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var No="undefined"==typeof document?Ge:Je;function ko(e,t){const[r,n]=qe(0);return No(()=>{const r=t?e.current:null;if(!r)return;const a=()=>{const e=r.getBoundingClientRect().width;e>0&&n(e)};if(a(),"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(a);return l.observe(r),()=>{l.disconnect()}},[e,t]),r}function $o(e,t,r){const n=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&n.set(e.x,Math.max(n.get(e.x)??0,e.widthPx));const a=[...n.keys()].sort((e,t)=>e-t);if(r<=0||a.length<2)return e;const l=Math.max(0,a[0]),i=Math.min(r,a[a.length-1]),o=i-l,s=[];for(let e=0;e+1<a.length;e++){const t=(n.get(a[e])??0)/2+(n.get(a[e+1])??0)/2+8;s.push(Math.max(28,t,a[e+1]-a[e]))}const c=s.reduce((e,t)=>e+t,0),d=Math.min(Math.max(c,o),.8*r);if(d<=o+.5)return e;const u=l,h=r-i,m=u+h,p=Math.max(0,r-d),f=m>0?p*u/m:0,g=f,b=f+d,y=s.map(e=>c>0?e*d/c:0),x=e=>{if(e<=l)return u>0?e*f/u:g;if(e>=i)return h>0?b+(e-i)*(r-b)/h:b;let t=g;for(let r=0;r+1<a.length;r++){if(e>a[r+1]){t+=y[r];continue}const n=a[r+1]-a[r];return t+(n>0?(e-a[r])/n*y[r]:0)}return b};return{anchorsMs:e.anchorsMs,xs:e.xs.map(x),gaps:e.gaps.map(e=>({...e,fromPx:x(e.fromPx),toPx:x(e.toPx),px:x(e.toPx)-x(e.fromPx)})),xByMs:t=>x(e.xByMs(t)),msByPx:t=>e.msByPx((e=>{if(e<=g)return f>0?e*u/f:l;if(e>=b)return r-b>0?i+(e-b)*h/(r-b):i;let t=g;for(let r=0;r+1<a.length;r++){if(!(e>t+y[r]))return a[r]+(y[r]>0?(e-t)/y[r]*(a[r+1]-a[r]):0);t+=y[r]}return i})(t)),inCut:e.inCut}}function Mo(e){if(!e||0===e.length)return null;const t=e.filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:null}function Co({marks:e,innerRef:t}){/* @__PURE__ */
|
|
370
370
|
return it("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */lt("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
|
|
371
371
|
/* @__PURE__ */it("span",{className:"rosh-tl-name",children:e.label}),
|
|
372
|
-
/* @__PURE__ */it("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function Lo({startMs:e,endMs:t,axis:r,geo:n,reveal:a}){const l=
|
|
372
|
+
/* @__PURE__ */it("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function Lo({startMs:e,endMs:t,axis:r,geo:n,reveal:a}){const l=ze().timeline,i=ke(Fe()),o=n.ruler,s=[],c=[],d=r.gaps.filter(e=>e.compressed),u=new Date(e);u.setUTCDate(u.getUTCDate()+(8-u.getUTCDay())%7);for(let e=u.getTime();e<t;e+=7*Ri){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*Ri)-t<14||s.push(
|
|
373
373
|
/* @__PURE__ */it("i",{className:"rosh-tl-tick is-week",style:{left:`${t}px`,top:`${o}px`,height:"3px"}},`wk-${e}`))}const h=d.map(e=>{const t=(e.fromPx+e.toPx)/2,r=go(l.days(Math.round(e.gapMs/Ri)))/2+6;return[t-r,t+r]}),m=(e,t)=>h.some(([r,n])=>e<n&&t>r);s.push(
|
|
374
374
|
/* @__PURE__ */it("i",{"data-timeline-part":"start-tick",className:"rosh-tl-tick",style:{left:"0px",top:`${o}px`,height:"6px"}},"start"));const p=new Date(e);p.setUTCDate(1);let f=-1/0,g=!0;for(;p.getTime()<t;){const t=p.getTime();if(!(t<=e)&&!r.inCut(t)){const e=r.xByMs(t);if(s.push(
|
|
375
375
|
/* @__PURE__ */it("i",{className:"rosh-tl-tick",style:{left:`${e}px`,top:`${o}px`,height:"6px"}},`mo-${t}`)),e-f>=72||g){const r=g||0===p.getUTCMonth()?i.shortMonthYear(p.getUTCFullYear(),p.getUTCMonth()):i.monthsShort[p.getUTCMonth()];m(e,e+go(r))||(c.push(
|
|
@@ -379,12 +379,12 @@ return lt("span",{"data-timeline-part":"break",className:"rosh-tl-rulercut"+(a?"
|
|
|
379
379
|
/* @__PURE__ */lt("span",{className:"rosh-tl-cutglyph",children:[
|
|
380
380
|
/* @__PURE__ */it("i",{}),
|
|
381
381
|
/* @__PURE__ */it("i",{})]}),
|
|
382
|
-
/* @__PURE__ */it("span",{children:l.days(t)})]},`cut-${e.fromMs}`)})]})}function Do({pending:e,reveal:t}){const r=
|
|
382
|
+
/* @__PURE__ */it("span",{children:l.days(t)})]},`cut-${e.fromMs}`)})]})}function Do({pending:e,reveal:t}){const r=ze().timeline,[n,a]=qe(!1),l=n?e:e.slice(0,2),i=e.length-l.length;/* @__PURE__ */
|
|
383
383
|
return lt("div",{className:"rosh-tl-pending","data-timeline-part":"pending",children:[
|
|
384
384
|
/* @__PURE__ */it("p",{className:"rosh-tl-pending-head",children:r.notReached}),
|
|
385
385
|
/* @__PURE__ */it("ol",{className:"rosh-tl-ghosts","aria-label":r.notReached,children:l.map((e,n)=>/* @__PURE__ */lt("li",{className:t?"rosh-tl-fade":void 0,style:t?{animationDelay:440+60*n+"ms"}:void 0,children:[
|
|
386
386
|
/* @__PURE__ */it("span",{"aria-hidden":"true",className:"rosh-tl-node is-ghost"+(e.kind&&bo[e.kind].diamond?" is-diamond":"")}),
|
|
387
|
-
/* @__PURE__ */lt("span",{children:[0===n&&/* @__PURE__ */it("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */it("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>a(!0),children:r.more(i)})]})}function So({marks:e,pending:t,currentKey:r,todayMs:n,reveal:a,ariaLabel:l,step:i,nodeProps:o,onKeyDown:s}){const c=
|
|
387
|
+
/* @__PURE__ */lt("span",{children:[0===n&&/* @__PURE__ */it("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */it("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>a(!0),children:r.more(i)})]})}function So({marks:e,pending:t,currentKey:r,todayMs:n,reveal:a,ariaLabel:l,step:i,nodeProps:o,onKeyDown:s}){const c=ze().timeline,d=e.findIndex(e=>e.key===r),u=e.length>0&&null!==n?Math.round((n-e[e.length-1].ms)/Ri):0;/* @__PURE__ */
|
|
388
388
|
return lt("div",{"data-timeline-part":"vertical",children:[
|
|
389
389
|
/* @__PURE__ */it("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:s,children:e.map((e,t)=>{const n=vo(e.kind,e.role),l=d>=0&&t<d,{glyph:s}=e;/* @__PURE__ */
|
|
390
390
|
return lt("li",{className:a?"rosh-tl-fade":void 0,style:a?eo(t,i):void 0,...e.key===r?{"aria-current":"step"}:{},children:[
|
|
@@ -398,15 +398,15 @@ return lt("li",{className:a?"rosh-tl-fade":void 0,style:a?eo(t,i):void 0,...e.ke
|
|
|
398
398
|
return lt("div",{"aria-hidden":"true",children:[
|
|
399
399
|
/* @__PURE__ */it("div",{className:"rosh-tl-rail bg-gray-200",style:{top:`${t.rail}px`,height:"6px",width:`${a}px`}}),null!==r&&/* @__PURE__ */it("div",{"data-timeline-part":"fill",className:`rosh-tl-fill bg-blue-600${l?" is-tweened":""}${n?" rosh-tl-draw":""}`,style:{top:`${t.rail}px`,height:"6px",width:`${Math.max(0,Math.min(e.xByMs(r),a))}px`}}),e.gaps.filter(e=>e.compressed).map(e=>/* @__PURE__ */lt("div",{className:"rosh-tl-cut",style:{left:(e.fromPx+e.toPx)/2+"px",top:`${t.rail}px`,height:"6px"},children:[
|
|
400
400
|
/* @__PURE__ */it("i",{}),
|
|
401
|
-
/* @__PURE__ */it("i",{})]},`railcut-${e.fromMs}`))]})}function
|
|
401
|
+
/* @__PURE__ */it("i",{})]},`railcut-${e.fromMs}`))]})}function Po({geo:e,caption:t,endCaption:r,around:n,reveal:a,trackPx:l}){const i=e.rail-13-4,o=a?" rosh-tl-fade":"",s=a?{animationDelay:"420ms"}:{};/* @__PURE__ */
|
|
402
402
|
return lt("div",{"aria-hidden":"true","data-timeline-part":"start",children:[
|
|
403
|
-
/* @__PURE__ */it("i",{className:`rosh-tl-start${n?" is-around":""}${o}`,style:{left:"0px",top:`${e.rail+3}px`,...s}}),null!=t&&!1!==t&&/* @__PURE__ */it("span",{className:`rosh-tl-edge${o}`,"data-timeline-part":"start-caption",style:{left:"0px",top:`${i}px`,...s},children:t}),null!=r&&!1!==r&&/* @__PURE__ */it("span",{className:`rosh-tl-edge is-end${o}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...s},children:r})]})}function
|
|
403
|
+
/* @__PURE__ */it("i",{className:`rosh-tl-start${n?" is-around":""}${o}`,style:{left:"0px",top:`${e.rail+3}px`,...s}}),null!=t&&!1!==t&&/* @__PURE__ */it("span",{className:`rosh-tl-edge${o}`,"data-timeline-part":"start-caption",style:{left:"0px",top:`${i}px`,...s},children:t}),null!=r&&!1!==r&&/* @__PURE__ */it("span",{className:`rosh-tl-edge is-end${o}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...s},children:r})]})}function jo({x:e,geo:t,trackPx:r,label:n,reveal:a}){const l=ze().timeline;/* @__PURE__ */
|
|
404
404
|
return lt("div",{"aria-hidden":"true","data-timeline-part":"today",children:[
|
|
405
405
|
/* @__PURE__ */it("div",{className:"rosh-tl-todayline"+(a?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${t.laneA}px`,height:t.ruler+20-t.laneA+"px",...a?{animationDelay:"420ms"}:{}}}),
|
|
406
406
|
/* @__PURE__ */it("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${oo(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function zo({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=go(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__ */it("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */it("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 Fo({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
|
|
407
407
|
return lt("div",{"aria-hidden":"true","data-timeline-part":"phase",children:[
|
|
408
408
|
/* @__PURE__ */it("div",{className:"rosh-tl-phase border-gray-300",style:{left:`${n}px`,width:`${a}px`,top:t.laneB+t.laneH-4+"px"}}),
|
|
409
|
-
/* @__PURE__ */lt("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 Eo({nodes:e,trackPx:t,geo:r,activeKey:n,hoveredKey:a,currentKey:l}){const i=
|
|
409
|
+
/* @__PURE__ */lt("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 Eo({nodes:e,trackPx:t,geo:r,activeKey:n,hoveredKey:a,currentKey:l}){const i=ze().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:co(d,u),m=c?.onOpen;/* @__PURE__ */
|
|
410
410
|
return lt("div",{"data-timeline-part":"label",className:`rosh-tl-label${s.key===a?" is-hot":""}${o(s,l)?" is-current":""}`,style:{left:`${oo(s.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */it("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */it("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
|
|
411
411
|
/* @__PURE__ */it("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function Bo({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:f,setZoomKey:g,startCaptionPx:b}){const y=[];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(y.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(go(a))+28}),n===c)for(const r of e.members)y.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;y.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})}),y.sort((e,t)=>e.x-t.x);const x=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}]:[],...y.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,Ri),{laneCount:2}),v=new Map(x.map(e=>[e.key,e.lane]));for(const e of y)e.lane=v.get(e.key)??-1,e.left=oo(e.x,e.widthPx,t);const w=y.find(e=>e.key===(h??p)),N=e=>0===e?r.laneA:r.laneB,k=e=>0===e?r.rail-4:r.rail+6+3;/* @__PURE__ */
|
|
412
412
|
return lt(ot,{children:[y.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=()=>{f(null),a||g(null)};/* @__PURE__ */
|
|
@@ -423,24 +423,24 @@ return lt("div",{children:[
|
|
|
423
423
|
/* @__PURE__ */it("p",{className:"rosh-tl-popover-head",children:w.text}),
|
|
424
424
|
/* @__PURE__ */it("ol",{children:w.group.members.map(e=>/* @__PURE__ */lt("li",{children:[
|
|
425
425
|
/* @__PURE__ */it("span",{children:e.label}),
|
|
426
|
-
/* @__PURE__ */it("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function
|
|
426
|
+
/* @__PURE__ */it("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function Oo({thumb:e,value:t,snap:r,axis:n,geo:a,startMs:l,endMs:i,trackPx:o,layerRef:s,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=ze().timeline,p=Fe(),f=Ue(!1),g=c?c.px:n.xByMs(t),b=c?c.ms:t,y=Mo(e.stops),x=y?y.indexOf(t):-1,v=e=>{const r=s.current?.getBoundingClientRect();return r?n.msByPx(e-r.left):t},w=n=>{const a=r(n);a!==t&&e.onChange(a)},N=t=>{d?.(),f.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},k=t=>{f.current&&(f.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},$=e=>{if(!f.current)return;const t=v(e.clientX);w(t),h(function(e,t){if(!Number.isFinite(t))return null;const r=e.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms);for(let e=0;e+1<r.length;e++){const n=r[e],a=r[e+1];if(t<n.ms||t>a.ms)continue;const l=a.ms-n.ms;return{fromKey:n.key,toKey:a.key,t:l>0?uo((t-n.ms)/l,0,1):1,ms:t}}return null}(u,t))},M=e.valueText?e.valueText(b):Ki(b,p),C=Math.max(1,Math.round((i-l)/Ri));/* @__PURE__ */
|
|
427
427
|
return lt(ot,{children:[
|
|
428
428
|
/* @__PURE__ */it("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:a.rail-9+"px",height:"24px"},onPointerDown:e=>{N(e),w(v(e.clientX))},onPointerMove:$,onPointerUp:k,onPointerCancel:k}),
|
|
429
429
|
/* @__PURE__ */it("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${oo(g,88,o)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):Ki(b,p)}),
|
|
430
|
-
/* @__PURE__ */it("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":y&&y.length>0?y.length-1:C,"aria-valuenow":y&&y.length>0?Math.max(0,x):Math.round((t-l)/Ri),"aria-valuetext":M,style:{left:`${g}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(y&&y.length>0){const e=x<0?0:x;return"ArrowRight"===r||"ArrowUp"===r?y[Math.min(e+1,y.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?y[Math.max(e-1,0)]:"Home"===r?y[0]:"End"===r?y[y.length-1]:null}const n=(e.shiftKey?7:1)*Ri;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 To(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Oo({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:f,zoomRange:g=null,motion:b=!0,ariaLabel:y,highlightKeys:x=null,onHoverChange:v,endMark:w=null}){const N="none"===s,k=de(Date.now,null),$=de(fo,!1),M=o??k,C=Ue(null),L=Ee().timeline,D=Be(),S=e=>Ki(e,D),A=Ue(null),j=Ue(null),P=Ue(null),z=Ue(/* @__PURE__ */new Map),F=Ue(void 0),E=Ue(void 0),B=Ue(null),[I,T]=qe({}),[O,R]=qe(null),[W,K]=qe(null),[_,H]=qe(null),[q,U]=qe(null),[V,Y]=qe(null),[X,Z]=qe(null),J=He(),Q=He(),ee=ko(C,!0),te=ee>0?ee-(l.length>0&&!N?176:0):0,re=te>0&&te-20<320,ne=ko(A,!re),ae=ne>0?ne:600,le=po[s],ie=N&&l.length>0,oe=ie?Math.max(0,ae-36):ae,se=r=>r>=e-Ri&&r<=t+Ri,ce=n.filter(e=>Number.isFinite(e.ms)&&se(e.ms)).slice().sort((e,t)=>e.ms-t.ms),ue="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],me=io([e,...[...ce.map(e=>e.ms),...ue].filter(r=>r>e&&r<t),t],oe,"compressed"===(pe=r)?{}:"spread"===pe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var pe;const fe=me.xByMs,ge=ce.filter(e=>!e.provisional),be=f??(ge.length>0?ge[ge.length-1].key:null),ye=ce.map((e,t)=>{const r=e.date??S(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?yo[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:fe(e.ms),baseX:fe(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:xo(e,a,0===t&&"default"===a),role:e.key===be?"current":n?"dot":"key",widthPx:N?Math.max(16,go(e.caption??"")+6):I[e.key]||co(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),xe=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&se(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=S(t);return{key:r,ms:t,x:fe(t),baseX:fe(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??bo[e.kind].glyph,role:"key",widthPx:I[r]||co(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}}),ve=ie?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Ri,x:ae,baseX:ae,kind:e.kind??"default",label:e.label,dateText:L.notReached,detail:r.length>0?L.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],we=N&&w&&!ie?[{key:w.key,ms:t,x:oe,baseX:oe,kind:"default",label:w.label,dateText:w.dateText??S(t),detail:w.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Ne=[...ye,...xe,...ve,...we].sort((e,t)=>e.x-t.x||e.ms-t.ms),ke=m?.start??L.start(S(e)),$e=null==ke||!1===ke?0:"string"==typeof ke?Math.ceil(go(ke)):96,Me="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}(Ne):[],Ce=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:so,members:t})}n=a}return r}(Ne),Le=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,De=/* @__PURE__ */new Map;for(const e of Ce)if("cluster"===e.type)for(const t of e.members)De.set(t.key,Le(e));const Se=_??q??V,Ae=Me.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Se)??Ce.find(e=>"cluster"===e.type&&Le(e)===Se),je=e=>({x:e.baseX,widthPx:e.widthPx}),Pe=Ae&&"cluster"===Ae.type?Ae.members.map(je):g?Ne.filter(e=>e.ms>=g[0]&&e.ms<=g[1]).map(je):[],ze=Pe.length>1?$o(me,Pe,oe):me,Fe=ze!==me;if(Fe)for(const e of Ne)e.isCap||(e.x=ze.xByMs(e.ms));const Ie=Ne.some(e=>e.x<14),Te=Fe&&Ae?Se:null,Oe=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Re=re?Ne.map(Oe):Ce.flatMap(e=>{if("item"===e.type)return[Oe(e.mark)];const t=Le(e);if(t===Te&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Oe);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}]}),We=/* @__PURE__ */new Map;for(const e of Re)for(const t of e.members)We.set(t.key,e.key);const Ke=Ce.find(e=>"cluster"===e.type&&Le(e)===Te),_e=Ke&&"cluster"===Ke.type?{from:Math.min(...Ke.members.map(e=>e.x))-16,to:Math.max(...Ke.members.map(e=>e.x))+16}:null,Ve=Ue(Te),[Xe,Ze]=qe(!1);Ge(()=>{if(Ve.current===Te)return;Ve.current=Te,Ze(!0);const e=setTimeout(()=>Ze(!1),240);return()=>clearTimeout(e)},[Te]);const Je=Ne.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");No(()=>{const e=j.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}T(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)},[Je]);const Qe=`${s}|${r}|${Ne.map(e=>`${e.key}@${e.ms}`).join("|")}`,[et,tt]=qe(Qe),rt=b&&et===Qe;Ge(()=>{et!==Qe&&tt(Qe)},[et,Qe]);const nt=Math.min(28,340/Math.max(1,Ne.length-1)),at=Mo(u?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!at)return n;let a=at[0];for(const e of at)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?st(u.valueMs):null,dt=h&&u?ye.filter(e=>!at||at.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:uo(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}(ze,dt,{speed:h?.speed,reducedMotion:$}),[ht,mt]=qe(null),pt=Ue(null),ft=Ue({segments:ut,value:ct,playback:h});Ge(()=>{ft.current={segments:ut,value:ct,playback:h}});const gt=Ue(null),bt=Ye(e=>{null===e&&null===gt.current||(gt.current=e,ft.current.playback?.onProgress?.(e))},[]),yt=Ye(()=>{pt.current=null,mt(null),bt(null),ft.current.playback?.onStop?.()},[bt]),xt=!!h?.playing&&!!u;Ge(()=>{if(!xt)return;const e=ft.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void yt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=ft.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(mo(t,0))):yt()},o=e=>{const t=ft.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:mo(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:mo(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=mo(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:ho(l),ms:i.ms}};const o=e[t.index+1];return{cursor:o?{index:t.index+1,phase:"rest",t:0,restLeftMs:o.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(o)):yt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[xt,yt,bt]);const vt=ye.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===M?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,M):null,Nt=new Set(x??[]),kt=Ne.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=Ye(()=>{clearTimeout(F.current),clearTimeout(E.current),R(null),K(null),H(null),U(null),Y(null)},[]);Ge(()=>()=>{clearTimeout(F.current),clearTimeout(E.current)},[]),Ge(()=>{const e=B.current;e&&(B.current=null,z.current.get(e)?.focus())});const Ct=null!==W||null!==_||null!==q||null!==V;Ge(()=>{if(Ct)return he(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=Ye((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,ae-r)):t;const a=e.parentElement;if(r>0&&a){const t=G(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`)},[ae]),Dt=Re.find(e=>e.key===W)??null,St=Dt?Dt.x:0;No(()=>{Lt(P.current,St)},[Lt,W,St]);const At=ct??void 0,jt=Ue(null);Ge(()=>{if(void 0===At)return;const e=ze.xByMs(At),t=jt.current;if(jt.current=e,null===t||e<=t)return;const r=[];for(const n of Ne){if(n.x<=t||n.x>e)continue;const a=z.current.get(We.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 Pt=Re.map(e=>e.key),zt=be?We.get(be)??null:null,Ft=X&&Pt.includes(X)?X:zt&&Pt.includes(zt)?zt:Pt[0],Et=e=>{const t=Pt.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?Pt.length-1:-1;r<0||r>Pt.length-1||(e.preventDefault(),Z(Pt[r]),z.current.get(Pt[r])?.focus())},Bt=()=>clearTimeout(E.current),It=e=>{Bt(),Y(e)},Tt=()=>{clearTimeout(E.current),E.current=setTimeout(()=>Y(null),260)},Ot=e=>{Te&&De.get(e)===Te?Bt():(Bt(),Y(null))},Rt=e=>{clearTimeout(F.current),R(e),K(e),v?.((e=>{const t=Re.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{R(t=>t===e?null:t),clearTimeout(F.current),F.current=setTimeout(()=>K(t=>t===e?null:t),160),v?.(null)},Kt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":wo(e),"aria-describedby":W===e.key?J:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?z.current.set(e.key,t):z.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),Z(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),_t=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=L,r.events(t.length,t.map(wo))),"aria-describedby":W===e.key?J:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?z.current.set(e.key,t):z.current.delete(e.key)},onMouseEnter:()=>{e.openable?It(e.key):Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{Bt(),Rt(e.key),Z(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];Z(r.key),B.current=r.key}};var t,r},Ht="lanes"!==s||Ne.length>1;if(re)/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */it("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":y&&y.length>0?y.length-1:C,"aria-valuenow":y&&y.length>0?Math.max(0,x):Math.round((t-l)/Ri),"aria-valuetext":M,style:{left:`${g}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(y&&y.length>0){const e=x<0?0:x;return"ArrowRight"===r||"ArrowUp"===r?y[Math.min(e+1,y.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?y[Math.max(e-1,0)]:"Home"===r?y[0]:"End"===r?y[y.length-1]:null}const n=(e.shiftKey?7:1)*Ri;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 To(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Io({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:f,zoomRange:g=null,motion:b=!0,ariaLabel:y,highlightKeys:x=null,onHoverChange:v,endMark:w=null}){const N="none"===s,k=de(Date.now,null),$=de(fo,!1),M=o??k,C=Ue(null),L=ze().timeline,D=Fe(),S=e=>Ki(e,D),A=Ue(null),P=Ue(null),j=Ue(null),z=Ue(/* @__PURE__ */new Map),F=Ue(void 0),E=Ue(void 0),B=Ue(null),[O,T]=qe({}),[I,R]=qe(null),[W,K]=qe(null),[H,_]=qe(null),[q,U]=qe(null),[V,Y]=qe(null),[X,J]=qe(null),Z=_e(),Q=_e(),ee=ko(C,!0),te=ee>0?ee-(l.length>0&&!N?176:0):0,re=te>0&&te-20<320,ne=ko(A,!re),ae=ne>0?ne:600,le=po[s],ie=N&&l.length>0,oe=ie?Math.max(0,ae-36):ae,se=r=>r>=e-Ri&&r<=t+Ri,ce=n.filter(e=>Number.isFinite(e.ms)&&se(e.ms)).slice().sort((e,t)=>e.ms-t.ms),ue="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],me=io([e,...[...ce.map(e=>e.ms),...ue].filter(r=>r>e&&r<t),t],oe,"compressed"===(pe=r)?{}:"spread"===pe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var pe;const fe=me.xByMs,ge=ce.filter(e=>!e.provisional),be=f??(ge.length>0?ge[ge.length-1].key:null),ye=ce.map((e,t)=>{const r=e.date??S(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?yo[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:fe(e.ms),baseX:fe(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:xo(e,a,0===t&&"default"===a),role:e.key===be?"current":n?"dot":"key",widthPx:N?Math.max(16,go(e.caption??"")+6):O[e.key]||co(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),xe=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&se(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=S(t);return{key:r,ms:t,x:fe(t),baseX:fe(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??bo[e.kind].glyph,role:"key",widthPx:O[r]||co(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}}),ve=ie?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Ri,x:ae,baseX:ae,kind:e.kind??"default",label:e.label,dateText:L.notReached,detail:r.length>0?L.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],we=N&&w&&!ie?[{key:w.key,ms:t,x:oe,baseX:oe,kind:"default",label:w.label,dateText:w.dateText??S(t),detail:w.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Ne=[...ye,...xe,...ve,...we].sort((e,t)=>e.x-t.x||e.ms-t.ms),ke=m?.start??L.start(S(e)),$e=null==ke||!1===ke?0:"string"==typeof ke?Math.ceil(go(ke)):96,Me="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}(Ne):[],Ce=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:so,members:t})}n=a}return r}(Ne),Le=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,De=/* @__PURE__ */new Map;for(const e of Ce)if("cluster"===e.type)for(const t of e.members)De.set(t.key,Le(e));const Se=H??q??V,Ae=Me.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Se)??Ce.find(e=>"cluster"===e.type&&Le(e)===Se),Pe=e=>({x:e.baseX,widthPx:e.widthPx}),je=Ae&&"cluster"===Ae.type?Ae.members.map(Pe):g?Ne.filter(e=>e.ms>=g[0]&&e.ms<=g[1]).map(Pe):[],Ee=je.length>1?$o(me,je,oe):me,Be=Ee!==me;if(Be)for(const e of Ne)e.isCap||(e.x=Ee.xByMs(e.ms));const Oe=Ne.some(e=>e.x<14),Te=Be&&Ae?Se:null,Ie=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Re=re?Ne.map(Ie):Ce.flatMap(e=>{if("item"===e.type)return[Ie(e.mark)];const t=Le(e);if(t===Te&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ie);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}]}),We=/* @__PURE__ */new Map;for(const e of Re)for(const t of e.members)We.set(t.key,e.key);const Ke=Ce.find(e=>"cluster"===e.type&&Le(e)===Te),He=Ke&&"cluster"===Ke.type?{from:Math.min(...Ke.members.map(e=>e.x))-16,to:Math.max(...Ke.members.map(e=>e.x))+16}:null,Ve=Ue(Te),[Xe,Je]=qe(!1);Ge(()=>{if(Ve.current===Te)return;Ve.current=Te,Je(!0);const e=setTimeout(()=>Je(!1),240);return()=>clearTimeout(e)},[Te]);const Ze=Ne.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");No(()=>{const e=P.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)}T(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)},[Ze]);const Qe=`${s}|${r}|${Ne.map(e=>`${e.key}@${e.ms}`).join("|")}`,[et,tt]=qe(Qe),rt=b&&et===Qe;Ge(()=>{et!==Qe&&tt(Qe)},[et,Qe]);const nt=Math.min(28,340/Math.max(1,Ne.length-1)),at=Mo(u?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!at)return n;let a=at[0];for(const e of at)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?st(u.valueMs):null,dt=h&&u?ye.filter(e=>!at||at.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:uo(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}(Ee,dt,{speed:h?.speed,reducedMotion:$}),[ht,mt]=qe(null),pt=Ue(null),ft=Ue({segments:ut,value:ct,playback:h});Ge(()=>{ft.current={segments:ut,value:ct,playback:h}});const gt=Ue(null),bt=Ye(e=>{null===e&&null===gt.current||(gt.current=e,ft.current.playback?.onProgress?.(e))},[]),yt=Ye(()=>{pt.current=null,mt(null),bt(null),ft.current.playback?.onStop?.()},[bt]),xt=!!h?.playing&&!!u;Ge(()=>{if(!xt)return;const e=ft.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void yt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=ft.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(mo(t,0))):yt()},o=e=>{const t=ft.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:mo(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:mo(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=mo(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:ho(l),ms:i.ms}};const o=e[t.index+1];return{cursor:o?{index:t.index+1,phase:"rest",t:0,restLeftMs:o.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(o)):yt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[xt,yt,bt]);const vt=ye.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===M?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,M):null,Nt=new Set(x??[]),kt=Ne.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=Ye(()=>{clearTimeout(F.current),clearTimeout(E.current),R(null),K(null),_(null),U(null),Y(null)},[]);Ge(()=>()=>{clearTimeout(F.current),clearTimeout(E.current)},[]),Ge(()=>{const e=B.current;e&&(B.current=null,z.current.get(e)?.focus())});const Ct=null!==W||null!==H||null!==q||null!==V;Ge(()=>{if(Ct)return he(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=Ye((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,ae-r)):t;const a=e.parentElement;if(r>0&&a){const t=G(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`)},[ae]),Dt=Re.find(e=>e.key===W)??null,St=Dt?Dt.x:0;No(()=>{Lt(j.current,St)},[Lt,W,St]);const At=ct??void 0,Pt=Ue(null);Ge(()=>{if(void 0===At)return;const e=Ee.xByMs(At),t=Pt.current;if(Pt.current=e,null===t||e<=t)return;const r=[];for(const n of Ne){if(n.x<=t||n.x>e)continue;const a=z.current.get(We.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 jt=Re.map(e=>e.key),zt=be?We.get(be)??null:null,Ft=X&&jt.includes(X)?X:zt&&jt.includes(zt)?zt:jt[0],Et=e=>{const t=jt.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?jt.length-1:-1;r<0||r>jt.length-1||(e.preventDefault(),J(jt[r]),z.current.get(jt[r])?.focus())},Bt=()=>clearTimeout(E.current),Ot=e=>{Bt(),Y(e)},Tt=()=>{clearTimeout(E.current),E.current=setTimeout(()=>Y(null),260)},It=e=>{Te&&De.get(e)===Te?Bt():(Bt(),Y(null))},Rt=e=>{clearTimeout(F.current),R(e),K(e),v?.((e=>{const t=Re.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{R(t=>t===e?null:t),clearTimeout(F.current),F.current=setTimeout(()=>K(t=>t===e?null:t),160),v?.(null)},Kt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":wo(e),"aria-describedby":W===e.key?Z:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?z.current.set(e.key,t):z.current.delete(e.key)},onMouseEnter:()=>{It(e.key),Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{It(e.key),Rt(e.key),J(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),Ht=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=L,r.events(t.length,t.map(wo))),"aria-describedby":W===e.key?Z:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?z.current.set(e.key,t):z.current.delete(e.key)},onMouseEnter:()=>{e.openable?Ot(e.key):Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{Bt(),Rt(e.key),J(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Ot(e.key);const r=e.members[0];J(r.key),B.current=r.key}};var t,r},_t="lanes"!==s||Ne.length>1;if(re)/* @__PURE__ */
|
|
431
431
|
return it("div",{ref:C,children:/* @__PURE__ */it(So,{marks:Ne.filter(e=>!e.isCap),pending:l,currentKey:be,todayMs:M,reveal:rt,ariaLabel:y,step:nt,nodeProps:Kt,onKeyDown:Et})});const qt=(e,t)=>null==e||!1===e?null:/* @__PURE__ */it("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:le.rail-3+"px"},children:e});/* @__PURE__ */
|
|
432
432
|
return lt("div",{ref:C,className:"rosh-tl-body"+(l.length>0&&!N?"":" is-solo"),children:[
|
|
433
433
|
/* @__PURE__ */lt("div",{className:"flex items-stretch gap-3",children:[N&&qt(ke,!1),
|
|
434
|
-
/* @__PURE__ */it("div",{className:"rosh-tl-stage",style:{height:`${To(le,
|
|
435
|
-
/* @__PURE__ */it(Ao,{axis:
|
|
434
|
+
/* @__PURE__ */it("div",{className:"rosh-tl-stage",style:{height:`${To(le,_t,p.length>0&&!N)}px`},children:/* @__PURE__ */lt("div",{ref:A,className:`rosh-tl-layer${Xe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!He)return;const t=A.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=He.from&&r<=He.to?Bt():Tt()},onMouseLeave:Tt,children:[!N&&/* @__PURE__ */it(Co,{marks:Ne,innerRef:P}),
|
|
435
|
+
/* @__PURE__ */it(Ao,{axis:Ee,geo:le,fillTo:wt,reveal:rt,trackPx:oe,tweened:!!u}),ie&&
|
|
436
436
|
/* @__PURE__ */it("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${oe}px`,width:ae-oe+"px",top:le.rail+3-1+"px"}}),$t&&/* @__PURE__ */it("div",{"aria-hidden":"true",className:"rosh-tl-band","data-timeline-part":"highlight",style:{left:$t.from-10+"px",width:$t.to-$t.from+20+"px",top:le.rail-7+"px",height:"20px"}}),
|
|
437
|
-
/* @__PURE__ */it(Lo,{startMs:e,endMs:t,axis:
|
|
438
|
-
/* @__PURE__ */it(
|
|
437
|
+
/* @__PURE__ */it(Lo,{startMs:e,endMs:t,axis:Ee,geo:le,reveal:rt}),
|
|
438
|
+
/* @__PURE__ */it(Po,{geo:le,caption:N?null:ke,endCaption:N?null:m?.end,around:Oe,reveal:rt,trackPx:ae}),N&&/* @__PURE__ */it(zo,{nodes:Re,geo:le,reveal:rt}),null!==M&&M>e&&M<=t+Ri&&/* @__PURE__ */it(jo,{x:Ee.xByMs(Math.min(M,t)),geo:le,trackPx:ae,label:S(M),reveal:rt}),!N&&p.map(e=>/* @__PURE__ */it(Fo,{phase:e,geo:le,xOf:Ee.xByMs},e.key)),
|
|
439
439
|
/* @__PURE__ */it("ol",{className:"rosh-tl-nodes","aria-label":y,onKeyDown:Et,children:Re.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${le.rail+3}px`,a=rt?eo(t,nt):{},l=(e=>!!$t&&e.x>=$t.from-.5&&e.x<=$t.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
|
|
440
440
|
return it("li",{children:/* @__PURE__ */it("button",{...Kt(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${rt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:n,...a}})},e.key);if(!e.mark){const t=e.kind===so,i=vo(t?"default":e.kind,"key"),o=t?void 0:bo[e.kind]?.glyph;/* @__PURE__ */
|
|
441
441
|
return lt("li",{...r(be)?{"aria-current":"step"}:{},children:[
|
|
442
|
-
/* @__PURE__ */lt("button",{...
|
|
443
|
-
return it("li",{...i.key===be?{"aria-current":"step"}:{},children:/* @__PURE__ */lt("button",{...Kt(i),className:`${o.className}${i.key===c?" is-active":""}${l}${rt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */it(ro,{name:s}),"current"===i.role&&/* @__PURE__ */it("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(rt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */it(Bo,{groups:Me,trackPx:ae,geo:le,startMs:e,endMs:t,currentKey:be,hoveredKey:
|
|
442
|
+
/* @__PURE__ */lt("button",{...Ht(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(c)?" is-active":""}${l}${rt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:n,...a},children:[o&&/* @__PURE__ */it(ro,{name:o}),t&&/* @__PURE__ */lt("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */lt("i",{"aria-hidden":"true",className:"rosh-tl-count"+(rt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:n},children:["×",e.members.length]})]},e.key)}const i=e.mark,o=vo(i.kind,i.role,i.provisional),{glyph:s}=i;/* @__PURE__ */
|
|
443
|
+
return it("li",{...i.key===be?{"aria-current":"step"}:{},children:/* @__PURE__ */lt("button",{...Kt(i),className:`${o.className}${i.key===c?" is-active":""}${l}${rt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */it(ro,{name:s}),"current"===i.role&&/* @__PURE__ */it("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(rt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */it(Bo,{groups:Me,trackPx:ae,geo:le,startMs:e,endMs:t,currentKey:be,hoveredKey:I,reveal:rt,step:nt,zoomedKey:Te,popId:Q,aimBubble:Lt,startCaptionPx:$e,openCluster:H,setOpenCluster:_,previewCluster:q,setPreviewCluster:U,setZoomKey:Y}):"active"===s?/* @__PURE__ */it(Eo,{nodes:Re,trackPx:ae,geo:le,activeKey:c,hoveredKey:I,currentKey:be}):null,Dt&&/* @__PURE__ */it("div",{ref:j,id:Z,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${le.rail+6+6}px`},onMouseEnter:()=>{Bt(),Rt(Dt.key)},onMouseLeave:()=>{Tt(),Wt(Dt.key)},onFocus:()=>{Bt(),Rt(Dt.key)},onBlur:()=>{Tt(),Wt(Dt.key)},children:Dt.mark?/* @__PURE__ */lt(ot,{children:[
|
|
444
444
|
/* @__PURE__ */it("span",{className:"rosh-tl-name",children:Dt.mark.label}),
|
|
445
445
|
/* @__PURE__ */it("span",{className:"rosh-tl-date",children:Dt.mark.dateText}),Dt.mark.preview?/* @__PURE__ */it("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:Dt.mark.preview}):Dt.mark.detail&&/* @__PURE__ */it("span",{className:"rosh-tl-detail",children:Dt.mark.detail}),(Dt.mark.onOpen??Dt.mark.onClick)&&/* @__PURE__ */it("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(Dt.mark?.onOpen??Dt.mark?.onClick)?.(),children:L.openButton})]}):
|
|
446
446
|
/* @__PURE__ */lt("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
|
|
@@ -449,31 +449,31 @@ return it("li",{...i.key===be?{"aria-current":"step"}:{},children:/* @__PURE__ *
|
|
|
449
449
|
/* @__PURE__ */lt("p",{className:"rosh-tl-foldrow",children:[
|
|
450
450
|
/* @__PURE__ */it("span",{children:e.label}),
|
|
451
451
|
/* @__PURE__ */it("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */it("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */it("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),u&&null!==ct&&
|
|
452
|
-
/* @__PURE__ */it(
|
|
452
|
+
/* @__PURE__ */it(Oo,{thumb:u,value:ct,snap:st,axis:Ee,geo:le,startMs:e,endMs:t,trackPx:ae,layerRef:A,glide:ht,onScrub:h?yt:void 0,nodes:dt,onProgress:bt})]})}),N&&qt(m?.end,!0)]}),l.length>0&&!N&&/* @__PURE__ */it(Do,{pending:l,reveal:rt})]})}function Ro({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const o=[...r?[/* @__PURE__ */it("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
|
|
453
453
|
return lt("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
|
|
454
454
|
/* @__PURE__ */lt("div",{className:"rosh-tl-head",children:[
|
|
455
455
|
/* @__PURE__ */lt("div",{className:"rosh-tl-head-main text-gray-800",children:[e&&/* @__PURE__ */it("span",{className:"rosh-tl-ico","aria-hidden":"true",children:e}),
|
|
456
456
|
/* @__PURE__ */it("h4",{className:"rosh-tl-title",children:t}),o.length>0&&/* @__PURE__ */it("p",{className:"rosh-tl-meta text-gray-500",children:o.map((e,t)=>
|
|
457
|
-
/* @__PURE__ */lt(rt,{children:[t>0&&/* @__PURE__ */it("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */it("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */it("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Wo({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=de(Date.now,null),h=[],m=[],p=
|
|
458
|
-
return it("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */it(Ro,{icon:/* @__PURE__ */it(no,{}),heading:t??e,subject:r,meta:N,children:L})})}var Ko=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),
|
|
459
|
-
return it("div",{className:"select-none",children:/* @__PURE__ */it(
|
|
460
|
-
/* @__PURE__ */lt("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__ */it(
|
|
461
|
-
/* @__PURE__ */it("span",{children:C.playing?L.pause:L.play})]}),
|
|
457
|
+
/* @__PURE__ */lt(rt,{children:[t>0&&/* @__PURE__ */it("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */it("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */it("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Wo({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=de(Date.now,null),h=[],m=[],p=ze().timeline,f=Fe();for(const e of n){const t=Wi(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 g=Wi(l??null);let b,y,x=!0;0===h.length?(y=g??u??0,b=y-30*Ri,x=null!==g||null!==u):(b=h[0].ms,y=g??h[h.length-1].ms,y-b<Ri&&(y=b+Ri));const v=h.length>0?Math.max(0,Math.round((y-b)/Ri)):0,w=a??(v>0?p.duration(v):void 0),N=[h.length>0?p.started(Ki(h[0].ms,f)):void 0,w,m.length>0?p.reached(h.length,n.length):void 0],k=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),$={};for(const e of h)e.phase&&($[e.phase]=$[e.phase]||[]).push(e.ms);const M=Object.entries($).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),C="rail"===o,L=x&&/* @__PURE__ */it("div",{className:"select-none",children:/* @__PURE__ */it(Io,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:k,pending:m,phases:M,startMs:b,endMs:y,todayMs:u??void 0,edgeCaptions:s,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
|
|
458
|
+
return it("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */it(Ro,{icon:/* @__PURE__ */it(no,{}),heading:t??e,subject:r,meta:N,children:L})})}var Ko=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),Ho=[{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 _o(e){if(e.order_qty<=0)return 0;let t=0;for(const r of Ho)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function qo(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_o(t),0)/t.length}function Uo(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:o,msPerDayOfPlayback:s=500,markers:c=[]}=e,[d,u]=qe(null),h=ze().production;Ge(()=>{o?u(new Date(o).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=qe(!1),f=Ue(null),g=()=>{null!=f.current&&(cancelAnimationFrame(f.current),f.current=null),p(!1)};Ge(()=>()=>g(),[]),Ge(()=>{g()},[i]);const b=t.map(e=>Wi(e.date)).filter(e=>null!=e),y=de(Date.now,null)??Math.max(0,...b,...c.map(e=>Wi(e.date)??0),Wi(r??null)??0,Wi(n??null)??0),x=b.length?Math.min(...b):y,v=b.length?Math.max(...b):y,w=Wi(r??null)??x,N=Wi(n??null)??0,k=Ko.has((a||"").toLowerCase()),$=c.reduce((e,t)=>{const r=Wi(t.date);return null!=r&&r>e?r:e},0),M=(()=>{const e=[N,v,$,w+Ri];return k||e.push(y),Math.max(...e)})(),C=Math.max(1,Math.round((M-w)/Ri)),L=Wi(o??null)??v??w,D=Math.min(Math.max(d??L,w),M),S=t.find(e=>{const t=Wi(e.date);return null!=t&&t<=D})??null;let A=null;for(let e=t.length-1;e>=0;e--){const r=Wi(t[e].date);if(null!=r&&r>D){A=t[e];break}}const P=(()=>{if(S||!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:""}})(),j=S??P,z=S?Wi(S.date):P?w:null,F=A?Wi(A.date):null,E=!!(j&&A&&null!=z&&null!=F&&D>z&&D<F);let B,O;if(E&&null!=z&&null!=F){const e=(D-z)/Math.max(F-z,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of j?.items??[])r[e.part_number]=e;const 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=Wi(j?.est_completion_date),i=Wi(A?.est_completion_date);let o;o=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):j?.est_completion_date||A?.est_completion_date||null,B={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:""},O=j}else if(B=j??t[t.length-1]??null,B){const e=t.findIndex(e=>e.id===B.id);O=e>=0&&e<t.length-1?t[e+1]:null}else O=null;const T={};for(const e of O?.items??[])T[e.part_number]=e;const I=!(!i||B?.id===i),R=i?Math.min(Wi(o??null)??M,M):M,W=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:M,totalLeadDays:C,scrubMs:D,setScrubMs:e=>{g(),u(e)},resetToCurrent:()=>{g(),o&&u(new Date(o).getTime())},scrubbedAway:I,beforeAnchor:j,nextAfter:A,displayed:B,prevReport:O,prevByPN:T,isInterpolated:E,playing:m,startPlay:()=>{if(m)return void g();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*Ri,t>=R)return u(R),f.current=null,void p(!1);u(t),f.current=requestAnimationFrame(r)};f.current=requestAnimationFrame(r)},stopPlay:g,reports:t,markers:c,poNumber:l,currentReportId:i,currentReportProgressNumber:W,estCompletionMs:Wi(n??null)}}function Vo({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:f=!1,endMark:g=null}){const b=ze().production,y=Fe(),x=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),v=x.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:h(e),preview:e.preview??u?.(e),onOpen:s?()=>s(e.id):void 0})),w=new Map(x.map(({report:e,ms:t})=>[e.id,t])),N=x.map(({ms:e})=>e),k=c?n.map(e=>({...e,onOpen:c})):n;/* @__PURE__ */
|
|
459
|
+
return it("div",{className:"select-none",children:/* @__PURE__ */it(Io,{axis:f?"spread":"linear",labels:f?"none":"active",endMark:f?g:null,items:v,markers:k,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),o(e)},playback:m,edgeCaptions:p,thumb:{valueMs:a,onChange:i,onDragStart:d,stops:N,ariaLabel:b.scrub,valueText:e=>{const t=(e=>x.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${Ki(e,y)}`:Ki(e,y)}},ariaLabel:b.label(Ki(e,y),Ki(t,y))})})}function Yo({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:f,endMs:g,totalLeadDays:b,scrubMs:y,setScrubMs:x,displayed:v,scrubbedAway:w,resetToCurrent:N,currentReportId:k,currentReportProgressNumber:$,estCompletionMs:M}=e,C=function(e,t,r){const[n,a]=qe(!1),l=Ue(!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=>Wi(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),x,u),L=ze().production,D=Fe(),S=i??L.heading,A=e=>Ki(e,D);if(0===h.length&&0===m.length)return null;const P=m.filter(e=>"shipment"===e.kind),j=m.filter(e=>"inspection"===e.kind),z=m.filter(e=>"invoice"===e.kind),F=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),E=v?qo(v):0,B=h.find(e=>e.id===k),O=B?s(B):$,T=
|
|
460
|
+
/* @__PURE__ */lt("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__ */it(be,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */it(be,{name:"play","aria-hidden":"true"}),
|
|
461
|
+
/* @__PURE__ */it("span",{children:C.playing?L.pause:L.play})]}),I=w&&(c??O)?/* @__PURE__ */it("button",{type:"button",onClick:()=>{C.stop(),N()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(O))}):null,[R,W]=Oe(L.showing),K=e=>/* @__PURE__ */it("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */lt(ot,{children:[e&&R,
|
|
462
462
|
/* @__PURE__ */it("b",{className:"font-medium",children:s(v)}),e&&W,
|
|
463
463
|
/* @__PURE__ */lt("span",{className:"text-gray-500",children:[" · ",A(new Date(v.date).getTime())," · ",L.overall(Math.round(E))," · ",L.inStock(F)]})]}):/* @__PURE__ */it("span",{className:"text-gray-500",children:L.noReport})});if("rail"===d){const e=null!=M&&M>=g&&g>f,i=e?{key:"__estimate__",label:L.estimatedCompletion,dateText:A(M)}:null;/* @__PURE__ */
|
|
464
464
|
return lt("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
465
465
|
/* @__PURE__ */it(Vo,{bare:!0,endMark:i,startMs:f,endMs:g,reports:h,markers:m,valueMs:y,activeId:v?.id??"",onChange:x,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:{start:o?.start??L.start,end:o?.end??(e?L.estDone:void 0)},onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>x(t),onProgress:l,onStop:C.stop}}),
|
|
466
|
-
/* @__PURE__ */lt("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[T,
|
|
467
|
-
return it("div",{className:"shrink-0",children:/* @__PURE__ */it(Ro,{icon:/* @__PURE__ */it(ao,{}),heading:S,subject:p,meta:[`${A(f)} → ${A(g)}`,L.leadTime(b)],actions:/* @__PURE__ */lt(ot,{children:[
|
|
466
|
+
/* @__PURE__ */lt("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[T,I,K(!1)]})]})}/* @__PURE__ */
|
|
467
|
+
return it("div",{className:"shrink-0",children:/* @__PURE__ */it(Ro,{icon:/* @__PURE__ */it(ao,{}),heading:S,subject:p,meta:[`${A(f)} → ${A(g)}`,L.leadTime(b)],actions:/* @__PURE__ */lt(ot,{children:[I,T]}),footer:/* @__PURE__ */lt(ot,{children:[K(!0),
|
|
468
468
|
/* @__PURE__ */lt("div",{className:"rosh-tl-legend",children:[h.length>0&&/* @__PURE__ */lt("span",{className:"border-gray-200 text-gray-500",children:[
|
|
469
|
-
/* @__PURE__ */it("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),
|
|
470
|
-
/* @__PURE__ */it("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */it(ro,{name:"truck"})}),L.shipment]}),
|
|
469
|
+
/* @__PURE__ */it("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),P.length>0&&/* @__PURE__ */lt("span",{className:"border-gray-200 text-gray-500",children:[
|
|
470
|
+
/* @__PURE__ */it("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */it(ro,{name:"truck"})}),L.shipment]}),j.length>0&&/* @__PURE__ */lt("span",{className:"border-gray-200 text-gray-500",children:[
|
|
471
471
|
/* @__PURE__ */it("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */it(ro,{name:"flask"})}),L.inspection]}),z.length>0&&/* @__PURE__ */lt("span",{className:"border-gray-200 text-gray-500",children:[
|
|
472
|
-
/* @__PURE__ */it("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */it(ro,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */it(Vo,{startMs:f,endMs:g,reports:h,markers:m,valueMs:y,activeId:v?.id??"",onChange:x,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:o,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>x(t),onProgress:l,onStop:C.stop}})})})}var Go=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function Xo({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:n,qtyField:a="instruction",showNewIndicator:l=!1,getInstructionQty:i=e=>e.quantity,getActualQty:o=e=>e.actual_qty,isFilled:s,isNew:c=e=>Boolean(e._isNew),className:d,style:u}){const h=
|
|
472
|
+
/* @__PURE__ */it("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */it(ro,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */it(Vo,{startMs:f,endMs:g,reports:h,markers:m,valueMs:y,activeId:v?.id??"",onChange:x,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:o,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>x(t),onProgress:l,onStop:C.stop}})})})}var Go=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function Xo({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:n,qtyField:a="instruction",showNewIndicator:l=!1,getInstructionQty:i=e=>e.quantity,getActualQty:o=e=>e.actual_qty,isFilled:s,isNew:c=e=>Boolean(e._isNew),className:d,style:u}){const h=ze().containers,m=s?e.filter(s):e,p=e=>Go(i(e)),f=e=>Go(o(e)),g=m.some(e=>null!=o(e)&&f(e)>0),b=e=>g?p(e):"actual"===a?o(e)??i(e)??0:i(e)??0,y=m.reduce((e,t)=>e+Go(b(t)),0),x=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+Go(b(t)),0),w=m.reduce((e,t)=>e+p(t),0),N=m.reduce((e,t)=>e+f(t),0),k=e=>t?.(e)??0,$=r??(e=>k(e)*p(e)),M=n??(e=>k(e)*f(e)),C=m.reduce((e,t)=>e+$(t),0),L=m.reduce((e,t)=>e+M(t),0),D=g?Math.max(C,L):"actual"===a&&L||C,S=D<=34.65?"20ft":"40ft",A="20ft"===S?33:67,P=D>0?Math.max(1,Math.ceil(D/A)):0,j=P*A,z=D>0&&D>=.95*j&&D<=1.1*j;if(0===m.length)return null;const F=(e,t)=>A>0?Math.max(0,Math.min((e-t*A)/A*100,100)):0;/* @__PURE__ */
|
|
473
473
|
return lt("div",{className:`mt-2 px-1 space-y-2 ${d??""}`.trim(),style:u,children:[
|
|
474
474
|
/* @__PURE__ */lt("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
|
|
475
475
|
/* @__PURE__ */lt("span",{children:[`${h.items(m.length)} · ${h.pieces(y)}`,g&&w!==N&&/* @__PURE__ */it("span",{className:"ml-1 text-gray-400",children:h.split(w,N)})]}),l&&x>0&&/* @__PURE__ */lt("span",{className:"flex items-center gap-1 text-green-600",children:[
|
|
476
|
-
/* @__PURE__ */it("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(x,v)]})]}),D>0?/* @__PURE__ */lt("div",{className:"space-y-2",children:[Array.from({length:
|
|
476
|
+
/* @__PURE__ */it("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(x,v)]})]}),D>0?/* @__PURE__ */lt("div",{className:"space-y-2",children:[Array.from({length:P}).map((e,t)=>{const r=F(C,t),n=F(L,t),a=g,l=Math.max(r,n),i=Math.min(r,n),o=r>=n,s=a?o?"bg-blue-500":"bg-green-500":"bg-blue-500",c=a?o?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
|
|
477
477
|
return lt("div",{className:"flex items-center gap-2",children:[
|
|
478
478
|
/* @__PURE__ */it("span",{className:"text-2xs text-gray-400 w-8 shrink-0",children:S}),
|
|
479
479
|
/* @__PURE__ */lt("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
|
|
@@ -486,18 +486,18 @@ return lt("div",{className:"flex items-center gap-2",children:[
|
|
|
486
486
|
/* @__PURE__ */it("span",{className:"text-gray-400",children:"/"}),
|
|
487
487
|
/* @__PURE__ */lt("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
|
|
488
488
|
/* @__PURE__ */it("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),h.loaded(L)]})]}):/* @__PURE__ */it("b",{className:"text-gray-700",children:h.volume(D)})]}),
|
|
489
|
-
/* @__PURE__ */lt("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",
|
|
489
|
+
/* @__PURE__ */lt("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",P," × ",S]})]})]}):/* @__PURE__ */it("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var Jo=({open:e})=>/* @__PURE__ */it(be,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function Zo({docs:e,loading:t=!1,categoryOrder:r,canEdit:n=!1,onNew:a,onEdit:l,renderBody:o,emptyMessage:s}){const c=ze(),[d,h]=qe(""),[m,p]=qe(null),[f,g]=qe({}),b=d.trim().toLowerCase(),y=Ve(()=>{const t=/* @__PURE__ */new Map;for(const r of e){let e=t.get(r.category);e||(e={key:r.category,label:r.category_label||r.category,docs:[]},t.set(r.category,e)),e.docs.push(r)}if(!r?.length)return[...t.values()];const n=new Map(r.map((e,t)=>[e,t]));return[...t.values()].sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0))},[e,r]),x=e=>!b||e.title.toLowerCase().includes(b)||e.body.toLowerCase().includes(b)||e.category_label.toLowerCase().includes(b),v=Ve(()=>y.map(e=>({...e,docs:e.docs.filter(x)})).filter(e=>e.docs.length>0),[y,b]),w=Ve(()=>v.flatMap(e=>e.docs),[v]),N=(m?w.find(e=>e.slug===m):void 0)??w[0]??null,k=e=>!!b||(f[e]??e===N?.category);/* @__PURE__ */
|
|
490
490
|
return lt("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
491
491
|
/* @__PURE__ */lt("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
492
492
|
/* @__PURE__ */lt("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
493
493
|
/* @__PURE__ */it("h2",{className:"text-sm font-semibold text-gray-900",children:c.help.title}),n&&a&&/* @__PURE__ */it("button",{type:"button",onClick:a,className:"text-xs text-blue-600 hover:underline",children:c.help.newArticle})]}),
|
|
494
494
|
/* @__PURE__ */it("div",{className:"px-3 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */lt("div",{className:"relative",children:[
|
|
495
|
-
/* @__PURE__ */it(
|
|
495
|
+
/* @__PURE__ */it(be,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${u}`,"aria-hidden":"true"}),
|
|
496
496
|
/* @__PURE__ */it("input",{type:"text",value:d,onChange:e=>h(e.target.value),placeholder:c.help.searchPlaceholder,className:"w-full rounded-md border border-gray-300 bg-white h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
|
|
497
|
-
/* @__PURE__ */it("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */it(
|
|
497
|
+
/* @__PURE__ */it("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */it(Ke,{size:"sm",padding:"py-6",label:c.help.loading}):0===v.length?/* @__PURE__ */it("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:b?c.help.noResults:s??c.help.empty}):v.map(e=>{const t=k(e.key);/* @__PURE__ */
|
|
498
498
|
return lt("div",{className:"py-0.5",children:[
|
|
499
499
|
/* @__PURE__ */lt("button",{type:"button",onClick:()=>{return t=e.key,g(e=>({...e,[t]:!k(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
|
|
500
|
-
/* @__PURE__ */it(
|
|
500
|
+
/* @__PURE__ */it(Jo,{open:t}),
|
|
501
501
|
/* @__PURE__ */it("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=N?.slug===e.slug;/* @__PURE__ */
|
|
502
502
|
return lt("button",{type:"button",onClick:()=>p(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
|
|
503
503
|
/* @__PURE__ */it("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */it("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:c.help.draft})]},e.slug)})]},e.key)})})]}),
|
|
@@ -506,34 +506,34 @@ return lt("button",{type:"button",onClick:()=>p(e.slug),className:"w-full text-l
|
|
|
506
506
|
/* @__PURE__ */lt("div",{className:"min-w-0",children:[
|
|
507
507
|
/* @__PURE__ */it("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:N.title}),
|
|
508
508
|
/* @__PURE__ */lt("p",{className:"text-xs text-gray-500 mt-0.5",children:[N.category_label,!1===N.is_published&&/* @__PURE__ */lt("span",{className:"ml-2 text-amber-600",children:["· ",c.help.draft]})]})]}),n&&l&&/* @__PURE__ */it("button",{type:"button",onClick:()=>l(N),className:"shrink-0 text-sm text-blue-600 hover:underline",children:c.help.edit})]}),
|
|
509
|
-
/* @__PURE__ */it("div",{className:"flex-1 overflow-auto px-5 py-4",children:o?o(N):N.body?/* @__PURE__ */it(i,{children:N.body}):/* @__PURE__ */it("p",{className:"text-sm text-gray-500 italic",children:c.help.noBody})})]}):/* @__PURE__ */it("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:t?/* @__PURE__ */it(
|
|
509
|
+
/* @__PURE__ */it("div",{className:"flex-1 overflow-auto px-5 py-4",children:o?o(N):N.body?/* @__PURE__ */it(i,{children:N.body}):/* @__PURE__ */it("p",{className:"text-sm text-gray-500 italic",children:c.help.noBody})})]}):/* @__PURE__ */it("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:t?/* @__PURE__ */it(Ke,{size:"sm",padding:"",label:c.help.loading}):/* @__PURE__ */it("p",{className:"text-sm text-gray-500",children:c.help.pickArticle})})})]})}var Qo={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50"};function es({children:e,onClick:t,variant:r="primary",hotkey:n,disabled:a=!1,type:l="button",title:i,className:o=""}){const s=k(n??"");/* @__PURE__ */
|
|
510
510
|
return lt("button",{type:l,onClick:t,disabled:a,title:i,className:`w-full inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors disabled:opacity-50 ${Qo[r]} ${o}`,children:[e,n&&/* @__PURE__ */it("kbd",{className:"kbd-submit rounded border px-2 py-0.5 text-2xs font-medium",children:s})]})}function ts(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-2 h-5 rounded-full text-2xs font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function rs({children:e,count:t}){return null==t?/* @__PURE__ */it("p",{className:"px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */lt("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:[
|
|
511
511
|
/* @__PURE__ */it("span",{className:"min-w-0 truncate",children:e}),
|
|
512
|
-
/* @__PURE__ */it("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function ns(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function as({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:o=0}){const s=
|
|
512
|
+
/* @__PURE__ */it("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function ns(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function as({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:o=0}){const s=ji(i,"SidebarNavItem"),c=ze().severity,d=s?(h=c,(u=s).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */lt(ot,{children:[null!=a&&/* @__PURE__ */it("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:a}),s&&
|
|
513
513
|
/* @__PURE__ */it("span",{"aria-hidden":"true",title:d,className:`shrink-0 h-1.5 w-1.5 rounded-full ${s.fill}`}),
|
|
514
514
|
/* @__PURE__ */it("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),s&&/* @__PURE__ */it("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */it("span",{className:ts(r),children:t}),null!=l&&/* @__PURE__ */it("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
|
|
515
|
-
return it("button",1===o?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */it("span",{className:ns(r),children:m})}:{type:"button",onClick:n,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:m})}function ls({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=
|
|
515
|
+
return it("button",1===o?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */it("span",{className:ns(r),children:m})}:{type:"button",onClick:n,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:m})}function ls({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=_e(),[i,o]=ue(()=>{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&&Ze.toArray(r).some(e=>Qe(e)&&!0===e.props.active);/* @__PURE__ */
|
|
516
516
|
return lt("div",{children:[
|
|
517
517
|
/* @__PURE__ */lt("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-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(s?"bg-blue-50 text-blue-700":"text-gray-800 hover:bg-gray-100"),children:[
|
|
518
518
|
/* @__PURE__ */it("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
519
|
-
/* @__PURE__ */it(
|
|
519
|
+
/* @__PURE__ */it(be,{name:"chevron-down",className:"mr-auto ml-0.5 size-3 shrink-0 text-gray-400 transition-transform "+(i?"":"-rotate-90"),strokeWidth:2.6,"aria-hidden":"true"}),null!=t&&t>0&&/* @__PURE__ */it("span",{className:ts(s),children:t})]}),
|
|
520
520
|
/* @__PURE__ */it("div",{id:l,role:"group","aria-label":e,hidden:!i,children:r})]})}function is({items:e,activeKey:t,onSelect:r,brand:n,actions:a,className:l}){/* @__PURE__ */
|
|
521
521
|
return lt("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[n&&/* @__PURE__ */it("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:n}),
|
|
522
522
|
/* @__PURE__ */it("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const n=e.key===t;/* @__PURE__ */
|
|
523
523
|
return lt("button",{type:"button",disabled:e.disabled,"aria-current":n?"page":void 0,onClick:()=>!e.disabled&&r?.(e.key),className:"relative inline-flex items-center gap-2 px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40 "+(n?"text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.icon&&/* @__PURE__ */it("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
524
|
-
/* @__PURE__ */it("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */it("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */it("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */it("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var os=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function ss({anchor:e,bounds:t,side:r="top",align:n="start","aria-label":a,children:l,className:i=""}){const o=ce(),s=Ue(null),c=Ue(e);c.current=e;const d=Ue(t);d.current=t;const u=Ye(()=>{const e=s.current,t=c.current();if(!e||!t)return;const a=(d.current??os)(),l=e.style;l.maxWidth=`${Math.max(0,a.right-a.left-2*
|
|
524
|
+
/* @__PURE__ */it("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */it("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */it("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */it("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var os=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function ss({anchor:e,bounds:t,side:r="top",align:n="start","aria-label":a,children:l,className:i=""}){const o=ce(),s=Ue(null),c=Ue(e);c.current=e;const d=Ue(t);d.current=t;const u=Ye(()=>{const e=s.current,t=c.current();if(!e||!t)return;const a=(d.current??os)(),l=e.style;l.maxWidth=`${Math.max(0,a.right-a.left-2*J)}px`;const i=Y({trigger:t,menu:{width:e.offsetWidth,height:e.offsetHeight},bounds:a,align:n,side:r});l.left=`${i.left}px`,l.top=`${i.top}px`,e.dataset.side=i.side},[n,r]);oe(()=>{o&&u()}),Ge(()=>{if(!o)return;const e=re(()=>c.current(),u),t=s.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>u());return r.observe(t),()=>{e(),r.disconnect()}},[o,u]);return o&&e()?st(
|
|
525
525
|
/* @__PURE__ */it("div",{ref:s,role:"group","aria-label":a,"data-floating-bar":"",onMouseDown:e=>{const t=e.target;t?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||e.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${i}`.trim(),style:{...ae(),position:"fixed",left:0,top:0,zIndex:pe.popup},children:l}),document.body):null}function cs(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function ds({at:e,onClose:t,children:r,owner:n,"aria-label":a,minWidth:l=180,className:i="",autoFocus:o=!0}){const s=Ue(null),[c,d]=qe(null),u=Ue(t);u.current=t,oe(()=>{const t=s.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},a=ne({point:e,menu:r,bounds:G(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=Ue(null),m=Ue(!1);Ge(()=>(h.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!s.current?.contains(e)||h.current?.focus?.({preventScroll:!0})}),[]),Ge(()=>{c&&!m.current&&o&&(m.current=!0,cs(s.current)[0]?.focus({preventScroll:!0}))},[c,o]),Ge(()=>{if(o)return;const e=e=>{if(s.current?.contains(document.activeElement))return;const t=cs(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]),Ge(()=>he(e=>"Escape"===e.key&&(u.current(),!0),()=>s.current),[]),Ge(()=>{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=Ye(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void u.current();const t=cs(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())},[]),f=c?{left:c.left,top:c.top,maxHeight:c.maxHeight,...c.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
|
|
526
526
|
return it(D,{portal:!0,minWidth:l,style:f,onClose:t,className:i,children:/* @__PURE__ */it(F.Provider,{value:!0,children:/* @__PURE__ */it("div",{ref:s,role:"menu","aria-label":a,"data-context-menu":"",onKeyDown:p,children:r})})})}function us(){const[e,t]=qe(null),r=Ye(()=>t(null),[]),n=Ye((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(E(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=Ye(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 hs="Alt+ArrowUp Alt+ArrowDown";function ms(e){return!e.altKey||e.ctrlKey||e.metaKey?null:"ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":null}var ps=/* @__PURE__ */lt("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
|
|
527
527
|
/* @__PURE__ */it("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
528
528
|
/* @__PURE__ */it("circle",{cx:"2",cy:"7",r:"1.1"}),
|
|
529
|
-
/* @__PURE__ */it("circle",{cx:"2",cy:"11",r:"1.1"})]});function fs({hint:e,dragging:t,revealClassName:r,marker:n}){const a=
|
|
529
|
+
/* @__PURE__ */it("circle",{cx:"2",cy:"11",r:"1.1"})]});function fs({hint:e,dragging:t,revealClassName:r,marker:n}){const a=ze().tree;/* @__PURE__ */
|
|
530
530
|
return it(q,{content:e??a.dragHint,side:"left",delay:700,className:"absolute inset-y-0 left-0 inline-flex transition-opacity "+(t?"opacity-0":`opacity-0 ${r}`),children:/* @__PURE__ */it("span",{"aria-hidden":"true",[`data-${n}-grip`]:"",className:"flex h-full w-2 items-center justify-center text-[color:var(--ink-faintest)]",children:ps})})}function gs({id:e}){/* @__PURE__ */
|
|
531
|
-
return it("span",{id:e,hidden:!0,children:
|
|
531
|
+
return it("span",{id:e,hidden:!0,children:ze().tree.moveHint})}var bs='[role="treeitem"]';function ys(e){return[...e.querySelectorAll(bs)].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 xs({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=Ue(null);oe(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(bs)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??ys(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=Ye(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(bs);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const n=ys(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(bs))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__ */
|
|
532
532
|
return it("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 vs({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
533
533
|
return it("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}var ws=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal","bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600"].join(" ");function Ns({children:e,count:t,expanded:r,onToggle:n}){const a=void 0!==r,l=
|
|
534
534
|
/* @__PURE__ */it("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */it(N,{children:e})}),i=null!=t&&!1!==t&&/* @__PURE__ */it("span",{"data-tree-count":"",className:ws,children:t}),o="text-xs font-semibold uppercase tracking-wide text-gray-500";return a?/* @__PURE__ */it("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */lt("button",{type:"button","aria-expanded":r,onClick:n,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-gray-900","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",o].join(" "),children:[
|
|
535
535
|
/* @__PURE__ */it("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:ks(!!r)}),l,i]})}):/* @__PURE__ */lt("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${o}`,children:[
|
|
536
|
-
/* @__PURE__ */it("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,i]})}var ks=e=>/* @__PURE__ */it(
|
|
536
|
+
/* @__PURE__ */it("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,i]})}var ks=e=>/* @__PURE__ */it(be,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),$s={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function Ms({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:f=!1,draggable:g=!1,dragHint:b,onMove:y,rowProps:x,className:v=""}){const w=void 0!==l,k=_e(),$=[x?.["aria-describedby"],y?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__ */
|
|
537
537
|
return lt("div",{...x,role:"treeitem","aria-level":t,"aria-selected":a,"aria-expanded":w?l:void 0,tabIndex:a?0:-1,"aria-keyshortcuts":x?.["aria-keyshortcuts"]??(y?hs:void 0),"aria-describedby":$,"data-drop":p,"data-draggable":g||void 0,onKeyDown:e=>{if(x?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=ms(e);t&&y?(e.preventDefault(),y(t)):"Enter"!==e.key&&" "!==e.key||!o?("ArrowRight"===e.key&&w&&!l&&i||"ArrowLeft"===e.key&&w&&l&&i)&&(e.preventDefault(),i()):(e.preventDefault(),o())},onClick:e=>{x?.onClick?.(e),e.defaultPrevented||o?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",g?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",M,"into"===p?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",f?"opacity-40":"",v].filter(Boolean).join(" "),children:["before"===p&&/* @__PURE__ */it("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===p&&/* @__PURE__ */it("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),g&&
|
|
538
538
|
/* @__PURE__ */it(fs,{marker:"tree",hint:b,dragging:f,revealClassName:"group-hover/treerow:opacity-100"}),
|
|
539
539
|
/* @__PURE__ */it("span",w?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),i?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:ks(!!l)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=r&&/* @__PURE__ */it("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(s?"text-gray-400":""),children:r}),
|
|
@@ -542,77 +542,77 @@ return lt("div",{...x,role:"treeitem","aria-level":t,"aria-selected":a,"aria-exp
|
|
|
542
542
|
/* @__PURE__ */lt("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:$s,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:[
|
|
543
543
|
/* @__PURE__ */it("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
544
544
|
/* @__PURE__ */it("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
545
|
-
/* @__PURE__ */it("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:d})]}),y&&/* @__PURE__ */it(gs,{id:k})]})}function Cs({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=
|
|
545
|
+
/* @__PURE__ */it("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:d})]}),y&&/* @__PURE__ */it(gs,{id:k})]})}function Cs({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=ze().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__ */
|
|
546
546
|
return it("div",{...n,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */lt("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:[
|
|
547
|
-
/* @__PURE__ */it("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */it("span",{className:i,children:l})})}function Ls({onInsert:e,label:t,drop:r=!1,seamProps:n}){const a=
|
|
547
|
+
/* @__PURE__ */it("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */it("span",{className:i,children:l})})}function Ls({onInsert:e,label:t,drop:r=!1,seamProps:n}){const a=ze().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__ */
|
|
548
548
|
return lt("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:[
|
|
549
549
|
/* @__PURE__ */it("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
550
|
-
/* @__PURE__ */it("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__ */it(q,{content:l,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */it("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__ */it(
|
|
551
|
-
return it(Ds.Provider,{value:n,children:/* @__PURE__ */it("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 As({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=tt(Ds),p=Ue(null),f=
|
|
550
|
+
/* @__PURE__ */it("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__ */it(q,{content:l,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */it("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__ */it(be,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}var Ds=Xe("compact");function Ss({"aria-label":e,"aria-labelledby":t,children:r,spacing:n="compact",className:a="",rootProps:l}){/* @__PURE__ */
|
|
551
|
+
return it(Ds.Provider,{value:n,children:/* @__PURE__ */it("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 As({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=tt(Ds),p=Ue(null),f=_e(),g=[d?.["aria-describedby"],c?f:void 0].filter(Boolean).join(" ")||void 0,b=d?.tabIndex;oe(()=>{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__ */
|
|
552
552
|
return lt("div",{role:"listitem","data-list-item":"","data-drop":s,className:"relative flex min-w-0 flex-col",children:[s&&/* @__PURE__ */it("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]}`}),
|
|
553
553
|
/* @__PURE__ */lt("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?hs:void 0),"aria-describedby":g,onKeyDown:e=>{if(d?.onKeyDown?.(e),e.defaultPrevented||!c)return;const t=ms(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__ */it(fs,{marker:"list",hint:i,dragging:o,revealClassName:"group-hover/listrow:opacity-100 group-focus-within/listrow:opacity-100"}),
|
|
554
|
-
/* @__PURE__ */it("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__ */it("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:t}),c&&/* @__PURE__ */it(gs,{id:f})]}),null!=r&&!1!==r&&/* @__PURE__ */it("div",{"data-list-below":"",children:r})]})}var
|
|
555
|
-
return it("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(
|
|
554
|
+
/* @__PURE__ */it("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__ */it("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:t}),c&&/* @__PURE__ */it(gs,{id:f})]}),null!=r&&!1!==r&&/* @__PURE__ */it("div",{"data-list-below":"",children:r})]})}var Ps=Xe({labels:"none",shown:"none"}),js="button[data-icon-rail-button]:not([disabled])";function zs(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 Fs({"aria-label":e,orientation:t="vertical",children:r,className:n="",labels:a="none",labelsFit:l=!1,onLabelsShown:i}){const o=Ue(null),s="none"!==a&&l,[c,d]=qe(null),u="none"===a?"none":s?c??"none":"all",h=Ue(()=>{});h.current=()=>{const e=o.current;if(!e||!s)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const r=getComputedStyle(e),n=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a=parseFloat(r.minWidth)||0,l=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(a,n+l),worded:"below"===t?Math.max(a,n+Math.max(l,i)):Math.max(a,n+l+8+i),active:"true"===e.getAttribute("aria-pressed")}})}(e,a);d(function({buttons:e,orientation:t,chrome:r,room:n}){if(0===e.length)return"none";const a=n=>{const a=e.map(e=>n(e)?e.worded:e.bare);return r+("horizontal"===t?a.reduce((e,t)=>e+t,0):Math.max(...a))};return a(()=>!0)<=n+.5?"all":e.some(e=>e.active)&&a(e=>e.active)<=n+.5?"chosen":"none"}({buttons:r,orientation:t,...zs(e,t,r.length)}))},oe(()=>{h.current()}),Ge(()=>{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=Ue(null),p=Ue(i);p.current=i,Ge(()=>{s&&null!==c&&m.current!==c&&(m.current=c,p.current?.(c))},[s,c]),oe(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(js)];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__ */
|
|
555
|
+
return it("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(js)],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__ */it(Ps.Provider,{value:{labels:a,shown:u},children:r})})}function Es({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}=tt(Ps),u=void 0===l||!1===l||0===l?t:/* @__PURE__ */it(li,{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__ */it("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 not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-gray-900",o].filter(Boolean).join(" "),children:h?/* @__PURE__ */lt(ot,{children:[
|
|
556
556
|
/* @__PURE__ */it("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:u}),
|
|
557
557
|
/* @__PURE__ */it("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",m?"beside"===c?"ml-2":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):u});/* @__PURE__ */
|
|
558
|
-
return it(q,{content:e,side:i,children:p})}var Bs=6e4;function
|
|
559
|
-
return it("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */lt(o,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */it(
|
|
558
|
+
return it(q,{content:e,side:i,children:p})}var Bs=6e4;function Os({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=qe(null);return Ge(()=>{if(!e||null!==n)return;let l=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const r=t.includes("?")?"&":"?",n=await fetch(`${t}${r}t=${Date.now()}`,{cache:"no-store"});if(!n.ok)return;const i=await n.json(),o=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&o&&o!==e&&a(o)}catch{}};i();const o=setInterval(()=>{i()},r),s=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",s),()=>{l=!0,clearInterval(o),document.removeEventListener("visibilitychange",s)}},[e,t,r,n]),n}function Ts({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=Os({currentVersion:e,versionUrl:t,pollMs:r}),s=ze();if(null===i)return null;const c=a??(()=>window.location.reload());/* @__PURE__ */
|
|
559
|
+
return it("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */lt(o,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */it(_,{type:"button",variant:"primary",size:"md",onClick:c,children:s.update.refreshNow}),children:[
|
|
560
560
|
/* @__PURE__ */it("span",{className:"font-medium",children:n??s.update.available}),
|
|
561
|
-
/* @__PURE__ */lt("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var
|
|
562
|
-
return it("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__ */it(
|
|
561
|
+
/* @__PURE__ */lt("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var Is={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Rs={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function Ws({onClose:e}){const t=ze().dialog;/* @__PURE__ */
|
|
562
|
+
return it("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__ */it(be,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function Ks({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=Ue(null),f=_e(),g=_e(),b=_e();if(H(e),I(p,e,c),R(e),Ge(()=>{if(e)return he(()=>(s||t(),!0),()=>p.current)},[e,s,t]),!e)return null;const y="bottom"===r,x=y?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
|
|
563
563
|
return lt("div",{className:"fixed inset-0",style:{zIndex:pe.overlay},role:"presentation",children:[
|
|
564
564
|
/* @__PURE__ */it("div",{className:"fixed inset-0 bg-black/30",onClick:s?void 0:t,"aria-hidden":"true"}),
|
|
565
|
-
/* @__PURE__ */lt("div",{ref:p,...W({modal:!0,titleId:a?b:void 0,labelledBy:u,label:d}),"aria-describedby":h??(l?g:o?f:void 0),style:x,className:["fixed flex flex-col bg-white shadow-xl",y?"":`w-full max-w-full ${
|
|
565
|
+
/* @__PURE__ */lt("div",{ref:p,...W({modal:!0,titleId:a?b:void 0,labelledBy:u,label:d}),"aria-describedby":h??(l?g:o?f:void 0),style:x,className:["fixed flex flex-col bg-white shadow-xl",y?"":`w-full max-w-full ${Is[n]}`,Rs[r],y?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */lt("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
566
566
|
/* @__PURE__ */lt("div",{className:"min-w-0",children:[
|
|
567
567
|
/* @__PURE__ */it("h2",{id:b,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */it("p",{id:g,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!s&&/* @__PURE__ */it(Ws,{onClose:t})]}):!s&&/* @__PURE__ */it("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */it(Ws,{onClose:t})}),
|
|
568
|
-
/* @__PURE__ */lt("div",{id:f,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */it("p",{id:g,className:("mb-3 text-sm text-gray-500 "+(s?"":"pr-8")).trim(),children:l}),o]}),i&&/* @__PURE__ */it("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function
|
|
568
|
+
/* @__PURE__ */lt("div",{id:f,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */it("p",{id:g,className:("mb-3 text-sm text-gray-500 "+(s?"":"pr-8")).trim(),children:l}),o]}),i&&/* @__PURE__ */it("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function Hs({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 f=ze().kanban,g=Fe(),b=c??f.loading,y=h??f.dropHere,x=p??f.addItem,[v,w]=qe(null),[N,k]=qe(null),$=Ve(()=>{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]),M=()=>{w(null),k(null)},C=Ue(null),L=Ue(/* @__PURE__ */new Map);oe(()=>{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})})}},[$,v]);return s?/* @__PURE__ */it(Ke,{size:"sm",padding:"p-4",label:b}):0!==e.length||u?/* @__PURE__ */it("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */it("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=$[e.value]??[],r=null!==N&&N.col===e.value,o=null!==v?t.findIndex(e=>n(e)===v):-1,s=r&&(-1===o||N.index!==o&&N.index!==o+1)?N.index:-1;/* @__PURE__ */
|
|
569
569
|
return lt("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(r?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:t=>{t.preventDefault(),(e=>{if(v&&N&&N.col===e){const t=($[e]??[]).findIndex(e=>n(e)===v),r=-1!==t;if(!r||N.index!==t&&N.index!==t+1){const n=r&&N.index>t?N.index-1:N.index;a(v,e,n)}}M()})(e.value)},children:[
|
|
570
570
|
/* @__PURE__ */lt("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:[
|
|
571
571
|
/* @__PURE__ */lt("span",{className:"flex items-center gap-2",children:[
|
|
572
572
|
/* @__PURE__ */it("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
|
|
573
|
-
/* @__PURE__ */it("span",{className:"text-xs opacity-70",children:
|
|
573
|
+
/* @__PURE__ */it("span",{className:"text-xs opacity-70",children:Te(t.length,g)})]}),
|
|
574
574
|
/* @__PURE__ */lt("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>k(r=>r&&r.col===e.value&&r.index===t.length?r:{col:e.value,index:t.length}),children:[t.map((r,a)=>{const o=n(r),c=o===v;/* @__PURE__ */
|
|
575
575
|
return lt(rt,{children:[s===a&&/* @__PURE__ */it("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
|
|
576
576
|
/* @__PURE__ */it("div",{"data-kanban-card":o,draggable:!0,onDragStart:e=>{w(o);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:r=>{r.stopPropagation();const l=null!==v?t.findIndex(e=>n(e)===v):-1,i=-1!==l&&l<a?a+1:a;k(t=>t&&t.col===e.value&&t.index===i?t:{col:e.value,index:i})},onDragEnd:M,onClick:i?()=>i(r):void 0,style:null===v?void 0:{opacity:c?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(i?"cursor-pointer":""),children:l(r)})]},o)}),t.length>0&&s===t.length&&/* @__PURE__ */it("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===t.length&&/* @__PURE__ */it("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(r?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:y})]}),m&&/* @__PURE__ */it("div",{className:"p-2 pt-0",children:/* @__PURE__ */lt("button",{type:"button",onClick:()=>m(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-gray-500 opacity-0 transition hover:bg-gray-100 hover:text-gray-700 focus-visible:opacity-100 group-hover:opacity-100",children:[
|
|
577
|
-
/* @__PURE__ */it("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),x]})})]},e.value)})})}):/* @__PURE__ */it(ot,{children:d??/* @__PURE__ */it("div",{className:"text-sm text-gray-500 p-4",children:f.empty})})}var
|
|
578
|
-
return lt("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[a&&/* @__PURE__ */it("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${
|
|
579
|
-
/* @__PURE__ */it("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${
|
|
580
|
-
/* @__PURE__ */it("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${
|
|
577
|
+
/* @__PURE__ */it("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),x]})})]},e.value)})})}):/* @__PURE__ */it(ot,{children:d??/* @__PURE__ */it("div",{className:"text-sm text-gray-500 p-4",children:f.empty})})}var _s="inline-flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-40";function qs({page:e,pageCount:t,onPageChange:r,siblingCount:n=1,showEdges:a=!1,className:l=""}){const i=ze().pagination,o=Fe();if(t<=1)return null;const s=function(e,t,r){const n=/* @__PURE__ */new Set([1,t]);for(let a=e-r;a<=e+r;a++)a>=1&&a<=t&&n.add(a);const a=[...n].sort((e,t)=>e-t),l=[];let i=0;for(const e of a)i&&e-i>1&&l.push("…"),l.push(e),i=e;return l}(e,t,n),c=n=>{n>=1&&n<=t&&n!==e&&r(n)};/* @__PURE__ */
|
|
578
|
+
return lt("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[a&&/* @__PURE__ */it("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${_s} text-gray-600 hover:bg-gray-100`,children:"«"}),
|
|
579
|
+
/* @__PURE__ */it("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${_s} text-gray-600 hover:bg-gray-100`,children:"‹"}),s.map((t,r)=>"…"===t?/* @__PURE__ */it("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */it("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${_s} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:Te(t,o)},t)),
|
|
580
|
+
/* @__PURE__ */it("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${_s} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */it("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${_s} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function Us(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 Vs=e=>Array.isArray(e.columns),Ys=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",Gs="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",Xs={sm:"px-2 py-2",md:"px-3 py-2"},Js={left:"text-left",right:"text-right",center:"text-center"};function Zs({direction:e}){/* @__PURE__ */
|
|
581
581
|
return lt("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
582
582
|
/* @__PURE__ */it("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */it("path",{d:"M4 0L8 5H0z"})}),
|
|
583
|
-
/* @__PURE__ */it("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */it("path",{d:"M4 5L0 0h8z"})})]})}function Qs(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function ec({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:f,emptyText:g,selection:b,footer:y,virtualized:x,stackOnNarrow:v=!1,stackBelow:w,className:k=""}){const M=
|
|
584
|
-
return it("th",{scope:"col",...A("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:(de[t]??0)+ee}:{},...x?{top:n}:{}},className:[le,i,$,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-2xs":"text-xs",o?x?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":x?"sticky z-10 bg-gray-50":"",D&&s?"rosh-dt-sort":"",D?Ys(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:ie(e,s?/* @__PURE__ */lt("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=
|
|
583
|
+
/* @__PURE__ */it("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */it("path",{d:"M4 5L0 0h8z"})})]})}function Qs(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function ec({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:f,emptyText:g,selection:b,footer:y,virtualized:x,stackOnNarrow:v=!1,stackBelow:w,className:k=""}){const M=ze(),C=g??M.table.empty,L=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),D=v&&!x,S=D?e:e.flatMap(e=>{if(!Vs(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),A=e=>D?{role:e}:{},P=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[j,z]=qe(0),F=x?.overscan??6,E=x?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/x.rowHeight)-F);z(e=>e===t?e:t)}:void 0,B=x?Math.ceil(x.height/x.rowHeight)+2*F:t.length,O=x?Math.min(j,Math.max(0,t.length-B)):0,T=Math.min(t.length,O+B),I=x?O*x.rowHeight:0,R=x?(t.length-T)*x.rowHeight:0,W=Ue(null),[K,H]=qe(0);oe(()=>{if(!x)return;const e=W.current?.offsetHeight??0;H(t=>t===e?t:e)});const _=e=>e.sortField??e.key,q=e=>n&&n.field===_(e)?n.direction:null,U=S.flatMap(e=>Vs(e)?e.columns:[e]),V=S.some(Vs),Y=/* @__PURE__ */new Map;if(D)for(const e of S)if(Vs(e))for(const t of e.columns)Y.set(t,P(e.title,e.label));const G=e=>{const t=P(e.title,e.label),r=Y.get(e);return t&&r?`${r} · ${t}`:t},X=new Set(b?.selected??[]),J=b?t.map((e,t)=>L(e,t)):[],Z=J.length>0&&J.every(e=>X.has(e)),Q=J.some(e=>X.has(e)),ee=b?36:0,te=U.length+(b?1:0),re=U.some(e=>"left"===e.fixed),ne=D&&!b&&U.some(e=>e.cardCorner),ae=f??"a",le=`${Xs[c]} ${"sm"===c?"text-xs":"text-sm"}`,ie=(e,t)=>e.ellipsis?/* @__PURE__ */it("span",{className:"block w-0 min-w-full",children:t}):t,se=(e,t,r,n=0)=>{const l=q(e),i=Js[e.align??(e.numeric?"right":"left")],o="left"===e.fixed,s=!(!e.sortable||!a);/* @__PURE__ */
|
|
584
|
+
return it("th",{scope:"col",...A("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:(de[t]??0)+ee}:{},...x?{top:n}:{}},className:[le,i,$,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-2xs":"text-xs",o?x?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":x?"sticky z-10 bg-gray-50":"",D&&s?"rosh-dt-sort":"",D?Ys(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:ie(e,s?/* @__PURE__ */lt("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=_(e),r=q(e),n=e.sortFirst??"asc";a(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":D?Y.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[
|
|
585
585
|
/* @__PURE__ */it(N,{children:e.title}),
|
|
586
|
-
/* @__PURE__ */it(
|
|
586
|
+
/* @__PURE__ */it(Zs,{direction:l})]}):/* @__PURE__ */it(N,{children:e.title}))},e.key)};let ce=0;const de=U.map(e=>{if("left"!==e.fixed)return null;const t=ce;return ce+=e.width??0,t}),ue=/* @__PURE__ */lt(ot,{children:[
|
|
587
587
|
/* @__PURE__ */lt("div",{onScroll:E,style:x?{maxHeight:x.height}:void 0,className:`relative overflow-x-auto ${x?"overflow-y-auto":""} ${s?"rounded-lg border border-gray-200":""}${D?" rosh-dt-scroll":""}`.trim(),children:[o&&
|
|
588
588
|
/* @__PURE__ */lt("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
589
|
-
/* @__PURE__ */it(
|
|
589
|
+
/* @__PURE__ */it(We,{className:"h-6 w-6"}),
|
|
590
590
|
/* @__PURE__ */it("span",{className:"sr-only",children:M.table.loading})]}),
|
|
591
591
|
/* @__PURE__ */lt("table",{...A("table"),className:(D?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */it("caption",{className:"sr-only",children:i}),
|
|
592
592
|
/* @__PURE__ */lt("thead",{...A("rowgroup"),className:D?"rosh-dt-head":void 0,children:[
|
|
593
|
-
/* @__PURE__ */lt("tr",{ref:W,...A("row"),className:"border-b border-gray-200 bg-gray-50",children:[b&&/* @__PURE__ */it("th",{scope:"col",...A("columnheader"),rowSpan:V?2:void 0,style:{width:36,...x?{top:0}:{}},className:[le,$,re||x?"sticky z-20 bg-gray-50":"",re?"left-0":"",D?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */it(zt,{"aria-label":M.table.selectAll,checked:
|
|
594
|
-
/* @__PURE__ */it("tbody",{...A("rowgroup"),className:D?"rosh-dt-body":void 0,children:0!==t.length||o?/* @__PURE__ */lt(ot,{children:[
|
|
593
|
+
/* @__PURE__ */lt("tr",{ref:W,...A("row"),className:"border-b border-gray-200 bg-gray-50",children:[b&&/* @__PURE__ */it("th",{scope:"col",...A("columnheader"),rowSpan:V?2:void 0,style:{width:36,...x?{top:0}:{}},className:[le,$,re||x?"sticky z-20 bg-gray-50":"",re?"left-0":"",D?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */it(zt,{"aria-label":M.table.selectAll,checked:Z,indeterminate:Q&&!Z,onChange:()=>{if(!b)return;const e=new Set(J);b.onChange(Z?b.selected.filter(t=>!e.has(t)):[...b.selected,...J.filter(e=>!X.has(e))])}})}),S.map((e,t)=>Vs(e)?/* @__PURE__ */it("th",{scope:"colgroup",...A("columnheader"),colSpan:e.columns.length,style:x?{top:0}:void 0,className:[le,"text-center",$,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-2xs":"text-xs","border-b border-gray-200",x?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */it(N,{children:e.title})},e.key??`group-${t}`):se(e,U.indexOf(e),V?2:1))]}),V&&/* @__PURE__ */it("tr",{...A("row"),className:"border-b border-gray-200 bg-gray-50",children:S.flatMap(e=>Vs(e)?e.columns:[]).map(e=>se(e,U.indexOf(e),1,K))})]}),
|
|
594
|
+
/* @__PURE__ */it("tbody",{...A("rowgroup"),className:D?"rosh-dt-body":void 0,children:0!==t.length||o?/* @__PURE__ */lt(ot,{children:[I>0&&/* @__PURE__ */it("tr",{"aria-hidden":"true",children:/* @__PURE__ */it("td",{colSpan:te,style:{height:I,padding:0,border:0}})}),t.slice(O,T).map((e,t)=>{const r=O+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=[Gs,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */it(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */it("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=U.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(o&&!s){const e=U.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=U.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const f=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
595
595
|
return lt("tr",{...Us(n),...A("row"),style:x?{height:x.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:f(n?.onFocus),onBlur:f(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:[D?b?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",D&&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=L(e,r);/* @__PURE__ */
|
|
596
596
|
return it("td",{...A("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,re?"sticky left-0 z-10 bg-white":"",D?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */it(zt,{"aria-label":M.table.selectRow,checked:X.has(t),onChange:()=>(e=>{b&&b.onChange(X.has(e)?b.selected.filter(t=>t!==e):[...b.selected,e])})(t)})})})(),U.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ne&&!!e.cardCorner,l=D&&!a&&"wide"!==e.only;/* @__PURE__ */
|
|
597
|
-
return it("td",{...A("cell"),"data-label":l?G(e):void 0,style:r?{left:(de[t]??0)+ee}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",D?Ys(e):"",le,
|
|
597
|
+
return it("td",{...A("cell"),"data-label":l?G(e):void 0,style:r?{left:(de[t]??0)+ee}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",D?Ys(e):"",le,Js[e.align??(e.numeric?"right":"left")],D?"":Qs(e),"text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:D?
|
|
598
598
|
/* @__PURE__ */it("span",{className:["rosh-dt-value",Qs(e,!0)].filter(Boolean).join(" "),children:n}):n},e.key)})]},L(e,r))}),R>0&&/* @__PURE__ */it("tr",{"aria-hidden":"true",children:/* @__PURE__ */it("td",{colSpan:te,style:{height:R,padding:0,border:0}})})]}):/* @__PURE__ */it("tr",{...A("row"),className:D?"rosh-dt-empty":void 0,children:/* @__PURE__ */it("td",{...A("cell"),colSpan:te,className:`${le} py-10 text-center text-gray-500`,children:C})})})]}),y]}),l&&l.pageCount>1&&/* @__PURE__ */it("div",{className:D?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */it(qs,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
|
|
599
|
-
return it("div",D?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${k}`.trim(),children:/* @__PURE__ */it("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */it("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:ue})})}:{className:`rosh-dt-stack ${k}`.trim(),children:ue}:{className:k,children:ue})}function tc({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=
|
|
599
|
+
return it("div",D?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${k}`.trim(),children:/* @__PURE__ */it("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */it("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:ue})})}:{className:`rosh-dt-stack ${k}`.trim(),children:ue}:{className:k,children:ue})}function tc({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=ze().list,s=n??r,c=r>=s,d=t>0?o.selectedNotShown(e,t):e>0?o.selected(e):"";/* @__PURE__ */
|
|
600
600
|
return lt(ot,{children:[i,d?`${d} — `:"",c?null!=n?o.allLoaded(s,a):o.count(s,a):o.loadedOf(r,s,a),l?/* @__PURE__ */lt(ot,{children:[" · ",
|
|
601
601
|
/* @__PURE__ */lt("span",{className:"inline-flex items-center gap-1",role:"status",children:[
|
|
602
|
-
/* @__PURE__ */it(
|
|
602
|
+
/* @__PURE__ */it(We,{}),o.loadingMore]})]}):""]})}function rc({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=ze().list;/* @__PURE__ */
|
|
603
603
|
return lt("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:[
|
|
604
|
-
/* @__PURE__ */it(
|
|
604
|
+
/* @__PURE__ */it(be,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
|
|
605
605
|
/* @__PURE__ */it("h3",{className:"text-sm font-medium text-gray-900",children:e??a.loadError}),
|
|
606
|
-
/* @__PURE__ */it("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */it("div",{className:"mt-4",children:/* @__PURE__ */it(
|
|
606
|
+
/* @__PURE__ */it("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */it("div",{className:"mt-4",children:/* @__PURE__ */it(_,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function nc({data:e,width:t=120,height:r=32,stroke:n="currentColor",fill:a,strokeWidth:l=1.5,showDots:i=!1,className:o,style:s}){if(0===e.length)return null;const c=Math.max(...e),d=Math.min(...e),u=c-d||1,h=l+(i?2:0),m=e=>r-h-(e-d)/u*(r-2*h),p=1===e.length?[[0,r/2],[t,r/2]]:e.map((r,n)=>[n*t/(e.length-1),m(r)]),f=p.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "),g=`${f} L${t.toFixed(2)},${r} L0,${r} Z`;/* @__PURE__ */
|
|
607
607
|
return lt("svg",{className:o,style:s,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[a&&/* @__PURE__ */it("path",{d:g,fill:a,stroke:"none"}),
|
|
608
|
-
/* @__PURE__ */it("path",{d:f,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */it("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}var ac=8,lc=["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)"],ic={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},oc={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function sc(e){return lc[e]??oc.muted}function cc(e,t,r){return t||(r?ic[r]:sc(e))}function dc(e,t={},r=8){const n={},a=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set;for(const r of e){const e=t[r];void 0===e||a.has(e)||(n[r]=e,a.add(e)),l.add(r)}const i=0===Object.keys(t).length;for(const l of e){if(void 0!==n[l])continue;if(!i&&l in t)continue;const e=Array.from({length:r},(e,t)=>t).find(e=>!a.has(e));if(void 0===e)break;n[l]=e,a.add(e)}return n}function uc(e,t,r=8){if(void 0!==e[t]){const{[t]:r,...n}=e;return n}const n=new Set(Object.values(e)),a=Array.from({length:r},(e,t)=>t).find(e=>!n.has(e));return void 0===a?e:{...e,[t]:a}}function hc(e,t,r,n){return r||n?cc(e,r,n):e<t?sc(e):oc.muted}function mc(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 pc(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 fc(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 gc(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 bc(e,t,{intervals:r=5,integer:n=!1,zero:a=!0}={}){const l=a?Math.min(0,e):e,i=a?Math.max(0,t):Math.max(e,t);if(!Number.isFinite(l)||!Number.isFinite(i)||i-l<=0){const e=Number.isFinite(l)&&!a?l:0;return{lo:e,hi:e+1,ticks:[e,e+1]}}const o=Math.max(1,Math.floor(r));let s=10**Math.floor(Math.log10((i-l)/o));for(;;){for(const e of[1,2,2.5,5]){const t=e*s;if(n&&!Number.isInteger(t))continue;const r=Math.floor(l/t)*t,a=Math.ceil(i/t)*t,c=Math.round((a-r)/t);if(c<=o){const e=Array.from({length:c+1},(e,n)=>Number((r+n*t).toPrecision(12)));return{lo:e[0],hi:e[c],ticks:e}}}s*=10}}function yc(e,t,{intervals:r=5,integerLeft:n=!1,integerRight:a=!1}={}){const l=e=>Math.min(0,e),i=e=>Math.max(0,e),o=([e,t],r,n,a)=>{if(l(e)<0&&0===r)return null;if(i(t)>0&&0===n)return null;const o=function(e,t){if(!(e>0))return 1;let r=10**Math.floor(Math.log10(e));for(;;){for(const n of[1,2,2.5,5]){const a=n*r;if((!t||Number.isInteger(a))&&a>=e*(1-1e-9))return a}r*=10}}(Math.max(r?-l(e)/r:0,n?i(t)/n:0),a),s=o*(r+n),c=i(t)-l(e);return{step:o,waste:c>0?(s-c)/s:1}};let s=null;const c=Math.max(2,Math.floor(r));for(let r=2;r<=c;r++)for(let l=0;l<=r;l++){const i=o(e,l,r-l,n),d=o(t,l,r-l,a);if(!i||!d)continue;const u=i.waste+d.waste+.02*(c-r);(!s||u<s.score-1e-9)&&(s={n:r,k:l,l:i.step,r:d.step,score:u})}const{n:d,k:u,l:h,r:m}=s??{n:1,k:0,l:1,r:1},p=e=>{const t=Array.from({length:d+1},(t,r)=>Number(((r-u)*e).toPrecision(12)));return{lo:t[0],hi:t[d],ticks:t}};return{left:p(h),right:p(m)}}function xc(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 vc(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 wc(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 Nc(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}function kc(e,t,{fontSize:r=11,gap:n=8}={}){const a=e.reduce((e,t)=>Math.max(e,t.length),0);return Math.max(t,Math.ceil(.62*a*r+n+2))}function $c(e,t=720){const[r,n]=qe(t);return Ge(()=>{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 Mc(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,overlay:h,tooltip:m,onSelect:p,ariaLabel:f,className:g,emptyLabel:b}){const y=
|
|
609
|
-
return it("div",{className:g,ref:N,children:/* @__PURE__ */it("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:w})});const D=t.filter(Number.isFinite),S=D.every(Number.isInteger),A=void 0===l&&void 0===i?bc(Math.min(0,...D),Math.max(0,...D),{intervals:o+1,integer:S}):null,
|
|
608
|
+
/* @__PURE__ */it("path",{d:f,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */it("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}var ac=8,lc=["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)"],ic={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},oc={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function sc(e){return lc[e]??oc.muted}function cc(e,t,r){return t||(r?ic[r]:sc(e))}function dc(e,t={},r=8){const n={},a=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set;for(const r of e){const e=t[r];void 0===e||a.has(e)||(n[r]=e,a.add(e)),l.add(r)}const i=0===Object.keys(t).length;for(const l of e){if(void 0!==n[l])continue;if(!i&&l in t)continue;const e=Array.from({length:r},(e,t)=>t).find(e=>!a.has(e));if(void 0===e)break;n[l]=e,a.add(e)}return n}function uc(e,t,r=8){if(void 0!==e[t]){const{[t]:r,...n}=e;return n}const n=new Set(Object.values(e)),a=Array.from({length:r},(e,t)=>t).find(e=>!n.has(e));return void 0===a?e:{...e,[t]:a}}function hc(e,t,r,n){return r||n?cc(e,r,n):e<t?sc(e):oc.muted}function mc(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 pc(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 fc(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 gc(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 bc(e,t,{intervals:r=5,integer:n=!1,zero:a=!0}={}){const l=a?Math.min(0,e):e,i=a?Math.max(0,t):Math.max(e,t);if(!Number.isFinite(l)||!Number.isFinite(i)||i-l<=0){const e=Number.isFinite(l)&&!a?l:0;return{lo:e,hi:e+1,ticks:[e,e+1]}}const o=Math.max(1,Math.floor(r));let s=10**Math.floor(Math.log10((i-l)/o));for(;;){for(const e of[1,2,2.5,5]){const t=e*s;if(n&&!Number.isInteger(t))continue;const r=Math.floor(l/t)*t,a=Math.ceil(i/t)*t,c=Math.round((a-r)/t);if(c<=o){const e=Array.from({length:c+1},(e,n)=>Number((r+n*t).toPrecision(12)));return{lo:e[0],hi:e[c],ticks:e}}}s*=10}}function yc(e,t,{intervals:r=5,integerLeft:n=!1,integerRight:a=!1}={}){const l=e=>Math.min(0,e),i=e=>Math.max(0,e),o=([e,t],r,n,a)=>{if(l(e)<0&&0===r)return null;if(i(t)>0&&0===n)return null;const o=function(e,t){if(!(e>0))return 1;let r=10**Math.floor(Math.log10(e));for(;;){for(const n of[1,2,2.5,5]){const a=n*r;if((!t||Number.isInteger(a))&&a>=e*(1-1e-9))return a}r*=10}}(Math.max(r?-l(e)/r:0,n?i(t)/n:0),a),s=o*(r+n),c=i(t)-l(e);return{step:o,waste:c>0?(s-c)/s:1}};let s=null;const c=Math.max(2,Math.floor(r));for(let r=2;r<=c;r++)for(let l=0;l<=r;l++){const i=o(e,l,r-l,n),d=o(t,l,r-l,a);if(!i||!d)continue;const u=i.waste+d.waste+.02*(c-r);(!s||u<s.score-1e-9)&&(s={n:r,k:l,l:i.step,r:d.step,score:u})}const{n:d,k:u,l:h,r:m}=s??{n:1,k:0,l:1,r:1},p=e=>{const t=Array.from({length:d+1},(t,r)=>Number(((r-u)*e).toPrecision(12)));return{lo:t[0],hi:t[d],ticks:t}};return{left:p(h),right:p(m)}}function xc(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 vc(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 wc(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 Nc(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}function kc(e,t,{fontSize:r=11,gap:n=8}={}){const a=e.reduce((e,t)=>Math.max(e,t.length),0);return Math.max(t,Math.ceil(.62*a*r+n+2))}function $c(e,t=720){const[r,n]=qe(t);return Ge(()=>{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 Mc(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,overlay:h,tooltip:m,onSelect:p,ariaLabel:f,className:g,emptyLabel:b}){const y=ze().charts,x=Fe(),v=s??(e=>Te(e,x)),w=b??y.noData,N=Ue(null),k=$c(N),$=n??k,[M,C]=qe(null),L=_e();if(Ge(()=>{if(null!==M)return he(e=>"Escape"===e.key&&(C(null),!0))},[M]),0===e.length||!t.some(Number.isFinite))/* @__PURE__ */
|
|
609
|
+
return it("div",{className:g,ref:N,children:/* @__PURE__ */it("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:w})});const D=t.filter(Number.isFinite),S=D.every(Number.isInteger),A=void 0===l&&void 0===i?bc(Math.min(0,...D),Math.max(0,...D),{intervals:o+1,integer:S}):null,P=void 0!==l&&void 0===i?bc(l,Math.max(l,...D),{intervals:o+1,integer:S,zero:!1}):null,j=A?A.lo:l??Math.min(0,...D),z=A?A.hi:P?P.hi:i??gc(Math.max(...D,0)),F=A?A.ticks:P?[j,...P.ticks.filter(e=>e>j)]:mc([j,z],{from:0,to:1}).ticks(o+1),E={top:12,right:16,bottom:26,left:kc(F.map(v),48)+(c?10:0)},B=E.left,O=Math.max(B+1,$-E.right),T=E.top,I=r-E.bottom,R=mc([j,z],{from:I,to:T}),W=pc(e.length,{from:B,to:O},a),K=(O-B)/Math.max(1,e.length),H=K>=48,_=H?1:Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor($/84)))),q=Math.max(2,Math.floor((K-6)/6.6)),U=e=>H&&e.length>q?`${e.slice(0,q-1).trimEnd()}…`:e;/* @__PURE__ */
|
|
610
610
|
return lt("div",{className:`relative ${g??""}`,ref:N,children:[
|
|
611
611
|
/* @__PURE__ */lt("svg",{width:"100%",height:r,viewBox:`0 0 ${$} ${r}`,role:"img","aria-label":f,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>C(null),onBlur:()=>C(null),onKeyDown:t=>{if(p&&null!==M&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void p(M);if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;C(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
|
|
612
|
-
/* @__PURE__ */it("defs",{children:/* @__PURE__ */it("clipPath",{id:L,children:/* @__PURE__ */it("rect",{x:B,y:T,width:
|
|
613
|
-
/* @__PURE__ */it("line",{x1:B,y1:R(Math.max(
|
|
614
|
-
/* @__PURE__ */it("g",{clipPath:`url(#${L})`,children:u({x:W,y:R,left:B,right:
|
|
615
|
-
/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 z-10",style:Mc(W.center(M),W.bandwidth,$),children:m(M)})]})}function Lc({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=
|
|
612
|
+
/* @__PURE__ */it("defs",{children:/* @__PURE__ */it("clipPath",{id:L,children:/* @__PURE__ */it("rect",{x:B,y:T,width:O-B,height:I-T})})}),F.map(e=>/* @__PURE__ */it("line",{x1:B,y1:R(e),x2:O,y2:R(e),stroke:oc.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
613
|
+
/* @__PURE__ */it("line",{x1:B,y1:R(Math.max(j,0)),x2:O,y2:R(Math.max(j,0)),stroke:oc.axis,strokeWidth:1,shapeRendering:"crispEdges"}),F.map(e=>/* @__PURE__ */it("text",{x:B-8,y:R(e)+4,textAnchor:"end",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:v(e)},`t${e}`)),c&&/* @__PURE__ */it("text",{x:14,y:(T+I)/2,transform:`rotate(-90 14 ${(T+I)/2})`,textAnchor:"middle",fontSize:11,fill:oc.label,children:c}),
|
|
614
|
+
/* @__PURE__ */it("g",{clipPath:`url(#${L})`,children:u({x:W,y:R,left:B,right:O,top:T,bottom:I,width:$,height:r,clipId:L,active:M})}),h?.({x:W,y:R,left:B,right:O,top:T,bottom:I,width:$,height:r,clipId:L,active:M}),e.map((e,t)=>t%_===0?/* @__PURE__ */it("text",{x:"start"===d?W(t):W.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:U(e)},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */it("rect",{x:W.center(r)-(O-B)/e.length/2,y:T,width:(O-B)/e.length,height:I-T,fill:"transparent",onMouseEnter:()=>C(r),onClick:p?()=>p(r):void 0,style:p?{cursor:"pointer"}:void 0},`h${r}`))]}),m&&null!==M&&
|
|
615
|
+
/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 z-10",style:Mc(W.center(M),W.bandwidth,$),children:m(M)})]})}function Lc({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=ze().charts,o=a??i.loading,s=`${_e()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
|
|
616
616
|
return it("div",{className:l,children:/* @__PURE__ */lt("svg",{width:"100%",height:e,viewBox:`0 0 ${t} ${e}`,role:"img","aria-label":o,"aria-busy":"true",children:[
|
|
617
617
|
/* @__PURE__ */it("defs",{children:/* @__PURE__ */lt("linearGradient",{id:s,x1:"0",y1:"0",x2:"1",y2:"0",children:[
|
|
618
618
|
/* @__PURE__ */it("stop",{offset:"0%",stopColor:oc.surface,stopOpacity:"0"}),
|
|
@@ -622,39 +622,39 @@ return it("div",{className:l,children:/* @__PURE__ */lt("svg",{width:"100%",heig
|
|
|
622
622
|
return it("line",{x1:c,y1:r,x2:d,y2:r,stroke:oc.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */it("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:oc.grid},`t${t}`)),"bars"===r?Array.from({length:n},(e,t)=>{const r=(d-c)/n,a=.35+.4*Math.abs(Math.sin(1.1*(t+1))),l=(h-u)*a;/* @__PURE__ */
|
|
623
623
|
return it("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:oc.grid},t)}):/* @__PURE__ */it("path",{d:`M48,${h} C${c+.25*(d-c)},${u+.35*(h-u)} ${c+.55*(d-c)},${u+.15*(h-u)} ${d},${u+.55*(h-u)} L${d},${h} Z`,fill:oc.grid}),
|
|
624
624
|
/* @__PURE__ */it("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${s})`})]})})}var Dc=Xe({highlighted:null,setHighlighted:()=>{}});function Sc({children:e}){const[t,r]=qe(null),n=Ve(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
|
|
625
|
-
return it(Dc.Provider,{value:n,children:e})}function Ac(){return tt(Dc)}function
|
|
625
|
+
return it(Dc.Provider,{value:n,children:e})}function Ac(){return tt(Dc)}function Pc(e,t,r=.22){return null===t?null:t===e?1:r}function jc(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 zc({variant:e="solid",title:t,rows:r,footnote:n,emphasisKey:a,className:l}){const i="glass"===e;/* @__PURE__ */
|
|
626
626
|
return lt("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${i?"":"bg-white ring-1 ring-black/5"} ${l??""}`,style:i?le():{boxShadow:"var(--elevation-popup)"},children:[t&&/* @__PURE__ */it("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
|
|
627
627
|
/* @__PURE__ */it("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:r.map(e=>/* @__PURE__ */lt("li",{className:"flex items-center gap-3",style:a&&e.key!==a?{opacity:.45}:void 0,children:[
|
|
628
628
|
/* @__PURE__ */it("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??oc.muted}}),
|
|
629
629
|
/* @__PURE__ */it("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
|
|
630
|
-
/* @__PURE__ */it("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */it("p",{className:"mt-2 text-2xs text-gray-500",children:n})]})}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:f=!1,activeKey:g,highlight:b="none",valueLabels:y=!1,onSelect:x,min:v,formatTooltipValue:w,tooltipLabels:N,barGap:k=4,seriesLabels:$=!1}){const M=
|
|
630
|
+
/* @__PURE__ */it("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */it("p",{className:"mt-2 text-2xs text-gray-500",children:n})]})}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:f=!1,activeKey:g,highlight:b="none",valueLabels:y=!1,onSelect:x,min:v,formatTooltipValue:w,tooltipLabels:N,barGap:k=4,seriesLabels:$=!1}){const M=_e(),{highlighted:C}=Ac(),L=ze().charts,D=Fe(),S=o??(e=>Te(e,D)),A=w??S;if(h)/* @__PURE__ */return it(Lc,{height:a,width:l,variant:"bars",className:c});const P=(e,t)=>{const r=e.pointColors?.[t];if(r)return r;const n=e.pointTones?.[t];return n?ic[n]:cc(e.slot,e.color,e.tone)},j=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),z=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},F=t.map((e,t)=>j.reduce((e,r)=>e+z(r,t),0)),E=t.map((e,t)=>j.reduce((e,r)=>e+Math.max(0,z(r,t)),0)),B=t.map((e,t)=>j.reduce((e,r)=>e+Math.min(0,z(r,t)),0)),O=r&&"percent"===n,T=(e,t)=>F[t]>0?e/F[t]:null,I=O?[1]:r?[...E,...B]:j.flatMap(e=>e.data.filter(Number.isFinite)),R=(e,t)=>{const r=e.bandwidth/Math.max(1,j.length),n=j.length>1?Math.min(k,.25*r):0;return{offset:t*r+n/2,width:Math.max(1,r-n)}},W=$&&!r?({x:e,y:r})=>{const n=Math.min(r.domain[1],Math.max(r.domain[0],0));return t.map((t,a)=>j.map((t,l)=>{const i=t.data[a];if(!Number.isFinite(i))return null;const o=Math.min(r.domain[1],Math.max(r.domain[0],i)),{offset:s,width:c}=R(e,l),d=e(a)+s+c/2,u=Math.min(r(o),r(n)),h=Math.max(r(o),r(n));if(c<13)return null;const m=Math.floor((h-u-12)/6.6),p=m>=Math.min(4,t.label.length),f=p&&t.label.length>m?`${t.label.slice(0,m-1).trimEnd()}…`:t.label,g=p?h-6:u-4;/* @__PURE__ */
|
|
631
631
|
return it("text",{"data-series-label":"true",x:d,y:g,transform:`rotate(-90 ${d} ${g})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:p?oc.surface:oc.label,children:f},`n${t.key}-${a}`)}))}:null;/* @__PURE__ */
|
|
632
|
-
return it(Cc,{labels:t,values:
|
|
633
|
-
return it("text",{"data-value-label":"true",x:e.center(a),y:t>=0?n(r)-4:n(r)+12,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:S(t)},`v${a}`)}return
|
|
634
|
-
return it("text",{"data-value-label":"true",x:e(a)+o+s/2,y:i>=0?n(i)-4:n(i)+12,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:S(i)},`v${t.key}-${a}`)})})]}):void 0,children:({x:e,y:n,bottom:a,active:l})=>{const i=g?t.indexOf(g):-1,o=
|
|
632
|
+
return it(Cc,{labels:t,values:I,height:a,width:l,max:O?1:i,min:O?void 0:v,formatValue:O?e=>Re(Math.round(100*e),0,D):S,yAxisLabel:s,className:c,emptyLabel:d,onSelect:x,ariaLabel:L.acrossCategories(j.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */it(zc,{title:N?.[e]??t[e],rows:j.map(t=>({key:t.key,label:t.label,color:P(t,e),value:Number.isFinite(t.data[e])?O?`${Re(100*(T(t.data[e],e)??0),1,D)} · ${A(t.data[e])}`:A(t.data[e]):void 0})),footnote:O?L.inCategory(A(F[e])):void 0}),overlay:y&&!O||W?({x:e,y:n})=>/* @__PURE__ */lt("g",{pointerEvents:"none",children:[W?.({x:e,y:n}),y&&!O&&t.map((t,a)=>{if(r){if(!j.some(e=>Number.isFinite(e.data[a])))return null;const t=j.reduce((e,t)=>e+z(t,a),0),r=t>=0?E[a]:B[a];/* @__PURE__ */
|
|
633
|
+
return it("text",{"data-value-label":"true",x:e.center(a),y:t>=0?n(r)-4:n(r)+12,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:S(t)},`v${a}`)}return j.map((t,r)=>{const l=t.data[a];if(!Number.isFinite(l))return null;const i=l,{offset:o,width:s}=R(e,r);/* @__PURE__ */
|
|
634
|
+
return it("text",{"data-value-label":"true",x:e(a)+o+s/2,y:i>=0?n(i)-4:n(i)+12,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:S(i)},`v${t.key}-${a}`)})})]}):void 0,children:({x:e,y:n,bottom:a,active:l})=>{const i=g?t.indexOf(g):-1,o=jc(r?F:j[0]?.data??[],b),s=l??(i>=0?i:o);/* @__PURE__ */
|
|
635
635
|
return lt("g",{children:[
|
|
636
|
-
/* @__PURE__ */it(
|
|
637
|
-
return it("rect",{x:y,y:v,width:x,height:k,rx:u,fill:L,fillOpacity:D??($?1:f?.32:.45),filter:p&&s===a?`url(#${
|
|
636
|
+
/* @__PURE__ */it(Ji,{id:M,glow:p}),t.map((t,a)=>{let l=0,i=0;const o=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return j.map((t,c)=>{const d=t.data[a];if(!Number.isFinite(d))return null;const h=O?T(d,a):d;if(null===h)return null;const g=P(t,a),b=R(e,c),y=r?e(a):e(a)+b.offset,x=r?Math.max(1,e.bandwidth):b.width;let v,w,N=!0;if(r){const e=h>=0?l:i,t=e+h;h>=0?l=t:i=t,v=n(Math.max(e,t)),w=n(Math.min(e,t)),N=0===e}else v=Math.min(n(h),o),w=Math.max(n(h),o);const k=Math.max(0,w-v-(r&&!N?2:0)),$=null===s||s===a,L=$?g:f?oc.muted:g,D=Pc(t.key,C);/* @__PURE__ */
|
|
637
|
+
return it("rect",{x:y,y:v,width:x,height:k,rx:u,fill:L,fillOpacity:D??($?1:f?.32:.45),filter:p&&s===a?`url(#${_i(M)})`:void 0,className:"rosh-viz-mark"+(m?` ${Qi.rise}`:""),style:m?eo(a*(r?1:j.length)+c,26):void 0},`${t.key}-${a}`)})}),null!==l&&!f&&/* @__PURE__ */it("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:oc.axis,strokeWidth:1})]})}})}var Ec=e=>e.toFixed(2);function Bc(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Ec(e)},${Ec(t)}`).join(" ")}function Oc(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Ec(e.start)},${Ec(e.y)}`,t+=` L${Ec(e.end)},${Ec(e.y)}`}),t}function Tc(e){if(e.length<3)return Bc(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${Ec(e[0][0])},${Ec(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${Ec(e[n][0]+t)},${Ec(e[n][1]+a[n]*t)} ${Ec(e[n+1][0]-t)},${Ec(e[n+1][1]-a[n+1]*t)} ${Ec(e[n+1][0])},${Ec(e[n+1][1])}`}return l}function Ic(e,t=0){if(e.length<3)return Bc(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${Ec(e[0][0])},${Ec(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${Ec(c)},${Ec(d)} ${Ec(u)},${Ec(h)} ${Ec(a[0])},${Ec(a[1])}`}return o}function Rc(e){if(e.length<2)return Bc(e);let t=`M${Ec(e[0][0])},${Ec(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${Ec(o)},${Ec(a)} ${Ec(o)},${Ec(i)} ${Ec(l)},${Ec(i)}`}return t}function Wc(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Ec(e[0][0])},${Ec(e[0][1])}`:"monotone"===t?Tc(e):"spline"===t?Ic(e,r):"bump"===t?Rc(e):Bc(e)}function Kc(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${Ec(a[0])},${Ec(r)} L${Ec(n[0])},${Ec(r)} Z`}function Hc(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Ec(e)},${Ec(t)}`).join(" L")} Z`}function _c(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 qc(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${qc(e,t,r,n,a,l)} ${qc(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${Ec(e)},${Ec(t)} L${Ec(c)},${Ec(d)} A${Ec(n)},${Ec(n)} 0 ${o} 1 ${Ec(u)},${Ec(h)} Z`;const[m,p]=s(r,l),[f,g]=s(r,a);return`M${Ec(c)},${Ec(d)} A${Ec(n)},${Ec(n)} 0 ${o} 1 ${Ec(u)},${Ec(h)} L${Ec(m)},${Ec(p)} A${Ec(r)},${Ec(r)} 0 ${o} 0 ${Ec(f)},${Ec(g)} Z`}function Uc({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=ze().charts,f=Fe(),g=o??(e=>Te(e,f)),b=i??p.other,y=m??p.nothingToBreakDown,x=_e(),[v,w]=qe(null),{highlighted:N}=Ac(),k=Ue(null),$=$c(k,Number.POSITIVE_INFINITY),M=e.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===M.length)/* @__PURE__ */return it("p",{className:`text-sm text-gray-500 ${h??""}`,children:y});const C=[...M].sort((e,t)=>t.value-e.value),L=C.slice(0,l),D=C.slice(l),S=D.length>0?[...L,{key:"__other__",label:b,value:D.reduce((e,t)=>e+t.value,0),slot:-1,color:oc.muted}]:L,A=e=>cc(e.slot,e.color,e.tone),P=S.reduce((e,t)=>e+t.value,0),j=Math.ceil(.62*Math.max(...S.map(e=>String(e.label).length),4)*11)+24,z="outside"===d&&$>=120+2*j,F=z?j:0,E=z?Math.max(120,Math.min(r,$-2*F)):r,B=E+2*F,O=F+E/2,T=E/2,I=E/2-12,R=n??("ring"===t?.58*I:0),W=vc(S.length,a),K=Math.max(...S.map(e=>e.value)),H=e=>R+(I-R)*Math.sqrt(Math.max(0,e)/K);let _=-Math.PI/2;const q=(()=>{if(!z)return[];let e=-Math.PI/2;const r=S.map((r,n)=>{const l="rose"===t?vc(S.length,a).step:r.value/P*Math.PI*2,i="rose"===t?vc(S.length,a).center(n):e+l/2;e+=l;const o="rose"===t?H(r.value):I;return{key:r.key,label:r.label,share:r.value/P,right:Math.cos(i)>=0,anchor:[O+o*Math.cos(i),T+o*Math.sin(i)],y:T+(o+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u),n=Math.max(1,Math.floor((E-11-13)/26)+1),l=/* @__PURE__ */new Set;for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,n).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<26&&(t[e].y=t[e-1].y+26);for(let e=t.length-1;e>=0;e-=1){const r=e===t.length-1?E-13:t[e+1].y-26;t[e].y=Math.min(t[e].y,r)}t.forEach((e,r)=>{e.y=Math.max(e.y,0===r?11:t[r-1].y+26),l.add(e.key)})}return r.filter(e=>l.has(e.key))})(),U=(e,t)=>null!==v?v!==e:null!==N&&N!==t,V=null!==v?S[v]:void 0;/* @__PURE__ */
|
|
638
638
|
return lt("div",{className:`relative ${h??""}`,ref:k,children:[
|
|
639
639
|
/* @__PURE__ */lt("svg",{width:"100%",height:E,viewBox:`0 0 ${B} ${E}`,role:"img","aria-labelledby":x,onMouseLeave:()=>w(null),children:[
|
|
640
|
-
/* @__PURE__ */it("title",{id:x,children:p.breakdown(g(
|
|
641
|
-
return it("path",{d:qc(
|
|
640
|
+
/* @__PURE__ */it("title",{id:x,children:p.breakdown(g(P),S.length)}),S.map((e,r)=>{const n=A(e),l="rose"===t?W(r):_,i="rose"===t?W.step:e.value/P*Math.PI*2-a;"rose"!==t&&(_+=e.value/P*Math.PI*2);const o=l+Math.max(.001,i),s="rose"===t?H(e.value):I;/* @__PURE__ */
|
|
641
|
+
return it("path",{d:qc(O,T,R,s,l,o),fill:n,fillOpacity:U(r,e.key)?.4:1,stroke:oc.surface,strokeWidth:1,className:c?Qi.sweep:void 0,style:c?eo(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),q.map(e=>{const t=e.right?B-6:6,r=e.right?O+I+14:O-I-14;/* @__PURE__ */
|
|
642
642
|
return lt("g",{children:[
|
|
643
643
|
/* @__PURE__ */it("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${r},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:oc.grid,strokeWidth:1}),
|
|
644
644
|
/* @__PURE__ */it("text",{x:t,y:e.y-2,fontSize:11,fill:oc.label,textAnchor:e.right?"end":"start",children:e.label}),
|
|
645
|
-
/* @__PURE__ */it("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:oc.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:
|
|
645
|
+
/* @__PURE__ */it("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:oc.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:Re(100*e.share,1,f)})]},`lbl-${e.key}`)}),s&&R>0&&/* @__PURE__ */it("text",{x:O,y:T+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:oc.label,children:s})]}),V&&null!==v&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:V.label,rows:[{key:"value",label:p.value,color:A(V),value:g(V.value)},{key:"share",label:p.share,color:oc.muted,value:Re(V.value/P*100,1,f)}]})}),
|
|
646
646
|
/* @__PURE__ */it("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:S.map((e,t)=>/* @__PURE__ */lt("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
647
647
|
/* @__PURE__ */it("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:A(e)}}),
|
|
648
648
|
/* @__PURE__ */it("span",{className:"flex-1 truncate",children:e.label}),
|
|
649
|
-
/* @__PURE__ */it("span",{className:"tabular-nums text-gray-800",children:
|
|
649
|
+
/* @__PURE__ */it("span",{className:"tabular-nums text-gray-800",children:Re(e.value/P*100,1,f)})]},e.key))})]})}var Vc={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},Yc=[12,18,14,22,19,27,24,31,28,35,30,38],Gc=["J","F","M","A","M","J","J","A","S","O","N","D"],Xc=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],Jc=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function Zc(){/* @__PURE__ */
|
|
650
650
|
return it(M,{groups:Vc,children:/* @__PURE__ */it("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */lt("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
651
651
|
/* @__PURE__ */lt("div",{className:"flex items-center justify-between gap-4",children:[
|
|
652
652
|
/* @__PURE__ */lt("div",{children:[
|
|
653
653
|
/* @__PURE__ */it("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
|
|
654
654
|
/* @__PURE__ */it("p",{className:"text-sm text-gray-500",children:"Overview of your store this month"})]}),
|
|
655
655
|
/* @__PURE__ */lt("div",{className:"flex items-center gap-2",children:[
|
|
656
|
-
/* @__PURE__ */it(
|
|
657
|
-
/* @__PURE__ */it(
|
|
656
|
+
/* @__PURE__ */it(_,{variant:"secondary",size:"sm",children:"Export"}),
|
|
657
|
+
/* @__PURE__ */it(_,{size:"sm",children:"New report"})]})]}),
|
|
658
658
|
/* @__PURE__ */lt("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
|
|
659
659
|
/* @__PURE__ */it(pl,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
|
|
660
660
|
/* @__PURE__ */it(pl,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
|
|
@@ -669,7 +669,7 @@ return it(M,{groups:Vc,children:/* @__PURE__ */it("div",{className:"h-full overf
|
|
|
669
669
|
/* @__PURE__ */it("th",{className:`${$} px-4 py-2 font-medium`,children:"Customer"}),
|
|
670
670
|
/* @__PURE__ */it("th",{className:`${$} px-4 py-2 font-medium`,children:"Total"}),
|
|
671
671
|
/* @__PURE__ */it("th",{className:`${$} px-4 py-2 font-medium`,children:"Status"})]})}),
|
|
672
|
-
/* @__PURE__ */it("tbody",{className:"divide-y divide-gray-100",children:
|
|
672
|
+
/* @__PURE__ */it("tbody",{className:"divide-y divide-gray-100",children:Jc.map(e=>/* @__PURE__ */lt("tr",{className:"text-gray-700",children:[
|
|
673
673
|
/* @__PURE__ */it("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:e.id}),
|
|
674
674
|
/* @__PURE__ */it("td",{className:"px-4 py-2",children:/* @__PURE__ */lt("span",{className:"flex items-center gap-2",children:[
|
|
675
675
|
/* @__PURE__ */it(hi,{size:"xs",name:e.customer}),e.customer]})}),
|
|
@@ -680,12 +680,12 @@ return it(M,{groups:Vc,children:/* @__PURE__ */it("div",{className:"h-full overf
|
|
|
680
680
|
return it(M,{groups:Qc,children:/* @__PURE__ */it("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */lt("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
681
681
|
/* @__PURE__ */lt("div",{className:"flex items-center justify-between gap-4",children:[
|
|
682
682
|
/* @__PURE__ */it("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
|
|
683
|
-
/* @__PURE__ */it(
|
|
683
|
+
/* @__PURE__ */it(_,{size:"sm",children:"Invite member"})]}),
|
|
684
684
|
/* @__PURE__ */lt(ml,{padded:!1,children:[
|
|
685
685
|
/* @__PURE__ */lt("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
|
|
686
686
|
/* @__PURE__ */it("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */it(gt,{value:a,onChange:e=>l(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */it(rd,{})})}),
|
|
687
|
-
/* @__PURE__ */it("div",{className:"w-40",children:/* @__PURE__ */it(
|
|
688
|
-
/* @__PURE__ */it(
|
|
687
|
+
/* @__PURE__ */it("div",{className:"w-40",children:/* @__PURE__ */it(Pt,{value:r,onChange:n,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
|
|
688
|
+
/* @__PURE__ */it(_,{variant:"secondary",size:"sm",children:"Filter"})]}),
|
|
689
689
|
/* @__PURE__ */lt("table",{className:"w-full text-sm",children:[
|
|
690
690
|
/* @__PURE__ */it("thead",{children:/* @__PURE__ */lt("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
|
|
691
691
|
/* @__PURE__ */it("th",{className:`${$} px-4 py-2 font-medium`,children:"Name"}),
|
|
@@ -698,11 +698,11 @@ return it(M,{groups:Qc,children:/* @__PURE__ */it("div",{className:"h-full overf
|
|
|
698
698
|
/* @__PURE__ */it("div",{className:"text-xs text-gray-400",children:e.email})]}),
|
|
699
699
|
/* @__PURE__ */it("td",{className:"px-4 py-3",children:e.role}),
|
|
700
700
|
/* @__PURE__ */it("td",{className:"px-4 py-3",children:/* @__PURE__ */it(C,{status:e.status})}),
|
|
701
|
-
/* @__PURE__ */it("td",{className:"px-4 py-3 text-right",children:/* @__PURE__ */it(
|
|
701
|
+
/* @__PURE__ */it("td",{className:"px-4 py-3 text-right",children:/* @__PURE__ */it(_,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
|
|
702
702
|
/* @__PURE__ */lt("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
|
|
703
703
|
/* @__PURE__ */it("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
|
|
704
704
|
/* @__PURE__ */it(qs,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function rd(){/* @__PURE__ */
|
|
705
|
-
return it(
|
|
705
|
+
return it(be,{name:"search",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}function nd(){const[e,t]=qe("pro"),[r,n]=qe(!0),[a,l]=qe("us");/* @__PURE__ */
|
|
706
706
|
return it("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */lt("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
|
|
707
707
|
/* @__PURE__ */lt("div",{children:[
|
|
708
708
|
/* @__PURE__ */it("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
@@ -715,15 +715,15 @@ return it("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
|
|
|
715
715
|
/* @__PURE__ */it(Bt,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */it(s,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
|
|
716
716
|
/* @__PURE__ */it(ml,{header:"Preferences",children:/* @__PURE__ */lt("div",{className:"space-y-4",children:[
|
|
717
717
|
/* @__PURE__ */lt("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
718
|
-
/* @__PURE__ */it(Bt,{label:"Country",htmlFor:"country",children:/* @__PURE__ */it(
|
|
718
|
+
/* @__PURE__ */it(Bt,{label:"Country",htmlFor:"country",children:/* @__PURE__ */it(Pt,{value:a,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
|
|
719
719
|
/* @__PURE__ */it(Bt,{label:"Plan",children:/* @__PURE__ */lt("div",{className:"space-y-2 pt-1",children:[
|
|
720
720
|
/* @__PURE__ */it(Et,{name:"plan",checked:"free"===e,onChange:()=>t("free"),label:"Free"}),
|
|
721
721
|
/* @__PURE__ */it(Et,{name:"plan",checked:"pro"===e,onChange:()=>t("pro"),label:"Pro"}),
|
|
722
722
|
/* @__PURE__ */it(Et,{name:"plan",checked:"team"===e,onChange:()=>t("team"),label:"Team"})]})})]}),
|
|
723
723
|
/* @__PURE__ */it(zt,{checked:r,onChange:n,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
|
|
724
724
|
/* @__PURE__ */lt("div",{className:"flex items-center justify-end gap-2",children:[
|
|
725
|
-
/* @__PURE__ */it(
|
|
726
|
-
/* @__PURE__ */it(
|
|
725
|
+
/* @__PURE__ */it(_,{variant:"secondary",children:"Cancel"}),
|
|
726
|
+
/* @__PURE__ */it(_,{type:"submit",children:"Save changes"})]})]})})}var ad=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function ld(){const[e,t]=qe(!0),[r,n]=qe("us"),a=ad.reduce((e,t)=>e+t.qty*t.price,0),l=a+9;/* @__PURE__ */
|
|
727
727
|
return it("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */lt("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
728
728
|
/* @__PURE__ */it("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
729
729
|
/* @__PURE__ */lt("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
@@ -737,7 +737,7 @@ return it("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
|
|
|
737
737
|
/* @__PURE__ */lt("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[
|
|
738
738
|
/* @__PURE__ */it(Bt,{label:"City",children:/* @__PURE__ */it(gt,{placeholder:"San Francisco"})}),
|
|
739
739
|
/* @__PURE__ */it(Bt,{label:"ZIP",children:/* @__PURE__ */it(gt,{placeholder:"94103"})}),
|
|
740
|
-
/* @__PURE__ */it(Bt,{label:"Country",children:/* @__PURE__ */it(
|
|
740
|
+
/* @__PURE__ */it(Bt,{label:"Country",children:/* @__PURE__ */it(Pt,{value:r,onChange:n,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
|
|
741
741
|
/* @__PURE__ */it(zt,{checked:e,onChange:t,label:"Billing address same as shipping"})]})}),
|
|
742
742
|
/* @__PURE__ */it(ml,{header:"Payment",children:/* @__PURE__ */lt("div",{className:"space-y-4",children:[
|
|
743
743
|
/* @__PURE__ */it(Bt,{label:"Card number",required:!0,children:/* @__PURE__ */it(gt,{placeholder:"1234 5678 9012 3456"})}),
|
|
@@ -760,10 +760,10 @@ return it("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
|
|
|
760
760
|
/* @__PURE__ */lt("div",{className:"flex justify-between text-base font-semibold text-gray-900",children:[
|
|
761
761
|
/* @__PURE__ */it("span",{children:"Total"}),
|
|
762
762
|
/* @__PURE__ */lt("span",{children:["$",l]})]})]}),
|
|
763
|
-
/* @__PURE__ */lt(
|
|
763
|
+
/* @__PURE__ */lt(_,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
|
|
764
764
|
/* @__PURE__ */it(o,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var id=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],od=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function sd(){const[e,t]=qe(1),n=od.find(t=>t.id===e)??od[0];/* @__PURE__ */
|
|
765
765
|
return it("div",{className:"h-full",children:/* @__PURE__ */it(r,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */lt("div",{className:"flex h-full flex-col p-2",children:[
|
|
766
|
-
/* @__PURE__ */it(
|
|
766
|
+
/* @__PURE__ */it(_,{block:!0,className:"mb-2",children:"Compose"}),id.map((e,t)=>/* @__PURE__ */lt("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
767
767
|
/* @__PURE__ */it("span",{children:e.label}),null!=e.count&&/* @__PURE__ */it("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */lt("div",{className:"flex h-full",children:[
|
|
768
768
|
/* @__PURE__ */it("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:od.map(r=>/* @__PURE__ */lt("button",{onClick:()=>t(r.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
|
|
769
769
|
/* @__PURE__ */lt("div",{className:"flex items-center justify-between gap-2",children:[
|
|
@@ -775,8 +775,8 @@ return it("div",{className:"h-full",children:/* @__PURE__ */it(r,{side:"left",de
|
|
|
775
775
|
/* @__PURE__ */lt("div",{className:"flex items-center justify-between gap-3 border-b border-gray-200 p-4",children:[
|
|
776
776
|
/* @__PURE__ */it("h2",{className:"truncate text-base font-semibold text-gray-900",children:n.subject}),
|
|
777
777
|
/* @__PURE__ */lt("div",{className:"flex shrink-0 gap-2",children:[
|
|
778
|
-
/* @__PURE__ */it(
|
|
779
|
-
/* @__PURE__ */it(
|
|
778
|
+
/* @__PURE__ */it(_,{variant:"ghost",size:"sm",children:"Archive"}),
|
|
779
|
+
/* @__PURE__ */it(_,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
|
|
780
780
|
/* @__PURE__ */lt("div",{className:"flex items-center gap-3 border-b border-gray-100 p-4",children:[
|
|
781
781
|
/* @__PURE__ */it(hi,{name:n.from}),
|
|
782
782
|
/* @__PURE__ */lt("div",{className:"min-w-0",children:[
|
|
@@ -802,11 +802,11 @@ return it("div",{className:"h-full",children:/* @__PURE__ */it(r,{side:"left",de
|
|
|
802
802
|
/* @__PURE__ */it("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:dd.map((e,t)=>/* @__PURE__ */it("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */it("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))}),
|
|
803
803
|
/* @__PURE__ */lt("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
|
|
804
804
|
/* @__PURE__ */it("div",{className:"flex-1",children:/* @__PURE__ */it(gt,{placeholder:"Type a message…"})}),
|
|
805
|
-
/* @__PURE__ */it(
|
|
805
|
+
/* @__PURE__ */it(_,{type:"submit",children:"Send"})]})]})})})}var hd={featured:"success",new:"active",draft:"draft"},md=["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 pd(){const[e,t]=qe("all"),r="all"===e?md:md.filter(t=>t.tag===e);/* @__PURE__ */
|
|
806
806
|
return it(M,{groups:hd,children:/* @__PURE__ */it("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */lt("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
807
807
|
/* @__PURE__ */lt("div",{className:"flex items-center justify-between gap-4",children:[
|
|
808
808
|
/* @__PURE__ */it("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
|
|
809
|
-
/* @__PURE__ */it(
|
|
809
|
+
/* @__PURE__ */it(_,{size:"sm",children:"Upload"})]}),
|
|
810
810
|
/* @__PURE__ */it(yi,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
|
|
811
811
|
/* @__PURE__ */it("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */lt(ml,{padded:!1,className:"overflow-hidden",children:[
|
|
812
812
|
/* @__PURE__ */it("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */it("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */it(C,{status:e.tag})})}),
|
|
@@ -822,35 +822,35 @@ return it("div",{className:"flex h-full items-center justify-center overflow-aut
|
|
|
822
822
|
/* @__PURE__ */it(Bt,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */it(gt,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */it(Bt,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */it(gt,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */lt("div",{className:"flex items-center justify-between",children:[
|
|
823
823
|
/* @__PURE__ */it(zt,{checked:t,onChange:r,label:"Remember me"}),
|
|
824
824
|
/* @__PURE__ */it("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
|
|
825
|
-
/* @__PURE__ */it(
|
|
825
|
+
/* @__PURE__ */it(_,{type:"submit",block:!0,children:n.cta})]})}),
|
|
826
826
|
/* @__PURE__ */it("p",{className:"mt-4 text-center text-sm text-gray-500",children:/* @__PURE__ */lt(ot,"register"===e?{children:["Already have an account? ",
|
|
827
827
|
/* @__PURE__ */it("a",{href:"#",className:"text-blue-600 hover:underline",children:"Sign in"})]}:{children:["New here? ",
|
|
828
|
-
/* @__PURE__ */it("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var bd={403:e=>({title:e.forbidden,body:e.forbiddenBody}),404:e=>({title:e.notFound,body:e.notFoundBody}),500:e=>({title:e.serverError,body:e.serverErrorBody})};function yd({code:e=404,actions:t}){const r=bd[e](
|
|
828
|
+
/* @__PURE__ */it("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var bd={403:e=>({title:e.forbidden,body:e.forbiddenBody}),404:e=>({title:e.notFound,body:e.notFoundBody}),500:e=>({title:e.serverError,body:e.serverErrorBody})};function yd({code:e=404,actions:t}){const r=bd[e](ze().errors);/* @__PURE__ */
|
|
829
829
|
return lt("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
|
|
830
830
|
/* @__PURE__ */it("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:e}),
|
|
831
831
|
/* @__PURE__ */it("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:r.title}),
|
|
832
832
|
/* @__PURE__ */it("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */it("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function xd({pick:e}){/* @__PURE__ */
|
|
833
|
-
return it(ot,{children:e(
|
|
833
|
+
return it(ot,{children:e(ze().errors)})}var vd=class extends nt{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),B(e),this.props.onError?.(e,t)}componentDidUpdate(e){if(!this.state.error)return;const t=e.resetKeys??[],r=this.props.resetKeys??[];(t.length!==r.length||t.some((e,t)=>!Object.is(e,r[t])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
|
|
834
834
|
/* @__PURE__ */lt("div",{className:"flex h-full flex-col",children:[
|
|
835
835
|
/* @__PURE__ */it("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */it(yd,{code:500,actions:/* @__PURE__ */lt(ot,{children:[
|
|
836
|
-
/* @__PURE__ */it(
|
|
836
|
+
/* @__PURE__ */it(_,{onClick:this.reset,children:/* @__PURE__ */it(xd,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */lt("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
|
|
837
837
|
/* @__PURE__ */it("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */it(xd,{pick:e=>e.details})}),
|
|
838
|
-
/* @__PURE__ */it("pre",{className:"mt-2 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-700",children:e.stack??e.message})]})]}):this.props.children}};function wd(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Nd(e){const t=wd();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function kd(){return wd()?.matches??!1}function $d(){return!1}function Md(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),l=Math.min(t,r,n);let i=0,o=0;const s=(a+l)/2;if(a!==l){const e=a-l;o=s>.5?e/(2-a-l):e/(a+l),i=a===t?((r-n)/e+(r<n?6:0))/6:a===r?((n-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*o,100*s]}function Cd(e,t,r){r/=100;const n=(t/=100)*Math.min(r,1-r),a=t=>{const a=(t+e/30)%12;return r-n*Math.max(Math.min(a-3,9-a,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(a(0))}${l(a(8))}${l(a(4))}`}function Ld(e){const t=e||"system";return"system"===t?kd()?"dark":"light":t}function Dd(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Md(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Cd(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Cd(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Cd(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Cd(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Cd(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Cd(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Cd(r,Math.min(n+20,100),Math.min(a+46,98)))}else t.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(e=>t.style.removeProperty(e))}function Sd(e,t,r,n,a){const l=document.documentElement;if(e){const e=e=>`${parseInt(e.slice(1,3),16)} ${parseInt(e.slice(3,5),16)} ${parseInt(e.slice(5,7),16)}`;if(t&&l.style.setProperty("--custom-bg-color",t),r&&(l.style.setProperty("--window-header-rgb",e(r)),l.style.setProperty("--window-footer-rgb",e(r))),n&&l.style.setProperty("--window-content-rgb",e(n)),a){l.style.setProperty("--custom-button-color",a);const[e,t,r]=Md(a);l.style.setProperty("--custom-button-hover",Cd(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var Ad=["square","soft","round"];function
|
|
839
|
-
/* @__PURE__ */it(
|
|
840
|
-
/* @__PURE__ */it("span",{className:"block",style:{width:`${Td(a.map(e=>e.name))}em`},children:/* @__PURE__ */it(
|
|
838
|
+
/* @__PURE__ */it("pre",{className:"mt-2 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-700",children:e.stack??e.message})]})]}):this.props.children}};function wd(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Nd(e){const t=wd();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function kd(){return wd()?.matches??!1}function $d(){return!1}function Md(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),l=Math.min(t,r,n);let i=0,o=0;const s=(a+l)/2;if(a!==l){const e=a-l;o=s>.5?e/(2-a-l):e/(a+l),i=a===t?((r-n)/e+(r<n?6:0))/6:a===r?((n-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*o,100*s]}function Cd(e,t,r){r/=100;const n=(t/=100)*Math.min(r,1-r),a=t=>{const a=(t+e/30)%12;return r-n*Math.max(Math.min(a-3,9-a,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(a(0))}${l(a(8))}${l(a(4))}`}function Ld(e){const t=e||"system";return"system"===t?kd()?"dark":"light":t}function Dd(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Md(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Cd(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Cd(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Cd(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Cd(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Cd(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Cd(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Cd(r,Math.min(n+20,100),Math.min(a+46,98)))}else t.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(e=>t.style.removeProperty(e))}function Sd(e,t,r,n,a){const l=document.documentElement;if(e){const e=e=>`${parseInt(e.slice(1,3),16)} ${parseInt(e.slice(3,5),16)} ${parseInt(e.slice(5,7),16)}`;if(t&&l.style.setProperty("--custom-bg-color",t),r&&(l.style.setProperty("--window-header-rgb",e(r)),l.style.setProperty("--window-footer-rgb",e(r))),n&&l.style.setProperty("--window-content-rgb",e(n)),a){l.style.setProperty("--custom-button-color",a);const[e,t,r]=Md(a);l.style.setProperty("--custom-button-hover",Cd(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var Ad=["square","soft","round"];function Pd(e){return"square"===e||"round"===e?e:"soft"}var jd={pink:"round",grey:"square"};function zd(e,t,r){return r?"square"===t||"round"===t?t:"soft":jd[e]??"soft"}function Fd(e){const t=Pd(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function Ed(e){const t="string"==typeof e&&e?e:null;ye(t),t&&a(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function Bd(e){const t=!!e.accent_color;"corners"in e&&Fd(zd(Ld(e.theme),e.corners,t)),"icon_set"in e&&Ed(l(Ld(e.theme),e.icon_set,t)),document.documentElement.setAttribute("data-theme",Ld(e.theme)),Dd(e.accent_color??null),Sd(e.accent_color??null,e.custom_bg_color??null,e.custom_title_color??null,e.custom_window_color??null,e.custom_button_color??null)}function Od(){const{prefs:e}=L(),t=at(Nd,kd,$d),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,i=e.custom_title_color||null,o=e.custom_window_color||null,s=e.custom_button_color||null,c=e.corners,d="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,u="system"===r?t?"dark":"light":r,h=zd(u,c,!!n);Ge(()=>(document.documentElement.setAttribute("data-theme",u),()=>document.documentElement.removeAttribute("data-theme")),[u]),Ge(()=>(Fd(h),()=>document.documentElement.removeAttribute("data-corners")),[h]);const m=l(u,d,!!n);return Ge(()=>(Ed(m),()=>Ed(null)),[m]),Ge(()=>{Dd(n)},[n]),Ge(()=>{Sd(n,a,i,o,s)},[n,a,i,o,s]),{theme:r,resolved:u,corners:h,iconSet:d}}function Td(e){const t=Math.max(0,...e.map(e=>[...e].reduce((e,t)=>e+((t.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(t+3.5))/10}function Id({size:e="sm",className:t=""}){const{language:r,languages:a,setLanguage:l}=n(),i=ze().language;return a.length<2?null:/* @__PURE__ */lt("span",{className:`inline-flex items-center gap-2 text-gray-500 ${t}`.trim(),children:[
|
|
839
|
+
/* @__PURE__ */it(be,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
|
|
840
|
+
/* @__PURE__ */it("span",{className:"block",style:{width:`${Td(a.map(e=>e.name))}em`},children:/* @__PURE__ */it(Pt,{size:e,touchSize:e,"aria-label":i.title,value:r,onChange:e=>{l(e)},options:a.map(({tag:e,name:t})=>({value:e,label:t,lang:e}))})})]})}function Rd({description:e,className:t=""}){const{language:r,languages:a,setLanguage:l}=n(),i=ze().language;return a.length<2?null:/* @__PURE__ */lt("div",{className:`space-y-4 ${t}`.trim(),children:[
|
|
841
841
|
/* @__PURE__ */lt("div",{children:[
|
|
842
842
|
/* @__PURE__ */it("h3",{className:"text-sm font-semibold text-gray-900",children:i.title}),
|
|
843
843
|
/* @__PURE__ */it("p",{className:"mt-0.5 text-sm text-gray-500",children:e??i.description})]}),
|
|
844
844
|
/* @__PURE__ */it(Tt,{name:"shell-language",value:r,onChange:e=>{l(e)},hint:i.reloadNote,options:a.map(({tag:e,name:t})=>({value:e,label:/* @__PURE__ */it("span",{lang:e,children:t})}))})]})}function Wd({label:e="Not available"}){/* @__PURE__ */
|
|
845
|
-
return it("span",{className:"text-gray-400",role:"img","aria-label":e,children:
|
|
846
|
-
return it("time",{dateTime:i,title:
|
|
847
|
-
return it("p",{className:`text-sm text-gray-500 ${d??""}`,children:f});const g=
|
|
845
|
+
return it("span",{className:"text-gray-400",role:"img","aria-label":e,children:Ce})}function Kd({value:e,precise:t,locale:r,className:n}){const a=Fe(),l=Le(e);if(!l)/* @__PURE__ */return it(Wd,{});const i="string"==typeof e?e:l.toISOString();/* @__PURE__ */
|
|
846
|
+
return it("time",{dateTime:i,title:Se(i,{locale:r??a}),className:n,children:De(l,{precise:t,locale:r??a})})}function Hd(e,t=300){const[r,n]=qe(e);return Ge(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function _d(e,t){Ge(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}function qd(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 Ud(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 Vd(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=qd(s.map(e=>e.value),c,t),a=qd([...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=Ud(s,c,o,r);i.push(...e.tiles),o=e.rest,s=[],c=0}}s.length>0&&i.push(...Ud(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}))}function Yd({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:o=30,animate:s=!0,labelFont:c="sans",className:d,emptyLabel:u}){const h=ze().charts,m=Fe(),p=r??(e=>Te(e,m)),f=u??h.nothingToRank;if(0===e.length)/* @__PURE__ */
|
|
847
|
+
return it("p",{className:`text-sm text-gray-500 ${d??""}`,children:f});const g=jc(e.map(e=>e.value),a),b=n??(null===g?void 0:e[g]?.key),y=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),x=sc(0);/* @__PURE__ */
|
|
848
848
|
return it("ol",{className:`m-0 list-none p-0 ${d??""}`,style:{display:"grid",rowGap:`${Math.max(4,o-i)}px`},children:e.map((e,t)=>{const r=e.key===b,n=r?l?ic[l]:sc(1):b?oc.muted:x,a=Number.isFinite(e.value)?e.value:null,o=null!==a&&y>0?Math.max(0,Math.min(1,a/y)):0;/* @__PURE__ */
|
|
849
849
|
return lt("li",{className:"grid gap-1",children:[
|
|
850
850
|
/* @__PURE__ */lt("div",{className:"flex items-baseline justify-between gap-3",children:[
|
|
851
851
|
/* @__PURE__ */lt("span",{className:`truncate ${"mono"===c?"font-mono ":""}text-xs text-gray-600 ${r?"font-semibold":""}`,title:e.label,children:[e.label,r&&/* @__PURE__ */it("span",{className:"sr-only",children:` ${h.emphasised}`})]}),
|
|
852
852
|
/* @__PURE__ */it("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-gray-700",style:r?{color:n}:void 0,children:null===a?"—":p(a)})]}),
|
|
853
|
-
/* @__PURE__ */it("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */it("div",{className:`rounded-sm ${s?Qi.grow:""}`,style:{width:`${(100*o).toFixed(2)}%`,height:i,backgroundColor:n,minWidth:o>0?2:0,...s?eo(t):{}}})})]},e.key)})})}var Gd=e=>Math.max(0,Math.min(1,e));function Xd({value:e,segments:t,objective:r,label:n,detail:a,formatValue:l,tone:i,className:o,unavailableLabel:s}){const c=
|
|
853
|
+
/* @__PURE__ */it("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */it("div",{className:`rounded-sm ${s?Qi.grow:""}`,style:{width:`${(100*o).toFixed(2)}%`,height:i,backgroundColor:n,minWidth:o>0?2:0,...s?eo(t):{}}})})]},e.key)})})}var Gd=e=>Math.max(0,Math.min(1,e));function Xd({value:e,segments:t,objective:r,label:n,detail:a,formatValue:l,tone:i,className:o,unavailableLabel:s}){const c=ze().charts,d=Fe(),u=l??(e=>Re(100*e,1,d)),h=s??c.notEnough;if(null==e||!Number.isFinite(e))/* @__PURE__ */
|
|
854
854
|
return lt("div",{className:o,children:[n&&/* @__PURE__ */it("p",{className:"text-sm font-medium text-gray-700",children:n}),
|
|
855
855
|
/* @__PURE__ */it("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=Gd(e),p=null==r||e>=r,f=i??(p?"good":"critical"),g=ic[f],b=[t?.length?t.map(e=>`${e.label} ${u(e.value)}`).join(" · "):"",a??"",null!=r?(p?c.objectiveMet:c.objectiveMissed)(u(r)):""].filter(Boolean).join(" · ");/* @__PURE__ */
|
|
856
856
|
return lt("div",{className:o,children:[
|
|
@@ -858,13 +858,13 @@ return lt("div",{className:o,children:[
|
|
|
858
858
|
/* @__PURE__ */it("span",{className:"text-sm font-medium text-gray-700",children:n}),
|
|
859
859
|
/* @__PURE__ */it("span",{className:"text-sm font-semibold tabular-nums",style:{color:g},children:u(e)})]}),
|
|
860
860
|
/* @__PURE__ */lt("div",{className:"relative w-full rounded-full bg-gray-200",style:{height:12},role:"meter","aria-valuenow":Number((100*m).toFixed(2)),"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":u(e),"aria-label":n,children:[
|
|
861
|
-
/* @__PURE__ */it("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */it("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*Gd(e.value)).toFixed(2)}%`,backgroundColor:ic[e.tone??(0===r?f:"neutral")]}},`${e.label}-${r}`))}:{className:"h-full rounded-full",style:{width:`${(100*m).toFixed(2)}%`,backgroundColor:g}}),null!=r&&/* @__PURE__ */it("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*Gd(r)).toFixed(2)}%`,height:20,backgroundColor:oc.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */it("p",{className:"mt-2 text-xs text-gray-500",children:b})]})}var
|
|
861
|
+
/* @__PURE__ */it("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */it("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*Gd(e.value)).toFixed(2)}%`,backgroundColor:ic[e.tone??(0===r?f:"neutral")]}},`${e.label}-${r}`))}:{className:"h-full rounded-full",style:{width:`${(100*m).toFixed(2)}%`,backgroundColor:g}}),null!=r&&/* @__PURE__ */it("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*Gd(r)).toFixed(2)}%`,height:20,backgroundColor:oc.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */it("p",{className:"mt-2 text-xs text-gray-500",children:b})]})}var Jd={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function Zd({label:e,value:t,unit:r,delta:n,deltaTone:a,trend:l,trendTone:i,footnote:o,className:s}){const c=ze().charts,d=Fe(),u=null==n?null:n>0?"up":n<0?"down":"flat",h=a?ic[a]:void 0,m=i?ic[i]:cc(0);/* @__PURE__ */
|
|
862
862
|
return lt("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${s??""}`,children:[
|
|
863
863
|
/* @__PURE__ */it("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
864
864
|
/* @__PURE__ */lt("span",{className:"flex items-baseline gap-2",children:[
|
|
865
865
|
/* @__PURE__ */it("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:t}),r&&/* @__PURE__ */it("span",{className:"text-sm font-medium text-gray-500",children:r})]}),u&&/* @__PURE__ */lt("span",{className:"text-xs font-medium",style:h?{color:h}:void 0,children:[
|
|
866
|
-
/* @__PURE__ */it("span",{"aria-hidden":"true",children:
|
|
867
|
-
/* @__PURE__ */lt("span",{className:"sr-only",children:[" ",c[
|
|
866
|
+
/* @__PURE__ */it("span",{"aria-hidden":"true",children:Jd[u].glyph})," ",Te(Math.abs(n),d),
|
|
867
|
+
/* @__PURE__ */lt("span",{className:"sr-only",children:[" ",c[Jd[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */it(nc,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-2 w-full"}),o&&/* @__PURE__ */it("span",{className:"mt-1 text-xs text-gray-500",children:o})]})}function Qd({shape:e,colour:t}){const r="shrink-0";switch(e){case"circle":/* @__PURE__ */
|
|
868
868
|
return it("span",{className:`${r} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:t}});case"circle-outline":/* @__PURE__ */
|
|
869
869
|
return it("span",{className:`${r} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:t}});case"rounded-square-outline":/* @__PURE__ */
|
|
870
870
|
return it("span",{className:`${r} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:t}});case"square":/* @__PURE__ */
|
|
@@ -874,7 +874,7 @@ return it("span",{className:`${r} h-3.5 w-1 rounded-full`,style:{backgroundColor
|
|
|
874
874
|
return it("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function eu({entries:e,interactive:t,fallbackSwatch:r,onClick:n}){const{highlighted:a,setHighlighted:l}=Ac();/* @__PURE__ */
|
|
875
875
|
return it("ul",{className:"m-0 flex flex-wrap items-center gap-x-4 gap-y-1 p-0",children:e.map((e,i)=>{const o=t&&null!==a&&a!==e.key,s=/* @__PURE__ */lt(ot,{children:[
|
|
876
876
|
/* @__PURE__ */it(Qd,{shape:e.swatch??r,colour:cc(i,e.color,e.tone)}),e.label]});/* @__PURE__ */
|
|
877
|
-
return it("li",{className:"list-none",children:t||n?/* @__PURE__ */it("button",{type:"button",onClick:n?()=>n(e.key):void 0,"aria-pressed":n?Boolean(e.pressed):void 0,onMouseEnter:t?()=>l(e.key):void 0,onMouseLeave:t?()=>l(null):void 0,onFocus:t?()=>l(e.key):void 0,onBlur:t?()=>l(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(o?"opacity-40":""),children:s}):/* @__PURE__ */it("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:s})},e.key)})})}function tu({title:e,subtitle:t,legend:r,table:n,tableLabel:a,busy:l=!1,loading:i=!1,skeletonVariant:o="area",skeletonHeight:s,interactiveLegend:c=!0,legendSwatch:d="rounded-square",onLegendClick:u,actions:h,children:m,className:p}){const f=
|
|
877
|
+
return it("li",{className:"list-none",children:t||n?/* @__PURE__ */it("button",{type:"button",onClick:n?()=>n(e.key):void 0,"aria-pressed":n?Boolean(e.pressed):void 0,onMouseEnter:t?()=>l(e.key):void 0,onMouseLeave:t?()=>l(null):void 0,onFocus:t?()=>l(e.key):void 0,onBlur:t?()=>l(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(o?"opacity-40":""),children:s}):/* @__PURE__ */it("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:s})},e.key)})})}function tu({title:e,subtitle:t,legend:r,table:n,tableLabel:a,busy:l=!1,loading:i=!1,skeletonVariant:o="area",skeletonHeight:s,interactiveLegend:c=!0,legendSwatch:d="rounded-square",onLegendClick:u,actions:h,children:m,className:p}){const f=ze().charts;/* @__PURE__ */
|
|
878
878
|
return it(Sc,{children:/* @__PURE__ */lt("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${p??""}`,"aria-busy":l||i||void 0,children:[
|
|
879
879
|
/* @__PURE__ */lt("header",{className:"flex items-start justify-between gap-4",children:[
|
|
880
880
|
/* @__PURE__ */lt("div",{className:"min-w-0",children:[
|
|
@@ -882,48 +882,48 @@ return it(Sc,{children:/* @__PURE__ */lt("section",{className:`flex min-w-0 flex
|
|
|
882
882
|
/* @__PURE__ */it("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:a??f.showTable}),
|
|
883
883
|
/* @__PURE__ */it("div",{className:"mt-3 overflow-x-auto",style:{color:oc.label},children:n})]})]})})}function ru({cx:e,cy:t,color:r,variant:n="default",pulse:a=!1,title:l}){const i="border"===n?3:"colored-border"===n?1.5:0,o="border"===n?3:3.5;/* @__PURE__ */
|
|
884
884
|
return lt("g",{children:[a&&/* @__PURE__ */it("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:o,fill:r,fillOpacity:.45}),"border"===n&&/* @__PURE__ */it("circle",{cx:e,cy:t,r:o+i,fill:oc.surface}),
|
|
885
|
-
/* @__PURE__ */it("circle",{cx:e,cy:t,r:o,fill:"colored-border"===n?oc.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */it("title",{children:l})})]})}function nu({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:o}){const s=
|
|
885
|
+
/* @__PURE__ */it("circle",{cx:e,cy:t,r:o,fill:"colored-border"===n?oc.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */it("title",{children:l})})]})}function nu({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:o}){const s=ze().charts,c=Ue(null),d=e.length-1,[u,h]=r,m=i??cc(0),p=e=>0===d?0:e/d*l,f=e=>"number"==typeof e&&Number.isFinite(e),g=t.filter(f),b=Math.max(...g,1),y=e=>a-e/b*(a-6),x=[];e.forEach((e,r)=>{if(!f(t[r]))return;const n=x[x.length-1];n&&n.to===r-1?n.to=r:x.push({from:r,to:r})});const v=x.map(e=>{const r=[];for(let n=e.from;n<=e.to;n+=1)r.push(`${n===e.from?"M":"L"}${p(n).toFixed(2)},${y(t[n]).toFixed(2)}`);return`${r.join(" ")} L${p(e.to).toFixed(2)},${a} L${p(e.from).toFixed(2)},${a} Z`}).join(" "),w=(e,t)=>{const r=Math.max(0,Math.min(d,t));n("from"===e?[Math.min(r,h-1),h]:[u,Math.max(r,u+1)])},N=e=>t=>{const r=t.shiftKey?5:1,n="from"===e?u:h;"ArrowLeft"===t.key&&(t.preventDefault(),w(e,n-r)),"ArrowRight"===t.key&&(t.preventDefault(),w(e,n+r)),"Home"===t.key&&(t.preventDefault(),w(e,0)),"End"===t.key&&(t.preventDefault(),w(e,d))},k=Ue(null),$=e=>t=>{k.current=e,t.currentTarget.setPointerCapture(t.pointerId)},M=e=>t=>{k.current===e&&w(e,(e=>{const t=c.current?.getBoundingClientRect();if(!t||0===t.width)return u;const r=Math.max(0,Math.min(1,(e-t.left)/t.width));return Math.round(r*d)})(t.clientX))},C=e=>()=>{k.current===e&&(k.current=null)},L=t=>{const r="from"===t?u:h;/* @__PURE__ */
|
|
886
886
|
return it("rect",{x:p(r)-4.5,y:0,width:9,height:a,rx:3,fill:m,className:"cursor-ew-resize rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",tabIndex:0,role:"slider","aria-label":"from"===t?s.windowStart:s.windowEnd,"aria-valuemin":0,"aria-valuemax":d,"aria-valuenow":r,"aria-valuetext":e[r],style:{touchAction:"none"},onKeyDown:N(t),onPointerDown:$(t),onPointerMove:M(t),onPointerUp:C(t),onPointerCancel:C(t)},t)};/* @__PURE__ */
|
|
887
887
|
return it("div",{className:o,children:/* @__PURE__ */lt("svg",{ref:c,width:"100%",height:a,viewBox:`0 0 ${l} ${a}`,role:"group","aria-label":s.window(e[u],e[h],e.length),children:[
|
|
888
888
|
/* @__PURE__ */it("path",{d:v,fill:oc.grid}),
|
|
889
889
|
/* @__PURE__ */it("rect",{x:0,y:0,width:p(u),height:a,fill:oc.surface,fillOpacity:.72}),
|
|
890
890
|
/* @__PURE__ */it("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:oc.surface,fillOpacity:.72}),
|
|
891
|
-
/* @__PURE__ */it("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}var au=12,lu=16,iu=26,ou=52,su=e=>"number"==typeof e&&Number.isFinite(e);function cu({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:o=0,max:s,yTickCount:c=4,formatValue:d,formatTooltipValue:u,tooltipLabels:h,yAxisLabel:m,referenceLines:p,labelEndpoints:f=!1,dots:g,dotVariant:b="border",pulse:y=!1,brush:x=!1,range:v,onRangeChange:w,loading:N=!1,animate:k=!0,reveal:$="left-to-right",fillVariant:M="gradient",gridStyle:C="solid",width:L,className:D,emptyLabel:S}){const A=
|
|
892
|
-
return it("div",{className:D,ref:E,children:/* @__PURE__ */it(Lc,{height:r,width:L??B})});const
|
|
893
|
-
return it("div",{className:D,ref:E,children:/* @__PURE__ */it("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:F})});const X=t.map((e,t)=>G.reduce((e,r)=>e+(su(r.data[t])?r.data[t]:0),0)),
|
|
891
|
+
/* @__PURE__ */it("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}var au=12,lu=16,iu=26,ou=52,su=e=>"number"==typeof e&&Number.isFinite(e);function cu({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:o=0,max:s,yTickCount:c=4,formatValue:d,formatTooltipValue:u,tooltipLabels:h,yAxisLabel:m,referenceLines:p,labelEndpoints:f=!1,dots:g,dotVariant:b="border",pulse:y=!1,brush:x=!1,range:v,onRangeChange:w,loading:N=!1,animate:k=!0,reveal:$="left-to-right",fillVariant:M="gradient",gridStyle:C="solid",width:L,className:D,emptyLabel:S}){const A=ze().charts,P=Fe(),j=d??(e=>Te(e,P)),z=u??j,F=S??A.noData,E=Ue(null),B=$c(E),O=L??B,[T,I]=qe(null),[R,W]=qe(null),{highlighted:K}=Ac(),H=_e();if(Ge(()=>{if(null!==T)return he(e=>"Escape"===e.key&&(I(null),!0))},[T]),N)/* @__PURE__ */
|
|
892
|
+
return it("div",{className:D,ref:E,children:/* @__PURE__ */it(Lc,{height:r,width:L??B})});const _=t,q=v??R??[0,Math.max(0,_.length-1)],[U,V]=q,Y=e=>x?e.slice(U,V+1):e,G=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(su)).map(e=>({...e,data:Y(e.data)}));if(t=Y(_),0===G.length||0===t.length)/* @__PURE__ */
|
|
893
|
+
return it("div",{className:D,ref:E,children:/* @__PURE__ */it("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:F})});const X=t.map((e,t)=>G.reduce((e,r)=>e+(su(r.data[t])?r.data[t]:0),0)),J=(e,t)=>X[t]>0?e/X[t]:null,Z=[];if(n){let e=t.map(()=>0);for(const t of G)e=e.map((e,r)=>e+(su(t.data[r])?t.data[r]:0)),Z.push("percent"===a?e.map((e,t)=>J(e,t)):[...e])}const Q=!!l&&l.length>0,ee=e=>"right"===e.axis,te=!n&&!Q&&void 0===s&&G.some(ee)&&G.some(e=>!ee(e)),re=te?G.filter(e=>!ee(e)):G,ne=te?G.filter(ee).flatMap(e=>e.data.filter(su)):[],ae=n?(Z.at(-1)??[]).filter(su):re.flatMap(e=>e.data.filter(su)),le=te?yc([Math.min(0,...ae),Math.max(0,...ae)],[Math.min(0,...ne),Math.max(0,...ne)],{intervals:c+1,integerLeft:ae.every(Number.isInteger),integerRight:ne.every(Number.isInteger)}):null,ie=le?le.left:n&&"percent"===a||Q||void 0!==s?null:bc(n?0:Math.min(0,...ae),Math.max(0,...ae),{intervals:c+1,integer:ae.every(Number.isInteger)}),oe=ie?ie.lo:0,se=n&&"percent"===a?1:ie?ie.hi:s??gc(Math.max(...ae,0)),ce=n&&"percent"===a?e=>Re(Math.round(100*e),0,P):j,de=Q?l:ie?ie.ticks:mc([oe,se],{from:0,to:1}).ticks(c+1),ue=kc(de.map(ce),ou),me=le?kc(le.right.ticks.map(j),lu):lu,pe={left:ue,right:Math.max(ue+1,O-me),top:au,bottom:r-iu},fe=pc(t.length,{from:pe.left,to:pe.right}),ge=Q?fc(l,{from:pe.bottom,to:pe.top}):null,be=mc([oe,se],{from:pe.bottom,to:pe.top}),ye=be(Math.max(oe,0)),xe=e=>ge?ge(e):be(e),ve=le?mc([le.right.lo,le.right.hi],{from:pe.bottom,to:pe.top}):null,we=e=>ve&&ee(e)?ve:xe,Ne=ge?ge.levels.map(e=>({value:e,y:ge(e)})):de.map(e=>({value:e,y:be(e)})),ke=e=>r=>{r.preventDefault(),I(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},$e=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(O/96))));/* @__PURE__ */
|
|
894
894
|
return lt("div",{className:`relative ${D??""}`,ref:E,children:[
|
|
895
|
-
/* @__PURE__ */lt("svg",{width:"100%",height:r,viewBox:`0 0 ${
|
|
896
|
-
/* @__PURE__ */it("defs",{children:/* @__PURE__ */it("clipPath",{id:
|
|
897
|
-
/* @__PURE__ */it(
|
|
898
|
-
/* @__PURE__ */it("line",{x1:pe.left,y1:ye,x2:pe.right,y2:ye,stroke:oc.axis,strokeWidth:1,shapeRendering:"crispEdges"}),Ne.map(e=>/* @__PURE__ */it("text",{x:pe.left-8,y:e.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:ce(e.value)},`ytick-${e.value}`)),le&&Ne.map((e,t)=>/* @__PURE__ */it("text",{x:pe.right+8,y:e.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:
|
|
899
|
-
/* @__PURE__ */it("g",{clipPath:`url(#${
|
|
900
|
-
return it("path",{d:
|
|
901
|
-
return it("g",{opacity:s??void 0,className:"rosh-viz-mark",children:t.map((t,s)=>{const c=n?
|
|
902
|
-
return it("rect",{x:fe.center(s)-l/2,y:Math.min(d,ye),width:l,height:Math.abs(ye-d),rx:2,fill:a,fillOpacity:i?1:.35,className:k?Qi.rise:void 0,style:k?eo(s,26):void 0},s)})},e.key)}const d=Wc(c,i,o),u=n&&r>0?t.map((e,t)=>[fe.center(t),xe(
|
|
895
|
+
/* @__PURE__ */lt("svg",{width:"100%",height:r,viewBox:`0 0 ${O} ${r}`,role:"img","aria-label":A.overIntervals(G.map(e=>e.label),t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>I(null),onBlur:()=>I(null),onKeyDown:e=>{"ArrowRight"===e.key&&ke(1)(e),"ArrowLeft"===e.key&&ke(-1)(e)},children:[
|
|
896
|
+
/* @__PURE__ */it("defs",{children:/* @__PURE__ */it("clipPath",{id:H,children:/* @__PURE__ */it("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
|
|
897
|
+
/* @__PURE__ */it(Ji,{id:H,fills:G.map((e,t)=>({color:cc(e.slot,e.color,e.tone),variant:e.fillVariant??M})),fadeFrom:n?.42:.3,reveal:!!k&&$}),Ne.map(e=>/* @__PURE__ */it("line",{x1:pe.left,y1:e.y,x2:pe.right,y2:e.y,stroke:oc.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===C?"3 3":void 0},`grid-${e.value}`)),
|
|
898
|
+
/* @__PURE__ */it("line",{x1:pe.left,y1:ye,x2:pe.right,y2:ye,stroke:oc.axis,strokeWidth:1,shapeRendering:"crispEdges"}),Ne.map(e=>/* @__PURE__ */it("text",{x:pe.left-8,y:e.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:ce(e.value)},`ytick-${e.value}`)),le&&Ne.map((e,t)=>/* @__PURE__ */it("text",{x:pe.right+8,y:e.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:j(le.right.ticks[t])},`ytick-r-${e.value}`)),m&&/* @__PURE__ */it("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:oc.label,children:m}),
|
|
899
|
+
/* @__PURE__ */it("g",{clipPath:`url(#${H})`,mask:k&&$?`url(#${qi(H)})`:void 0,children:G.map((e,r)=>{const a=cc(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),s=Pc(e.key,K);if("step"===l){const r=t.map((t,r)=>({start:fe(r),end:fe.end(r),value:e.data[r]})).filter(e=>su(e.value)).map(t=>({start:t.start,end:t.end,y:we(e)(t.value)}));/* @__PURE__ */
|
|
900
|
+
return it("path",{d:Oc(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?Z[r]?.[a]:e.data[a];return su(l)?[fe.center(a),we(e)(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*fe.bandwidth),i="solid"===e.fillVariant,o=we(e);/* @__PURE__ */
|
|
901
|
+
return it("g",{opacity:s??void 0,className:"rosh-viz-mark",children:t.map((t,s)=>{const c=n?Z[r]?.[s]:e.data[s];if(!su(c))return null;const d=o(c);/* @__PURE__ */
|
|
902
|
+
return it("rect",{x:fe.center(s)-l/2,y:Math.min(d,ye),width:l,height:Math.abs(ye-d),rx:2,fill:a,fillOpacity:i?1:.35,className:k?Qi.rise:void 0,style:k?eo(s,26):void 0},s)})},e.key)}const d=Wc(c,i,o),u=n&&r>0?t.map((e,t)=>[fe.center(t),xe(Z[r-1]?.[t]??0)-2]):null,h=u?Hc(d,u):Kc(d,c,ye);/* @__PURE__ */
|
|
903
903
|
return lt("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===l||n)&&
|
|
904
|
-
/* @__PURE__ */it("path",{d:h,fill:Vi(
|
|
904
|
+
/* @__PURE__ */it("path",{d:h,fill:Vi(H,r,e.fillVariant??M,a),stroke:"none"}),
|
|
905
905
|
/* @__PURE__ */it("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:Yi(e.stroke??(e.forecast?"animated-dashed":"solid")),className:k&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?Qi.march:void 0})]},e.key)})}),p?.map((e,t)=>{const r=e.color??ic[e.tone??"critical"],n=xe(e.value);/* @__PURE__ */
|
|
906
906
|
return lt("g",{children:[
|
|
907
|
-
/* @__PURE__ */it("line",{x1:pe.left,y1:n,x2:pe.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */it("text",{x:pe.right-4,y:n-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(g??(f?"last":"none"))&&G.map((e,r)=>{if("column"===e.mode)return null;const a=g??(f?"last":"none"),l=cc(e.slot,e.color,e.tone),i=[...e.data].map(su).lastIndexOf(!0),o="all"===a?t.map((e,t)=>t).filter(t=>su(n?
|
|
908
|
-
return lt("g",{children:[o.map(a=>{const o=n?
|
|
909
|
-
/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 z-10",style:Mc(fe.center(T),fe.bandwidth,
|
|
910
|
-
return it("div",{className:h,ref:x,children:/* @__PURE__ */it("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:y})});const S=L.flatMap(e=>e.points),A=S.some(e=>null!=e.size),
|
|
907
|
+
/* @__PURE__ */it("line",{x1:pe.left,y1:n,x2:pe.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */it("text",{x:pe.right-4,y:n-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(g??(f?"last":"none"))&&G.map((e,r)=>{if("column"===e.mode)return null;const a=g??(f?"last":"none"),l=cc(e.slot,e.color,e.tone),i=[...e.data].map(su).lastIndexOf(!0),o="all"===a?t.map((e,t)=>t).filter(t=>su(n?Z[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
|
|
908
|
+
return lt("g",{children:[o.map(a=>{const o=n?Z[r]?.[a]:e.data[a];return su(o)?/* @__PURE__ */it(ru,{cx:fe.center(a),cy:we(e)(o),color:l,variant:b,pulse:y&&a===i,title:`${t[a]}: ${e.label} ${j(o)}`},a):null}),f&&i>=0&&su(n?Z[r]?.[i]:e.data[i])&&/* @__PURE__ */it("text",{x:fe.center(i)-10,y:we(e)(n?Z[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:j(n?Z[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%$e===0?/* @__PURE__ */it("text",{x:fe.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==T&&/* @__PURE__ */it("line",{x1:fe.center(T),y1:pe.top,x2:fe.center(T),y2:pe.bottom,stroke:oc.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */it("rect",{x:fe(t),y:pe.top,width:Math.max(1,fe.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>I(t)},`hit-${t}`))]}),x&&_.length>2&&/* @__PURE__ */it(nu,{className:"mt-1",labels:_,width:O,data:e[0]?.data??[],range:q,onRangeChange:e=>{w?w(e):W(e)}}),null!==T&&
|
|
909
|
+
/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 z-10",style:Mc(fe.center(T),fe.bandwidth,O),children:/* @__PURE__ */it(zc,{title:h?.[T]??t[T],rows:G.map((e,t)=>({key:e.key,label:e.label,color:cc(e.slot,e.color,e.tone),value:su(e.data[T])?n&&"percent"===a?`${Re(100*(J(e.data[T],T)??0),1,P)} · ${z(e.data[T])}`:z(e.data[T]):void 0})),footnote:n&&"percent"===a?A.inBucket(z(X[T])):void 0})})]})}var du=3;function uu({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=ze().charts,f=Fe(),g=l??(e=>Te(e,f)),b=i??(e=>Te(e,f)),y=m??p.noObservations,x=Ue(null),v=$c(x),w=r??v,N=_e(),[k,$]=qe(null);Ge(()=>{if(null!==k)return he(e=>"Escape"===e.key&&($(null),!0))},[k]);const M=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),L=o||s?C.map(e=>({...e,points:e.points.filter(e=>M(e.x,o)&&M(e.y,s))})).filter(e=>e.points.length>0):C,D=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
|
|
910
|
+
return it("div",{className:h,ref:x,children:/* @__PURE__ */it("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:y})});const S=L.flatMap(e=>e.points),A=S.some(e=>null!=e.size),P=14,j=20,z=34,F=52,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,gc(Math.max(...e))];return"log"===r?xc(i,n):mc(i,n)},B=E(S.map(e=>e.y),s,d,{from:t-z,to:P}),O=kc(B.ticks(5).map(b),F),T=Math.max(O+1,w-j),I=E(S.map(e=>e.x),o,c,{from:O,to:T}),R=wc([0,Math.max(...S.map(e=>e.size??1))],{from:u[0],to:u[1]}),W=k?L[k.s]:void 0,K=k&&W?W.points[k.i]:void 0,H=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
|
|
911
911
|
return lt("div",{className:`relative ${h??""}`,ref:x,children:[
|
|
912
|
-
/* @__PURE__ */lt("svg",{width:"100%",height:t,viewBox:`0 0 ${w} ${t}`,role:"img","aria-label":p.scatter(L.map(e=>e.label),a??p.yAxis,n??p.xAxis)+(D>0?`. ${p.outsideRange(D)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>$(null),onBlur:()=>$(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=k?
|
|
913
|
-
/* @__PURE__ */it("defs",{children:/* @__PURE__ */it("clipPath",{id:N,children:/* @__PURE__ */it("rect",{x:
|
|
914
|
-
/* @__PURE__ */it("line",{x1:
|
|
915
|
-
/* @__PURE__ */it("text",{x:
|
|
916
|
-
/* @__PURE__ */it("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=hc(e.slot,3,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */it("circle",{cx:
|
|
912
|
+
/* @__PURE__ */lt("svg",{width:"100%",height:t,viewBox:`0 0 ${w} ${t}`,role:"img","aria-label":p.scatter(L.map(e=>e.label),a??p.yAxis,n??p.xAxis)+(D>0?`. ${p.outsideRange(D)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>$(null),onBlur:()=>$(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=k?H.findIndex(e=>e.s===k.s&&e.i===k.i):0;$(H[Math.min(H.length-1,Math.max(0,r+t))])},children:[
|
|
913
|
+
/* @__PURE__ */it("defs",{children:/* @__PURE__ */it("clipPath",{id:N,children:/* @__PURE__ */it("rect",{x:O-u[1],y:P-u[1],width:T-O+2*u[1],height:t-z-P+2*u[1]})})}),B.ticks(5).map(e=>/* @__PURE__ */lt("g",{children:[
|
|
914
|
+
/* @__PURE__ */it("line",{x1:O,y1:B(e),x2:T,y2:B(e),stroke:oc.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
915
|
+
/* @__PURE__ */it("text",{x:O-8,y:B(e)+4,textAnchor:"end",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),I.ticks(5).map(e=>/* @__PURE__ */it("text",{x:I(e),y:t-12,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:g(e)},`x${e}`)),n&&/* @__PURE__ */it("text",{x:(O+T)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:oc.label,children:n}),a&&/* @__PURE__ */it("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:oc.label,children:a}),
|
|
916
|
+
/* @__PURE__ */it("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=hc(e.slot,3,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */it("circle",{cx:I(n.x),cy:B(n.y),r:A?R(n.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:oc.surface,strokeWidth:2,onMouseEnter:()=>$({s:t,i:a})},`${e.key}-${a}`))})})]}),k&&W&&K&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:K.label??W.label,rows:[{key:"x",label:n??p.xAxis,color:hc(W.slot,3,W.color,W.tone),value:g(K.x)},{key:"y",label:a??p.yAxis,color:hc(W.slot,3,W.color,W.tone),value:b(K.y)},...null!=K.size?[{key:"size",label:p.size,color:oc.muted,value:Te(K.size,f)}]:[]],footnote:K.label?W.label:void 0})})]})}function hu({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:f=3}){const g=ze().charts,b=Fe(),y=s??(e=>Te(e,b)),x=h??g.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=cc(0,d,u);/* @__PURE__ */
|
|
917
917
|
return it(Cc,{labels:t,values:v,height:a,width:l,max:i,min:o,formatValue:y,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:g.rangeLabel(x,t.length),tooltip:r=>/* @__PURE__ */it(zc,{title:t[r],rows:[{key:"high",label:g.high,color:w,value:null==e[r]?void 0:y(e[r].high)},{key:"low",label:g.low,color:w,value:null==e[r]?void 0:y(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */it("g",{children:e.map((e,r)=>/* @__PURE__ */it("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:f,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */lt("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__ */
|
|
918
918
|
return lt(ot,{children:[
|
|
919
|
-
/* @__PURE__ */it("path",{d:
|
|
919
|
+
/* @__PURE__ */it("path",{d:Hc(Wc(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
|
|
920
920
|
/* @__PURE__ */it("path",{d:Wc(r,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
|
|
921
|
-
/* @__PURE__ */it("path",{d:Wc(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */it("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:oc.axis,strokeWidth:1})]})})}function mu({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:o=3,connectors:s=!0}){const c=
|
|
921
|
+
/* @__PURE__ */it("path",{d:Wc(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */it("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:oc.axis,strokeWidth:1})]})})}function mu({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:o=3,connectors:s=!0}){const c=ze().charts,d=Fe(),u=n??(e=>Te(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__ */
|
|
922
922
|
return it(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?ic.neutral:t.value>=0?ic.good:ic.critical;/* @__PURE__ */
|
|
923
923
|
return it(zc,{title:t?.label,rows:[{key:"step",color:r,label:t?.total?c.balance:t.value>=0?c.increase:c.decrease,value:t?.total?u(t.to):`${t.value>=0?"+":"−"}${u(Math.abs(t.value))}`},...t?.total?[]:[{key:"running",label:c.runningTotal,color:ic.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */lt("g",{children:[s&&m.slice(0,-1).map((r,n)=>
|
|
924
924
|
/* @__PURE__ */it("line",{x1:e.end(n),y1:t(r.to),x2:e(n+1),y2:t(r.to),stroke:oc.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${n}`)),m.map((n,a)=>{const l=n.total?ic.neutral:n.value>=0?ic.good:ic.critical,i=Math.min(t(n.from),t(n.to)),s=Math.max(1,Math.abs(t(n.to)-t(n.from)));/* @__PURE__ */
|
|
925
|
-
return it("rect",{x:e(a),y:i,width:Math.max(1,e.bandwidth),height:s,rx:o,fill:l,fillOpacity:null===r||r===a?1:.45},a)})]})})}function pu({values:e,bins:t=10,precomputed:r,height:n=220,width:a,color:l,tone:i,formatBound:o,formatCount:s,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=
|
|
926
|
-
return it(Cc,{labels:w,values:N,height:n,width:a,bandPadding:0,xTickAnchor:"start",formatValue:g,yAxisLabel:b,className:u,emptyLabel:h,ariaLabel:m.histogram(y,x.length,(e??[]).length),tooltip:e=>/* @__PURE__ */it(zc,{title:`${f(x[e].from)} – ${f(x[e].to)}`,rows:[{key:"count",label:m.observations,color:v,value:g(x[e].count)}]}),children:({x:e,y:t,bottom:r,active:n})=>/* @__PURE__ */it("g",{children:x.map((a,l)=>/* @__PURE__ */it("rect",{x:e(l)+.5,y:t(a.count),width:Math.max(1,e.bandwidth-1),height:Math.max(0,r-t(a.count)),fill:v,fillOpacity:null===n||n===l?.85:.42},l))})})}function fu({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:o,className:s,emptyLabel:c}){const d=
|
|
925
|
+
return it("rect",{x:e(a),y:i,width:Math.max(1,e.bandwidth),height:s,rx:o,fill:l,fillOpacity:null===r||r===a?1:.45},a)})]})})}function pu({values:e,bins:t=10,precomputed:r,height:n=220,width:a,color:l,tone:i,formatBound:o,formatCount:s,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=ze().charts,p=Fe(),f=o??(e=>Number.isInteger(e)?Te(e,p):Ie(e,1,p)),g=s??(e=>Te(e,p)),b=c??m.countAxis,y=d??m.distribution,x=r??Nc(e??[],t),v=cc(0,l,i),w=x.map(e=>f(e.from)),N=x.map(e=>e.count);/* @__PURE__ */
|
|
926
|
+
return it(Cc,{labels:w,values:N,height:n,width:a,bandPadding:0,xTickAnchor:"start",formatValue:g,yAxisLabel:b,className:u,emptyLabel:h,ariaLabel:m.histogram(y,x.length,(e??[]).length),tooltip:e=>/* @__PURE__ */it(zc,{title:`${f(x[e].from)} – ${f(x[e].to)}`,rows:[{key:"count",label:m.observations,color:v,value:g(x[e].count)}]}),children:({x:e,y:t,bottom:r,active:n})=>/* @__PURE__ */it("g",{children:x.map((a,l)=>/* @__PURE__ */it("rect",{x:e(l)+.5,y:t(a.count),width:Math.max(1,e.bandwidth-1),height:Math.max(0,r-t(a.count)),fill:v,fillOpacity:null===n||n===l?.85:.42},l))})})}function fu({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:o,className:s,emptyLabel:c}){const d=ze().charts,u=Fe(),h=l??(e=>Te(e,u)),m=o??d.distribution,p=cc(0,n,a),f=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
|
|
927
927
|
return it(Cc,{labels:e.map(e=>e.label),values:f,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:s,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
|
|
928
928
|
return it(zc,{title:r.label,rows:[{key:"max",label:d.maximum,color:p,value:h(r.max)},{key:"q3",label:d.q3,color:p,value:h(r.q3)},{key:"median",label:d.median,color:p,value:h(r.median)},{key:"q1",label:d.q1,color:p,value:h(r.q1)},{key:"min",label:d.minimum,color:p,value:h(r.min)}],emphasisKey:"median",footnote:r.outliers?.length?d.outliers(r.outliers.length):void 0})},children:({x:t,y:r,active:n})=>/* @__PURE__ */it("g",{children:e.map((e,a)=>{const l=t.center(a),i=Math.max(6,t.bandwidth);/* @__PURE__ */
|
|
929
929
|
return lt("g",{opacity:null!==n&&n!==a?.45:1,children:[
|
|
@@ -932,13 +932,13 @@ return lt("g",{opacity:null!==n&&n!==a?.45:1,children:[
|
|
|
932
932
|
/* @__PURE__ */it("line",{x1:l-i/4,y1:r(e.max),x2:l+i/4,y2:r(e.max),stroke:p,strokeWidth:1.5}),
|
|
933
933
|
/* @__PURE__ */it("line",{x1:l-i/4,y1:r(e.min),x2:l+i/4,y2:r(e.min),stroke:p,strokeWidth:1.5}),
|
|
934
934
|
/* @__PURE__ */it("rect",{x:l-i/2,y:r(e.q3),width:i,height:Math.max(1,r(e.q1)-r(e.q3)),rx:2,fill:p,fillOpacity:.22,stroke:p,strokeWidth:1.5}),
|
|
935
|
-
/* @__PURE__ */it("line",{x1:l-i/2,y1:r(e.median),x2:l+i/2,y2:r(e.median),stroke:p,strokeWidth:3}),(e.outliers??[]).map((e,t)=>/* @__PURE__ */it("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:oc.surface,strokeWidth:1.5},t))]},a)})})})}function gu({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:o,emptyLabel:s}){const c=
|
|
935
|
+
/* @__PURE__ */it("line",{x1:l-i/2,y1:r(e.median),x2:l+i/2,y2:r(e.median),stroke:p,strokeWidth:3}),(e.outliers??[]).map((e,t)=>/* @__PURE__ */it("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:oc.surface,strokeWidth:1.5},t))]},a)})})})}function gu({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:o,emptyLabel:s}){const c=ze().charts,d=Fe(),u=a??(e=>Number.isInteger(e)?Te(e,d):Ie(e,2,d)),h=i??c.price,m=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),p=Math.min(...m),f=Math.max(...m),g=.08*(f-p)||1;/* @__PURE__ */
|
|
936
936
|
return it(Cc,{labels:e.map(e=>e.label),values:m,height:r,width:n,min:p-g,max:f+g,bandPadding:.42,formatValue:u,yAxisLabel:l,className:o,emptyLabel:s,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],n=r.close>=r.open,a=n?ic.good:ic.critical;/* @__PURE__ */
|
|
937
937
|
return it(zc,{title:r.label,rows:[{key:"open",label:c.open,color:a,value:u(r.open)},{key:"high",label:c.high,color:a,value:u(r.high)},{key:"low",label:c.low,color:a,value:u(r.low)},{key:"close",label:c.close,color:a,value:u(r.close)}],emphasisKey:"close",footnote:n?c.closedAbove:c.closedBelow})},children:({x:r,y:n,active:a})=>/* @__PURE__ */it("g",{children:e.map((e,l)=>{const i=e.close>=e.open,o=i?ic.good:ic.critical,s=r.center(l),c=Math.max(3,r.bandwidth),d=null!==a&&a!==l,u=n(Math.max(e.open,e.close)),h=Math.max(1,Math.abs(n(e.close)-n(e.open)));/* @__PURE__ */
|
|
938
938
|
return lt("g",{opacity:d?.45:1,children:[
|
|
939
939
|
/* @__PURE__ */it("line",{x1:s,y1:n(e.high),x2:s,y2:n(e.low),stroke:o,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */it("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__ */lt(ot,{children:[
|
|
940
940
|
/* @__PURE__ */it("line",{x1:s-c/2,y1:n(e.open),x2:s,y2:n(e.open),stroke:o,strokeWidth:2}),
|
|
941
|
-
/* @__PURE__ */it("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function bu({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=
|
|
941
|
+
/* @__PURE__ */it("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function bu({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=ze().charts,p=Fe(),f=o??(e=>Te(e,p)),g=s??m.intensity,b=d??m.noActivity,y=Ue(null),x=$c(y),v=a??x,w=_e(),[N,k]=qe(null);if(Ge(()=>{if(null!==N)return he(e=>"Escape"===e.key&&(k(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
|
|
942
942
|
return it("div",{className:c,ref:y,children:/* @__PURE__ */it("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const $=l??cc(0),M=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=n??L+26+26,S=Math.max(2,(Math.max(97,v)-C)/t.length),A=e=>{const t=M>0?Math.max(0,Math.min(1,e/M)):0;return`color-mix(in oklab, ${$} ${(8+92*t).toFixed(1)}%, ${oc.surface})`};/* @__PURE__ */
|
|
943
943
|
return lt("div",{className:`relative ${c??""}`,ref:y,children:[
|
|
944
944
|
/* @__PURE__ */lt("svg",{width:"100%",height:D,viewBox:`0 0 ${v} ${D}`,role:"img","aria-label":m.heatmap(g,e.length,t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>k(null),onBlur:()=>k(null),onKeyDown:r=>{const n="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,a="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===n&&0===a||(r.preventDefault(),k(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+n)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+a))})))},children:[
|
|
@@ -952,21 +952,21 @@ return it("rect",{x:C+a*S+u/2,y:26*n+u/2,width:Math.max(1,S-u),height:26-u,rx:h,
|
|
|
952
952
|
return lt("table",{className:"sr-only",children:[
|
|
953
953
|
/* @__PURE__ */it("caption",{children:e}),
|
|
954
954
|
/* @__PURE__ */it("thead",{children:/* @__PURE__ */it("tr",{children:t.map(e=>/* @__PURE__ */it("th",{className:$,scope:"col",children:e},e))})}),
|
|
955
|
-
/* @__PURE__ */it("tbody",{children:r.map((e,t)=>/* @__PURE__ */it("tr",{children:e.map((e,t)=>/* @__PURE__ */it("td",{children:e},t))},t))})]})}var xu=3,vu=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function wu({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:o=!0,className:s,emptyLabel:c}){const d=
|
|
955
|
+
/* @__PURE__ */it("tbody",{children:r.map((e,t)=>/* @__PURE__ */it("tr",{children:e.map((e,t)=>/* @__PURE__ */it("td",{children:e},t))},t))})]})}var xu=3,vu=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function wu({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:o=!0,className:s,emptyLabel:c}){const d=ze().charts,u=Fe(),h=i??(e=>Te(e,u)),m=c??d.nothingToCompare,p=_e(),[f,g]=qe(null),{highlighted:b}=Ac(),y=t;if(e.length<3||0===y.length)/* @__PURE__ */
|
|
956
956
|
return it("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const x=r/2,v=r/2,w=r/2-46,N=vc(e.length),k=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...y.map(e=>e.values[t]??0).filter(Number.isFinite))),$=(e,t)=>{const r=Math.max(0,Math.min(1,t/k[e])),n=N.center(e)-N.step/2;return[x+w*r*Math.cos(n),v+w*r*Math.sin(n)]},M=(e,t)=>null!==f?f!==e:null!==b&&b!==t,C=null!==f?y[f]:void 0;/* @__PURE__ */
|
|
957
957
|
return lt("div",{className:`relative ${s??""}`,children:[
|
|
958
958
|
/* @__PURE__ */lt("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>g(null),children:[
|
|
959
|
-
/* @__PURE__ */it("title",{id:p,children:d.acrossMeasures(y.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const n=w*(r+1)/l;return"circle"===a?/* @__PURE__ */it("circle",{cx:x,cy:v,r:n,fill:"none",stroke:oc.grid,strokeWidth:1},r):/* @__PURE__ */it("path",{d:vu(
|
|
959
|
+
/* @__PURE__ */it("title",{id:p,children:d.acrossMeasures(y.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const n=w*(r+1)/l;return"circle"===a?/* @__PURE__ */it("circle",{cx:x,cy:v,r:n,fill:"none",stroke:oc.grid,strokeWidth:1},r):/* @__PURE__ */it("path",{d:vu(_c(x,v,n,e.length)),fill:"none",stroke:oc.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,n]=$(t,k[t]);/* @__PURE__ */
|
|
960
960
|
return lt("g",{children:[
|
|
961
961
|
/* @__PURE__ */it("line",{x1:x,y1:v,x2:r,y2:n,stroke:oc.grid,strokeWidth:1}),
|
|
962
962
|
/* @__PURE__ */it("text",{x:x+(w+18)*Math.cos(N.center(t)-N.step/2),y:v+(w+18)*Math.sin(N.center(t)-N.step/2)+4,textAnchor:"middle",fontSize:11,fill:oc.label,children:e.label})]},e.key)}),
|
|
963
|
-
/* @__PURE__ */it(
|
|
963
|
+
/* @__PURE__ */it(Ji,{id:p,reveal:!!o&&"center-out"}),y.map((t,r)=>{const a=hc(r,3,t.color,t.tone),l=e.map((e,r)=>$(r,t.values[r]??0));/* @__PURE__ */
|
|
964
964
|
return lt("g",{opacity:M(r,t.key)?.3:1,onMouseEnter:()=>g(r),mask:o?`url(#${qi(p)})`:void 0,children:["area"===n&&/* @__PURE__ */it("path",{d:vu(l),fill:a,fillOpacity:.18,stroke:"none"}),
|
|
965
965
|
/* @__PURE__ */it("path",{d:vu(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */it("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:oc.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:hc(f,3,C.color,C.tone),value:h(C.values[t]??0)}))})}),
|
|
966
966
|
/* @__PURE__ */it("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:y.map((e,t)=>/* @__PURE__ */lt("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
967
967
|
/* @__PURE__ */it("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:hc(t,3,e.color,e.tone)}}),
|
|
968
968
|
/* @__PURE__ */it("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
969
|
-
/* @__PURE__ */it(yu,{caption:d.acrossMeasures(y.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:y.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}var Nu=300*Math.PI/180;function ku({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:o,trackGap:s=6}){const c=
|
|
969
|
+
/* @__PURE__ */it(yu,{caption:d.acrossMeasures(y.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:y.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}var Nu=300*Math.PI/180;function ku({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:o,trackGap:s=6}){const c=ze().charts,d=Fe(),u=a??(e=>Te(e,d)),h=o??c.nothingToPlot,m=_e(),[p,f]=qe(null),{highlighted:g}=Ac();if(0===e.length)/* @__PURE__ */return it("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const b=r/2,y=r/2,x=r/2-10,v=n??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(x-.16*r)/e.length):0,N=Math.max(1,Math.floor((x-.16*r)/w||1)),k="track"===t?e.slice(0,N):e,$=Math.min(s,Math.max(1,w-2)),M=vc(k.length,.03),C=null!==p?k[p]:void 0;/* @__PURE__ */
|
|
970
970
|
return lt("div",{className:`relative ${i??""}`,children:[
|
|
971
971
|
/* @__PURE__ */lt("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>f(null),children:[
|
|
972
972
|
/* @__PURE__ */it("title",{id:m,children:"track"===t?c.radialTrack(k.length):c.radialCycle(k.length)}),k.map((e,n)=>{const a=cc(n,e.color,e.tone),i=Math.max(0,Math.min(1,e.value/v)),o=((e,t)=>null!==p?p!==e:null!==g&&g!==t)(n,e.key);if("track"===t){const t=x-n*w,r=t-w+$,s=-Math.PI/2;/* @__PURE__ */
|
|
@@ -977,41 +977,41 @@ return it("g",{opacity:o?.4:1,onMouseEnter:()=>f(n),children:/* @__PURE__ */it("
|
|
|
977
977
|
/* @__PURE__ */it("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:e.map((e,t)=>/* @__PURE__ */lt("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
978
978
|
/* @__PURE__ */it("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:cc(t,e.color,e.tone)}}),
|
|
979
979
|
/* @__PURE__ */it("span",{className:"flex-1 truncate",children:e.label}),
|
|
980
|
-
/* @__PURE__ */it("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function $u({stages:e,shape:t="funnel",height:r,width:n,gap:a=4,minBandWidth:l=0,formatValue:i,color:o,className:s,emptyLabel:c}){const d=
|
|
980
|
+
/* @__PURE__ */it("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function $u({stages:e,shape:t="funnel",height:r,width:n,gap:a=4,minBandWidth:l=0,formatValue:i,color:o,className:s,emptyLabel:c}){const d=ze().charts,u=Fe(),h=i??(e=>Te(e,u)),m=c??d.noStages,p=_e(),[f,g]=qe(null),{highlighted:b}=Ac(),y=Ue(null),x=$c(y,560),v=n??x;if(0===e.length)/* @__PURE__ */return it("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const w=o??cc(0),N=r??54*e.length,k=Math.max(...e.map(e=>e.value),1),$="bars"===t,M=$?Math.round(Math.min(132,Math.max(80,.24*v))):Math.round(Math.min(168,Math.max(104,.38*v))),C=t=>{const r=e[t-1]?.value;return null!=r&&r>0?100*(1-e[t].value/r):null},L=t=>{const r=C(t);return{count:h(e[t].value),drop:null!=r?`−${Re(r,1,u)}`:""}},D=$?Math.ceil(Math.max(...e.map((e,t)=>{const{count:r,drop:n}=L(t);return.62*(r.length+(n?n.length+1:0))*12}))+16):0,S=v-M-D,A=Math.max($?2:0,Math.min(l,S)),P=e=>Math.max(A,S*Math.max(0,e/k)),j=e=>P(e)/2,z=M+S/2,F=t=>46+t/Math.max(1,e.length-1)*54,E=e=>`color-mix(in oklab, ${w} ${F(e).toFixed(0)}%, ${oc.surface})`,B=e=>F(e)>=55?oc.surface:oc.label,O=(e,t)=>null!==f?f!==e:null!==b&&b!==t,T=null!==f?e[f]:void 0;/* @__PURE__ */
|
|
981
981
|
return lt("div",{className:`relative ${s??""}`,ref:y,children:[
|
|
982
982
|
/* @__PURE__ */lt("svg",{width:"100%",height:N,viewBox:`0 0 ${v} ${N}`,role:"img","aria-labelledby":p,onMouseLeave:()=>g(null),children:[
|
|
983
|
-
/* @__PURE__ */it("title",{id:p,children:d.funnel(e.length,h(e[0].value),h(e[e.length-1].value))}),e.map((r,n)=>{const l=n*N/e.length+a/2,i=(n+1)*N/e.length-a/2,o=(l+i)/2,s=
|
|
984
|
-
return lt("g",{opacity:
|
|
983
|
+
/* @__PURE__ */it("title",{id:p,children:d.funnel(e.length,h(e[0].value),h(e[e.length-1].value))}),e.map((r,n)=>{const l=n*N/e.length+a/2,i=(n+1)*N/e.length-a/2,o=(l+i)/2,s=Re(r.value/(e[0].value||1)*100,0,u),c=.62*s.length*12+12;if($){const e=M,t=e+P(r.value),{count:a,drop:d}=L(n);/* @__PURE__ */
|
|
984
|
+
return lt("g",{opacity:O(n,r.key)?.45:1,onMouseEnter:()=>g(n),children:[
|
|
985
985
|
/* @__PURE__ */it("path",{d:`M${e},${l} L${t},${l} L${t},${i} L${e},${i} Z`,fill:E(n)}),
|
|
986
986
|
/* @__PURE__ */it("text",{x:M-12,y:o+4,textAnchor:"end",fontSize:12,fill:oc.label,children:r.label}),t-e>=c&&/* @__PURE__ */it("text",{x:e+8,y:o+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:B(n),style:{fontVariantNumeric:"tabular-nums"},children:s}),
|
|
987
987
|
/* @__PURE__ */lt("text",{"data-funnel-value":"true",x:t+8,y:o+4,textAnchor:"start",fontSize:12,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:[
|
|
988
|
-
/* @__PURE__ */it("tspan",{fontWeight:600,children:a}),d&&/* @__PURE__ */it("tspan",{fill:oc.muted,children:` ${d}`})]})]},r.key)}const d=
|
|
989
|
-
return lt("g",{opacity:
|
|
988
|
+
/* @__PURE__ */it("tspan",{fontWeight:600,children:a}),d&&/* @__PURE__ */it("tspan",{fill:oc.muted,children:` ${d}`})]})]},r.key)}const d=j(r.value),m="cone"===t?j(e[n+1]?.value??r.value):d,p=C(n),f=2*Math.min(d,m)>=c;/* @__PURE__ */
|
|
989
|
+
return lt("g",{opacity:O(n,r.key)?.45:1,onMouseEnter:()=>g(n),children:[
|
|
990
990
|
/* @__PURE__ */it("path",{d:`M${z-d},${l} L${z+d},${l} L${z+m},${i} L${z-m},${i} Z`,fill:E(n)}),
|
|
991
991
|
/* @__PURE__ */it("text",{x:M-14,y:o-2,textAnchor:"end",fontSize:12,fill:oc.label,children:r.label}),
|
|
992
|
-
/* @__PURE__ */lt("text",{x:M-14,y:o+14,textAnchor:"end",fontSize:11,fill:oc.muted,style:{fontVariantNumeric:"tabular-nums"},children:[h(r.value),null!=p?` · −${
|
|
993
|
-
/* @__PURE__ */it("text",{x:f?z:z+Math.max(d,m)+6,y:o+4,textAnchor:f?"middle":"start",fontSize:12,fontWeight:600,fill:f?B(n):oc.label,style:{fontVariantNumeric:"tabular-nums"},children:s})]},r.key)})]}),T&&null!==f&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:T.label,rows:[{key:"value",label:d.count,color:E(f),value:h(T.value)},{key:"share",label:d.ofFirstStage,color:oc.muted,value:
|
|
992
|
+
/* @__PURE__ */lt("text",{x:M-14,y:o+14,textAnchor:"end",fontSize:11,fill:oc.muted,style:{fontVariantNumeric:"tabular-nums"},children:[h(r.value),null!=p?` · −${Re(p,1,u)}`:""]}),
|
|
993
|
+
/* @__PURE__ */it("text",{x:f?z:z+Math.max(d,m)+6,y:o+4,textAnchor:f?"middle":"start",fontSize:12,fontWeight:600,fill:f?B(n):oc.label,style:{fontVariantNumeric:"tabular-nums"},children:s})]},r.key)})]}),T&&null!==f&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:T.label,rows:[{key:"value",label:d.count,color:E(f),value:h(T.value)},{key:"share",label:d.ofFirstStage,color:oc.muted,value:Re(T.value/(e[0].value||1)*100,0,u)},...f>0&&e[f-1].value>0?[{key:"drop",label:d.droppedHere,color:ic.critical,value:`−${Re(100*(1-T.value/e[f-1].value),1,u)}`}]:[]]})})]})}function Mu({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:o,emptyLabel:s}){const c=ze().charts,d=Fe(),u=l??(e=>Te(e,d)),h=s??c.nothingToBreakDown,m=Ue(null),p=$c(m),f=r??p,[g,b]=qe(null),{highlighted:y}=Ac(),x=Vd(e,f,t);if(0===x.length)/* @__PURE__ */
|
|
994
994
|
return it("div",{className:o,ref:m,children:/* @__PURE__ */it("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??cc(0),w=Math.max(...x.map(e=>e.value),1),N=e=>34+e/w*62,k=e=>`color-mix(in oklab, ${v} ${N(e).toFixed(0)}%, ${oc.surface})`,$=e=>N(e)>=55?oc.surface:oc.label,M=g??y,C=g?x.find(e=>e.key===g):void 0;/* @__PURE__ */
|
|
995
995
|
return lt("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
996
996
|
/* @__PURE__ */it("svg",{width:"100%",height:t,viewBox:`0 0 ${f} ${t}`,role:"img","aria-label":c.treemap(e.length),onMouseLeave:()=>b(null),children:x.map(e=>{const t=Math.max(0,e.width-n),r=Math.max(0,e.height-n),l=t>6.2*e.label.length+12&&r>30,i=l&&r>44;/* @__PURE__ */
|
|
997
997
|
return lt("g",{opacity:M&&M!==e.key?.55:1,onMouseEnter:()=>b(e.key),children:[
|
|
998
998
|
/* @__PURE__ */it("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:k(e.value)}),l&&/* @__PURE__ */it("text",{x:e.x+n/2+8,y:e.y+n/2+18,fontSize:12,fontWeight:600,fill:$(e.value),children:e.label}),i&&/* @__PURE__ */it("text",{x:e.x+n/2+8,y:e.y+n/2+34,fontSize:11,fill:$(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:C.label,rows:[{key:"value",label:c.value,color:k(C.value),value:u(C.value)}]})}),
|
|
999
|
-
/* @__PURE__ */it(yu,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:x.map(e=>[e.label,u(e.value)])})]})}function Cu(e,t,r,n,a,l,i,o){if(n>=8)return;const s=e.reduce((e,t)=>e+Lu(t,8-n),0);if(s<=0)return;let c=t;e.forEach((e,t)=>{const d=Lu(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&&Cu(e.children,c,u,n+1,m,p,h,o),c+=u})}function Lu(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+Lu(r,t-1),0):Math.max(0,e.value??0)}function Du({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:o}){const s=
|
|
999
|
+
/* @__PURE__ */it(yu,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:x.map(e=>[e.label,u(e.value)])})]})}function Cu(e,t,r,n,a,l,i,o){if(n>=8)return;const s=e.reduce((e,t)=>e+Lu(t,8-n),0);if(s<=0)return;let c=t;e.forEach((e,t)=>{const d=Lu(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&&Cu(e.children,c,u,n+1,m,p,h,o),c+=u})}function Lu(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+Lu(r,t-1),0):Math.max(0,e.value??0)}function Du({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:o}){const s=ze().charts,c=Fe(),d=a??(e=>Te(e,c)),u=o??s.nothingToBreakDown,[h,m]=qe(null),{highlighted:p}=Ac(),f=[];if(Cu(e,-Math.PI/2,2*Math.PI,0,0,"","",f),0===f.length)/* @__PURE__ */return it("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const g=Math.max(...f.map(e=>e.depth))+1,b=t/2,y=t/2,x=(t/2-8-r)/g,v=f.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),w=e=>`color-mix(in oklab, ${cc(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${oc.surface})`,N=e=>null!==h?e.id===h:null===p||e.branchKey===p,k=h?f.find(e=>e.id===h):void 0,$=e=>Re(e.value/v*100,1,c);/* @__PURE__ */
|
|
1000
1000
|
return lt("div",{className:`relative ${i??""}`,children:[
|
|
1001
1001
|
/* @__PURE__ */lt("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":s.sunburst(d(v),g),onMouseLeave:()=>m(null),children:[f.map(e=>/* @__PURE__ */it("path",{d:qc(b,y,r+e.depth*x+n/2,r+(e.depth+1)*x-n/2,e.start,e.end),fill:w(e),fillOpacity:N(e)?1:.45,stroke:oc.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */it("text",{x:b,y:y+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:oc.label,children:l})]}),k&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:k.label,rows:[{key:"value",label:s.value,color:w(k),value:d(k.value)},{key:"share",label:s.share,color:oc.muted,value:$(k)}]})}),
|
|
1002
|
-
/* @__PURE__ */it(yu,{caption:s.sunburst(d(v),g),head:[s.tableLevel,s.tableItem,s.value,s.share],rows:f.map(e=>[e.depth+1,e.label,d(e.value),$(e)])})]})}function Su({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:o,emptyLabel:s}){const c=
|
|
1003
|
-
return it("div",{className:o,ref:m,children:/* @__PURE__ */it("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const x=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>x.length<=1?0:x.indexOf(e)/(x.length-1)*(f-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),N=/* @__PURE__ */new Map;for(const t of e)N.set(t.depth,[...N.get(t.depth)??[],t]);const k=Math.max(...[...N.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),$=r-20,M=k>0?($-l*(Math.max(...[...N.values()].map(e=>e.length))-1))/k:0,C=/* @__PURE__ */new Map;for(const[e,t]of N){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*M)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>$&&a>0?Math.max(0,1-(n-$)/a):1;let o=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:o,h:a,index:n}),o+=a+l})}const L=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,S=/* @__PURE__ */new Map,A=(e,t)=>e.from===t||e.to===t,
|
|
1002
|
+
/* @__PURE__ */it(yu,{caption:s.sunburst(d(v),g),head:[s.tableLevel,s.tableItem,s.value,s.share],rows:f.map(e=>[e.depth+1,e.label,d(e.value),$(e)])})]})}function Su({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:o,emptyLabel:s}){const c=ze().charts,d=Fe(),u=i??(e=>Te(e,d)),h=s??c.noFlows,m=Ue(null),p=$c(m),f=n??p,[g,b]=qe(null),{highlighted:y}=Ac();if(0===e.length||0===t.length)/* @__PURE__ */
|
|
1003
|
+
return it("div",{className:o,ref:m,children:/* @__PURE__ */it("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const x=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>x.length<=1?0:x.indexOf(e)/(x.length-1)*(f-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),N=/* @__PURE__ */new Map;for(const t of e)N.set(t.depth,[...N.get(t.depth)??[],t]);const k=Math.max(...[...N.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),$=r-20,M=k>0?($-l*(Math.max(...[...N.values()].map(e=>e.length))-1))/k:0,C=/* @__PURE__ */new Map;for(const[e,t]of N){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*M)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>$&&a>0?Math.max(0,1-(n-$)/a):1;let o=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:o,h:a,index:n}),o+=a+l})}const L=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,S=/* @__PURE__ */new Map,A=(e,t)=>e.from===t||e.to===t,P="link"===g?.kind?t[g.index]:void 0,j="node"===g?.kind?e.find(e=>e.key===g.key):void 0;/* @__PURE__ */
|
|
1004
1004
|
return lt("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
1005
1005
|
/* @__PURE__ */lt("svg",{width:"100%",height:r,viewBox:`0 0 ${f} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>b(null),children:[t.map((e,t)=>{const r=C.get(e.from),n=C.get(e.to);if(!r||!n)return null;const l=Math.max(1,e.value*M),i=r.y+(L.get(e.from)??0)+l/2,o=n.y+(D.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),D.set(e.to,(D.get(e.to)??0)+l);const s=r.x+a,c=n.x,d=cc(r.index,e.color),u=`${e.from}→${e.to}`,h=S.get(u)??0;S.set(u,h+1);const m=((e,t)=>g?"link"===g.kind?g.index===t:A(e,g.key):null!==y?A(e,y):null)(e,t);/* @__PURE__ */
|
|
1006
1006
|
return it("path",{d:Rc([[s,i],[c,o]]),fill:"none",stroke:d,strokeWidth:l,strokeOpacity:null===m||m?.42:.12,onMouseEnter:()=>b({kind:"link",index:t})},h?`${u}#${h}`:u)}),e.map(e=>{const r=C.get(e.key);if(!r)return null;const n=r.x>f/2,l=(i=e.key,g?"node"===g.kind?g.key===i:A(t[g.index],i):null!==y?y===i:null);var i;/* @__PURE__ */
|
|
1007
1007
|
return lt("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>b({kind:"node",key:e.key}),children:[
|
|
1008
1008
|
/* @__PURE__ */it("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:cc(r.index,e.color,e.tone)}),
|
|
1009
|
-
/* @__PURE__ */it("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:oc.label,children:e.label})]},e.key)})]}),
|
|
1010
|
-
/* @__PURE__ */it(yu,{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 Au({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=
|
|
1009
|
+
/* @__PURE__ */it("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:oc.label,children:e.label})]},e.key)})]}),P&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:`${P.from} → ${P.to}`,rows:[{key:"value",label:c.flow,color:cc(C.get(P.from)?.index??0,P.color),value:u(P.value)}]})}),j&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:j.label,rows:[{key:"value",label:c.throughput,color:cc(C.get(j.key)?.index??0,j.color,j.tone),value:u(w.get(j.key)??0)}]})}),
|
|
1010
|
+
/* @__PURE__ */it(yu,{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 Au({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=ze().charts,d=Fe(),u=i??(e=>Te(e,d)),h=s??c.noFlows,[m,p]=qe(null),{highlighted:f}=Ac(),g=function(e,t,r,n){const a=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},l=e.map((t,r)=>e.reduce((e,t,n)=>e+a(r,n)+a(n,r),0)),i=Math.max(2,r),o=e.length>i,s=o?e.map((e,t)=>t).sort((e,t)=>l[t]-l[e]).slice(0,i-1).sort((e,t)=>e-t):e.map((e,t)=>t),c=new Map(s.map((e,t)=>[e,t])),d=o?s.length:-1,u=o?[...s.map(t=>e[t]),n]:[...e],h=u.map(()=>u.map(()=>0));let m=0;e.forEach((t,r)=>e.forEach((e,t)=>{const n=c.get(r)??d,l=c.get(t)??d;n!==d||l!==d?h[n][l]+=a(r,t):m+=a(r,t)}));const p=u.map((e,t)=>u.reduce((e,r,n)=>e+h[t][n]+h[n][t],0));return d>=0&&(p[d]+=m),{labels:u,matrix:h,totals:p,otherIndex:d,foldedCount:o?e.length-s.length:0}}(e,t,n,c.other),{labels:b,matrix:y,otherIndex:x,foldedCount:v}=g,w=(e,t)=>y[e]?.[t]??0,N=e=>e===x?oc.muted:cc(e),k=g.totals,$=b.map((e,t)=>t).sort((e,t)=>k[t]-k[e]),M=$.reduce((e,t)=>e+k[t],0);if(M<=0)/* @__PURE__ */return it("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const C=r/2,L=r/2,D=r/2-44,S=D-l,A=a*$.length,P=/* @__PURE__ */new Map;let j=-Math.PI/2;$.forEach((e,t)=>{const r=k[e]/M*(2*Math.PI-A);P.set(e,{start:j,end:j+r,slot:t}),j+=r+a});const z=/* @__PURE__ */new Map,F=[];for(const e of $)for(const t of $){const r=w(e,t);if(r<=0)continue;const n=P.get(e),a=r/Math.max(1,k[e])*(n.end-n.start),l=z.get(e)??0;z.set(e,l+a),F.push({from:e,to:t,value:r,a:n.start+l+a/2,b:P.get(t).start+(P.get(t).end-P.get(t).start)/2})}const E=(e,t)=>[C+t*Math.cos(e),L+t*Math.sin(e)],B="arc"===m?.kind?m.index:void 0,O="ribbon"===m?.kind?F[m.index]:void 0;/* @__PURE__ */
|
|
1011
1011
|
return lt("div",{className:`relative ${o??""}`,children:[
|
|
1012
1012
|
/* @__PURE__ */lt("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord($.length),onMouseLeave:()=>p(null),children:[F.map((e,t)=>{const[n,a]=E(e.a,S),[l,i]=E(e.b,S),o=N(e.from),s=((e,t)=>m?"ribbon"===m.kind?m.index===t:m.index===e.from||m.index===e.to:null!==f?b[e.from]===f||b[e.to]===f:null)(e,t);/* @__PURE__ */
|
|
1013
|
-
return it("path",{d:`M${n},${a} Q${C},${L} ${l},${i}`,fill:"none",stroke:o,strokeWidth:Math.max(1,e.value/M*r*.9),strokeOpacity:null===s||s?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:t})},`${b[e.from]}→${b[e.to]}`)}),$.map(e=>{const t=
|
|
1013
|
+
return it("path",{d:`M${n},${a} Q${C},${L} ${l},${i}`,fill:"none",stroke:o,strokeWidth:Math.max(1,e.value/M*r*.9),strokeOpacity:null===s||s?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:t})},`${b[e.from]}→${b[e.to]}`)}),$.map(e=>{const t=P.get(e),r=(t.start+t.end)/2,[n,a]=E(r,D+16),l=(e=>m?"arc"===m.kind?m.index===e:F[m.index].from===e||F[m.index].to===e:null!==f?b[e]===f:null)(e);/* @__PURE__ */
|
|
1014
1014
|
return lt("g",{onMouseEnter:()=>p({kind:"arc",index:e}),children:[
|
|
1015
1015
|
/* @__PURE__ */it("path",{d:qc(C,L,S,D,t.start,t.end),fill:N(e),fillOpacity:null===l||l?1:.45}),
|
|
1016
|
-
/* @__PURE__ */it("text",{x:n,y:a+4,fontSize:11,fill:oc.label,textAnchor:Math.cos(r)>.15?"start":Math.cos(r)<-.15?"end":"middle",children:b[e]})]},e)})]}),v>0&&/* @__PURE__ */it("p",{className:"mt-1 text-xs text-gray-500",children:c.chordFolded(v)}),void 0!==B&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:b[B],rows:[{key:"total",label:c.totalFlow,color:N(B),value:u(k[B])}]})}),
|
|
1017
|
-
/* @__PURE__ */it(yu,{caption:c.chord($.length),head:[c.tableFrom,c.tableTo,c.value],rows:F.map(e=>[b[e.from],b[e.to],u(e.value)])})]})}export{Bs as APP_UPDATE_POLL_MS,Ni as Accordion,tl as AlignmentGrid,Ts as AppUpdateBanner,ol as AttachButton,ll as AttachmentDropZone,il as AttachmentList,gd as AuthScreen,hi as Avatar,mi as AvatarGroup,Vn as BORDER_LINE_STYLES,Wl as BORDER_WIDTHS,ea as BorderInput,fu as BoxPlotChart,ar as BrandAssetEditor,
|
|
1016
|
+
/* @__PURE__ */it("text",{x:n,y:a+4,fontSize:11,fill:oc.label,textAnchor:Math.cos(r)>.15?"start":Math.cos(r)<-.15?"end":"middle",children:b[e]})]},e)})]}),v>0&&/* @__PURE__ */it("p",{className:"mt-1 text-xs text-gray-500",children:c.chordFolded(v)}),void 0!==B&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:b[B],rows:[{key:"total",label:c.totalFlow,color:N(B),value:u(k[B])}]})}),O&&/* @__PURE__ */it("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */it(zc,{title:`${b[O.from]} → ${b[O.to]}`,rows:[{key:"value",label:c.flow,color:N(O.from),value:u(O.value)}]})}),
|
|
1017
|
+
/* @__PURE__ */it(yu,{caption:c.chord($.length),head:[c.tableFrom,c.tableTo,c.value],rows:F.map(e=>[b[e.from],b[e.to],u(e.value)])})]})}export{Bs as APP_UPDATE_POLL_MS,Ni as Accordion,tl as AlignmentGrid,Ts as AppUpdateBanner,ol as AttachButton,ll as AttachmentDropZone,il as AttachmentList,gd as AuthScreen,hi as Avatar,mi as AvatarGroup,Vn as BORDER_LINE_STYLES,Wl as BORDER_WIDTHS,ea as BorderInput,fu as BoxPlotChart,ar as BrandAssetEditor,Ii as BudgetBar,oc as CHART_INK,fa as COLUMN_COUNT_MAX,ba as COLUMN_COUNT_WIDTHS,ya as COLUMN_SHARES_EQUAL,ga as COLUMN_SHARE_MIN,El as CONTROL_HEIGHTS,Ad as CORNERS,jd as CORNERS_FOR_THEME,vr as Calendar,gu as CandlestickChart,ml as Card,Cc as CartesianPlot,nu as ChartBrush,Ji as ChartDefs,ru as ChartDot,tu as ChartFrame,Sc as ChartHighlightProvider,Lc as ChartSkeleton,zc as ChartTooltip,ud as ChatTemplate,zt as Checkbox_default,ld as CheckoutTemplate,Au as ChordChart,Un as ColorPicker,Hn as ColorPickerPanel,In as ColorSwatch,Fc as ColumnChart,sl as ComposerAttachments,Xo as ContainerFillChart,ds as ContextMenu,Qa as CornersInput,li as CountBadge,Ri as DAY_MS,Zc as DashboardTemplate,ec as DataTable,td as DataTablePage,Wr as DatePicker_default,Ar as DateRangePicker,qr as DateTimePicker_default,Jl as DescriptionList,ma as DisplayChips,jl as Divider,Ks as Drawer,ht as DropdownMenu,Hl as ELEVATION_LEVELS,sd as EmailTemplate,$i as EmptyState,Wd as EmptyValue,vd as ErrorBoundary,yd as ErrorPage,Il as FONT_WEIGHTS,rl as FilePicker_default,ss as FloatingBar,It as FormErrorSummary,Bt as FormField,nd as FormLayoutPage,$u as FunnelChart,pd as GalleryTemplate,Al as Grid,bu as HeatmapChart,Zo as HelpCenter,qn as HexInput,pu as HistogramChart,bn as IconPicker,Fs as IconRail,Es as IconRailButton,za as ImageFocusPoint,Cl as Inline,wn as InputNumber_default,gt as Input_default,Hs as Kanban,Kt as Label,Rd as LanguagePanel,Id as LanguageSelect,Ra as LinkPicker,tc as ListFooter,rc as ListLoadError,As as ListRow,en as MAX_FRACTION_DIGITS,Qi as MOTION,Rl as MOTION_DURATIONS,nr as MediaUploadField,ur as MediaUploadGrid,Xd as Meter,Ei as MetricBar,Wo as MilestoneTimeline,Dt as NativeSelect,an as NumericKeypad,Ko as POST_PRODUCTION_STATUSES,Mi as PageHeader,qs as Pagination,nl as PaperclipGlyph,wl as Paragraph,pa as PictureTiles,Uc as PieChart,fn as Popover,sr as PortalBrandingProvider,Yo as ProductionTimeline,xu as RADAR_SERIES_CAP,Kl as RADIUS_ROLES,Bl as ROW_HEIGHTS,wu as RadarChart,ku as RadialBarChart,Tt as RadioGroup,Et as Radio_default,hu as RangeChart,Yd as RankedBars,du as SCATTER_SERIES_CAP,ac as SERIES_SLOT_COUNT,lc as SERIES_VARS,Fl as SPACING_ROLES,zl as SPACING_SCALE,Ho as STAGES,ic as STATUS_VARS,Su as SankeyChart,uu as ScatterChart,Ea as SearchableSelect,mn as Segmented,Pt as Select_default,ri as SettingRow,ni as ShowWhen,es as SidebarActionButton,rs as SidebarGroupLabel,ls as SidebarNavGroup,as as SidebarNavItem,Ln as SidesEachToggle,Cn as SidesInput,Ul as Skeleton,ha as Slider,ua as SliderGroup,Qr as Snippet,Ss as SortableList,nc as Sparkline,ft as SplitButton_default,Ml as Stack,pl as StatCard,Zd as StatTile,si as Statistic,vi as Stepper,Du as SunburstChart,aa as Switch_default,Tl as TYPE_SCALE,yi as Tabs,dl as TagInput,yl as Text,Wa as TextLinkField,Xa as TextToolbar,on as TileButton_default,Kd as TimeAgo,Fr as TimePicker_default,cu as TimeSeriesChart,Io as TimelineTrack,vl as Title,is as TopNav,qt as TransferProgress,xs as Tree,Cs as TreeEmptySlot,vs as TreeGroup,Ns as TreeGroupLabel,Ms as TreeRow,Ls as TreeSeam,Mu as TreemapChart,mu as WaterfallChart,Aa as WidthsBar,vc as angleScale,tn as appendKey,Fd as applyCorners,Ed as applyIconSet,Bd as applyThemePrefs,qc as arcPath,Hc as areaBetween,Kc as areaFrom,dc as assignSeriesSlots,jc as autoHighlightIndex,rn as backspace,pc as bandScale,Nc as binValues,Gn as borderSides,Xn as borderStartEach,Oi as budgetState,Rc as bumpPath,_o as calcOverall,qo as calcReportOverall,On as colorFill,Tn as colorSwatchClasses,wa as columnSharesWidths,Yr as copyToClipboard,zd as cornersFor,Wc as curvePath,Yi as dashFor,Vi as fillFor,Hi as fillId,bt as firstEnabledIndex,Ki as fmtSliderDate,fr as fromKey,_i as glowId,Ui as groundId,jn as hexToHsv,Pc as highlightOpacity,zn as hsvToHex,Li as isSeverityTone,ei as isShown,Ol as isSpacingStep,Wt as labelClasses,fc as ladderScale,Td as languageSelectWidth,yt as lastEnabledIndex,Bc as linearPath,mc as linearScale,xc as logScale,qi as maskId,vt as matchTypeahead,Vt as mediaFileName,Tc as monotonePath,xt as nextEnabledIndex,bc as niceAxis,gc as niceMax,Sn as parseHexColor,_c as polygonPoints,wc as radiusScale,va as resolveColumnShares,Na as resolveColumnWidths,Pd as resolveCorners,lr as resolvePortalBrandAsset,cc as resolveSeriesColor,hc as resolveSeriesColorWithin,Ld as resolveTheme,Ur as selectionAt,sc as seriesColor,Di as severityOf,Mn as sidesStartEach,Ic as splinePath,Vd as squarify,eo as stagger,Oc as stepPath,pi as tabButtonId,fi as tabPanelId,Ya as textToolbarRows,Va as textToolbarWindowColumns,Wi as toDayMs,$r as toISODate,pr as toKey,uc as toggleSeriesSlot,Os as useAppUpdate,_d as useClickOutside,us as useContextMenu,Hd as useDebouncedValue,Ac as useHighlight,$c as usePlotWidth,cr as usePortalBranding,Uo as useProductionTimeline,Od as useTheme,ki as useTransferProgress};
|